Revved to chromium 4dfb55c9cf0950b8bac8b10070c9b8f3e7de66c2 refs/remotes/origin/HEAD
diff --git a/.gitignore b/.gitignore
index 2b40704..5e33b5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -72,6 +72,8 @@
/chrome/app/theme/default_200_percent/google_chrome
/chrome/app/theme/google_chrome
/chrome/browser/autofill/internal
+/chrome/browser/chromeos/login/screenshot_testing/golden_screenshots/*.png
+/chrome/browser/chromeos/login/screenshot_testing/artifacts
/chrome/browser/extensions/api/ledger/
/chrome/browser/extensions/default_extensions/chromeos
/chrome/browser/google/linkdoctor_internal
@@ -239,6 +241,7 @@
/sandbox/linux/seccomp-legacy/
/sdch/open-vcdiff
/seccompsandbox
+/signing_keys
/skia/tools/clusterfuzz-data/
/sql/sql_unittests_run.xml
/sync/sync.xml
diff --git a/AUTHORS b/AUTHORS
index 2e9a4d2..a6a5491 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,7 +15,7 @@
Adam Roben <adam@github.com>
Adam Treat <adam.treat@samsung.com>
Addanki Gandhi Kishor <kishor.ag@samsung.com>
-Adenilson Cavalcanti <a.cavalcanti@partner.samsung.com>
+Adenilson Cavalcanti <a.cavalcanti@samsung.com>
Aditya Bhargava <heuristicist@gmail.com>
Ajay Berwal <ajay.berwal@samsung.com>
Ajith Kumar V <ajith.v@samsung.com>
@@ -49,6 +49,7 @@
Arpita Bahuguna <a.bah@samsung.com>
Arthur Lussos <developer0420@gmail.com>
Arun Kulkarni <kulkarni.a@samsung.com>
+Arun Kumar <arun87.kumar@samsung.com>
Arun Mankuzhi <arun.m@samsung.com>
Arunoday Sarkar <a.sarkar.arun@gmail.com>
Arunprasad Rajkumar <ararunprasad@gmail.com>
@@ -341,10 +342,12 @@
Peter Brophy <pbrophy@adobe.com>
Peter Collingbourne <peter@pcc.me.uk>
Peter Gal <pgal.u-szeged@partner.samsung.com>
+Peter Molnar <pmolnar.u-szeged@partner.samsung.com>
Philippe Beauchamp <philippe.beauchamp@gmail.com>
Philippe Beaudoin <philippe.beaudoin@gmail.com>
Pierre-Antoine LaFayette <pierre.lafayette@gmail.com>
Po-Chun Chang <pochang0403@gmail.com>
+Pramod Begur Srinath <pramod.bs@samsung.com>
Prashant Hiremath <prashhir@cisco.com>
Prashant Nevase <prashant.n@samsung.com>
Praveen Akkiraju <praveen.anp@samsung.com>
@@ -391,6 +394,7 @@
Sanjoy Pal <sanjoy.pal@samsung.com>
Sanne Wouda <sanne.wouda@gmail.com>
Sarath Singapati <s.singapati@samsung.com>
+Saravanan KR <sramajay@cisco.com>
Sathish Kuppuswamy <sathish.kuppuswamy@intel.com>
Satoshi Matsuzaki <satoshi.matsuzaki@gmail.com>
Sayan Nayak <sayan.nayak@samsung.com>
@@ -464,6 +468,7 @@
Xing Zhang <xzhang@adobe.com>
Xu Samuel <samuel.xu@intel.com>
Xuefei Ren <xrenishere@gmail.com>
+Xun Sun <xun.sun@intel.com>
Yael Aharon <yael.aharon@intel.com>
Yair Yogev <progame@chromium.org>
Yang Gu <yang.gu@intel.com>
@@ -490,6 +495,7 @@
Yupei Wang <perryuwang@tencent.com>
Peng Hu <penghu@tencent.com>
WenSheng He <wensheng.he@samsung.com>
+Raghu Ram Nagaraj <r.nagaraj@samsung.com>
BlackBerry Limited <*@blackberry.com>
Code Aurora Forum <*@codeaurora.org>
diff --git a/base/BUILD.gn b/base/BUILD.gn
index a190ea3..18f2b01 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -78,7 +78,7 @@
"atomicops.h",
"atomicops_internals_gcc.h",
"atomicops_internals_mac.h",
- "atomicops_internals_tsan.h",
+ "atomicops_internals_portable.h",
"atomicops_internals_x86_gcc.cc",
"atomicops_internals_x86_gcc.h",
"atomicops_internals_x86_msvc.h",
@@ -325,8 +325,6 @@
"memory/discardable_memory_emulated.h",
"memory/discardable_memory_linux.cc",
"memory/discardable_memory_mac.cc",
- "memory/discardable_memory_malloc.cc",
- "memory/discardable_memory_malloc.h",
"memory/discardable_memory_manager.cc",
"memory/discardable_memory_manager.h",
"memory/discardable_memory_win.cc",
@@ -865,6 +863,10 @@
# Mac.
if (is_mac) {
+ sources += [
+ "memory/discardable_memory_mach.cc",
+ "memory/discardable_memory_mach.h",
+ ]
sources -= [
"base_paths_posix.cc",
"native_library_posix.cc",
diff --git a/base/android/java/src/org/chromium/base/ApplicationStatus.java b/base/android/java/src/org/chromium/base/ApplicationStatus.java
index 53134b5..c706dfd 100644
--- a/base/android/java/src/org/chromium/base/ApplicationStatus.java
+++ b/base/android/java/src/org/chromium/base/ApplicationStatus.java
@@ -396,7 +396,7 @@
*/
@CalledByNative
private static void registerThreadSafeNativeApplicationStateListener() {
- ThreadUtils.runOnUiThread(new Runnable () {
+ ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (sNativeApplicationStateListener != null) return;
diff --git a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
index 91e5367..86bca43 100644
--- a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
+++ b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
@@ -10,7 +10,6 @@
import org.chromium.base.CommandLine;
import org.chromium.base.JNINamespace;
-import org.chromium.base.SysUtils;
import org.chromium.base.TraceEvent;
/**
@@ -46,6 +45,15 @@
// library_loader_hooks.cc).
private static boolean sInitialized = false;
+ // One-way switches recording attempts to use Relro sharing in the browser.
+ // The flags are used to report UMA stats later.
+ private static boolean sIsUsingBrowserSharedRelros = false;
+ private static boolean sLoadAtFixedAddressFailed = false;
+
+ // One-way switch recording whether the device supports memory mapping
+ // APK files with executable permissions. Only used in the browser.
+ private static boolean sLibraryLoadFromApkSupported = false;
+
// One-way switch becomes true if the system library loading failed,
// and the right native library was found and loaded by the hack.
// The flag is used to report UMA stats later.
@@ -156,10 +164,17 @@
// Load libraries using the Chromium linker.
Linker.prepareLibraryLoad();
+ // Check if the device supports loading a library directly from the APK file.
+ String apkfile = context.getApplicationInfo().sourceDir;
+ if (Linker.isInBrowserProcess()) {
+ sLibraryLoadFromApkSupported = Linker.checkLibraryLoadFromApkSupport(
+ apkfile);
+ }
+
for (String library : NativeLibraries.LIBRARIES) {
String zipfile = null;
if (Linker.isInZipFile()) {
- zipfile = context.getApplicationInfo().sourceDir;
+ zipfile = apkfile;
Log.i(TAG, "Loading " + library + " from within " + zipfile);
} else {
Log.i(TAG, "Loading: " + library);
@@ -167,6 +182,7 @@
boolean isLoaded = false;
if (Linker.isUsingBrowserSharedRelros()) {
+ sIsUsingBrowserSharedRelros = true;
try {
if (zipfile != null) {
Linker.loadLibraryInZipFile(zipfile, library);
@@ -178,6 +194,7 @@
Log.w(TAG, "Failed to load native library with shared RELRO, " +
"retrying without");
Linker.disableSharedRelros();
+ sLoadAtFixedAddressFailed = true;
}
}
if (!isLoaded) {
@@ -229,9 +246,9 @@
Log.i(TAG, String.format(
"Expected native library version number \"%s\"," +
"actual native library version number \"%s\"",
- NativeLibraries.VERSION_NUMBER,
+ NativeLibraries.sVersionNumber,
nativeGetVersionNumber()));
- if (!NativeLibraries.VERSION_NUMBER.equals(nativeGetVersionNumber())) {
+ if (!NativeLibraries.sVersionNumber.equals(nativeGetVersionNumber())) {
throw new ProcessInitException(LoaderErrors.LOADER_ERROR_NATIVE_LIBRARY_WRONG_VERSION);
}
}
@@ -291,15 +308,33 @@
// Called after all native initializations are complete.
public static void onNativeInitializationComplete() {
- // Record histogram for the Chromium linker.
- if (Linker.isUsed()) {
- nativeRecordChromiumAndroidLinkerHistogram(Linker.loadAtFixedAddressFailed(),
- SysUtils.isLowEndDevice());
- }
-
+ recordBrowserProcessHistogram();
nativeRecordNativeLibraryHack(sNativeLibraryHackWasUsed);
}
+ // Record Chromium linker histogram state for the main browser process. Called from
+ // onNativeInitializationComplete().
+ private static void recordBrowserProcessHistogram() {
+ if (Linker.isUsed()) {
+ assert Linker.isInBrowserProcess();
+ nativeRecordChromiumAndroidLinkerBrowserHistogram(sIsUsingBrowserSharedRelros,
+ sLoadAtFixedAddressFailed,
+ sLibraryLoadFromApkSupported);
+ }
+ }
+
+ // Register pending Chromium linker histogram state for renderer processes. This cannot be
+ // recorded as a histogram immediately because histograms and IPC are not ready at the
+ // time it are captured. This function stores a pending value, so that a later call to
+ // RecordChromiumAndroidLinkerRendererHistogram() will record it correctly.
+ public static void registerRendererProcessHistogram(boolean requestedSharedRelro,
+ boolean loadAtFixedAddressFailed) {
+ if (Linker.isUsed()) {
+ nativeRegisterChromiumAndroidLinkerRendererHistogram(requestedSharedRelro,
+ loadAtFixedAddressFailed);
+ }
+ }
+
private static native void nativeInitCommandLine(String[] initCommandLine);
// Only methods needed before or during normal JNI registration are during System.OnLoad.
@@ -310,12 +345,21 @@
// Return true on success and false on failure.
private static native boolean nativeLibraryLoaded();
- // Method called to record statistics about the Chromium linker operation,
- // i.e. whether the library failed to be loaded at a fixed address, and
- // whether the device is 'low-memory'.
- private static native void nativeRecordChromiumAndroidLinkerHistogram(
- boolean loadedAtFixedAddressFailed,
- boolean isLowMemoryDevice);
+ // Method called to record statistics about the Chromium linker operation for the main
+ // browser process. Indicates whether the linker attempted relro sharing for the browser,
+ // and if it did, whether the library failed to load at a fixed address. Also records
+ // support for memory mapping APK files with executable permissions.
+ private static native void nativeRecordChromiumAndroidLinkerBrowserHistogram(
+ boolean isUsingBrowserSharedRelros,
+ boolean loadAtFixedAddressFailed,
+ boolean apkMemoryMappingSupported);
+
+ // Method called to register (for later recording) statistics about the Chromium linker
+ // operation for a renderer process. Indicates whether the linker attempted relro sharing,
+ // and if it did, whether the library failed to load at a fixed address.
+ private static native void nativeRegisterChromiumAndroidLinkerRendererHistogram(
+ boolean requestedSharedRelro,
+ boolean loadAtFixedAddressFailed);
// Get the version of the native library. This is needed so that we can check we
// have the right version before initializing the (rest of the) JNI.
diff --git a/base/android/java/src/org/chromium/base/library_loader/Linker.java b/base/android/java/src/org/chromium/base/library_loader/Linker.java
index 2a3006a..cc30af4 100644
--- a/base/android/java/src/org/chromium/base/library_loader/Linker.java
+++ b/base/android/java/src/org/chromium/base/library_loader/Linker.java
@@ -136,7 +136,7 @@
*
* This behaviour is altered by the BROWSER_SHARED_RELRO_CONFIG configuration
* variable below, which may force the browser to load the libraries at
- * fixed addresses to.
+ * fixed addresses too.
*
* - Once all libraries are loaded in the browser process, one can call
* getSharedRelros() which returns a Bundle instance containing a map that
@@ -215,9 +215,6 @@
// Current fixed-location load address for the next library called by loadLibrary().
private static long sCurrentLoadAddress = 0;
- // Becomes true if any library fails to load at a given, non-0, fixed address.
- private static boolean sLoadAtFixedAddressFailed = false;
-
// Becomes true once prepareLibraryLoad() has been called.
private static boolean sPrepareLibraryLoadCalled = false;
@@ -227,7 +224,7 @@
if (!sInitialized) {
sRelroSharingSupported = false;
- if (NativeLibraries.USE_LINKER) {
+ if (NativeLibraries.sUseLinker) {
if (DEBUG) Log.i(TAG, "Loading lib" + TAG + ".so");
try {
System.loadLibrary(TAG);
@@ -282,7 +279,7 @@
/**
* A public interface used to run runtime linker tests after loading
* libraries. Should only be used to implement the linker unit tests,
- * which is controlled by the value of NativeLibraries.ENABLE_LINKER_TESTS
+ * which is controlled by the value of NativeLibraries.sEnableLinkerTests
* configured at build time.
*/
public interface TestRunner {
@@ -306,7 +303,7 @@
public static void setTestRunnerClassName(String testRunnerClassName) {
if (DEBUG) Log.i(TAG, "setTestRunnerByClassName(" + testRunnerClassName + ") called");
- if (!NativeLibraries.ENABLE_LINKER_TESTS) {
+ if (!NativeLibraries.sEnableLinkerTests) {
// Ignore this in production code to prevent malvolent runtime injection.
return;
}
@@ -338,7 +335,7 @@
public static void setMemoryDeviceConfig(int memoryDeviceConfig) {
if (DEBUG) Log.i(TAG, "setMemoryDeviceConfig(" + memoryDeviceConfig + ") called");
// Sanity check. This method should only be called during tests.
- assert NativeLibraries.ENABLE_LINKER_TESTS;
+ assert NativeLibraries.sEnableLinkerTests;
synchronized (Linker.class) {
assert sMemoryDeviceConfig == MEMORY_DEVICE_CONFIG_INIT;
assert memoryDeviceConfig == MEMORY_DEVICE_CONFIG_LOW ||
@@ -361,8 +358,8 @@
public static boolean isUsed() {
// Only GYP targets that are APKs and have the 'use_chromium_linker' variable
// defined as 1 will use this linker. For all others (the default), the
- // auto-generated NativeLibraries.USE_LINKER variable will be false.
- if (!NativeLibraries.USE_LINKER)
+ // auto-generated NativeLibraries.sUseLinker variable will be false.
+ if (!NativeLibraries.sUseLinker)
return false;
synchronized (Linker.class) {
@@ -385,11 +382,24 @@
}
/**
+ * Call this method to determine if the linker is running in the browser
+ * process.
+ *
+ * @return true if the linker is running in the browser process.
+ */
+ public static boolean isInBrowserProcess() {
+ synchronized (Linker.class) {
+ ensureInitializedLocked();
+ return sInBrowserProcess;
+ }
+ }
+
+ /**
* Call this method to determine if the chromium project must load
* the library directly from the zip file.
*/
public static boolean isInZipFile() {
- return NativeLibraries.USE_LIBRARY_IN_ZIP_FILE;
+ return NativeLibraries.sUseLibraryInZipFile;
}
/**
@@ -458,7 +468,7 @@
}
}
- if (NativeLibraries.ENABLE_LINKER_TESTS && sTestRunnerClassName != null) {
+ if (NativeLibraries.sEnableLinkerTests && sTestRunnerClassName != null) {
// The TestRunner implementation must be instantiated _after_
// all libraries are loaded to ensure that its native methods
// are properly registered.
@@ -700,15 +710,6 @@
}
/**
- * Returns whether the linker was unable to load one library at a given fixed address.
- *
- * @return true if at least one library was not loaded at the expected fixed address.
- */
- public static boolean loadAtFixedAddressFailed() {
- return sLoadAtFixedAddressFailed;
- }
-
- /**
* Load a native shared library with the Chromium linker.
* The shared library is uncompressed and page aligned inside the zipfile.
* Note the crazy linker treats libraries and files as equivalent,
@@ -771,11 +772,9 @@
String sharedRelRoName = libName;
if (zipFile != null) {
- if (!nativeLoadLibraryInZipFile(
- zipFile, libName, loadAddress, libInfo)) {
- String errorMessage =
- "Unable to load library: " + libName + " in: " +
- zipFile;
+ if (!nativeLoadLibraryInZipFile(zipFile, libName, loadAddress, libInfo)) {
+ String errorMessage = "Unable to load library: " + libName +
+ ", in: " + zipFile;
Log.e(TAG, errorMessage);
throw new UnsatisfiedLinkError(errorMessage);
}
@@ -787,9 +786,6 @@
throw new UnsatisfiedLinkError(errorMessage);
}
}
- // Keep track whether the library has been loaded at the expected load address.
- if (loadAddress != 0 && loadAddress != libInfo.mLoadAddress)
- sLoadAtFixedAddressFailed = true;
// Print the load address to the logcat when testing the linker. The format
// of the string is expected by the Python test_runner script as one of:
@@ -797,7 +793,7 @@
// RENDERER_LIBRARY_ADDRESS: <library-name> <address>
// Where <library-name> is the library name, and <address> is the hexadecimal load
// address.
- if (NativeLibraries.ENABLE_LINKER_TESTS) {
+ if (NativeLibraries.sEnableLinkerTests) {
Log.i(TAG, String.format(
Locale.US,
"%s_LIBRARY_ADDRESS: %s %x",
@@ -837,6 +833,24 @@
}
/**
+ * Check whether the device supports loading a library directly from the APK file.
+ *
+ * @param apkFile Filename of the APK.
+ * @return true if supported.
+ */
+ public static boolean checkLibraryLoadFromApkSupport(String apkFile) {
+ synchronized (Linker.class) {
+ ensureInitializedLocked();
+
+ if (DEBUG) Log.i(TAG, "checkLibraryLoadFromApkSupported: " + apkFile);
+ boolean supported = nativeCheckLibraryLoadFromApkSupport(apkFile);
+ if (DEBUG) Log.i(TAG, "Loading a library directly from the APK file " +
+ (supported ? "" : "NOT ") + "supported");
+ return supported;
+ }
+ }
+
+ /**
* Move activity from the native thread to the main UI thread.
* Called from native code on its own thread. Posts a callback from
* the UI thread back to native code.
@@ -934,6 +948,16 @@
private static native long nativeGetRandomBaseLoadAddress(long sizeBytes);
/**
+ * Native method which checks whether the device supports loading a library
+ * directly from the APK file.
+ *
+ * @param apkFile Filename of the APK.
+ * @return true if supported.
+ *
+ */
+ private static native boolean nativeCheckLibraryLoadFromApkSupport(String apkFile);
+
+ /**
* Record information for a given library.
* IMPORTANT: Native code knows about this class's fields, so
* don't change them without modifying the corresponding C++ sources.
diff --git a/base/android/java/templates/NativeLibraries.template b/base/android/java/templates/NativeLibraries.template
index 165f468..f52acb4 100644
--- a/base/android/java/templates/NativeLibraries.template
+++ b/base/android/java/templates/NativeLibraries.template
@@ -49,21 +49,21 @@
// Set to true to enable the use of the Chromium Linker.
#if defined(ENABLE_CHROMIUM_LINKER)
- public static boolean USE_LINKER = true;
+ public static boolean sUseLinker = true;
#else
- public static boolean USE_LINKER = false;
+ public static boolean sUseLinker = false;
#endif
#if defined(ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE)
- public static boolean USE_LIBRARY_IN_ZIP_FILE = true;
+ public static boolean sUseLibraryInZipFile = true;
#else
- public static boolean USE_LIBRARY_IN_ZIP_FILE = false;
+ public static boolean sUseLibraryInZipFile = false;
#endif
#if defined(ENABLE_CHROMIUM_LINKER_TESTS)
- public static boolean ENABLE_LINKER_TESTS = true;
+ public static boolean sEnableLinkerTests = true;
#else
- public static boolean ENABLE_LINKER_TESTS = false;
+ public static boolean sEnableLinkerTests = false;
#endif
// This is the list of native libraries to be loaded (in the correct order)
@@ -83,7 +83,7 @@
// This is the expected version of the 'main' native library, which is the one that
// implements the initial set of base JNI functions including
// base::android::nativeGetVersionName()
- static String VERSION_NUMBER =
+ static String sVersionNumber =
#if defined(NATIVE_LIBRARIES_VERSION_NUMBER)
NATIVE_LIBRARIES_VERSION_NUMBER;
#else
diff --git a/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java b/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java
index df8b80f..c3a1df5 100644
--- a/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java
+++ b/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java
@@ -162,13 +162,13 @@
*/
// String constants that look like comments don't confuse the generator:
- private String arrgh = "*/*";
+ private String mArrgh = "*/*";
//------------------------------------------------------------------------------------------------
// Java fields which are accessed from C++ code only must be annotated with @AccessedByNative to
// prevent them being eliminated when unreferenced code is stripped.
@AccessedByNative
- private int javaField;
+ private int mJavaField;
//------------------------------------------------------------------------------------------------
// The following methods demonstrate declaring methods to call into C++ from Java.
diff --git a/base/android/library_loader/library_loader_hooks.cc b/base/android/library_loader/library_loader_hooks.cc
index 87f7910..819fe3d 100644
--- a/base/android/library_loader/library_loader_hooks.cc
+++ b/base/android/library_loader/library_loader_hooks.cc
@@ -19,8 +19,94 @@
const char* g_library_version_number = "";
LibraryLoadedHook* g_registration_callback = NULL;
+enum RendererHistogramCode {
+ // Renderer load at fixed address success, fail, or not attempted.
+ // Renderers do not attempt to load at at fixed address if on a
+ // low-memory device on which browser load at fixed address has already
+ // failed.
+ LFA_SUCCESS = 0,
+ LFA_BACKOFF_USED = 1,
+ LFA_NOT_ATTEMPTED = 2,
+
+ // End sentinel, also used as nothing-pending indicator.
+ MAX_RENDERER_HISTOGRAM_CODE = 3,
+ NO_PENDING_HISTOGRAM_CODE = MAX_RENDERER_HISTOGRAM_CODE
+};
+
+enum BrowserHistogramCode {
+ // Non-low-memory random address browser loads.
+ NORMAL_LRA_SUCCESS = 0,
+
+ // Low-memory browser loads at fixed address, success or fail.
+ LOW_MEMORY_LFA_SUCCESS = 1,
+ LOW_MEMORY_LFA_BACKOFF_USED = 2,
+
+ MAX_BROWSER_HISTOGRAM_CODE = 3,
+};
+
+RendererHistogramCode g_renderer_histogram_code = NO_PENDING_HISTOGRAM_CODE;
+
+enum LibraryLoadFromApkSupportCode {
+ // The device's support for loading a library directly from the APK file.
+ NOT_SUPPORTED = 0,
+ SUPPORTED = 1,
+
+ MAX_LIBRARY_LOAD_FROM_APK_SUPPORT_CODE = 2,
+};
+
} // namespace
+static void RegisterChromiumAndroidLinkerRendererHistogram(
+ JNIEnv* env,
+ jclass clazz,
+ jboolean requested_shared_relro,
+ jboolean load_at_fixed_address_failed) {
+ // Note a pending histogram value for later recording.
+ if (requested_shared_relro) {
+ g_renderer_histogram_code = load_at_fixed_address_failed
+ ? LFA_BACKOFF_USED : LFA_SUCCESS;
+ } else {
+ g_renderer_histogram_code = LFA_NOT_ATTEMPTED;
+ }
+}
+
+void RecordChromiumAndroidLinkerRendererHistogram() {
+ if (g_renderer_histogram_code == NO_PENDING_HISTOGRAM_CODE)
+ return;
+ // Record and release the pending histogram value.
+ UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.RendererStates",
+ g_renderer_histogram_code,
+ MAX_RENDERER_HISTOGRAM_CODE);
+ g_renderer_histogram_code = NO_PENDING_HISTOGRAM_CODE;
+}
+
+static void RecordChromiumAndroidLinkerBrowserHistogram(
+ JNIEnv* env,
+ jclass clazz,
+ jboolean is_using_browser_shared_relros,
+ jboolean load_at_fixed_address_failed,
+ jboolean library_load_from_apk_supported) {
+ // For low-memory devices, record whether or not we successfully loaded the
+ // browser at a fixed address. Otherwise just record a normal invocation.
+ BrowserHistogramCode histogram_code;
+ if (is_using_browser_shared_relros) {
+ histogram_code = load_at_fixed_address_failed
+ ? LOW_MEMORY_LFA_BACKOFF_USED : LOW_MEMORY_LFA_SUCCESS;
+ } else {
+ histogram_code = NORMAL_LRA_SUCCESS;
+ }
+ UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.BrowserStates",
+ histogram_code,
+ MAX_BROWSER_HISTOGRAM_CODE);
+
+ // Record whether the device supports loading a library directly from the APK
+ // file.
+ UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.LibraryLoadFromApkSupported",
+ library_load_from_apk_supported ?
+ SUPPORTED : NOT_SUPPORTED,
+ MAX_LIBRARY_LOAD_FROM_APK_SUPPORT_CODE);
+}
+
void SetLibraryLoadedHook(LibraryLoadedHook* func) {
g_registration_callback = func;
}
@@ -31,23 +117,12 @@
}
static jboolean LibraryLoaded(JNIEnv* env, jclass clazz) {
- if(g_registration_callback == NULL) {
+ if (g_registration_callback == NULL) {
return true;
}
return g_registration_callback(env, clazz);
}
-static void RecordChromiumAndroidLinkerHistogram(
- JNIEnv* env,
- jclass clazz,
- jboolean loaded_at_fixed_address_failed,
- jboolean is_low_memory_device) {
- UMA_HISTOGRAM_BOOLEAN("ChromiumAndroidLinker.LoadedAtFixedAddressFailed",
- loaded_at_fixed_address_failed);
- UMA_HISTOGRAM_BOOLEAN("ChromiumAndroidLinker.IsLowMemoryDevice",
- is_low_memory_device);
-}
-
void LibraryLoaderExitHook() {
if (g_at_exit_manager) {
delete g_at_exit_manager;
diff --git a/base/android/library_loader/library_loader_hooks.h b/base/android/library_loader/library_loader_hooks.h
index 72935cf..78dc535 100644
--- a/base/android/library_loader/library_loader_hooks.h
+++ b/base/android/library_loader/library_loader_hooks.h
@@ -12,6 +12,10 @@
namespace base {
namespace android {
+// Record any pending renderer histogram value as a histogram. Pending values
+// are set by RegisterChromiumAndroidLinkerRendererHistogram.
+BASE_EXPORT void RecordChromiumAndroidLinkerRendererHistogram();
+
// Registers the callbacks that allows the entry point of the library to be
// exposed to the calling java code. This handles only registering the
// the callbacks needed by the loader. Any application specific JNI bindings
diff --git a/base/android/linker/linker_jni.cc b/base/android/linker/linker_jni.cc
index 79dd201..81c6647 100644
--- a/base/android/linker/linker_jni.cc
+++ b/base/android/linker/linker_jni.cc
@@ -15,7 +15,9 @@
#include <android/log.h>
#include <crazy_linker.h>
+#include <fcntl.h>
#include <jni.h>
+#include <limits.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
@@ -574,6 +576,44 @@
return static_cast<jlong>(reinterpret_cast<uintptr_t>(address));
}
+// Check whether the device supports loading a library directly from the APK
+// file.
+//
+// |env| is the current JNI environment handle.
+// |clazz| is the static class handle which is not used here.
+// |apkfile_name| is the filename of the APK.
+// Returns true if supported.
+jboolean CheckLibraryLoadFromApkSupport(JNIEnv* env, jclass clazz,
+ jstring apkfile_name) {
+ String apkfile_name_str(env, apkfile_name);
+ const char* apkfile_name_c_str = apkfile_name_str.c_str();
+
+ int fd = open(apkfile_name_c_str, O_RDONLY);
+ if (fd == -1) {
+ LOG_ERROR("%s: Failed to open %s\n", __FUNCTION__, apkfile_name_c_str);
+ return false;
+ }
+
+ LOG_INFO(
+ "%s: Memory mapping the first page of %s with executable permissions\n",
+ __FUNCTION__, apkfile_name_c_str);
+ void* address = mmap(NULL, PAGE_SIZE, PROT_EXEC, MAP_PRIVATE, fd, 0);
+
+ jboolean success;
+ if (address == MAP_FAILED) {
+ success = false;
+ } else {
+ success = true;
+ munmap(address, PAGE_SIZE);
+ }
+
+ close(fd);
+
+ LOG_INFO(" %ssupported\n", success ? "" : "NOT ");
+ return success;
+
+}
+
const JNINativeMethod kNativeMethods[] = {
{"nativeLoadLibrary",
"("
@@ -623,7 +663,13 @@
"J"
")"
"J",
- reinterpret_cast<void*>(&GetRandomBaseLoadAddress)}, };
+ reinterpret_cast<void*>(&GetRandomBaseLoadAddress)},
+ {"nativeCheckLibraryLoadFromApkSupport",
+ "("
+ "Ljava/lang/String;"
+ ")"
+ "Z",
+ reinterpret_cast<void*>(&CheckLibraryLoadFromApkSupport)}, };
} // namespace
diff --git a/base/atomicops.h b/base/atomicops.h
index 84be8c0..833e170 100644
--- a/base/atomicops.h
+++ b/base/atomicops.h
@@ -28,8 +28,11 @@
#ifndef BASE_ATOMICOPS_H_
#define BASE_ATOMICOPS_H_
+#include <cassert> // Small C++ header which defines implementation specific
+ // macros used to identify the STL implementation.
#include <stdint.h>
+#include "base/base_export.h"
#include "build/build_config.h"
#if defined(OS_WIN) && defined(ARCH_CPU_64_BITS)
@@ -137,28 +140,66 @@
} // namespace subtle
} // namespace base
-// Include our platform specific implementation.
-#if defined(THREAD_SANITIZER)
-#include "base/atomicops_internals_tsan.h"
-#elif defined(OS_WIN) && defined(COMPILER_MSVC) && defined(ARCH_CPU_X86_FAMILY)
-#include "base/atomicops_internals_x86_msvc.h"
-#elif defined(OS_MACOSX)
-#include "base/atomicops_internals_mac.h"
-#elif defined(OS_NACL)
-#include "base/atomicops_internals_gcc.h"
-#elif defined(COMPILER_GCC) && defined(ARCH_CPU_ARMEL)
-#include "base/atomicops_internals_arm_gcc.h"
-#elif defined(COMPILER_GCC) && defined(ARCH_CPU_ARM64)
-#include "base/atomicops_internals_arm64_gcc.h"
-#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
-#include "base/atomicops_internals_x86_gcc.h"
-#elif defined(COMPILER_GCC) && \
- (defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_MIPS64_FAMILY))
-#include "base/atomicops_internals_mips_gcc.h"
-#else
-#error "Atomic operations are not supported on your platform"
+// The following x86 CPU features are used in atomicops_internals_x86_gcc.h, but
+// this file is duplicated inside of Chrome: protobuf and tcmalloc rely on the
+// struct being present at link time. Some parts of Chrome can currently use the
+// portable interface whereas others still use GCC one. The include guards are
+// the same as in atomicops_internals_x86_gcc.cc.
+#if defined(__i386__) || defined(__x86_64__)
+// This struct is not part of the public API of this module; clients may not
+// use it. (However, it's exported via BASE_EXPORT because clients implicitly
+// do use it at link time by inlining these functions.)
+// Features of this x86. Values may not be correct before main() is run,
+// but are set conservatively.
+struct AtomicOps_x86CPUFeatureStruct {
+ bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
+ // after acquire compare-and-swap.
+ // The following fields are unused by Chrome's base implementation but are
+ // still used by copies of the same code in other parts of the code base. This
+ // causes an ODR violation, and the other code is likely reading invalid
+ // memory.
+ // TODO(jfb) Delete these fields once the rest of the Chrome code base doesn't
+ // depend on them.
+ bool has_sse2; // Processor has SSE2.
+ bool has_cmpxchg16b; // Processor supports cmpxchg16b instruction.
+};
+BASE_EXPORT extern struct AtomicOps_x86CPUFeatureStruct
+ AtomicOps_Internalx86CPUFeatures;
#endif
+// Try to use a portable implementation based on C++11 atomics.
+//
+// Some toolchains support C++11 language features without supporting library
+// features (recent compiler, older STL). Whitelist libstdc++ and libc++ that we
+// know will have <atomic> when compiling C++11.
+#if ((__cplusplus >= 201103L) && \
+ ((defined(__GLIBCXX__) && (__GLIBCXX__ > 20110216)) || \
+ (defined(_LIBCPP_VERSION) && (_LIBCPP_STD_VER >= 11))))
+# include "base/atomicops_internals_portable.h"
+#else // Otherwise use a platform specific implementation.
+# if defined(THREAD_SANITIZER)
+# error "Thread sanitizer must use the portable atomic operations"
+# elif (defined(OS_WIN) && defined(COMPILER_MSVC) && \
+ defined(ARCH_CPU_X86_FAMILY))
+# include "base/atomicops_internals_x86_msvc.h"
+# elif defined(OS_MACOSX)
+# include "base/atomicops_internals_mac.h"
+# elif defined(OS_NACL)
+# include "base/atomicops_internals_gcc.h"
+# elif defined(COMPILER_GCC) && defined(ARCH_CPU_ARMEL)
+# include "base/atomicops_internals_arm_gcc.h"
+# elif defined(COMPILER_GCC) && defined(ARCH_CPU_ARM64)
+# include "base/atomicops_internals_arm64_gcc.h"
+# elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
+# include "base/atomicops_internals_x86_gcc.h"
+# elif (defined(COMPILER_GCC) && \
+ (defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_MIPS64_FAMILY)))
+# include "base/atomicops_internals_mips_gcc.h"
+# else
+# error "Atomic operations are not supported on your platform"
+# endif
+#endif // Portable / non-portable includes.
+
// On some platforms we need additional declarations to make
// AtomicWord compatible with our other Atomic* types.
#if defined(OS_MACOSX) || defined(OS_OPENBSD)
diff --git a/base/atomicops_internals_portable.h b/base/atomicops_internals_portable.h
new file mode 100644
index 0000000..b25099f
--- /dev/null
+++ b/base/atomicops_internals_portable.h
@@ -0,0 +1,227 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file is an internal atomic implementation, use atomicops.h instead.
+//
+// This implementation uses C++11 atomics' member functions. The code base is
+// currently written assuming atomicity revolves around accesses instead of
+// C++11's memory locations. The burden is on the programmer to ensure that all
+// memory locations accessed atomically are never accessed non-atomically (tsan
+// should help with this).
+//
+// TODO(jfb) Modify the atomicops.h API and user code to declare atomic
+// locations as truly atomic. See the static_assert below.
+//
+// Of note in this implementation:
+// * All NoBarrier variants are implemented as relaxed.
+// * All Barrier variants are implemented as sequentially-consistent.
+// * Compare exchange's failure ordering is always the same as the success one
+// (except for release, which fails as relaxed): using a weaker ordering is
+// only valid under certain uses of compare exchange.
+// * Acquire store doesn't exist in the C11 memory model, it is instead
+// implemented as a relaxed store followed by a sequentially consistent
+// fence.
+// * Release load doesn't exist in the C11 memory model, it is instead
+// implemented as sequentially consistent fence followed by a relaxed load.
+// * Atomic increment is expected to return the post-incremented value, whereas
+// C11 fetch add returns the previous value. The implementation therefore
+// needs to increment twice (which the compiler should be able to detect and
+// optimize).
+
+#ifndef BASE_ATOMICOPS_INTERNALS_PORTABLE_H_
+#define BASE_ATOMICOPS_INTERNALS_PORTABLE_H_
+
+#include <atomic>
+
+namespace base {
+namespace subtle {
+
+// This implementation is transitional and maintains the original API for
+// atomicops.h. This requires casting memory locations to the atomic types, and
+// assumes that the API and the C++11 implementation are layout-compatible,
+// which isn't true for all implementations or hardware platforms. The static
+// assertion should detect this issue, were it to fire then this header
+// shouldn't be used.
+//
+// TODO(jfb) If this header manages to stay committed then the API should be
+// modified, and all call sites updated.
+typedef volatile std::atomic<Atomic32>* AtomicLocation32;
+static_assert(sizeof(*(AtomicLocation32) nullptr) == sizeof(Atomic32),
+ "incompatible 32-bit atomic layout");
+
+inline void MemoryBarrier() {
+#if defined(__GLIBCXX__)
+ // Work around libstdc++ bug 51038 where atomic_thread_fence was declared but
+ // not defined, leading to the linker complaining about undefined references.
+ __atomic_thread_fence(std::memory_order_seq_cst);
+#else
+ std::atomic_thread_fence(std::memory_order_seq_cst);
+#endif
+}
+
+inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
+ Atomic32 old_value,
+ Atomic32 new_value) {
+ ((AtomicLocation32)ptr)
+ ->compare_exchange_strong(old_value,
+ new_value,
+ std::memory_order_relaxed,
+ std::memory_order_relaxed);
+ return old_value;
+}
+
+inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
+ Atomic32 new_value) {
+ return ((AtomicLocation32)ptr)
+ ->exchange(new_value, std::memory_order_relaxed);
+}
+
+inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
+ Atomic32 increment) {
+ return increment +
+ ((AtomicLocation32)ptr)
+ ->fetch_add(increment, std::memory_order_relaxed);
+}
+
+inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
+ Atomic32 increment) {
+ return increment + ((AtomicLocation32)ptr)->fetch_add(increment);
+}
+
+inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
+ Atomic32 old_value,
+ Atomic32 new_value) {
+ ((AtomicLocation32)ptr)
+ ->compare_exchange_strong(old_value,
+ new_value,
+ std::memory_order_acquire,
+ std::memory_order_acquire);
+ return old_value;
+}
+
+inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
+ Atomic32 old_value,
+ Atomic32 new_value) {
+ ((AtomicLocation32)ptr)
+ ->compare_exchange_strong(old_value,
+ new_value,
+ std::memory_order_release,
+ std::memory_order_relaxed);
+ return old_value;
+}
+
+inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
+ ((AtomicLocation32)ptr)->store(value, std::memory_order_relaxed);
+}
+
+inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
+ ((AtomicLocation32)ptr)->store(value, std::memory_order_relaxed);
+ MemoryBarrier();
+}
+
+inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
+ ((AtomicLocation32)ptr)->store(value, std::memory_order_release);
+}
+
+inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
+ return ((AtomicLocation32)ptr)->load(std::memory_order_relaxed);
+}
+
+inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
+ return ((AtomicLocation32)ptr)->load(std::memory_order_acquire);
+}
+
+inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
+ MemoryBarrier();
+ return ((AtomicLocation32)ptr)->load(std::memory_order_relaxed);
+}
+
+#if defined(ARCH_CPU_64_BITS)
+
+typedef volatile std::atomic<Atomic64>* AtomicLocation64;
+static_assert(sizeof(*(AtomicLocation64) nullptr) == sizeof(Atomic64),
+ "incompatible 64-bit atomic layout");
+
+inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
+ Atomic64 old_value,
+ Atomic64 new_value) {
+ ((AtomicLocation64)ptr)
+ ->compare_exchange_strong(old_value,
+ new_value,
+ std::memory_order_relaxed,
+ std::memory_order_relaxed);
+ return old_value;
+}
+
+inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
+ Atomic64 new_value) {
+ return ((AtomicLocation64)ptr)
+ ->exchange(new_value, std::memory_order_relaxed);
+}
+
+inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
+ Atomic64 increment) {
+ return increment +
+ ((AtomicLocation64)ptr)
+ ->fetch_add(increment, std::memory_order_relaxed);
+}
+
+inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
+ Atomic64 increment) {
+ return increment + ((AtomicLocation64)ptr)->fetch_add(increment);
+}
+
+inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
+ Atomic64 old_value,
+ Atomic64 new_value) {
+ ((AtomicLocation64)ptr)
+ ->compare_exchange_strong(old_value,
+ new_value,
+ std::memory_order_acquire,
+ std::memory_order_acquire);
+ return old_value;
+}
+
+inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
+ Atomic64 old_value,
+ Atomic64 new_value) {
+ ((AtomicLocation64)ptr)
+ ->compare_exchange_strong(old_value,
+ new_value,
+ std::memory_order_release,
+ std::memory_order_relaxed);
+ return old_value;
+}
+
+inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
+ ((AtomicLocation64)ptr)->store(value, std::memory_order_relaxed);
+}
+
+inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
+ ((AtomicLocation64)ptr)->store(value, std::memory_order_relaxed);
+ MemoryBarrier();
+}
+
+inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
+ ((AtomicLocation64)ptr)->store(value, std::memory_order_release);
+}
+
+inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
+ return ((AtomicLocation64)ptr)->load(std::memory_order_relaxed);
+}
+
+inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
+ return ((AtomicLocation64)ptr)->load(std::memory_order_acquire);
+}
+
+inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
+ MemoryBarrier();
+ return ((AtomicLocation64)ptr)->load(std::memory_order_relaxed);
+}
+
+#endif // defined(ARCH_CPU_64_BITS)
+}
+} // namespace base::subtle
+
+#endif // BASE_ATOMICOPS_INTERNALS_PORTABLE_H_
diff --git a/base/atomicops_internals_tsan.h b/base/atomicops_internals_tsan.h
deleted file mode 100644
index 24382fd..0000000
--- a/base/atomicops_internals_tsan.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file is an internal atomic implementation for compiler-based
-// ThreadSanitizer. Use base/atomicops.h instead.
-
-#ifndef BASE_ATOMICOPS_INTERNALS_TSAN_H_
-#define BASE_ATOMICOPS_INTERNALS_TSAN_H_
-
-#include <sanitizer/tsan_interface_atomic.h>
-
-namespace base {
-namespace subtle {
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
- Atomic32 old_value,
- Atomic32 new_value) {
- Atomic32 cmp = old_value;
- __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
- __tsan_memory_order_relaxed, __tsan_memory_order_relaxed);
- return cmp;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
- Atomic32 new_value) {
- return __tsan_atomic32_exchange(ptr, new_value,
- __tsan_memory_order_relaxed);
-}
-
-inline Atomic32 Acquire_AtomicExchange(volatile Atomic32* ptr,
- Atomic32 new_value) {
- return __tsan_atomic32_exchange(ptr, new_value,
- __tsan_memory_order_acquire);
-}
-
-inline Atomic32 Release_AtomicExchange(volatile Atomic32* ptr,
- Atomic32 new_value) {
- return __tsan_atomic32_exchange(ptr, new_value,
- __tsan_memory_order_release);
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
- Atomic32 increment) {
- return increment + __tsan_atomic32_fetch_add(ptr, increment,
- __tsan_memory_order_relaxed);
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
- Atomic32 increment) {
- return increment + __tsan_atomic32_fetch_add(ptr, increment,
- __tsan_memory_order_acq_rel);
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
- Atomic32 old_value,
- Atomic32 new_value) {
- Atomic32 cmp = old_value;
- __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
- __tsan_memory_order_acquire, __tsan_memory_order_acquire);
- return cmp;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
- Atomic32 old_value,
- Atomic32 new_value) {
- Atomic32 cmp = old_value;
- __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
- __tsan_memory_order_release, __tsan_memory_order_relaxed);
- return cmp;
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
- __tsan_atomic32_store(ptr, value, __tsan_memory_order_relaxed);
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
- __tsan_atomic32_store(ptr, value, __tsan_memory_order_relaxed);
- __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
- __tsan_atomic32_store(ptr, value, __tsan_memory_order_release);
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
- return __tsan_atomic32_load(ptr, __tsan_memory_order_relaxed);
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
- return __tsan_atomic32_load(ptr, __tsan_memory_order_acquire);
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
- __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
- return __tsan_atomic32_load(ptr, __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
- Atomic64 old_value,
- Atomic64 new_value) {
- Atomic64 cmp = old_value;
- __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
- __tsan_memory_order_relaxed, __tsan_memory_order_relaxed);
- return cmp;
-}
-
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
- Atomic64 new_value) {
- return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 Acquire_AtomicExchange(volatile Atomic64* ptr,
- Atomic64 new_value) {
- return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_acquire);
-}
-
-inline Atomic64 Release_AtomicExchange(volatile Atomic64* ptr,
- Atomic64 new_value) {
- return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_release);
-}
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
- Atomic64 increment) {
- return increment + __tsan_atomic64_fetch_add(ptr, increment,
- __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
- Atomic64 increment) {
- return increment + __tsan_atomic64_fetch_add(ptr, increment,
- __tsan_memory_order_acq_rel);
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
- __tsan_atomic64_store(ptr, value, __tsan_memory_order_relaxed);
-}
-
-inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
- __tsan_atomic64_store(ptr, value, __tsan_memory_order_relaxed);
- __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
-}
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
- __tsan_atomic64_store(ptr, value, __tsan_memory_order_release);
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
- return __tsan_atomic64_load(ptr, __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
- return __tsan_atomic64_load(ptr, __tsan_memory_order_acquire);
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
- __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
- return __tsan_atomic64_load(ptr, __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
- Atomic64 old_value,
- Atomic64 new_value) {
- Atomic64 cmp = old_value;
- __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
- __tsan_memory_order_acquire, __tsan_memory_order_acquire);
- return cmp;
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
- Atomic64 old_value,
- Atomic64 new_value) {
- Atomic64 cmp = old_value;
- __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
- __tsan_memory_order_release, __tsan_memory_order_relaxed);
- return cmp;
-}
-
-inline void MemoryBarrier() {
- __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
-}
-
-} // namespace base::subtle
-} // namespace base
-
-#endif // BASE_ATOMICOPS_INTERNALS_TSAN_H_
diff --git a/base/atomicops_internals_x86_gcc.cc b/base/atomicops_internals_x86_gcc.cc
index 3f47458..c21e96d 100644
--- a/base/atomicops_internals_x86_gcc.cc
+++ b/base/atomicops_internals_x86_gcc.cc
@@ -10,15 +10,11 @@
#include "base/atomicops.h"
-// This file only makes sense with atomicops_internals_x86_gcc.h -- it
-// depends on structs that are defined in that file. If atomicops.h
-// doesn't sub-include that file, then we aren't needed, and shouldn't
-// try to do anything.
-#ifdef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
-
// Inline cpuid instruction. In PIC compilations, %ebx contains the address
// of the global offset table. To avoid breaking such executables, this code
// must preserve that register's value across cpuid instructions.
+//
+// The include guards are the same as in atomicops.h.
#if defined(__i386__)
#define cpuid(a, b, c, d, inp) \
asm("mov %%ebx, %%edi\n" \
@@ -39,7 +35,10 @@
// if we haven't been initialized yet, we're probably single threaded, and our
// default values should hopefully be pretty safe.
struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = {
- false, // bug can't exist before process spawns multiple threads
+ false, // bug can't exist before process spawns multiple threads
+ false, // Chrome requires SSE2, but for transition assume not and initialize
+ // this properly.
+ false, // cmpxchg16b isn't present on early AMD64 CPUs.
};
namespace {
@@ -81,6 +80,12 @@
} else {
AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = false;
}
+
+ // edx bit 26 is SSE2 which we use to tell use whether we can use mfence
+ AtomicOps_Internalx86CPUFeatures.has_sse2 = ((edx >> 26) & 1);
+
+ // ecx bit 13 indicates whether the cmpxchg16b instruction is supported
+ AtomicOps_Internalx86CPUFeatures.has_cmpxchg16b = ((ecx >> 13) & 1);
}
class AtomicOpsx86Initializer {
@@ -96,5 +101,3 @@
} // namespace
#endif // if x86
-
-#endif // ifdef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
diff --git a/base/atomicops_internals_x86_gcc.h b/base/atomicops_internals_x86_gcc.h
index 7386fab..69eacdb 100644
--- a/base/atomicops_internals_x86_gcc.h
+++ b/base/atomicops_internals_x86_gcc.h
@@ -7,20 +7,6 @@
#ifndef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
#define BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
-#include "base/base_export.h"
-
-// This struct is not part of the public API of this module; clients may not
-// use it. (However, it's exported via BASE_EXPORT because clients implicitly
-// do use it at link time by inlining these functions.)
-// Features of this x86. Values may not be correct before main() is run,
-// but are set conservatively.
-struct AtomicOps_x86CPUFeatureStruct {
- bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
- // after acquire compare-and-swap.
-};
-BASE_EXPORT extern struct AtomicOps_x86CPUFeatureStruct
- AtomicOps_Internalx86CPUFeatures;
-
#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
namespace base {
diff --git a/base/base.gyp b/base/base.gyp
index 12de4b1..41fac4f 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -904,6 +904,8 @@
'test/multiprocess_test_android.cc',
'test/null_task_runner.cc',
'test/null_task_runner.h',
+ 'test/opaque_ref_counted.cc',
+ 'test/opaque_ref_counted.h',
'test/perf_log.cc',
'test/perf_log.h',
'test/perf_test_suite.cc',
diff --git a/base/base.gypi b/base/base.gypi
index c5796ef..5cd8b8c 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -81,7 +81,7 @@
'atomicops.h',
'atomicops_internals_gcc.h',
'atomicops_internals_mac.h',
- 'atomicops_internals_tsan.h',
+ 'atomicops_internals_portable.h',
'atomicops_internals_x86_gcc.cc',
'atomicops_internals_x86_gcc.h',
'atomicops_internals_x86_msvc.h',
@@ -328,8 +328,6 @@
'memory/discardable_memory_emulated.h',
'memory/discardable_memory_linux.cc',
'memory/discardable_memory_mac.cc',
- 'memory/discardable_memory_malloc.cc',
- 'memory/discardable_memory_malloc.h',
'memory/discardable_memory_manager.cc',
'memory/discardable_memory_manager.h',
'memory/discardable_memory_win.cc',
@@ -940,6 +938,10 @@
],
}],
['(OS == "mac" or OS == "ios") and >(nacl_untrusted_build)==0', {
+ 'sources': [
+ 'memory/discardable_memory_mach.cc',
+ 'memory/discardable_memory_mach.h',
+ ],
'sources/': [
['exclude', '^files/file_path_watcher_stub\\.cc$'],
['exclude', '^base_paths_posix\\.cc$'],
diff --git a/base/base.isolate b/base/base.isolate
index 047d5de..762d915 100644
--- a/base/base.isolate
+++ b/base/base.isolate
@@ -9,7 +9,7 @@
'../third_party/icu/icu.isolate',
],
'conditions': [
- ['OS=="linux" and asan==1', {
+ ['OS=="linux" and asan==1 and chromeos==0', {
'variables': {
'files': [
'<(PRODUCT_DIR)/lib/libc++.so',
@@ -23,6 +23,22 @@
],
},
}],
+ ['asan==1', {
+ 'variables': {
+ 'files': [
+ '../tools/valgrind/asan/',
+ '../third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer',
+ '../third_party/llvm-build/Release+Asserts/lib/libstdc++.so.6',
+ ],
+ },
+ }],
+ ['lsan==1', {
+ 'variables': {
+ 'files': [
+ '../tools/lsan/suppressions.txt',
+ ],
+ },
+ }],
['OS=="win" and component=="shared_library" and CONFIGURATION_NAME=="Debug"', {
'variables': {
'files': [
diff --git a/base/base_unittests.isolate b/base/base_unittests.isolate
index c5c192c..f561d20 100644
--- a/base/base_unittests.isolate
+++ b/base/base_unittests.isolate
@@ -18,6 +18,8 @@
'<(PRODUCT_DIR)/base_unittests<(EXECUTABLE_SUFFIX)',
'--brave-new-test-launcher',
'--test-launcher-bot-mode',
+ '--asan=<(asan)',
+ '--lsan=<(lsan)',
],
'files': [
'../testing/xvfb.py',
@@ -47,6 +49,8 @@
'<(PRODUCT_DIR)/base_unittests<(EXECUTABLE_SUFFIX)',
'--brave-new-test-launcher',
'--test-launcher-bot-mode',
+ '--asan=<(asan)',
+ '--lsan=<(lsan)',
],
},
}],
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index a93d350..ba57cc3 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -139,13 +139,6 @@
// virtual void foo() OVERRIDE;
#define OVERRIDE override
-// Annotate a virtual method indicating that subclasses must not override it,
-// or annotate a class to indicate that it cannot be subclassed.
-// Use like:
-// virtual void foo() FINAL;
-// class B FINAL : public A {};
-#define FINAL final
-
// Annotate a function indicating the caller must examine the return value.
// Use like:
// int foo() WARN_UNUSED_RESULT;
diff --git a/base/containers/hash_tables.h b/base/containers/hash_tables.h
index 6f37c49..c803ace 100644
--- a/base/containers/hash_tables.h
+++ b/base/containers/hash_tables.h
@@ -85,6 +85,17 @@
#undef DEFINE_TRIVIAL_HASH
#endif // !defined(OS_ANDROID)
+// To align with C++11's std::hash and MSVC's pre-standard stdext::hash_value,
+// provide a default hash function for raw pointers. Note: const char * is still
+// specialized to hash as a C string. This is consistent with the currently used
+// stdext::hash_value, but not C++11.
+template<typename T>
+struct hash<T*> {
+ std::size_t operator()(T* value) const {
+ return hash<uintptr_t>()(reinterpret_cast<uintptr_t>(value));
+ }
+};
+
// Implement string hash functions so that strings of various flavors can
// be used as keys in STL maps and sets. The hash algorithm comes from the
// GNU C++ library, in <tr1/functional>. It is duplicated here because GCC
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index 0607a19..d8f32cc 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -222,7 +222,7 @@
TraceBufferChunk* chunk = chunks_[chunk_index];
cloned_buffer->chunks_.push_back(chunk ? chunk->Clone().release() : NULL);
}
- return cloned_buffer.PassAs<TraceBuffer>();
+ return cloned_buffer.Pass();
}
private:
diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h
index f915541..bac74e3 100644
--- a/base/debug/trace_event_impl.h
+++ b/base/debug/trace_event_impl.h
@@ -45,17 +45,6 @@
template <typename Type>
struct DefaultSingletonTraits;
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-template <>
-struct hash<base::MessageLoop*> {
- std::size_t operator()(base::MessageLoop* value) const {
- return reinterpret_cast<std::size_t>(value);
- }
-};
-} // BASE_HASH_NAMESPACE
-#endif
-
namespace base {
class WaitableEvent;
diff --git a/base/file_util.h b/base/file_util.h
deleted file mode 100644
index 9760a34..0000000
--- a/base/file_util.h
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// TODO(brettw) update callers to use the new location and remove this file.
-#include "base/files/file_util.h"
diff --git a/base/files/file_path.cc b/base/files/file_path.cc
index ebc2d6d..11bf69d 100644
--- a/base/files/file_path.cc
+++ b/base/files/file_path.cc
@@ -35,7 +35,7 @@
namespace {
-const char* kCommonDoubleExtensionSuffixes[] = { "gz", "z", "bz2" };
+const char* kCommonDoubleExtensionSuffixes[] = { "gz", "z", "bz2", "bz" };
const char* kCommonDoubleExtensions[] = { "user.js" };
const FilePath::CharType kStringTerminator = FILE_PATH_LITERAL('\0');
diff --git a/base/files/file_path_unittest.cc b/base/files/file_path_unittest.cc
index 906d8df..956faea 100644
--- a/base/files/file_path_unittest.cc
+++ b/base/files/file_path_unittest.cc
@@ -765,6 +765,7 @@
{ FPL("/foo.tar.gz.gz"), FPL(".gz.gz") },
{ FPL("/foo.1234.user.js"), FPL(".user.js") },
{ FPL("foo.user.js"), FPL(".user.js") },
+ { FPL("/foo.tar.bz"), FPL(".tar.bz") },
};
for (unsigned int i = 0; i < arraysize(cases); ++i) {
FilePath path(cases[i].input);
diff --git a/base/mac/sdk_forward_declarations.h b/base/mac/sdk_forward_declarations.h
index e450282..1729ea5 100644
--- a/base/mac/sdk_forward_declarations.h
+++ b/base/mac/sdk_forward_declarations.h
@@ -207,6 +207,15 @@
@end
BASE_EXPORT extern "C" NSString* const NSWindowWillEnterFullScreenNotification;
+BASE_EXPORT extern "C" NSString* const NSWindowWillExitFullScreenNotification;
+BASE_EXPORT extern "C" NSString* const NSWindowDidEnterFullScreenNotification;
+BASE_EXPORT extern "C" NSString* const NSWindowDidExitFullScreenNotification;
+
+BASE_EXPORT extern "C" NSString* const
+ NSWindowDidFailToEnterFullScreenNotification;
+
+BASE_EXPORT extern "C" NSString* const
+ NSWindowDidFailToExitFullScreenNotification;
#endif // MAC_OS_X_VERSION_10_7
diff --git a/base/mac/sdk_forward_declarations.mm b/base/mac/sdk_forward_declarations.mm
index 5b76c88..06d10f2 100644
--- a/base/mac/sdk_forward_declarations.mm
+++ b/base/mac/sdk_forward_declarations.mm
@@ -11,6 +11,21 @@
NSString* const NSWindowWillEnterFullScreenNotification =
@"NSWindowWillEnterFullScreenNotification";
+NSString* const NSWindowWillExitFullScreenNotification =
+ @"NSWindowWillExitFullScreenNotification";
+
+NSString* const NSWindowDidEnterFullScreenNotification =
+ @"NSWindowDidEnterFullScreenNotification";
+
+NSString* const NSWindowDidExitFullScreenNotification =
+ @"NSWindowDidExitFullScreenNotification";
+
+NSString* const NSWindowDidFailToEnterFullScreenNotification =
+ @"NSWindowDidFailToEnterFullScreenNotification";
+
+NSString* const NSWindowDidFailToExitFullScreenNotification =
+ @"NSWindowDidFailToExitFullScreenNotification";
+
#endif // MAC_OS_X_VERSION_10_7
// Replicate specific 10.10 SDK declarations for building with prior SDKs.
diff --git a/base/macros.h b/base/macros.h
index 2741afc..2e3fc09 100644
--- a/base/macros.h
+++ b/base/macros.h
@@ -50,12 +50,6 @@
// The expression is a compile-time constant, and therefore can be
// used in defining new arrays, for example. If you use arraysize on
// a pointer by mistake, you will get a compile-time error.
-//
-// One caveat is that arraysize() doesn't accept any array of an
-// anonymous type or a type defined inside a function. In these rare
-// cases, you have to use the unsafe ARRAYSIZE_UNSAFE() macro below. This is
-// due to a limitation in C++'s template system. The limitation might
-// eventually be removed, but it hasn't happened yet.
// This template function declaration is used in defining arraysize.
// Note that the function doesn't need an implementation, as we only
@@ -73,46 +67,10 @@
#define arraysize(array) (sizeof(ArraySizeHelper(array)))
-// ARRAYSIZE_UNSAFE performs essentially the same calculation as arraysize,
-// but can be used on anonymous types or types defined inside
-// functions. It's less safe than arraysize as it accepts some
-// (although not all) pointers. Therefore, you should use arraysize
-// whenever possible.
-//
-// The expression ARRAYSIZE_UNSAFE(a) is a compile-time constant of type
-// size_t.
-//
-// ARRAYSIZE_UNSAFE catches a few type errors. If you see a compiler error
-//
-// "warning: division by zero in ..."
-//
-// when using ARRAYSIZE_UNSAFE, you are (wrongfully) giving it a pointer.
-// You should only use ARRAYSIZE_UNSAFE on statically allocated arrays.
-//
-// The following comments are on the implementation details, and can
-// be ignored by the users.
-//
-// ARRAYSIZE_UNSAFE(arr) works by inspecting sizeof(arr) (the # of bytes in
-// the array) and sizeof(*(arr)) (the # of bytes in one array
-// element). If the former is divisible by the latter, perhaps arr is
-// indeed an array, in which case the division result is the # of
-// elements in the array. Otherwise, arr cannot possibly be an array,
-// and we generate a compiler error to prevent the code from
-// compiling.
-//
-// Since the size of bool is implementation-defined, we need to cast
-// !(sizeof(a) & sizeof(*(a))) to size_t in order to ensure the final
-// result has type size_t.
-//
-// This macro is not perfect as it wrongfully accepts certain
-// pointers, namely where the pointer size is divisible by the pointee
-// size. Since all our code has to go through a 32-bit compiler,
-// where a pointer is 4 bytes, this means all pointers to a type whose
-// size is 3 or greater than 4 will be (righteously) rejected.
-
-#define ARRAYSIZE_UNSAFE(a) \
- ((sizeof(a) / sizeof(*(a))) / \
- static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
+// DEPRECATED: Just use |arraysize()|, now that C++11 has removed the
+// limitations that forced the use of |ARRAYSIZE_UNSAFE()|.
+// TODO(viettrungluu): Convert all instances and delete. crbug.com/423134
+#define ARRAYSIZE_UNSAFE(a) arraysize(a)
// Use implicit_cast as a safe version of static_cast or const_cast
@@ -141,7 +99,7 @@
// expression is true. For example, you could use it to verify the
// size of a static array:
//
-// COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES,
+// COMPILE_ASSERT(arraysize(content_type_names) == CONTENT_NUM_TYPES,
// content_type_names_incorrect_size);
//
// or to make sure a struct is smaller than a certain size:
diff --git a/base/memory/discardable_memory.cc b/base/memory/discardable_memory.cc
index 9ba47aa..3ecc5f7 100644
--- a/base/memory/discardable_memory.cc
+++ b/base/memory/discardable_memory.cc
@@ -15,9 +15,8 @@
const char* name;
} kTypeNamePairs[] = {
{ DISCARDABLE_MEMORY_TYPE_ASHMEM, "ashmem" },
- { DISCARDABLE_MEMORY_TYPE_MAC, "mac" },
- { DISCARDABLE_MEMORY_TYPE_EMULATED, "emulated" },
- { DISCARDABLE_MEMORY_TYPE_MALLOC, "malloc" }
+ { DISCARDABLE_MEMORY_TYPE_MACH, "mach" },
+ { DISCARDABLE_MEMORY_TYPE_EMULATED, "emulated" }
};
DiscardableMemoryType g_preferred_type = DISCARDABLE_MEMORY_TYPE_NONE;
diff --git a/base/memory/discardable_memory.h b/base/memory/discardable_memory.h
index 5b74705..5f83e33 100644
--- a/base/memory/discardable_memory.h
+++ b/base/memory/discardable_memory.h
@@ -18,9 +18,8 @@
enum DiscardableMemoryType {
DISCARDABLE_MEMORY_TYPE_NONE,
DISCARDABLE_MEMORY_TYPE_ASHMEM,
- DISCARDABLE_MEMORY_TYPE_MAC,
- DISCARDABLE_MEMORY_TYPE_EMULATED,
- DISCARDABLE_MEMORY_TYPE_MALLOC
+ DISCARDABLE_MEMORY_TYPE_MACH,
+ DISCARDABLE_MEMORY_TYPE_EMULATED
};
enum DiscardableMemoryLockStatus {
diff --git a/base/memory/discardable_memory_android.cc b/base/memory/discardable_memory_android.cc
index acf29ac..0c9f3fc 100644
--- a/base/memory/discardable_memory_android.cc
+++ b/base/memory/discardable_memory_android.cc
@@ -11,7 +11,6 @@
#include "base/memory/discardable_memory_ashmem.h"
#include "base/memory/discardable_memory_ashmem_allocator.h"
#include "base/memory/discardable_memory_emulated.h"
-#include "base/memory/discardable_memory_malloc.h"
#include "base/sys_info.h"
namespace base {
@@ -53,8 +52,7 @@
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
DISCARDABLE_MEMORY_TYPE_ASHMEM,
- DISCARDABLE_MEMORY_TYPE_EMULATED,
- DISCARDABLE_MEMORY_TYPE_MALLOC
+ DISCARDABLE_MEMORY_TYPE_EMULATED
};
types->assign(supported_types, supported_types + arraysize(supported_types));
}
@@ -63,39 +61,32 @@
scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
DiscardableMemoryType type, size_t size) {
switch (type) {
- case DISCARDABLE_MEMORY_TYPE_NONE:
- case DISCARDABLE_MEMORY_TYPE_MAC:
- return scoped_ptr<DiscardableMemory>();
case DISCARDABLE_MEMORY_TYPE_ASHMEM: {
SharedState* const shared_state = g_shared_state.Pointer();
scoped_ptr<internal::DiscardableMemoryAshmem> memory(
new internal::DiscardableMemoryAshmem(
size, &shared_state->allocator, &shared_state->manager));
if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
- return memory.PassAs<DiscardableMemory>();
+ return memory.Pass();
}
case DISCARDABLE_MEMORY_TYPE_EMULATED: {
scoped_ptr<internal::DiscardableMemoryEmulated> memory(
new internal::DiscardableMemoryEmulated(size));
if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
- return memory.PassAs<DiscardableMemory>();
+ return memory.Pass();
}
- case DISCARDABLE_MEMORY_TYPE_MALLOC: {
- scoped_ptr<internal::DiscardableMemoryMalloc> memory(
- new internal::DiscardableMemoryMalloc(size));
- if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
-
- return memory.PassAs<DiscardableMemory>();
- }
+ case DISCARDABLE_MEMORY_TYPE_NONE:
+ case DISCARDABLE_MEMORY_TYPE_MACH:
+ NOTREACHED();
+ return nullptr;
}
NOTREACHED();
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
}
// static
diff --git a/base/memory/discardable_memory_linux.cc b/base/memory/discardable_memory_linux.cc
index 578b2c1..6a9a28d 100644
--- a/base/memory/discardable_memory_linux.cc
+++ b/base/memory/discardable_memory_linux.cc
@@ -6,7 +6,6 @@
#include "base/logging.h"
#include "base/memory/discardable_memory_emulated.h"
-#include "base/memory/discardable_memory_malloc.h"
namespace base {
@@ -19,8 +18,7 @@
void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
- DISCARDABLE_MEMORY_TYPE_EMULATED,
- DISCARDABLE_MEMORY_TYPE_MALLOC
+ DISCARDABLE_MEMORY_TYPE_EMULATED
};
types->assign(supported_types, supported_types + arraysize(supported_types));
}
@@ -29,30 +27,23 @@
scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
DiscardableMemoryType type, size_t size) {
switch (type) {
- case DISCARDABLE_MEMORY_TYPE_NONE:
- case DISCARDABLE_MEMORY_TYPE_ASHMEM:
- case DISCARDABLE_MEMORY_TYPE_MAC:
- return scoped_ptr<DiscardableMemory>();
case DISCARDABLE_MEMORY_TYPE_EMULATED: {
scoped_ptr<internal::DiscardableMemoryEmulated> memory(
new internal::DiscardableMemoryEmulated(size));
if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
- return memory.PassAs<DiscardableMemory>();
+ return memory.Pass();
}
- case DISCARDABLE_MEMORY_TYPE_MALLOC: {
- scoped_ptr<internal::DiscardableMemoryMalloc> memory(
- new internal::DiscardableMemoryMalloc(size));
- if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
-
- return memory.PassAs<DiscardableMemory>();
- }
+ case DISCARDABLE_MEMORY_TYPE_NONE:
+ case DISCARDABLE_MEMORY_TYPE_ASHMEM:
+ case DISCARDABLE_MEMORY_TYPE_MACH:
+ NOTREACHED();
+ return nullptr;
}
NOTREACHED();
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
}
// static
diff --git a/base/memory/discardable_memory_mac.cc b/base/memory/discardable_memory_mac.cc
index 231eb17..6896e5a 100644
--- a/base/memory/discardable_memory_mac.cc
+++ b/base/memory/discardable_memory_mac.cc
@@ -4,156 +4,13 @@
#include "base/memory/discardable_memory.h"
-#include <mach/mach.h>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/lazy_instance.h"
#include "base/logging.h"
-#include "base/mac/mach_logging.h"
-#include "base/mac/scoped_mach_vm.h"
#include "base/memory/discardable_memory_emulated.h"
-#include "base/memory/discardable_memory_malloc.h"
+#include "base/memory/discardable_memory_mach.h"
#include "base/memory/discardable_memory_manager.h"
#include "base/memory/scoped_ptr.h"
namespace base {
-namespace {
-
-// For Mac, have the DiscardableMemoryManager trigger userspace eviction when
-// address space usage gets too high (e.g. 512 MBytes).
-const size_t kMacMemoryLimit = 512 * 1024 * 1024;
-
-struct SharedState {
- SharedState() : manager(kMacMemoryLimit, kMacMemoryLimit, TimeDelta::Max()) {}
-
- internal::DiscardableMemoryManager manager;
-};
-LazyInstance<SharedState>::Leaky g_shared_state = LAZY_INSTANCE_INITIALIZER;
-
-// The VM subsystem allows tagging of memory and 240-255 is reserved for
-// application use (see mach/vm_statistics.h). Pick 252 (after chromium's atomic
-// weight of ~52).
-const int kDiscardableMemoryTag = VM_MAKE_TAG(252);
-
-class DiscardableMemoryMac
- : public DiscardableMemory,
- public internal::DiscardableMemoryManagerAllocation {
- public:
- explicit DiscardableMemoryMac(size_t bytes)
- : memory_(0, 0),
- bytes_(mach_vm_round_page(bytes)),
- is_locked_(false) {
- g_shared_state.Pointer()->manager.Register(this, bytes);
- }
-
- bool Initialize() { return Lock() != DISCARDABLE_MEMORY_LOCK_STATUS_FAILED; }
-
- virtual ~DiscardableMemoryMac() {
- if (is_locked_)
- Unlock();
- g_shared_state.Pointer()->manager.Unregister(this);
- }
-
- // Overridden from DiscardableMemory:
- virtual DiscardableMemoryLockStatus Lock() override {
- DCHECK(!is_locked_);
-
- bool purged = false;
- if (!g_shared_state.Pointer()->manager.AcquireLock(this, &purged))
- return DISCARDABLE_MEMORY_LOCK_STATUS_FAILED;
-
- is_locked_ = true;
- return purged ? DISCARDABLE_MEMORY_LOCK_STATUS_PURGED
- : DISCARDABLE_MEMORY_LOCK_STATUS_SUCCESS;
- }
-
- virtual void Unlock() override {
- DCHECK(is_locked_);
- g_shared_state.Pointer()->manager.ReleaseLock(this);
- is_locked_ = false;
- }
-
- virtual void* Memory() const override {
- DCHECK(is_locked_);
- return reinterpret_cast<void*>(memory_.address());
- }
-
- // Overridden from internal::DiscardableMemoryManagerAllocation:
- virtual bool AllocateAndAcquireLock() override {
- kern_return_t ret;
- bool persistent;
- if (!memory_.size()) {
- vm_address_t address = 0;
- ret = vm_allocate(
- mach_task_self(),
- &address,
- bytes_,
- VM_FLAGS_ANYWHERE | VM_FLAGS_PURGABLE | kDiscardableMemoryTag);
- MACH_CHECK(ret == KERN_SUCCESS, ret) << "vm_allocate";
- memory_.reset(address, bytes_);
-
- // When making a fresh allocation, it's impossible for |persistent| to
- // be true.
- persistent = false;
- } else {
- // |persistent| will be reset to false below if appropriate, but when
- // reusing an existing allocation, it's possible for it to be true.
- persistent = true;
-
-#if !defined(NDEBUG)
- ret = vm_protect(mach_task_self(),
- memory_.address(),
- memory_.size(),
- FALSE,
- VM_PROT_DEFAULT);
- MACH_DCHECK(ret == KERN_SUCCESS, ret) << "vm_protect";
-#endif
- }
-
- int state = VM_PURGABLE_NONVOLATILE;
- ret = vm_purgable_control(mach_task_self(),
- memory_.address(),
- VM_PURGABLE_SET_STATE,
- &state);
- MACH_CHECK(ret == KERN_SUCCESS, ret) << "vm_purgable_control";
- if (state & VM_PURGABLE_EMPTY)
- persistent = false;
-
- return persistent;
- }
-
- virtual void ReleaseLock() override {
- int state = VM_PURGABLE_VOLATILE | VM_VOLATILE_GROUP_DEFAULT;
- kern_return_t ret = vm_purgable_control(mach_task_self(),
- memory_.address(),
- VM_PURGABLE_SET_STATE,
- &state);
- MACH_CHECK(ret == KERN_SUCCESS, ret) << "vm_purgable_control";
-
-#if !defined(NDEBUG)
- ret = vm_protect(mach_task_self(),
- memory_.address(),
- memory_.size(),
- FALSE,
- VM_PROT_NONE);
- MACH_DCHECK(ret == KERN_SUCCESS, ret) << "vm_protect";
-#endif
- }
-
- virtual void Purge() override {
- memory_.reset();
- }
-
- private:
- mac::ScopedMachVM memory_;
- const size_t bytes_;
- bool is_locked_;
-
- DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryMac);
-};
-
-} // namespace
// static
bool DiscardableMemory::ReduceMemoryUsage() {
@@ -164,9 +21,8 @@
void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
- DISCARDABLE_MEMORY_TYPE_MAC,
- DISCARDABLE_MEMORY_TYPE_EMULATED,
- DISCARDABLE_MEMORY_TYPE_MALLOC
+ DISCARDABLE_MEMORY_TYPE_MACH,
+ DISCARDABLE_MEMORY_TYPE_EMULATED
};
types->assign(supported_types, supported_types + arraysize(supported_types));
}
@@ -175,42 +31,35 @@
scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
DiscardableMemoryType type, size_t size) {
switch (type) {
- case DISCARDABLE_MEMORY_TYPE_NONE:
- case DISCARDABLE_MEMORY_TYPE_ASHMEM:
- return scoped_ptr<DiscardableMemory>();
- case DISCARDABLE_MEMORY_TYPE_MAC: {
- scoped_ptr<DiscardableMemoryMac> memory(new DiscardableMemoryMac(size));
+ case DISCARDABLE_MEMORY_TYPE_MACH: {
+ scoped_ptr<internal::DiscardableMemoryMach> memory(
+ new internal::DiscardableMemoryMach(size));
if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
- return memory.PassAs<DiscardableMemory>();
+ return memory.Pass();
}
case DISCARDABLE_MEMORY_TYPE_EMULATED: {
scoped_ptr<internal::DiscardableMemoryEmulated> memory(
new internal::DiscardableMemoryEmulated(size));
if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
- return memory.PassAs<DiscardableMemory>();
+ return memory.Pass();
}
- case DISCARDABLE_MEMORY_TYPE_MALLOC: {
- scoped_ptr<internal::DiscardableMemoryMalloc> memory(
- new internal::DiscardableMemoryMalloc(size));
- if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
-
- return memory.PassAs<DiscardableMemory>();
- }
+ case DISCARDABLE_MEMORY_TYPE_NONE:
+ case DISCARDABLE_MEMORY_TYPE_ASHMEM:
+ NOTREACHED();
+ return nullptr;
}
NOTREACHED();
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
}
// static
void DiscardableMemory::PurgeForTesting() {
- int state = 0;
- vm_purgable_control(mach_task_self(), 0, VM_PURGABLE_PURGE_ALL, &state);
+ internal::DiscardableMemoryMach::PurgeForTesting();
internal::DiscardableMemoryEmulated::PurgeForTesting();
}
diff --git a/base/memory/discardable_memory_mach.cc b/base/memory/discardable_memory_mach.cc
new file mode 100644
index 0000000..1051569
--- /dev/null
+++ b/base/memory/discardable_memory_mach.cc
@@ -0,0 +1,142 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/memory/discardable_memory_mach.h"
+
+#include <mach/mach.h>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/lazy_instance.h"
+#include "base/logging.h"
+#include "base/mac/mach_logging.h"
+
+namespace base {
+namespace {
+
+// For Mach, have the DiscardableMemoryManager trigger userspace eviction when
+// address space usage gets too high (e.g. 512 MBytes).
+const size_t kMachMemoryLimit = 512 * 1024 * 1024;
+
+struct SharedState {
+ SharedState()
+ : manager(kMachMemoryLimit, kMachMemoryLimit, TimeDelta::Max()) {}
+
+ internal::DiscardableMemoryManager manager;
+};
+LazyInstance<SharedState>::Leaky g_shared_state = LAZY_INSTANCE_INITIALIZER;
+
+// The VM subsystem allows tagging of memory and 240-255 is reserved for
+// application use (see mach/vm_statistics.h). Pick 252 (after chromium's atomic
+// weight of ~52).
+const int kDiscardableMemoryTag = VM_MAKE_TAG(252);
+
+} // namespace
+
+namespace internal {
+
+DiscardableMemoryMach::DiscardableMemoryMach(size_t bytes)
+ : memory_(0, 0), bytes_(mach_vm_round_page(bytes)), is_locked_(false) {
+ g_shared_state.Pointer()->manager.Register(this, bytes);
+}
+
+DiscardableMemoryMach::~DiscardableMemoryMach() {
+ if (is_locked_)
+ Unlock();
+ g_shared_state.Pointer()->manager.Unregister(this);
+}
+
+// static
+void DiscardableMemoryMach::PurgeForTesting() {
+ int state = 0;
+ vm_purgable_control(mach_task_self(), 0, VM_PURGABLE_PURGE_ALL, &state);
+}
+
+bool DiscardableMemoryMach::Initialize() {
+ return Lock() != DISCARDABLE_MEMORY_LOCK_STATUS_FAILED;
+}
+
+DiscardableMemoryLockStatus DiscardableMemoryMach::Lock() {
+ DCHECK(!is_locked_);
+
+ bool purged = false;
+ if (!g_shared_state.Pointer()->manager.AcquireLock(this, &purged))
+ return DISCARDABLE_MEMORY_LOCK_STATUS_FAILED;
+
+ is_locked_ = true;
+ return purged ? DISCARDABLE_MEMORY_LOCK_STATUS_PURGED
+ : DISCARDABLE_MEMORY_LOCK_STATUS_SUCCESS;
+}
+
+void DiscardableMemoryMach::Unlock() {
+ DCHECK(is_locked_);
+ g_shared_state.Pointer()->manager.ReleaseLock(this);
+ is_locked_ = false;
+}
+
+void* DiscardableMemoryMach::Memory() const {
+ DCHECK(is_locked_);
+ return reinterpret_cast<void*>(memory_.address());
+}
+
+bool DiscardableMemoryMach::AllocateAndAcquireLock() {
+ kern_return_t ret;
+ bool persistent;
+ if (!memory_.size()) {
+ vm_address_t address = 0;
+ ret = vm_allocate(
+ mach_task_self(),
+ &address,
+ bytes_,
+ VM_FLAGS_ANYWHERE | VM_FLAGS_PURGABLE | kDiscardableMemoryTag);
+ MACH_CHECK(ret == KERN_SUCCESS, ret) << "vm_allocate";
+ memory_.reset(address, bytes_);
+
+ // When making a fresh allocation, it's impossible for |persistent| to
+ // be true.
+ persistent = false;
+ } else {
+ // |persistent| will be reset to false below if appropriate, but when
+ // reusing an existing allocation, it's possible for it to be true.
+ persistent = true;
+
+#if !defined(NDEBUG)
+ ret = vm_protect(mach_task_self(),
+ memory_.address(),
+ memory_.size(),
+ FALSE,
+ VM_PROT_DEFAULT);
+ MACH_DCHECK(ret == KERN_SUCCESS, ret) << "vm_protect";
+#endif
+ }
+
+ int state = VM_PURGABLE_NONVOLATILE;
+ ret = vm_purgable_control(
+ mach_task_self(), memory_.address(), VM_PURGABLE_SET_STATE, &state);
+ MACH_CHECK(ret == KERN_SUCCESS, ret) << "vm_purgable_control";
+ if (state & VM_PURGABLE_EMPTY)
+ persistent = false;
+
+ return persistent;
+}
+
+void DiscardableMemoryMach::ReleaseLock() {
+ int state = VM_PURGABLE_VOLATILE | VM_VOLATILE_GROUP_DEFAULT;
+ kern_return_t ret = vm_purgable_control(
+ mach_task_self(), memory_.address(), VM_PURGABLE_SET_STATE, &state);
+ MACH_CHECK(ret == KERN_SUCCESS, ret) << "vm_purgable_control";
+
+#if !defined(NDEBUG)
+ ret = vm_protect(
+ mach_task_self(), memory_.address(), memory_.size(), FALSE, VM_PROT_NONE);
+ MACH_DCHECK(ret == KERN_SUCCESS, ret) << "vm_protect";
+#endif
+}
+
+void DiscardableMemoryMach::Purge() {
+ memory_.reset();
+}
+
+} // namespace internal
+} // namespace base
diff --git a/base/memory/discardable_memory_mach.h b/base/memory/discardable_memory_mach.h
new file mode 100644
index 0000000..a409047
--- /dev/null
+++ b/base/memory/discardable_memory_mach.h
@@ -0,0 +1,48 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_MEMORY_DISCARDABLE_MEMORY_MACH_H_
+#define BASE_MEMORY_DISCARDABLE_MEMORY_MACH_H_
+
+#include "base/memory/discardable_memory.h"
+
+#include "base/mac/scoped_mach_vm.h"
+#include "base/memory/discardable_memory_manager.h"
+
+namespace base {
+namespace internal {
+
+class DiscardableMemoryMach
+ : public DiscardableMemory,
+ public internal::DiscardableMemoryManagerAllocation {
+ public:
+ explicit DiscardableMemoryMach(size_t bytes);
+ virtual ~DiscardableMemoryMach();
+
+ static void PurgeForTesting();
+
+ bool Initialize();
+
+ // Overridden from DiscardableMemory:
+ virtual DiscardableMemoryLockStatus Lock() override;
+ virtual void Unlock() override;
+ virtual void* Memory() const override;
+
+ // Overridden from internal::DiscardableMemoryManagerAllocation:
+ virtual bool AllocateAndAcquireLock() override;
+ virtual void ReleaseLock() override;
+ virtual void Purge() override;
+
+ private:
+ mac::ScopedMachVM memory_;
+ const size_t bytes_;
+ bool is_locked_;
+
+ DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryMach);
+};
+
+} // namespace internal
+} // namespace base
+
+#endif // BASE_MEMORY_DISCARDABLE_MEMORY_MACH_H_
diff --git a/base/memory/discardable_memory_malloc.cc b/base/memory/discardable_memory_malloc.cc
deleted file mode 100644
index a72f911..0000000
--- a/base/memory/discardable_memory_malloc.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/memory/discardable_memory_malloc.h"
-
-#include "base/logging.h"
-
-namespace base {
-namespace internal {
-
-DiscardableMemoryMalloc::DiscardableMemoryMalloc(size_t size) : size_(size) {
-}
-
-DiscardableMemoryMalloc::~DiscardableMemoryMalloc() {
-}
-
-bool DiscardableMemoryMalloc::Initialize() {
- return Lock() != DISCARDABLE_MEMORY_LOCK_STATUS_FAILED;
-}
-
-DiscardableMemoryLockStatus DiscardableMemoryMalloc::Lock() {
- DCHECK(!memory_);
-
- memory_.reset(static_cast<uint8*>(malloc(size_)));
- if (!memory_)
- return DISCARDABLE_MEMORY_LOCK_STATUS_FAILED;
-
- return DISCARDABLE_MEMORY_LOCK_STATUS_PURGED;
-}
-
-void DiscardableMemoryMalloc::Unlock() {
- DCHECK(memory_);
- memory_.reset();
-}
-
-void* DiscardableMemoryMalloc::Memory() const {
- DCHECK(memory_);
- return memory_.get();
-}
-
-} // namespace internal
-} // namespace base
diff --git a/base/memory/discardable_memory_malloc.h b/base/memory/discardable_memory_malloc.h
deleted file mode 100644
index e22d515..0000000
--- a/base/memory/discardable_memory_malloc.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_MEMORY_DISCARDABLE_MEMORY_MALLOC_H_
-#define BASE_MEMORY_DISCARDABLE_MEMORY_MALLOC_H_
-
-#include "base/memory/discardable_memory.h"
-
-namespace base {
-namespace internal {
-
-class DiscardableMemoryMalloc : public DiscardableMemory {
- public:
- explicit DiscardableMemoryMalloc(size_t size);
- virtual ~DiscardableMemoryMalloc();
-
- bool Initialize();
-
- // Overridden from DiscardableMemory:
- virtual DiscardableMemoryLockStatus Lock() override;
- virtual void Unlock() override;
- virtual void* Memory() const override;
-
- private:
- scoped_ptr<uint8, FreeDeleter> memory_;
- const size_t size_;
-
- DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryMalloc);
-};
-
-} // namespace internal
-} // namespace base
-
-#endif // BASE_MEMORY_DISCARDABLE_MEMORY_MALLOC_H_
diff --git a/base/memory/discardable_memory_manager.cc b/base/memory/discardable_memory_manager.cc
index 3647b7b..5f5e604 100644
--- a/base/memory/discardable_memory_manager.cc
+++ b/base/memory/discardable_memory_manager.cc
@@ -5,6 +5,7 @@
#include "base/memory/discardable_memory_manager.h"
#include "base/bind.h"
+#include "base/containers/adapters.h"
#include "base/containers/hash_tables.h"
#include "base/containers/mru_cache.h"
#include "base/debug/crash_logging.h"
@@ -177,11 +178,9 @@
lock_.AssertAcquired();
size_t bytes_allocated_before_purging = bytes_allocated_;
- for (AllocationMap::reverse_iterator it = allocations_.rbegin();
- it != allocations_.rend();
- ++it) {
- Allocation* allocation = it->first;
- AllocationInfo* info = &it->second;
+ for (auto& entry : base::Reversed(allocations_)) {
+ Allocation* allocation = entry.first;
+ AllocationInfo* info = &entry.second;
if (bytes_allocated_ <= limit)
break;
diff --git a/base/memory/discardable_memory_manager.h b/base/memory/discardable_memory_manager.h
index 94b3c55..43737f8 100644
--- a/base/memory/discardable_memory_manager.h
+++ b/base/memory/discardable_memory_manager.h
@@ -38,18 +38,6 @@
} // namespace internal
} // namespace base
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-template <>
-struct hash<base::internal::DiscardableMemoryManagerAllocation*> {
- size_t operator()(
- base::internal::DiscardableMemoryManagerAllocation* ptr) const {
- return hash<size_t>()(reinterpret_cast<size_t>(ptr));
- }
-};
-} // namespace BASE_HASH_NAMESPACE
-#endif // COMPILER
-
namespace base {
namespace internal {
diff --git a/base/memory/discardable_memory_unittest.cc b/base/memory/discardable_memory_unittest.cc
index 516a96b..a111cfc 100644
--- a/base/memory/discardable_memory_unittest.cc
+++ b/base/memory/discardable_memory_unittest.cc
@@ -38,9 +38,8 @@
}
bool IsNativeType(DiscardableMemoryType type) {
- return
- type == DISCARDABLE_MEMORY_TYPE_ASHMEM ||
- type == DISCARDABLE_MEMORY_TYPE_MAC;
+ return type == DISCARDABLE_MEMORY_TYPE_ASHMEM ||
+ type == DISCARDABLE_MEMORY_TYPE_MACH;
}
TEST_P(DiscardableMemoryTest, SupportedNatively) {
diff --git a/base/memory/discardable_memory_win.cc b/base/memory/discardable_memory_win.cc
index 578b2c1..6a9a28d 100644
--- a/base/memory/discardable_memory_win.cc
+++ b/base/memory/discardable_memory_win.cc
@@ -6,7 +6,6 @@
#include "base/logging.h"
#include "base/memory/discardable_memory_emulated.h"
-#include "base/memory/discardable_memory_malloc.h"
namespace base {
@@ -19,8 +18,7 @@
void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
- DISCARDABLE_MEMORY_TYPE_EMULATED,
- DISCARDABLE_MEMORY_TYPE_MALLOC
+ DISCARDABLE_MEMORY_TYPE_EMULATED
};
types->assign(supported_types, supported_types + arraysize(supported_types));
}
@@ -29,30 +27,23 @@
scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
DiscardableMemoryType type, size_t size) {
switch (type) {
- case DISCARDABLE_MEMORY_TYPE_NONE:
- case DISCARDABLE_MEMORY_TYPE_ASHMEM:
- case DISCARDABLE_MEMORY_TYPE_MAC:
- return scoped_ptr<DiscardableMemory>();
case DISCARDABLE_MEMORY_TYPE_EMULATED: {
scoped_ptr<internal::DiscardableMemoryEmulated> memory(
new internal::DiscardableMemoryEmulated(size));
if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
- return memory.PassAs<DiscardableMemory>();
+ return memory.Pass();
}
- case DISCARDABLE_MEMORY_TYPE_MALLOC: {
- scoped_ptr<internal::DiscardableMemoryMalloc> memory(
- new internal::DiscardableMemoryMalloc(size));
- if (!memory->Initialize())
- return scoped_ptr<DiscardableMemory>();
-
- return memory.PassAs<DiscardableMemory>();
- }
+ case DISCARDABLE_MEMORY_TYPE_NONE:
+ case DISCARDABLE_MEMORY_TYPE_ASHMEM:
+ case DISCARDABLE_MEMORY_TYPE_MACH:
+ NOTREACHED();
+ return nullptr;
}
NOTREACHED();
- return scoped_ptr<DiscardableMemory>();
+ return nullptr;
}
// static
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h
index be4919c..7869e72 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -17,7 +17,7 @@
#include "base/threading/thread_collision_warner.h"
#include "build/build_config.h"
-#if defined(OS_LINUX) || (defined(OS_MACOSX) && !defined(OS_IOS))
+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_IOS) || defined(OS_ANDROID)
#define DISABLE_SCOPED_REFPTR_CONVERSION_OPERATOR
#endif
@@ -276,23 +276,23 @@
scoped_refptr(T* p) : ptr_(p) {
if (ptr_)
- ptr_->AddRef();
+ AddRef(ptr_);
}
scoped_refptr(const scoped_refptr<T>& r) : ptr_(r.ptr_) {
if (ptr_)
- ptr_->AddRef();
+ AddRef(ptr_);
}
template <typename U>
scoped_refptr(const scoped_refptr<U>& r) : ptr_(r.get()) {
if (ptr_)
- ptr_->AddRef();
+ AddRef(ptr_);
}
~scoped_refptr() {
if (ptr_)
- ptr_->Release();
+ Release(ptr_);
}
T* get() const { return ptr_; }
@@ -316,11 +316,11 @@
scoped_refptr<T>& operator=(T* p) {
// AddRef first so that self assignment should work
if (p)
- p->AddRef();
+ AddRef(p);
T* old_ptr = ptr_;
ptr_ = p;
if (old_ptr)
- old_ptr->Release();
+ Release(old_ptr);
return *this;
}
@@ -362,8 +362,26 @@
protected:
T* ptr_;
+
+ private:
+ // Non-inline helpers to allow:
+ // class Opaque;
+ // extern template class scoped_refptr<Opaque>;
+ // Otherwise the compiler will complain that Opaque is an incomplete type.
+ static void AddRef(T* ptr);
+ static void Release(T* ptr);
};
+template <typename T>
+void scoped_refptr<T>::AddRef(T* ptr) {
+ ptr->AddRef();
+}
+
+template <typename T>
+void scoped_refptr<T>::Release(T* ptr) {
+ ptr->Release();
+}
+
// Handy utility for creating a scoped_refptr<T> out of a T* explicitly without
// having to retype all the template arguments
template <typename T>
diff --git a/base/memory/ref_counted_unittest.cc b/base/memory/ref_counted_unittest.cc
index e8eb0fd..7e73bde 100644
--- a/base/memory/ref_counted_unittest.cc
+++ b/base/memory/ref_counted_unittest.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "base/memory/ref_counted.h"
+
+#include "base/test/opaque_ref_counted.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -60,3 +62,13 @@
check->SelfDestruct();
EXPECT_TRUE(ScopedRefPtrToSelf::was_destroyed());
}
+
+TEST(RefCountedUnitTest, ScopedRefPtrToOpaque) {
+ scoped_refptr<base::OpaqueRefCounted> p = base::MakeOpaqueRefCounted();
+ base::TestOpaqueRefCounted(p);
+
+ scoped_refptr<base::OpaqueRefCounted> q;
+ q = p;
+ base::TestOpaqueRefCounted(p);
+ base::TestOpaqueRefCounted(q);
+}
diff --git a/base/memory/scoped_ptr.h b/base/memory/scoped_ptr.h
index d93a8b4..f3bbd12 100644
--- a/base/memory/scoped_ptr.h
+++ b/base/memory/scoped_ptr.h
@@ -184,6 +184,17 @@
};
};
+template <typename T>
+struct ShouldAbortOnSelfReset {
+ template <typename U>
+ static NoType Test(const typename U::AllowSelfReset*);
+
+ template <typename U>
+ static YesType Test(...);
+
+ static const bool value = sizeof(Test<T>(0)) == sizeof(YesType);
+};
+
// Minimal implementation of the core logic of scoped_ptr, suitable for
// reuse in both scoped_ptr and its specializations.
template <class T, class D>
@@ -222,9 +233,9 @@
}
void reset(T* p) {
- // This is a self-reset, which is no longer allowed: http://crbug.com/162971
- if (p != nullptr && p == data_.ptr)
- abort();
+ // This is a self-reset, which is no longer allowed for default deleters:
+ // https://crbug.com/162971
+ assert(!ShouldAbortOnSelfReset<D>::value || p == nullptr || p != data_.ptr);
// Note that running data_.ptr = p can lead to undefined behavior if
// get_deleter()(get()) deletes this. In order to prevent this, reset()
diff --git a/base/memory/scoped_ptr_unittest.cc b/base/memory/scoped_ptr_unittest.cc
index 2ea44e9..3da8d3b 100644
--- a/base/memory/scoped_ptr_unittest.cc
+++ b/base/memory/scoped_ptr_unittest.cc
@@ -656,3 +656,41 @@
scoped_ptr<Super> super2 = SubClassReturn();
super2 = SubClassReturn();
}
+
+// Android death tests don't work properly with assert(). Yay.
+#if !defined(NDEBUG) && defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
+TEST(ScopedPtrTest, SelfResetAbortsWithDefaultDeleter) {
+ scoped_ptr<int> x(new int);
+ EXPECT_DEATH(x.reset(x.get()), "");
+}
+
+TEST(ScopedPtrTest, SelfResetAbortsWithDefaultArrayDeleter) {
+ scoped_ptr<int[]> y(new int[4]);
+ EXPECT_DEATH(y.reset(y.get()), "");
+}
+
+TEST(ScopedPtrTest, SelfResetAbortsWithDefaultFreeDeleter) {
+ scoped_ptr<int, base::FreeDeleter> z(static_cast<int*>(malloc(sizeof(int))));
+ EXPECT_DEATH(z.reset(z.get()), "");
+}
+
+// A custom deleter that doesn't opt out should still crash.
+TEST(ScopedPtrTest, SelfResetAbortsWithCustomDeleter) {
+ struct CustomDeleter {
+ inline void operator()(int* x) { delete x; }
+ };
+ scoped_ptr<int, CustomDeleter> x(new int);
+ EXPECT_DEATH(x.reset(x.get()), "");
+}
+#endif
+
+TEST(ScopedPtrTest, SelfResetWithCustomDeleterOptOut) {
+ // A custom deleter should be able to opt out of self-reset abort behavior.
+ struct NoOpDeleter {
+ typedef void AllowSelfReset;
+ inline void operator()(int*) {}
+ };
+ scoped_ptr<int> owner(new int);
+ scoped_ptr<int, NoOpDeleter> x(owner.get());
+ x.reset(x.get());
+}
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index 0a4fcc0..fe5b6e6 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -268,7 +268,7 @@
}
scoped_ptr<HistogramSamples> Histogram::SnapshotSamples() const {
- return SnapshotSampleVector().PassAs<HistogramSamples>();
+ return SnapshotSampleVector().Pass();
}
void Histogram::AddSamples(const HistogramSamples& samples) {
@@ -369,7 +369,7 @@
scoped_ptr<SampleVector> Histogram::SnapshotSampleVector() const {
scoped_ptr<SampleVector> samples(new SampleVector(bucket_ranges()));
samples->Add(*samples_);
- return samples.Pass();
+ return samples;
}
void Histogram::WriteAsciiImpl(bool graph_it,
diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
index 737ccad..773eeb6 100644
--- a/base/metrics/sparse_histogram.cc
+++ b/base/metrics/sparse_histogram.cc
@@ -57,7 +57,7 @@
base::AutoLock auto_lock(lock_);
snapshot->Add(samples_);
- return snapshot.PassAs<HistogramSamples>();
+ return snapshot.Pass();
}
void SparseHistogram::AddSamples(const HistogramSamples& samples) {
diff --git a/base/numerics/safe_conversions_impl.h b/base/numerics/safe_conversions_impl.h
index f05d553..c26757a 100644
--- a/base/numerics/safe_conversions_impl.h
+++ b/base/numerics/safe_conversions_impl.h
@@ -7,7 +7,6 @@
#include <limits>
-#include "base/macros.h"
#include "base/template_util.h"
namespace base {
@@ -203,10 +202,10 @@
template <typename Dst, typename Src>
inline RangeConstraint DstRangeRelationToSrcRange(Src value) {
- COMPILE_ASSERT(std::numeric_limits<Src>::is_specialized,
- argument_must_be_numeric);
- COMPILE_ASSERT(std::numeric_limits<Dst>::is_specialized,
- result_must_be_numeric);
+ static_assert(std::numeric_limits<Src>::is_specialized,
+ "Argument must be numeric.");
+ static_assert(std::numeric_limits<Dst>::is_specialized,
+ "Result must be numeric.");
return DstRangeRelationToSrcRangeImpl<Dst, Src>::Check(value);
}
diff --git a/base/numerics/safe_math.h b/base/numerics/safe_math.h
index b3694fe..ccda1c8 100644
--- a/base/numerics/safe_math.h
+++ b/base/numerics/safe_math.h
@@ -62,8 +62,8 @@
template <typename Src>
CheckedNumeric(Src value)
: state_(value) {
- COMPILE_ASSERT(std::numeric_limits<Src>::is_specialized,
- argument_must_be_numeric);
+ static_assert(std::numeric_limits<Src>::is_specialized,
+ "Argument must be numeric.");
}
// IsValid() is the public API to test if a CheckedNumeric is currently valid.
@@ -87,7 +87,7 @@
// we provide an easy method for extracting them directly, without a risk of
// crashing on a CHECK.
T ValueFloating() const {
- COMPILE_ASSERT(std::numeric_limits<T>::is_iec559, argument_must_be_float);
+ static_assert(std::numeric_limits<T>::is_iec559, "Argument must be float.");
return CheckedNumeric<T>::cast(*this).ValueUnsafe();
}
diff --git a/base/numerics/safe_math_impl.h b/base/numerics/safe_math_impl.h
index 34e2bf5..663f393 100644
--- a/base/numerics/safe_math_impl.h
+++ b/base/numerics/safe_math_impl.h
@@ -11,7 +11,6 @@
#include <cstdlib>
#include <limits>
-#include "base/macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/template_util.h"
@@ -362,8 +361,8 @@
: value_(static_cast<T>(value)),
validity_(GetRangeConstraint(validity |
DstRangeRelationToSrcRange<T>(value))) {
- COMPILE_ASSERT(std::numeric_limits<Src>::is_specialized,
- argument_must_be_numeric);
+ static_assert(std::numeric_limits<Src>::is_specialized,
+ "Argument must be numeric.");
}
// Copy constructor.
diff --git a/base/numerics/safe_numerics_unittest.cc b/base/numerics/safe_numerics_unittest.cc
index 23c2c78..0402cef 100644
--- a/base/numerics/safe_numerics_unittest.cc
+++ b/base/numerics/safe_numerics_unittest.cc
@@ -308,15 +308,15 @@
typedef numeric_limits<Src> SrcLimits;
typedef numeric_limits<Dst> DstLimits;
// Integral to floating.
- COMPILE_ASSERT((DstLimits::is_iec559 && SrcLimits::is_integer) ||
- // Not floating to integral and...
- (!(DstLimits::is_integer && SrcLimits::is_iec559) &&
- // Same sign, same numeric, source is narrower or same.
- ((SrcLimits::is_signed == DstLimits::is_signed &&
- sizeof(Dst) >= sizeof(Src)) ||
- // Or signed destination and source is smaller
- (DstLimits::is_signed && sizeof(Dst) > sizeof(Src)))),
- comparison_must_be_sign_preserving_and_value_preserving);
+ static_assert((DstLimits::is_iec559 && SrcLimits::is_integer) ||
+ // Not floating to integral and...
+ (!(DstLimits::is_integer && SrcLimits::is_iec559) &&
+ // Same sign, same numeric, source is narrower or same.
+ ((SrcLimits::is_signed == DstLimits::is_signed &&
+ sizeof(Dst) >= sizeof(Src)) ||
+ // Or signed destination and source is smaller
+ (DstLimits::is_signed && sizeof(Dst) > sizeof(Src)))),
+ "Comparison must be sign preserving and value preserving");
const CheckedNumeric<Dst> checked_dst = SrcLimits::max();
;
@@ -354,11 +354,11 @@
static void Test(const char *dst, const char *src, int line) {
typedef numeric_limits<Src> SrcLimits;
typedef numeric_limits<Dst> DstLimits;
- COMPILE_ASSERT(SrcLimits::is_signed == DstLimits::is_signed,
- destination_and_source_sign_must_be_the_same);
- COMPILE_ASSERT(sizeof(Dst) < sizeof(Src) ||
+ static_assert(SrcLimits::is_signed == DstLimits::is_signed,
+ "Destination and source sign must be the same");
+ static_assert(sizeof(Dst) < sizeof(Src) ||
(DstLimits::is_integer && SrcLimits::is_iec559),
- destination_must_be_narrower_than_source);
+ "Destination must be narrower than source");
const CheckedNumeric<Dst> checked_dst;
TEST_EXPECTED_VALIDITY(RANGE_OVERFLOW, checked_dst + SrcLimits::max());
@@ -390,10 +390,10 @@
static void Test(const char *dst, const char *src, int line) {
typedef numeric_limits<Src> SrcLimits;
typedef numeric_limits<Dst> DstLimits;
- COMPILE_ASSERT(sizeof(Dst) >= sizeof(Src),
- destination_must_be_equal_or_wider_than_source);
- COMPILE_ASSERT(SrcLimits::is_signed, source_must_be_signed);
- COMPILE_ASSERT(!DstLimits::is_signed, destination_must_be_unsigned);
+ static_assert(sizeof(Dst) >= sizeof(Src),
+ "Destination must be equal or wider than source.");
+ static_assert(SrcLimits::is_signed, "Source must be signed");
+ static_assert(!DstLimits::is_signed, "Destination must be unsigned");
const CheckedNumeric<Dst> checked_dst;
TEST_EXPECTED_VALUE(SrcLimits::max(), checked_dst + SrcLimits::max());
@@ -412,11 +412,11 @@
static void Test(const char *dst, const char *src, int line) {
typedef numeric_limits<Src> SrcLimits;
typedef numeric_limits<Dst> DstLimits;
- COMPILE_ASSERT((DstLimits::is_integer && SrcLimits::is_iec559) ||
+ static_assert((DstLimits::is_integer && SrcLimits::is_iec559) ||
(sizeof(Dst) < sizeof(Src)),
- destination_must_be_narrower_than_source);
- COMPILE_ASSERT(SrcLimits::is_signed, source_must_be_signed);
- COMPILE_ASSERT(!DstLimits::is_signed, destination_must_be_unsigned);
+ "Destination must be narrower than source.");
+ static_assert(SrcLimits::is_signed, "Source must be signed.");
+ static_assert(!DstLimits::is_signed, "Destination must be unsigned.");
const CheckedNumeric<Dst> checked_dst;
TEST_EXPECTED_VALUE(1, checked_dst + static_cast<Src>(1));
@@ -444,10 +444,10 @@
static void Test(const char *dst, const char *src, int line) {
typedef numeric_limits<Src> SrcLimits;
typedef numeric_limits<Dst> DstLimits;
- COMPILE_ASSERT(sizeof(Dst) <= sizeof(Src),
- destination_must_be_narrower_or_equal_to_source);
- COMPILE_ASSERT(!SrcLimits::is_signed, source_must_be_unsigned);
- COMPILE_ASSERT(DstLimits::is_signed, destination_must_be_signed);
+ static_assert(sizeof(Dst) <= sizeof(Src),
+ "Destination must be narrower or equal to source.");
+ static_assert(!SrcLimits::is_signed, "Source must be unsigned.");
+ static_assert(DstLimits::is_signed, "Destination must be signed.");
const CheckedNumeric<Dst> checked_dst;
TEST_EXPECTED_VALUE(1, checked_dst + static_cast<Src>(1));
diff --git a/base/prefs/json_pref_store_unittest.cc b/base/prefs/json_pref_store_unittest.cc
index 437f337..45bf895 100644
--- a/base/prefs/json_pref_store_unittest.cc
+++ b/base/prefs/json_pref_store_unittest.cc
@@ -388,7 +388,7 @@
scoped_refptr<JsonPrefStore> pref_store =
new JsonPrefStore(input_file,
message_loop_.message_loop_proxy().get(),
- intercepting_pref_filter.PassAs<PrefFilter>());
+ intercepting_pref_filter.Pass());
ASSERT_EQ(PersistentPrefStore::PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE,
pref_store->ReadPrefs());
@@ -435,7 +435,7 @@
scoped_refptr<JsonPrefStore> pref_store =
new JsonPrefStore(input_file,
message_loop_.message_loop_proxy().get(),
- intercepting_pref_filter.PassAs<PrefFilter>());
+ intercepting_pref_filter.Pass());
MockPrefStoreObserver mock_observer;
pref_store->AddObserver(&mock_observer);
diff --git a/base/process/process_metrics.cc b/base/process/process_metrics.cc
index 90baae5..2edd9c7 100644
--- a/base/process/process_metrics.cc
+++ b/base/process/process_metrics.cc
@@ -40,7 +40,7 @@
res->Set("swapinfo", swap_info_.ToValue().release());
#endif
- return res.PassAs<Value>();
+ return res.Pass();
}
double ProcessMetrics::GetPlatformIndependentCPUUsage() {
diff --git a/base/process/process_metrics_linux.cc b/base/process/process_metrics_linux.cc
index 03cc7eb..e8db571 100644
--- a/base/process/process_metrics_linux.cc
+++ b/base/process/process_metrics_linux.cc
@@ -524,7 +524,7 @@
res->SetInteger("gem_size", gem_size);
#endif
- return res.PassAs<Value>();
+ return res.Pass();
}
// exposed for testing
@@ -731,7 +731,7 @@
res->SetDouble("io_time", static_cast<double>(io_time));
res->SetDouble("weighted_io_time", static_cast<double>(weighted_io_time));
- return res.PassAs<Value>();
+ return res.Pass();
}
bool IsValidDiskName(const std::string& candidate) {
@@ -856,7 +856,7 @@
else
res->SetDouble("compression_ratio", 0);
- return res.PassAs<Value>();
+ return res.Pass();
}
void GetSwapInfo(SwapInfo* swap_info) {
diff --git a/base/test/BUILD.gn b/base/test/BUILD.gn
index add74cb..a2864b5 100644
--- a/base/test/BUILD.gn
+++ b/base/test/BUILD.gn
@@ -41,6 +41,8 @@
"multiprocess_test_android.cc",
"null_task_runner.cc",
"null_task_runner.h",
+ "opaque_ref_counted.cc",
+ "opaque_ref_counted.h",
"perf_log.cc",
"perf_log.h",
"perf_test_suite.cc",
diff --git a/base/test/opaque_ref_counted.cc b/base/test/opaque_ref_counted.cc
new file mode 100644
index 0000000..ed6c36f
--- /dev/null
+++ b/base/test/opaque_ref_counted.cc
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/test/opaque_ref_counted.h"
+
+#include "base/macros.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace base {
+
+class OpaqueRefCounted : public RefCounted<OpaqueRefCounted> {
+ public:
+ OpaqueRefCounted() {}
+
+ int Return42() { return 42; }
+
+ private:
+ virtual ~OpaqueRefCounted() {}
+
+ friend RefCounted<OpaqueRefCounted>;
+ DISALLOW_COPY_AND_ASSIGN(OpaqueRefCounted);
+};
+
+scoped_refptr<OpaqueRefCounted> MakeOpaqueRefCounted() {
+ return new OpaqueRefCounted();
+}
+
+void TestOpaqueRefCounted(scoped_refptr<OpaqueRefCounted> p) {
+ EXPECT_EQ(42, p->Return42());
+}
+
+} // namespace base
+
+template class scoped_refptr<base::OpaqueRefCounted>;
diff --git a/base/test/opaque_ref_counted.h b/base/test/opaque_ref_counted.h
new file mode 100644
index 0000000..faf6a65
--- /dev/null
+++ b/base/test/opaque_ref_counted.h
@@ -0,0 +1,24 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_TEST_OPAQUE_REF_COUNTED_H_
+#define BASE_TEST_OPAQUE_REF_COUNTED_H_
+
+#include "base/memory/ref_counted.h"
+
+namespace base {
+
+// OpaqueRefCounted is a test class for scoped_refptr to ensure it still works
+// when the pointed-to type is opaque (i.e., incomplete).
+class OpaqueRefCounted;
+
+// Test functions that return and accept scoped_refptr<OpaqueRefCounted> values.
+scoped_refptr<OpaqueRefCounted> MakeOpaqueRefCounted();
+void TestOpaqueRefCounted(scoped_refptr<OpaqueRefCounted> p);
+
+} // namespace base
+
+extern template class scoped_refptr<base::OpaqueRefCounted>;
+
+#endif // BASE_TEST_OPAQUE_REF_COUNTED_H_
diff --git a/base/test/test_support_ios.mm b/base/test/test_support_ios.mm
index 80a4caf..67fae06 100644
--- a/base/test/test_support_ios.mm
+++ b/base/test/test_support_ios.mm
@@ -70,6 +70,7 @@
// Yes, this is leaked, it's just to make what's running visible.
window_.reset([[UIWindow alloc] initWithFrame:bounds]);
+ [window_ setBackgroundColor:[UIColor whiteColor]];
[window_ makeKeyAndVisible];
// Add a label with the app name.
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 5304f37..b0256c3 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -903,11 +903,6 @@
std::vector<Closure>* delete_these_outside_lock) {
lock_.AssertAcquired();
-#if !defined(OS_NACL)
- UMA_HISTOGRAM_COUNTS_100("SequencedWorkerPool.TaskCount",
- static_cast<int>(pending_tasks_.size()));
-#endif
-
// Find the next task with a sequence token that's not currently in use.
// If the token is in use, that means another thread is running something
// in that sequence, and we can't run it without going out-of-order.
@@ -988,13 +983,6 @@
break;
}
- // Track the number of tasks we had to skip over to see if we should be
- // making this more efficient. If this number ever becomes large or is
- // frequently "some", we should consider the optimization above.
-#if !defined(OS_NACL)
- UMA_HISTOGRAM_COUNTS_100("SequencedWorkerPool.UnrunnableTaskCount",
- unrunnable_tasks);
-#endif
return status;
}
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
index 3c8612d..3653c96 100644
--- a/base/threading/thread_restrictions.h
+++ b/base/threading/thread_restrictions.h
@@ -41,6 +41,7 @@
}
namespace content {
class BrowserGpuChannelHostFactory;
+class BrowserGpuMemoryBufferManager;
class BrowserShutdownProfileDumper;
class BrowserTestBase;
class GLHelper;
@@ -213,6 +214,8 @@
friend class chrome_browser_net::Predictor; // http://crbug.com/78451
friend class
content::BrowserGpuChannelHostFactory; // http://crbug.com/125248
+ friend class
+ content::BrowserGpuMemoryBufferManager; // http://crbug.com/420368
friend class content::GLHelper; // http://crbug.com/125415
friend class content::GpuChannelHost; // http://crbug.com/125264
friend class content::TextInputClientMac; // http://crbug.com/121917
diff --git a/base/win/OWNERS b/base/win/OWNERS
index 65ed721..8624efe 100644
--- a/base/win/OWNERS
+++ b/base/win/OWNERS
@@ -1,2 +1,3 @@
cpu@chromium.org
+grt@chromium.org
rvargas@chromium.org
diff --git a/base/win/registry.cc b/base/win/registry.cc
index a6cb9ae..e8fb892 100644
--- a/base/win/registry.cc
+++ b/base/win/registry.cc
@@ -487,10 +487,26 @@
// RegistryValueIterator ------------------------------------------------------
RegistryValueIterator::RegistryValueIterator(HKEY root_key,
+ const wchar_t* folder_key,
+ REGSAM wow64access)
+ : name_(MAX_PATH, L'\0'),
+ value_(MAX_PATH, L'\0') {
+ Initialize(root_key, folder_key, wow64access);
+}
+
+RegistryValueIterator::RegistryValueIterator(HKEY root_key,
const wchar_t* folder_key)
: name_(MAX_PATH, L'\0'),
value_(MAX_PATH, L'\0') {
- LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_);
+ Initialize(root_key, folder_key, 0);
+}
+
+void RegistryValueIterator::Initialize(HKEY root_key,
+ const wchar_t* folder_key,
+ REGSAM wow64access) {
+ DCHECK_EQ(wow64access & ~kWow64AccessMask, static_cast<REGSAM>(0));
+ LONG result =
+ RegOpenKeyEx(root_key, folder_key, 0, KEY_READ | wow64access, &key_);
if (result != ERROR_SUCCESS) {
key_ = NULL;
} else {
@@ -577,23 +593,13 @@
RegistryKeyIterator::RegistryKeyIterator(HKEY root_key,
const wchar_t* folder_key) {
- LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_);
- if (result != ERROR_SUCCESS) {
- key_ = NULL;
- } else {
- DWORD count = 0;
- LONG result = ::RegQueryInfoKey(key_, NULL, 0, NULL, &count, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL);
+ Initialize(root_key, folder_key, 0);
+}
- if (result != ERROR_SUCCESS) {
- ::RegCloseKey(key_);
- key_ = NULL;
- } else {
- index_ = count - 1;
- }
- }
-
- Read();
+RegistryKeyIterator::RegistryKeyIterator(HKEY root_key,
+ const wchar_t* folder_key,
+ REGSAM wow64access) {
+ Initialize(root_key, folder_key, wow64access);
}
RegistryKeyIterator::~RegistryKeyIterator() {
@@ -634,5 +640,29 @@
return false;
}
+void RegistryKeyIterator::Initialize(HKEY root_key,
+ const wchar_t* folder_key,
+ REGSAM wow64access) {
+ DCHECK_EQ(wow64access & ~kWow64AccessMask, static_cast<REGSAM>(0));
+ LONG result =
+ RegOpenKeyEx(root_key, folder_key, 0, KEY_READ | wow64access, &key_);
+ if (result != ERROR_SUCCESS) {
+ key_ = NULL;
+ } else {
+ DWORD count = 0;
+ LONG result = ::RegQueryInfoKey(key_, NULL, 0, NULL, &count, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL);
+
+ if (result != ERROR_SUCCESS) {
+ ::RegCloseKey(key_);
+ key_ = NULL;
+ } else {
+ index_ = count - 1;
+ }
+ }
+
+ Read();
+}
+
} // namespace win
} // namespace base
diff --git a/base/win/registry.h b/base/win/registry.h
index af1aee7..e5524b8 100644
--- a/base/win/registry.h
+++ b/base/win/registry.h
@@ -157,8 +157,18 @@
// Iterates the entries found in a particular folder on the registry.
class BASE_EXPORT RegistryValueIterator {
public:
+ // Construct a Registry Value Iterator with default WOW64 access.
RegistryValueIterator(HKEY root_key, const wchar_t* folder_key);
+ // Construct a Registry Key Iterator with specific WOW64 access, one of
+ // KEY_WOW64_32KEY or KEY_WOW64_64KEY, or 0.
+ // Note: |wow64access| should be the same access used to open |root_key|
+ // previously, or a predefined key (e.g. HKEY_LOCAL_MACHINE).
+ // See http://msdn.microsoft.com/en-us/library/windows/desktop/aa384129.aspx.
+ RegistryValueIterator(HKEY root_key,
+ const wchar_t* folder_key,
+ REGSAM wow64access);
+
~RegistryValueIterator();
DWORD ValueCount() const;
@@ -181,6 +191,8 @@
// Read in the current values.
bool Read();
+ void Initialize(HKEY root_key, const wchar_t* folder_key, REGSAM wow64access);
+
// The registry key being iterated.
HKEY key_;
@@ -198,8 +210,18 @@
class BASE_EXPORT RegistryKeyIterator {
public:
+ // Construct a Registry Key Iterator with default WOW64 access.
RegistryKeyIterator(HKEY root_key, const wchar_t* folder_key);
+ // Construct a Registry Value Iterator with specific WOW64 access, one of
+ // KEY_WOW64_32KEY or KEY_WOW64_64KEY, or 0.
+ // Note: |wow64access| should be the same access used to open |root_key|
+ // previously, or a predefined key (e.g. HKEY_LOCAL_MACHINE).
+ // See http://msdn.microsoft.com/en-us/library/windows/desktop/aa384129.aspx.
+ RegistryKeyIterator(HKEY root_key,
+ const wchar_t* folder_key,
+ REGSAM wow64access);
+
~RegistryKeyIterator();
DWORD SubkeyCount() const;
@@ -218,6 +240,8 @@
// Read in the current values.
bool Read();
+ void Initialize(HKEY root_key, const wchar_t* folder_key, REGSAM wow64access);
+
// The registry key being iterated.
HKEY key_;
diff --git a/build/all.gyp b/build/all.gyp
index dad0538..f562537 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -766,6 +766,7 @@
'../breakpad/breakpad.gyp:minidump_dump#host',
'../breakpad/breakpad.gyp:minidump_stackwalk#host',
'../build/android/tests/multiple_proguards/multiple_proguards.gyp:multiple_proguards_test_apk',
+ '../build/android/pylib/device/commands/commands.gyp:chromium_commands',
'../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
'../cc/cc_tests.gyp:cc_perftests_apk',
'../cc/cc_tests.gyp:cc_unittests',
@@ -830,12 +831,20 @@
'target_name': 'android_builder_chromium_webrtc',
'type': 'none',
'dependencies': [
+ '../build/android/pylib/device/commands/commands.gyp:chromium_commands',
'../content/content_shell_and_tests.gyp:content_browsertests',
'../tools/android/android_tools.gyp:android_tools',
'../tools/android/android_tools.gyp:memconsumer',
# Unit test bundles packaged as an apk.
'../content/content_shell_and_tests.gyp:content_browsertests_apk',
],
+ 'conditions': [
+ ['"<(libpeer_target_type)"=="static_library"', {
+ 'dependencies': [
+ '../third_party/libjingle/libjingle.gyp:libjingle_peerconnection_javalib',
+ ],
+ }],
+ ],
}, # target_name: android_builder_chromium_webrtc
], # targets
}], # OS="android"
diff --git a/build/android/gyp/create_device_library_links.py b/build/android/gyp/create_device_library_links.py
index 30e050c..3e630b6 100755
--- a/build/android/gyp/create_device_library_links.py
+++ b/build/android/gyp/create_device_library_links.py
@@ -64,7 +64,8 @@
mkdir_cmd = ('if [ ! -e %(dir)s ]; then mkdir -p %(dir)s; fi ' %
{ 'dir': device_dir })
RunShellCommand(device, mkdir_cmd)
- device.PushChangedFiles(options.script_host_path, options.script_device_path)
+ device.PushChangedFiles([(options.script_host_path,
+ options.script_device_path)])
trigger_cmd = (
'APK_LIBRARIES_DIR=%(apk_libraries_dir)s; '
diff --git a/build/android/gyp/java_cpp_enum.py b/build/android/gyp/java_cpp_enum.py
index ad09742..6a1d5c1 100755
--- a/build/android/gyp/java_cpp_enum.py
+++ b/build/android/gyp/java_cpp_enum.py
@@ -36,22 +36,22 @@
assert self.entries
def _AssignEntryIndices(self):
- # Supporting the same set enum value assignments the compiler does is rather
- # complicated, so we limit ourselves to these cases:
- # - all the enum constants have values assigned,
- # - enum constants reference other enum constants or have no value assigned.
-
+ # Enums, if given no value, are given the value of the previous enum + 1.
if not all(self.entries.values()):
- index = 0
+ prev_enum_value = -1
for key, value in self.entries.iteritems():
if not value:
- self.entries[key] = index
- index = index + 1
+ self.entries[key] = prev_enum_value + 1
elif value in self.entries:
self.entries[key] = self.entries[value]
else:
- raise Exception('You can only reference other enum constants unless '
- 'you assign values to all of the constants.')
+ try:
+ self.entries[key] = int(value)
+ except ValueError:
+ raise Exception('Could not interpret integer from enum value "%s" '
+ 'for key %s.' % (value, key))
+ prev_enum_value = self.entries[key]
+
def _StripPrefix(self):
if not self.prefix_to_strip:
@@ -69,7 +69,7 @@
single_line_comment_re = re.compile(r'\s*//')
multi_line_comment_start_re = re.compile(r'\s*/\*')
enum_start_re = re.compile(r'^\s*enum\s+(\w+)\s+{\s*$')
- enum_line_re = re.compile(r'^\s*(\w+)(\s*\=\s*([^,\n]+))?,?\s*$')
+ enum_line_re = re.compile(r'^\s*(\w+)(\s*\=\s*([^,\n]+))?,?')
enum_end_re = re.compile(r'^\s*}\s*;\s*$')
generator_directive_re = re.compile(
r'^\s*//\s+GENERATED_JAVA_(\w+)\s*:\s*([\.\w]+)$')
diff --git a/build/android/gyp/push_libraries.py b/build/android/gyp/push_libraries.py
index 63421e9..6b31a2e 100755
--- a/build/android/gyp/push_libraries.py
+++ b/build/android/gyp/push_libraries.py
@@ -40,7 +40,7 @@
if needs_directory:
device.RunShellCommand('mkdir -p ' + options.device_dir)
needs_directory[:] = [] # = False
- device.PushChangedFiles(host_path, device_path)
+ device.PushChangedFiles([(host_path, device_path)])
record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number)
md5_check.CallAndRecordIfStale(
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py
index ab70a79..722d18c 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -171,6 +171,9 @@
config['resources'] = {}
config['resources']['dependency_zips'] = [
c['resources_zip'] for c in all_resources_deps]
+ config['resources']['extra_package_names'] = []
+
+ if options.type == 'android_apk':
config['resources']['extra_package_names'] = [
c['package_name'] for c in all_resources_deps if 'package_name' in c]
diff --git a/build/android/java_cpp_template.gypi b/build/android/java_cpp_template.gypi
index fe4238a..036f32c 100644
--- a/build/android/java_cpp_template.gypi
+++ b/build/android/java_cpp_template.gypi
@@ -22,8 +22,8 @@
#
# The 'sources' entry should only list template file. The template file
# itself should use the 'ClassName.template' format, and will generate
-# 'gen/templates/<package-name>/ClassName.java. The files which template
-# dependents on and typically included by the template should be listed
+# 'gen/templates/<target-name>/<package-name>/ClassName.java. The files which
+# template dependents on and typically included by the template should be listed
# in template_deps variables. Any change to them will force a rebuild of
# the template, and hence of any source that depends on it.
#
@@ -32,7 +32,7 @@
# Location where all generated Java sources will be placed.
'variables': {
'include_path%': '<(DEPTH)',
- 'output_dir': '<(SHARED_INTERMEDIATE_DIR)/templates/<(package_name)',
+ 'output_dir': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/<(package_name)',
},
'direct_dependent_settings': {
'variables': {
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index 54c90c3..468ef3f 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -72,7 +72,7 @@
logging.info(' Pushing adb_reboot ...')
adb_reboot = os.path.join(constants.DIR_SOURCE_ROOT,
'out/%s/adb_reboot' % target)
- device.PushChangedFiles(adb_reboot, '/data/local/tmp/')
+ device.PushChangedFiles([(adb_reboot, '/data/local/tmp/')])
# Launch adb_reboot
logging.info(' Launching adb_reboot ...')
device.old_interface.GetAndroidToolStatusAndOutput(
diff --git a/build/android/push_libraries.gypi b/build/android/push_libraries.gypi
index d74fb21..c96e5a5 100644
--- a/build/android/push_libraries.gypi
+++ b/build/android/push_libraries.gypi
@@ -32,6 +32,7 @@
'<(strip_stamp)',
'<(strip_additional_stamp)',
'<(build_device_config_path)',
+ '<(pack_arm_relocations_stamp)',
],
'outputs': [
'<(push_stamp)',
diff --git a/build/android/pylib/chrome_test_server_spawner.py b/build/android/pylib/chrome_test_server_spawner.py
index e1fe7b1..052c2fd 100644
--- a/build/android/pylib/chrome_test_server_spawner.py
+++ b/build/android/pylib/chrome_test_server_spawner.py
@@ -64,17 +64,14 @@
return False
-def _CheckPortStatus(port, expected_status):
- """Returns True if port has expected_status.
+def _CheckPortAvailable(port):
+ """Returns True if |port| is available."""
+ return _WaitUntil(lambda: ports.IsHostPortAvailable(port))
- Args:
- port: the port number.
- expected_status: boolean of expected status.
- Returns:
- Returns True if the status is expected. Otherwise returns False.
- """
- return _WaitUntil(lambda: ports.IsHostPortUsed(port) == expected_status)
+def _CheckPortNotAvailable(port):
+ """Returns True if |port| is not available."""
+ return _WaitUntil(lambda: not ports.IsHostPortAvailable(port))
def _CheckDevicePortStatus(device, port):
@@ -167,7 +164,7 @@
port_json = json.loads(port_json)
if port_json.has_key('port') and isinstance(port_json['port'], int):
self.host_port = port_json['port']
- return _CheckPortStatus(self.host_port, True)
+ return _CheckPortNotAvailable(self.host_port)
logging.error('Failed to get port information from the server data.')
return False
@@ -236,7 +233,7 @@
if self.pipe_out:
self.is_ready = self._WaitToStartAndGetPortFromTestServer()
else:
- self.is_ready = _CheckPortStatus(self.host_port, True)
+ self.is_ready = _CheckPortNotAvailable(self.host_port)
if self.is_ready:
Forwarder.Map([(0, self.host_port)], self.device, self.tool)
# Check whether the forwarder is ready on the device.
@@ -346,7 +343,7 @@
logging.info('Handling request to kill a test server on port: %d.', port)
self.server.test_server_instance.Stop()
# Make sure the status of test server is correct before sending response.
- if _CheckPortStatus(port, False):
+ if _CheckPortAvailable(port):
self._SendResponse(200, 'OK', {}, 'killed')
logging.info('Test server on port %d is killed', port)
else:
diff --git a/build/android/pylib/constants.py b/build/android/pylib/constants.py
index 8b800ab..292ff3b 100644
--- a/build/android/pylib/constants.py
+++ b/build/android/pylib/constants.py
@@ -172,6 +172,10 @@
os.environ['BUILDTYPE'] = build_type
+def SetBuildDirectory(build_directory):
+ os.environ['CHROMIUM_OUT_DIR'] = build_directory
+
+
def GetOutDirectory(build_type=None):
"""Returns the out directory where the output binaries are built.
diff --git a/build/android/pylib/device/commands/__init__.py b/build/android/pylib/device/commands/__init__.py
new file mode 100644
index 0000000..4d6aabb
--- /dev/null
+++ b/build/android/pylib/device/commands/__init__.py
@@ -0,0 +1,3 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
diff --git a/build/android/pylib/device/commands/commands.gyp b/build/android/pylib/device/commands/commands.gyp
new file mode 100644
index 0000000..d173e39
--- /dev/null
+++ b/build/android/pylib/device/commands/commands.gyp
@@ -0,0 +1,18 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'chromium_commands',
+ 'type': 'none',
+ 'variables': {
+ 'java_in_dir': ['java'],
+ },
+ 'includes': [
+ '../../../../../build/java.gypi',
+ ],
+ }
+ ],
+}
diff --git a/build/android/pylib/device/commands/install_commands.py b/build/android/pylib/device/commands/install_commands.py
new file mode 100644
index 0000000..35b11e3
--- /dev/null
+++ b/build/android/pylib/device/commands/install_commands.py
@@ -0,0 +1,51 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+
+from pylib import constants
+
+BIN_DIR = '%s/bin' % constants.TEST_EXECUTABLE_DIR
+_FRAMEWORK_DIR = '%s/framework' % constants.TEST_EXECUTABLE_DIR
+
+_COMMANDS = {
+ 'unzip': 'org.chromium.android.commands.unzip.Unzip',
+}
+
+_SHELL_COMMAND_FORMAT = (
+"""#!/system/bin/sh
+base=%s
+export CLASSPATH=$base/framework/chromium_commands.jar
+exec app_process $base/bin %s $@
+""")
+
+
+def Installed(device):
+ return (all(device.FileExists('%s/%s' % (BIN_DIR, c)) for c in _COMMANDS)
+ and device.FileExists('%s/chromium_commands.jar' % _FRAMEWORK_DIR))
+
+def InstallCommands(device):
+ if device.IsUserBuild():
+ raise Exception('chromium_commands currently requires a userdebug build.')
+
+ chromium_commands_jar_path = os.path.join(
+ constants.GetOutDirectory(), constants.SDK_BUILD_JAVALIB_DIR,
+ 'chromium_commands.dex.jar')
+ if not os.path.exists(chromium_commands_jar_path):
+ raise Exception('%s not found. Please build chromium_commands.'
+ % chromium_commands_jar_path)
+
+ device.RunShellCommand(['mkdir', BIN_DIR, _FRAMEWORK_DIR])
+ for command, main_class in _COMMANDS.iteritems():
+ shell_command = _SHELL_COMMAND_FORMAT % (
+ constants.TEST_EXECUTABLE_DIR, main_class)
+ shell_file = '%s/%s' % (BIN_DIR, command)
+ device.WriteTextFile(shell_file, shell_command)
+ device.RunShellCommand(
+ ['chmod', '755', shell_file], check_return=True)
+
+ device.adb.Push(
+ chromium_commands_jar_path,
+ '%s/chromium_commands.jar' % _FRAMEWORK_DIR)
+
diff --git a/build/android/pylib/device/commands/java/src/org/chromium/android/commands/unzip/Unzip.java b/build/android/pylib/device/commands/java/src/org/chromium/android/commands/unzip/Unzip.java
new file mode 100644
index 0000000..4d2a045
--- /dev/null
+++ b/build/android/pylib/device/commands/java/src/org/chromium/android/commands/unzip/Unzip.java
@@ -0,0 +1,94 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.android.commands.unzip;
+
+import android.util.Log;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+/**
+ * Minimal implementation of the command-line unzip utility for Android.
+ */
+public class Unzip {
+
+ private static final String TAG = "Unzip";
+
+ public static void main(String[] args) {
+ try {
+ (new Unzip()).run(args);
+ } catch (RuntimeException e) {
+ Log.e(TAG, e.toString());
+ System.exit(1);
+ }
+ }
+
+ private void showUsage(PrintStream s) {
+ s.println("Usage:");
+ s.println("unzip [zipfile]");
+ }
+
+ private void unzip(String[] args) {
+ ZipInputStream zis = null;
+ try {
+ String zipfile = args[0];
+ zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(zipfile)));
+ ZipEntry ze = null;
+
+ byte[] bytes = new byte[1024];
+ while ((ze = zis.getNextEntry()) != null) {
+ File outputFile = new File(ze.getName());
+ if (ze.isDirectory()) {
+ if (!outputFile.exists() && !outputFile.mkdirs()) {
+ throw new RuntimeException(
+ "Failed to create directory: " + outputFile.toString());
+ }
+ } else {
+ File parentDir = outputFile.getParentFile();
+ if (!parentDir.exists() && !parentDir.mkdirs()) {
+ throw new RuntimeException(
+ "Failed to create directory: " + parentDir.toString());
+ }
+ OutputStream out = new BufferedOutputStream(new FileOutputStream(outputFile));
+ int actual_bytes = 0;
+ int total_bytes = 0;
+ while ((actual_bytes = zis.read(bytes)) != -1) {
+ out.write(bytes, 0, actual_bytes);
+ total_bytes += actual_bytes;
+ }
+ out.close();
+ }
+ zis.closeEntry();
+ }
+
+ } catch (IOException e) {
+ throw new RuntimeException("Error while unzipping: " + e.toString());
+ } finally {
+ try {
+ if (zis != null) zis.close();
+ } catch (IOException e) {
+ throw new RuntimeException("Error while closing zip: " + e.toString());
+ }
+ }
+ }
+
+ public void run(String[] args) {
+ if (args.length != 1) {
+ showUsage(System.err);
+ throw new RuntimeException("Incorrect usage.");
+ }
+
+ unzip(args);
+ }
+}
+
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
index fccdd61..b726cb9 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -8,15 +8,22 @@
"""
# pylint: disable=W0613
+import logging
+import multiprocessing
+import os
import pipes
import sys
+import tempfile
import time
+import zipfile
import pylib.android_commands
from pylib.device import adb_wrapper
from pylib.device import decorators
from pylib.device import device_errors
+from pylib.device.commands import install_commands
from pylib.utils import apk_helper
+from pylib.utils import host_utils
from pylib.utils import parallelizer
_DEFAULT_TIMEOUT = 30
@@ -61,17 +68,23 @@
operation should be retried on failure if no explicit
value is provided.
"""
+ self.adb = None
self.old_interface = None
if isinstance(device, basestring):
+ self.adb = adb_wrapper.AdbWrapper(device)
self.old_interface = pylib.android_commands.AndroidCommands(device)
elif isinstance(device, adb_wrapper.AdbWrapper):
+ self.adb = device
self.old_interface = pylib.android_commands.AndroidCommands(str(device))
elif isinstance(device, pylib.android_commands.AndroidCommands):
+ self.adb = adb_wrapper.AdbWrapper(device.GetDevice())
self.old_interface = device
elif not device:
+ self.adb = adb_wrapper.AdbWrapper('')
self.old_interface = pylib.android_commands.AndroidCommands()
else:
raise ValueError('Unsupported type passed for argument "device"')
+ self._commands_installed = None
self._default_timeout = default_timeout
self._default_retries = default_retries
assert(hasattr(self, decorators.DEFAULT_TIMEOUT_ATTR))
@@ -91,6 +104,9 @@
Raises:
CommandTimeoutError on timeout.
"""
+ return self._IsOnlineImpl()
+
+ def _IsOnlineImpl(self):
return self.old_interface.IsOnline()
@decorators.WithTimeoutAndRetriesFromInstance()
@@ -111,17 +127,6 @@
return self._HasRootImpl()
def _HasRootImpl(self):
- """Implementation of HasRoot.
-
- This is split from HasRoot to allow other DeviceUtils methods to call
- HasRoot without spawning a new timeout thread.
-
- Returns:
- Same as for |HasRoot|.
-
- Raises:
- Same as for |HasRoot|.
- """
return self.old_interface.IsRootEnabled()
@decorators.WithTimeoutAndRetriesFromInstance()
@@ -141,6 +146,24 @@
'Could not enable root.', device=str(self))
@decorators.WithTimeoutAndRetriesFromInstance()
+ def IsUserBuild(self, timeout=None, retries=None):
+ """Checks whether or not the device is running a user build.
+
+ Args:
+ timeout: timeout in seconds
+ retries: number of retries
+
+ Returns:
+ True if the device is running a user build, False otherwise (i.e. if
+ it's running a userdebug build).
+
+ Raises:
+ CommandTimeoutError on timeout.
+ DeviceUnreachableError on missing device.
+ """
+ return self._GetPropImpl('ro.build.type') == 'user'
+
+ @decorators.WithTimeoutAndRetriesFromInstance()
def GetExternalStoragePath(self, timeout=None, retries=None):
"""Get the device's path to its SD card.
@@ -156,6 +179,9 @@
CommandTimeoutError on timeout.
DeviceUnreachableError on missing device.
"""
+ return self._GetExternalStoragePathImpl()
+
+ def _GetExternalStoragePathImpl(self):
try:
return self.old_interface.GetExternalStorage()
except AssertionError as e:
@@ -183,21 +209,6 @@
self._WaitUntilFullyBootedImpl(wifi=wifi, timeout=timeout)
def _WaitUntilFullyBootedImpl(self, wifi=False, timeout=None):
- """Implementation of WaitUntilFullyBooted.
-
- This is split from WaitUntilFullyBooted to allow other DeviceUtils methods
- to call WaitUntilFullyBooted without spawning a new timeout thread.
-
- TODO(jbudorick) Remove the timeout parameter once this is no longer
- implemented via AndroidCommands.
-
- Args:
- wifi: Same as for |WaitUntilFullyBooted|.
- timeout: timeout in seconds
-
- Raises:
- Same as for |WaitUntilFullyBooted|.
- """
if timeout is None:
timeout = self._default_timeout
self.old_interface.WaitForSystemBootCompleted(timeout)
@@ -281,8 +292,8 @@
str(e), device=str(self)), None, sys.exc_info()[2]
@decorators.WithTimeoutAndRetriesFromInstance()
- def RunShellCommand(self, cmd, check_return=False, as_root=False,
- timeout=None, retries=None):
+ def RunShellCommand(self, cmd, check_return=False, as_root=False, cwd=None,
+ env=None, timeout=None, retries=None):
"""Run an ADB shell command.
TODO(jbudorick) Switch the default value of check_return to True after
@@ -294,6 +305,8 @@
be checked.
as_root: A boolean indicating whether the shell command should be run
with root privileges.
+ cwd: The device directory in which the command should be run.
+ env: The environment variables with which the command should be run.
timeout: timeout in seconds
retries: number of retries
@@ -305,35 +318,23 @@
CommandTimeoutError on timeout.
DeviceUnreachableError on missing device.
"""
- return self._RunShellCommandImpl(cmd, check_return=check_return,
- as_root=as_root, timeout=timeout)
+ return self._RunShellCommandImpl(
+ cmd, check_return=check_return, as_root=as_root, cwd=cwd, env=env,
+ timeout=timeout)
def _RunShellCommandImpl(self, cmd, check_return=False, as_root=False,
- timeout=None):
- """Implementation of RunShellCommand.
-
- This is split from RunShellCommand to allow other DeviceUtils methods to
- call RunShellCommand without spawning a new timeout thread.
-
- TODO(jbudorick) Remove the timeout parameter once this is no longer
- implemented via AndroidCommands.
-
- Args:
- cmd: Same as for |RunShellCommand|.
- check_return: Same as for |RunShellCommand|.
- as_root: Same as for |RunShellCommand|.
- timeout: timeout in seconds
-
- Raises:
- Same as for |RunShellCommand|.
-
- Returns:
- Same as for |RunShellCommand|.
- """
+ cwd=None, env=None, timeout=None):
+ # TODO(jbudorick): Remove the timeout parameter once this is no longer
+ # backed by AndroidCommands.
if isinstance(cmd, list):
cmd = ' '.join(cmd)
- if as_root and not self.HasRoot():
+ if as_root and not self._HasRootImpl():
cmd = 'su -c %s' % cmd
+ if env:
+ cmd = '%s %s' % (
+ ' '.join('%s=%s' % (k, v) for k, v in env.iteritems()), cmd)
+ if cwd:
+ cmd = 'cd %s && %s' % (cwd, cmd)
if check_return:
code, output = self.old_interface.GetShellCommandStatusAndOutput(
cmd, timeout_time=timeout)
@@ -501,15 +502,15 @@
@decorators.WithTimeoutAndRetriesDefaults(
PUSH_CHANGED_FILES_DEFAULT_TIMEOUT,
PUSH_CHANGED_FILES_DEFAULT_RETRIES)
- def PushChangedFiles(self, host_path, device_path, timeout=None,
+ def PushChangedFiles(self, host_device_tuples, timeout=None,
retries=None):
"""Push files to the device, skipping files that don't need updating.
Args:
- host_path: A string containing the absolute path to the file or directory
- on the host that should be minimally pushed to the device.
- device_path: A string containing the absolute path of the destination on
- the device.
+ host_device_tuples: A list of (host_path, device_path) tuples, where
+ |host_path| is an absolute path of a file or directory on the host
+ that should be minimially pushed to the device, and |device_path| is
+ an absolute path of the destination on the device.
timeout: timeout in seconds
retries: number of retries
@@ -518,7 +519,165 @@
CommandTimeoutError on timeout.
DeviceUnreachableError on missing device.
"""
- self.old_interface.PushIfNeeded(host_path, device_path)
+
+ files = []
+ for h, d in host_device_tuples:
+ if os.path.isdir(h):
+ self._RunShellCommandImpl(['mkdir', '-p', '"%s"' % d],
+ check_return=True)
+ files += self._GetChangedFilesImpl(h, d)
+
+ if not files:
+ return
+
+ size = sum(host_utils.GetRecursiveDiskUsage(h) for h, _ in files)
+ file_count = len(files)
+ dir_size = sum(host_utils.GetRecursiveDiskUsage(h)
+ for h, _ in host_device_tuples)
+ dir_file_count = 0
+ for h, _ in host_device_tuples:
+ if os.path.isdir(h):
+ dir_file_count += sum(len(f) for _r, _d, f in os.walk(h))
+ else:
+ dir_file_count += 1
+
+ push_duration = self._ApproximateDuration(
+ file_count, file_count, size, False)
+ dir_push_duration = self._ApproximateDuration(
+ len(host_device_tuples), dir_file_count, dir_size, False)
+ zip_duration = self._ApproximateDuration(1, 1, size, True)
+
+ self._InstallCommands()
+
+ if dir_push_duration < push_duration and (
+ dir_push_duration < zip_duration or not self._commands_installed):
+ self._PushChangedFilesIndividually(host_device_tuples)
+ elif push_duration < zip_duration or not self._commands_installed:
+ self._PushChangedFilesIndividually(files)
+ else:
+ self._PushChangedFilesZipped(files)
+ self._RunShellCommandImpl(
+ ['chmod', '-R', '777'] + [d for _, d in host_device_tuples],
+ as_root=True)
+
+ def _GetChangedFilesImpl(self, host_path, device_path):
+ real_host_path = os.path.realpath(host_path)
+ try:
+ real_device_path = self._RunShellCommandImpl(
+ ['realpath', device_path], check_return=True)
+ real_device_path = real_device_path[0]
+ except device_errors.CommandFailedError:
+ return [(host_path, device_path)]
+
+ # TODO(jbudorick): Move the md5 logic up into DeviceUtils or base
+ # this function on mtime.
+ # pylint: disable=W0212
+ host_hash_tuples, device_hash_tuples = self.old_interface._RunMd5Sum(
+ real_host_path, real_device_path)
+ # pylint: enable=W0212
+
+ if os.path.isfile(host_path):
+ if (not device_hash_tuples
+ or device_hash_tuples[0].hash != host_hash_tuples[0].hash):
+ return [(host_path, device_path)]
+ else:
+ return []
+ else:
+ device_tuple_dict = dict((d.path, d.hash) for d in device_hash_tuples)
+ to_push = []
+ for host_hash, host_abs_path in (
+ (h.hash, h.path) for h in host_hash_tuples):
+ device_abs_path = '%s/%s' % (
+ real_device_path, os.path.relpath(host_abs_path, real_host_path))
+ if (device_abs_path not in device_tuple_dict
+ or device_tuple_dict[device_abs_path] != host_hash):
+ to_push.append((host_abs_path, device_abs_path))
+ return to_push
+
+ def _InstallCommands(self):
+ if self._commands_installed is None:
+ try:
+ if not install_commands.Installed(self):
+ install_commands.InstallCommands(self)
+ self._commands_installed = True
+ except Exception as e:
+ logging.warning('unzip not available: %s' % str(e))
+ self._commands_installed = False
+
+ @staticmethod
+ def _ApproximateDuration(adb_calls, file_count, byte_count, is_zipping):
+ # We approximate the time to push a set of files to a device as:
+ # t = c1 * a + c2 * f + c3 + b / c4 + b / (c5 * c6), where
+ # t: total time (sec)
+ # c1: adb call time delay (sec)
+ # a: number of times adb is called (unitless)
+ # c2: push time delay (sec)
+ # f: number of files pushed via adb (unitless)
+ # c3: zip time delay (sec)
+ # c4: zip rate (bytes/sec)
+ # b: total number of bytes (bytes)
+ # c5: transfer rate (bytes/sec)
+ # c6: compression ratio (unitless)
+
+ # All of these are approximations.
+ ADB_CALL_PENALTY = 0.1 # seconds
+ ADB_PUSH_PENALTY = 0.01 # seconds
+ ZIP_PENALTY = 2.0 # seconds
+ ZIP_RATE = 10000000.0 # bytes / second
+ TRANSFER_RATE = 2000000.0 # bytes / second
+ COMPRESSION_RATIO = 2.0 # unitless
+
+ adb_call_time = ADB_CALL_PENALTY * adb_calls
+ adb_push_setup_time = ADB_PUSH_PENALTY * file_count
+ if is_zipping:
+ zip_time = ZIP_PENALTY + byte_count / ZIP_RATE
+ transfer_time = byte_count / (TRANSFER_RATE * COMPRESSION_RATIO)
+ else:
+ zip_time = 0
+ transfer_time = byte_count / TRANSFER_RATE
+ return (adb_call_time + adb_push_setup_time + zip_time + transfer_time)
+
+ def _PushChangedFilesIndividually(self, files):
+ for h, d in files:
+ self.adb.Push(h, d)
+
+ def _PushChangedFilesZipped(self, files):
+ if not files:
+ return
+
+ with tempfile.NamedTemporaryFile(suffix='.zip') as zip_file:
+ zip_proc = multiprocessing.Process(
+ target=DeviceUtils._CreateDeviceZip,
+ args=(zip_file.name, files))
+ zip_proc.start()
+ zip_proc.join()
+
+ zip_on_device = '%s/tmp.zip' % self._GetExternalStoragePathImpl()
+ try:
+ self.adb.Push(zip_file.name, zip_on_device)
+ self._RunShellCommandImpl(
+ ['unzip', zip_on_device],
+ as_root=True, check_return=True,
+ env={'PATH': '$PATH:%s' % install_commands.BIN_DIR})
+ finally:
+ if zip_proc.is_alive():
+ zip_proc.terminate()
+ if self._IsOnlineImpl():
+ self._RunShellCommandImpl(['rm', zip_on_device])
+
+ @staticmethod
+ def _CreateDeviceZip(zip_path, host_device_tuples):
+ with zipfile.ZipFile(zip_path, 'w') as zip_file:
+ for host_path, device_path in host_device_tuples:
+ if os.path.isfile(host_path):
+ zip_file.write(host_path, device_path, zipfile.ZIP_DEFLATED)
+ else:
+ for hd, _, files in os.walk(host_path):
+ dd = '%s/%s' % (device_path, os.path.relpath(host_path, hd))
+ zip_file.write(hd, dd, zipfile.ZIP_STORED)
+ for f in files:
+ zip_file.write(os.path.join(hd, f), '%s/%s' % (dd, f),
+ zipfile.ZIP_DEFLATED)
@decorators.WithTimeoutAndRetriesFromInstance()
def FileExists(self, device_path, timeout=None, retries=None):
@@ -537,23 +696,6 @@
CommandTimeoutError on timeout.
DeviceUnreachableError on missing device.
"""
- return self._FileExistsImpl(device_path)
-
- def _FileExistsImpl(self, device_path):
- """Implementation of FileExists.
-
- This is split from FileExists to allow other DeviceUtils methods to call
- FileExists without spawning a new timeout thread.
-
- Args:
- device_path: Same as for |FileExists|.
-
- Returns:
- True if the file exists on the device, False otherwise.
-
- Raises:
- Same as for |FileExists|.
- """
return self.old_interface.FileExistsOnDevice(device_path)
@decorators.WithTimeoutAndRetriesFromInstance()
@@ -598,7 +740,7 @@
CommandTimeoutError on timeout.
DeviceUnreachableError on missing device.
"""
- # TODO(jbudorick) Evaluate whether we awant to return a list of lines after
+ # TODO(jbudorick) Evaluate whether we want to return a list of lines after
# the implementation switch, and if file not found should raise exception.
if as_root:
if not self.old_interface.CanAccessProtectedFileContents():
@@ -714,6 +856,9 @@
Raises:
CommandTimeoutError on timeout.
"""
+ return self._GetPropImpl(property_name)
+
+ def _GetPropImpl(self, property_name):
return self.old_interface.system_properties[property_name]
@decorators.WithTimeoutAndRetriesFromInstance()
@@ -734,6 +879,22 @@
self.old_interface.system_properties[property_name] = value
@decorators.WithTimeoutAndRetriesFromInstance()
+ def GetABI(self, timeout=None, retries=None):
+ """Gets the device main ABI.
+
+ Args:
+ timeout: timeout in seconds
+ retries: number of retries
+
+ Returns:
+ The device's main ABI name.
+
+ Raises:
+ CommandTimeoutError on timeout.
+ """
+ return self.GetProp('ro.product.cpu.abi')
+
+ @decorators.WithTimeoutAndRetriesFromInstance()
def GetPids(self, process_name, timeout=None, retries=None):
"""Returns the PIDs of processes with the given name.
@@ -755,21 +916,6 @@
return self._GetPidsImpl(process_name)
def _GetPidsImpl(self, process_name):
- """Implementation of GetPids.
-
- This is split from GetPids to allow other DeviceUtils methods to call
- GetPids without spawning a new timeout thread.
-
- Args:
- process_name: A string containing the process name to get the PIDs for.
-
- Returns:
- A dict mapping process name to PID for each process that contained the
- provided |process_name|.
-
- Raises:
- DeviceUnreachableError on missing device.
- """
procs_pids = {}
for line in self._RunShellCommandImpl('ps'):
try:
@@ -869,4 +1015,3 @@
return parallelizer_type([
d if isinstance(d, DeviceUtils) else DeviceUtils(d)
for d in devices])
-
diff --git a/build/android/pylib/device/device_utils_test.py b/build/android/pylib/device/device_utils_test.py
index 42dc5b2..513b538 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -85,6 +85,7 @@
st_size, st_atime, st_mtime, st_ctime)
MOCKED_FUNCTIONS = [
+ ('os.listdir', []),
('os.path.abspath', ''),
('os.path.dirname', ''),
('os.path.exists', False),
@@ -117,14 +118,23 @@
def addMockDirectory(self, path, **kw):
self._addMockThing(path, True, **kw)
- def _addMockThing(self, path, is_dir, size=0, stat=None, walk=None):
+ def _addMockThing(self, path, is_dir, listdir=None, size=0, stat=None,
+ walk=None):
+ if listdir is None:
+ listdir = []
if stat is None:
stat = self.osStatResult()
if walk is None:
walk = []
+
+ dirname = os.sep.join(path.rstrip(os.sep).split(os.sep)[:-1])
+ if dirname and not dirname in self.mock_file_info:
+ self._addMockThing(dirname, True)
+
self.mock_file_info[path] = {
+ 'os.listdir': listdir,
'os.path.abspath': path,
- 'os.path.dirname': '/' + '/'.join(path.strip('/').split('/')[:-1]),
+ 'os.path.dirname': dirname,
'os.path.exists': True,
'os.path.isdir': is_dir,
'os.path.getsize': size,
@@ -208,6 +218,24 @@
'0123456789abcdef', default_timeout=1, default_retries=0)
+class DeviceUtilsNewImplTest(unittest.TestCase):
+
+ def setUp(self):
+ test_serial = '0123456789abcdef'
+ self.adb = mock.Mock(spec=adb_wrapper.AdbWrapper)
+ self.adb.__str__ = mock.Mock(return_value=test_serial)
+ self.adb.GetDeviceSerial.return_value = test_serial
+ self.device = device_utils.DeviceUtils(
+ self.adb, default_timeout=1, default_retries=0)
+
+
+class DeviceUtilsHybridImplTest(DeviceUtilsOldImplTest):
+
+ def setUp(self):
+ super(DeviceUtilsHybridImplTest, self).setUp()
+ self.device.adb = self.adb = mock.Mock(spec=adb_wrapper.AdbWrapper)
+
+
class DeviceUtilsIsOnlineTest(DeviceUtilsOldImplTest):
def testIsOnline_true(self):
@@ -260,6 +288,21 @@
self.device.EnableRoot()
+class DeviceUtilsIsUserBuildTest(DeviceUtilsOldImplTest):
+
+ def testIsUserBuild_yes(self):
+ with self.assertCalls(
+ 'adb -s 0123456789abcdef shell getprop ro.build.type',
+ 'user\r\n'):
+ self.assertTrue(self.device.IsUserBuild())
+
+ def testIsUserBuild_no(self):
+ with self.assertCalls(
+ 'adb -s 0123456789abcdef shell getprop ro.build.type',
+ 'userdebug\r\n'):
+ self.assertFalse(self.device.IsUserBuild())
+
+
class DeviceUtilsGetExternalStoragePathTest(DeviceUtilsOldImplTest):
def testGetExternalStoragePath_succeeds(self):
@@ -843,132 +886,95 @@
self.device.SendKeyEvent(66)
-class DeviceUtilsPushChangedFilesTest(DeviceUtilsOldImplTest):
+class DeviceUtilsPushChangedFilesIndividuallyTest(DeviceUtilsNewImplTest):
+
+ def testPushChangedFilesIndividually_empty(self):
+ test_files = []
+ self.device._PushChangedFilesIndividually(test_files)
+ self.assertEqual(0, self.adb.Push.call_count)
+
+ def testPushChangedFilesIndividually_single(self):
+ test_files = [('/test/host/path', '/test/device/path')]
+ self.device._PushChangedFilesIndividually(test_files)
+ self.adb.Push.assert_called_once_with(
+ '/test/host/path', '/test/device/path')
+
+ def testPushChangedFilesIndividually_multiple(self):
+ test_files = [
+ ('/test/host/path/file1', '/test/device/path/file1'),
+ ('/test/host/path/file2', '/test/device/path/file2')]
+ self.device._PushChangedFilesIndividually(test_files)
+ self.assertEqual(2, self.adb.Push.call_count)
+ self.adb.Push.assert_any_call(
+ '/test/host/path/file1', '/test/device/path/file1')
+ self.adb.Push.assert_any_call(
+ '/test/host/path/file2', '/test/device/path/file2')
- def testPushChangedFiles_noHostPath(self):
- with mock.patch('os.path.exists', return_value=False):
- with self.assertRaises(device_errors.CommandFailedError):
- self.device.PushChangedFiles('/test/host/path', '/test/device/path')
+@mock.patch('pylib.device.commands.install_commands.Installed', new=None)
+@mock.patch('pylib.device.commands.install_commands.InstallCommands', new=None)
+class DeviceUtilsPushChangedFilesZippedTest(DeviceUtilsHybridImplTest):
- def testPushChangedFiles_file_noChange(self):
- self.device.old_interface._push_if_needed_cache = {}
+ def setUp(self):
+ super(DeviceUtilsPushChangedFilesZippedTest, self).setUp()
- host_file_path = '/test/host/path'
- device_file_path = '/test/device/path'
+ def testPushChangedFilesZipped_empty(self):
+ test_files = []
+ self.device._PushChangedFilesZipped(test_files)
+ self.assertEqual(0, self.adb.Push.call_count)
- mock_fs = MockFileSystem()
- mock_fs.addMockFile(host_file_path, size=100)
+ def testPushChangedFilesZipped_single(self):
+ test_files = [('/test/host/path/file1', '/test/device/path/file1')]
- self.device.old_interface.GetFilesChanged = mock.Mock(return_value=[])
+ self.device._GetExternalStoragePathImpl = mock.Mock(
+ return_value='/test/device/external_dir')
+ self.device._IsOnlineImpl = mock.Mock(return_value=True)
+ self.device._RunShellCommandImpl = mock.Mock()
+ mock_zip_temp = mock.mock_open()
+ mock_zip_temp.return_value.name = '/test/temp/file/tmp.zip'
+ with mock.patch('multiprocessing.Process') as mock_zip_proc, (
+ mock.patch('tempfile.NamedTemporaryFile', mock_zip_temp)):
+ self.device._PushChangedFilesZipped(test_files)
- with mock_fs:
- # GetFilesChanged is mocked, so its adb calls are omitted.
- with self.assertNoAdbCalls():
- self.device.PushChangedFiles(host_file_path, device_file_path)
+ mock_zip_proc.assert_called_once_with(
+ target=device_utils.DeviceUtils._CreateDeviceZip,
+ args=('/test/temp/file/tmp.zip', test_files))
+ self.adb.Push.assert_called_once_with(
+ '/test/temp/file/tmp.zip', '/test/device/external_dir/tmp.zip')
+ self.assertEqual(2, self.device._RunShellCommandImpl.call_count)
+ self.device._RunShellCommandImpl.assert_any_call(
+ ['unzip', '/test/device/external_dir/tmp.zip'],
+ as_root=True, check_return=True,
+ env={'PATH': '$PATH:/data/local/tmp/bin'})
+ self.device._RunShellCommandImpl.assert_any_call(
+ ['rm', '/test/device/external_dir/tmp.zip'])
- def testPushChangedFiles_file_changed(self):
- self.device.old_interface._push_if_needed_cache = {}
+ def testPushChangedFilesZipped_multiple(self):
+ test_files = [('/test/host/path/file1', '/test/device/path/file1'),
+ ('/test/host/path/file2', '/test/device/path/file2')]
- host_file_path = '/test/host/path'
- device_file_path = '/test/device/path'
+ self.device._GetExternalStoragePathImpl = mock.Mock(
+ return_value='/test/device/external_dir')
+ self.device._IsOnlineImpl = mock.Mock(return_value=True)
+ self.device._RunShellCommandImpl = mock.Mock()
+ mock_zip_temp = mock.mock_open()
+ mock_zip_temp.return_value.name = '/test/temp/file/tmp.zip'
+ with mock.patch('multiprocessing.Process') as mock_zip_proc, (
+ mock.patch('tempfile.NamedTemporaryFile', mock_zip_temp)):
+ self.device._PushChangedFilesZipped(test_files)
- mock_fs = MockFileSystem()
- mock_fs.addMockFile(
- host_file_path, size=100,
- stat=MockFileSystem.osStatResult(st_mtime=1000000000))
-
- self.device.old_interface.GetFilesChanged = mock.Mock(
- return_value=[('/test/host/path', '/test/device/path')])
-
- with mock_fs:
- with self.assertCalls('adb -s 0123456789abcdef push '
- '/test/host/path /test/device/path', '100 B/s (100 B in 1.000s)\r\n'):
- self.device.PushChangedFiles(host_file_path, device_file_path)
-
- def testPushChangedFiles_directory_nothingChanged(self):
- self.device.old_interface._push_if_needed_cache = {}
-
- host_file_path = '/test/host/path'
- device_file_path = '/test/device/path'
-
- mock_fs = MockFileSystem()
- mock_fs.addMockDirectory(
- host_file_path, size=256,
- stat=MockFileSystem.osStatResult(st_mtime=1000000000))
- mock_fs.addMockFile(
- host_file_path + '/file1', size=251,
- stat=MockFileSystem.osStatResult(st_mtime=1000000001))
- mock_fs.addMockFile(
- host_file_path + '/file2', size=252,
- stat=MockFileSystem.osStatResult(st_mtime=1000000002))
-
- self.device.old_interface.GetFilesChanged = mock.Mock(return_value=[])
-
- with mock_fs:
- with self.assertCallsSequence([
- ("adb -s 0123456789abcdef shell 'mkdir -p \"/test/device/path\"'",
- '')]):
- self.device.PushChangedFiles(host_file_path, device_file_path)
-
- def testPushChangedFiles_directory_somethingChanged(self):
- self.device.old_interface._push_if_needed_cache = {}
-
- host_file_path = '/test/host/path'
- device_file_path = '/test/device/path'
-
- mock_fs = MockFileSystem()
- mock_fs.addMockDirectory(
- host_file_path, size=256,
- stat=MockFileSystem.osStatResult(st_mtime=1000000000),
- walk=[('/test/host/path', [], ['file1', 'file2'])])
- mock_fs.addMockFile(
- host_file_path + '/file1', size=256,
- stat=MockFileSystem.osStatResult(st_mtime=1000000001))
- mock_fs.addMockFile(
- host_file_path + '/file2', size=256,
- stat=MockFileSystem.osStatResult(st_mtime=1000000002))
-
- self.device.old_interface.GetFilesChanged = mock.Mock(
- return_value=[('/test/host/path/file1', '/test/device/path/file1')])
-
- with mock_fs:
- with self.assertCallsSequence([
- ("adb -s 0123456789abcdef shell 'mkdir -p \"/test/device/path\"'",
- ''),
- ('adb -s 0123456789abcdef push '
- '/test/host/path/file1 /test/device/path/file1',
- '256 B/s (256 B in 1.000s)\r\n')]):
- self.device.PushChangedFiles(host_file_path, device_file_path)
-
- def testPushChangedFiles_directory_everythingChanged(self):
- self.device.old_interface._push_if_needed_cache = {}
-
- host_file_path = '/test/host/path'
- device_file_path = '/test/device/path'
-
- mock_fs = MockFileSystem()
- mock_fs.addMockDirectory(
- host_file_path, size=256,
- stat=MockFileSystem.osStatResult(st_mtime=1000000000))
- mock_fs.addMockFile(
- host_file_path + '/file1', size=256,
- stat=MockFileSystem.osStatResult(st_mtime=1000000001))
- mock_fs.addMockFile(
- host_file_path + '/file2', size=256,
- stat=MockFileSystem.osStatResult(st_mtime=1000000002))
-
- self.device.old_interface.GetFilesChanged = mock.Mock(
- return_value=[('/test/host/path/file1', '/test/device/path/file1'),
- ('/test/host/path/file2', '/test/device/path/file2')])
-
- with mock_fs:
- with self.assertCallsSequence([
- ("adb -s 0123456789abcdef shell 'mkdir -p \"/test/device/path\"'",
- ''),
- ('adb -s 0123456789abcdef push /test/host/path /test/device/path',
- '768 B/s (768 B in 1.000s)\r\n')]):
- self.device.PushChangedFiles(host_file_path, device_file_path)
+ mock_zip_proc.assert_called_once_with(
+ target=device_utils.DeviceUtils._CreateDeviceZip,
+ args=('/test/temp/file/tmp.zip', test_files))
+ self.adb.Push.assert_called_once_with(
+ '/test/temp/file/tmp.zip', '/test/device/external_dir/tmp.zip')
+ self.assertEqual(2, self.device._RunShellCommandImpl.call_count)
+ self.device._RunShellCommandImpl.assert_any_call(
+ ['unzip', '/test/device/external_dir/tmp.zip'],
+ as_root=True, check_return=True,
+ env={'PATH': '$PATH:/data/local/tmp/bin'})
+ self.device._RunShellCommandImpl.assert_any_call(
+ ['rm', '/test/device/external_dir/tmp.zip'])
class DeviceUtilsFileExistsTest(DeviceUtilsOldImplTest):
diff --git a/build/android/pylib/forwarder.py b/build/android/pylib/forwarder.py
index db6ea03..5e45043 100644
--- a/build/android/pylib/forwarder.py
+++ b/build/android/pylib/forwarder.py
@@ -288,9 +288,9 @@
if device_serial in self._initialized_devices:
return
Forwarder._KillDeviceLocked(device, tool)
- device.PushChangedFiles(
+ device.PushChangedFiles([(
self._device_forwarder_path_on_host,
- Forwarder._DEVICE_FORWARDER_FOLDER)
+ Forwarder._DEVICE_FORWARDER_FOLDER)])
cmd = '%s %s' % (tool.GetUtilWrapper(), Forwarder._DEVICE_FORWARDER_PATH)
(exit_code, output) = device.old_interface.GetAndroidToolStatusAndOutput(
cmd, lib_path=Forwarder._DEVICE_FORWARDER_FOLDER)
diff --git a/build/android/pylib/gtest/setup.py b/build/android/pylib/gtest/setup.py
index 1e52d3b..61a8539 100644
--- a/build/android/pylib/gtest/setup.py
+++ b/build/android/pylib/gtest/setup.py
@@ -14,9 +14,11 @@
from pylib import cmd_helper
from pylib import constants
+from pylib import valgrind_tools
from pylib.base import base_test_result
from pylib.base import test_dispatcher
+from pylib.device import device_utils
from pylib.gtest import test_package_apk
from pylib.gtest import test_package_exe
from pylib.gtest import test_runner
@@ -287,6 +289,19 @@
return tests
+def PushDataDeps(device, test_options, test_package):
+ valgrind_tools.PushFilesForTool(test_options.tool, device)
+ if os.path.exists(constants.ISOLATE_DEPS_DIR):
+ device_dir = (
+ constants.TEST_EXECUTABLE_DIR
+ if test_package.suite_name == 'breakpad_unittests'
+ else device.GetExternalStoragePath())
+ device.PushChangedFiles([
+ (os.path.join(constants.ISOLATE_DEPS_DIR, p),
+ '%s/%s' % (device_dir, p))
+ for p in os.listdir(constants.ISOLATE_DEPS_DIR)])
+
+
def Setup(test_options, devices):
"""Create the test runner factory and tests.
@@ -314,6 +329,9 @@
_GenerateDepsDirUsingIsolate(test_options.suite_name,
test_options.isolate_file_path)
+ device_utils.DeviceUtils.parallel(devices).pMap(
+ PushDataDeps, test_options, test_package)
+
tests = _GetTests(test_options, test_package, devices)
# Constructs a new TestRunner with the current options.
diff --git a/build/android/pylib/gtest/test_package_apk.py b/build/android/pylib/gtest/test_package_apk.py
index 429cd2b..4a91278 100644
--- a/build/android/pylib/gtest/test_package_apk.py
+++ b/build/android/pylib/gtest/test_package_apk.py
@@ -44,9 +44,9 @@
# GTest expects argv[0] to be the executable path.
command_line_file.write(self.suite_name + ' ' + options)
command_line_file.flush()
- device.PushChangedFiles(
+ device.PushChangedFiles([(
command_line_file.name,
- self._package_info.cmdline_file)
+ self._package_info.cmdline_file)])
def _GetFifo(self):
# The test.fifo path is determined by:
@@ -131,5 +131,5 @@
#override
def Install(self, device):
- self.tool.CopyFiles()
+ self.tool.CopyFiles(device)
device.Install(self.suite_path)
diff --git a/build/android/pylib/gtest/test_package_exe.py b/build/android/pylib/gtest/test_package_exe.py
index 5f82aad..b0be35c 100644
--- a/build/android/pylib/gtest/test_package_exe.py
+++ b/build/android/pylib/gtest/test_package_exe.py
@@ -105,9 +105,9 @@
TestPackageExecutable._TEST_RUNNER_RET_VAL_FILE))
sh_script_file.flush()
cmd_helper.RunCmd(['chmod', '+x', sh_script_file.name])
- device.PushChangedFiles(
+ device.PushChangedFiles([(
sh_script_file.name,
- constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh')
+ constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh')])
logging.info('Conents of the test runner script: ')
for line in open(sh_script_file.name).readlines():
logging.info(' ' + line.rstrip())
@@ -148,4 +148,4 @@
self.suite_name + '_stripped'))
test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name
- device.PushChangedFiles(target_name, test_binary)
+ device.PushChangedFiles([(target_name, test_binary)])
diff --git a/build/android/pylib/gtest/test_runner.py b/build/android/pylib/gtest/test_runner.py
index faffe8f..9f89beb 100644
--- a/build/android/pylib/gtest/test_runner.py
+++ b/build/android/pylib/gtest/test_runner.py
@@ -6,7 +6,6 @@
import os
import re
-from pylib import constants
from pylib import pexpect
from pylib.base import base_test_result
from pylib.base import base_test_runner
@@ -59,22 +58,6 @@
def InstallTestPackage(self):
self.test_package.Install(self.device)
- #override
- def PushDataDeps(self):
- self.device.WaitUntilFullyBooted(timeout=20)
- self.tool.CopyFiles()
- if os.path.exists(constants.ISOLATE_DEPS_DIR):
- # TODO(frankf): linux_dumper_unittest_helper needs to be in the same dir
- # as breakpad_unittests exe. Find a better way to do this.
- if self.test_package.suite_name == 'breakpad_unittests':
- device_dir = constants.TEST_EXECUTABLE_DIR
- else:
- device_dir = self.device.GetExternalStoragePath()
- for p in os.listdir(constants.ISOLATE_DEPS_DIR):
- self.device.PushChangedFiles(
- os.path.join(constants.ISOLATE_DEPS_DIR, p),
- os.path.join(device_dir, p))
-
def _ParseTestOutput(self, p):
"""Process the test output.
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
index 4f8cdcf..0e6c168 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -99,14 +99,15 @@
str(self.device))
return
+ host_device_file_tuples = []
test_data = _GetDataFilesForTestSuite(self.test_pkg.GetApkName())
if test_data:
# Make sure SD card is ready.
self.device.WaitUntilFullyBooted(timeout=20)
- for p in test_data:
- self.device.PushChangedFiles(
- os.path.join(constants.DIR_SOURCE_ROOT, p),
- os.path.join(self.device.GetExternalStoragePath(), p))
+ host_device_file_tuples += [
+ (os.path.join(constants.DIR_SOURCE_ROOT, p),
+ os.path.join(self.device.GetExternalStoragePath(), p))
+ for p in test_data]
# TODO(frankf): Specify test data in this file as opposed to passing
# as command-line.
@@ -117,13 +118,15 @@
host_test_files_path = os.path.join(constants.DIR_SOURCE_ROOT,
host_src)
if os.path.exists(host_test_files_path):
- self.device.PushChangedFiles(
+ host_device_file_tuples += [(
host_test_files_path,
'%s/%s/%s' % (
self.device.GetExternalStoragePath(),
TestRunner._DEVICE_DATA_DIR,
- dst_layer))
- self.tool.CopyFiles()
+ dst_layer))]
+ if host_device_file_tuples:
+ self.device.PushChangedFiles(host_device_file_tuples)
+ self.tool.CopyFiles(self.device)
TestRunner._DEVICE_HAS_TEST_FILES[str(self.device)] = True
def _GetInstrumentationArgs(self):
diff --git a/build/android/pylib/ports.py b/build/android/pylib/ports.py
index 34efb52..578152c 100644
--- a/build/android/pylib/ports.py
+++ b/build/android/pylib/ports.py
@@ -9,11 +9,9 @@
import httplib
import logging
import os
-import re
import socket
import traceback
-from pylib import cmd_helper
from pylib import constants
@@ -57,7 +55,7 @@
with open(constants.TEST_SERVER_PORT_FILE, 'r+') as fp:
port = int(fp.read())
ports_tried.append(port)
- while IsHostPortUsed(port):
+ while not IsHostPortAvailable(port):
port += 1
ports_tried.append(port)
if (port > constants.TEST_SERVER_PORT_LAST or
@@ -67,7 +65,7 @@
fp.seek(0, os.SEEK_SET)
fp.write('%d' % (port + 1))
except Exception as e:
- logging.info(e)
+ logging.error(e)
finally:
if fp_lock:
fcntl.flock(fp_lock, fcntl.LOCK_UN)
@@ -80,25 +78,23 @@
return port
-def IsHostPortUsed(host_port):
- """Checks whether the specified host port is used or not.
-
- Uses -n -P to inhibit the conversion of host/port numbers to host/port names.
+def IsHostPortAvailable(host_port):
+ """Checks whether the specified host port is available.
Args:
- host_port: Port on host we want to check.
+ host_port: Port on host to check.
Returns:
- True if the port on host is already used, otherwise returns False.
+ True if the port on host is available, otherwise returns False.
"""
- port_info = '(\*)|(127\.0\.0\.1)|(localhost):%d' % host_port
- # TODO(jnd): Find a better way to filter the port. Note that connecting to the
- # socket and closing it would leave it in the TIME_WAIT state. Setting
- # SO_LINGER on it and then closing it makes the Python HTTP server crash.
- re_port = re.compile(port_info, re.MULTILINE)
- if re_port.search(cmd_helper.GetCmdOutput(['lsof', '-nPi:%d' % host_port])):
+ s = socket.socket()
+ try:
+ s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ s.bind(('', host_port))
+ s.close()
return True
- return False
+ except socket.error:
+ return False
def IsDevicePortUsed(device, device_port, state=''):
diff --git a/build/android/pylib/uiautomator/test_package.py b/build/android/pylib/uiautomator/test_package.py
index d8558c1..fd9120e 100644
--- a/build/android/pylib/uiautomator/test_package.py
+++ b/build/android/pylib/uiautomator/test_package.py
@@ -24,4 +24,4 @@
# Override.
def Install(self, device):
- device.PushChangedFiles(self._jar_path, constants.TEST_EXECUTABLE_DIR)
+ device.PushChangedFiles([(self._jar_path, constants.TEST_EXECUTABLE_DIR)])
diff --git a/build/android/pylib/valgrind_tools.py b/build/android/pylib/valgrind_tools.py
index 69f351a..46cf9e3 100644
--- a/build/android/pylib/valgrind_tools.py
+++ b/build/android/pylib/valgrind_tools.py
@@ -10,12 +10,12 @@
1. For tests that simply run a native process (i.e. no activity is spawned):
-Call tool.CopyFiles().
+Call tool.CopyFiles(device).
Prepend test command line with tool.GetTestWrapper().
2. For tests that spawn an activity:
-Call tool.CopyFiles().
+Call tool.CopyFiles(device).
Call tool.SetupEnvironment().
Run the test as usual.
Call tool.CleanUpEnvironment().
@@ -62,7 +62,8 @@
"""
return ''
- def CopyFiles(self):
+ @classmethod
+ def CopyFiles(cls, device):
"""Copies tool-specific files to the device, create directories, etc."""
pass
@@ -106,21 +107,21 @@
# This is required because ASan is a compiler-based tool, and md5sum
# includes instrumented code from base.
device.old_interface.SetUtilWrapper(self.GetUtilWrapper())
+
+ @classmethod
+ def CopyFiles(cls, device):
+ """Copies ASan tools to the device."""
libs = glob.glob(os.path.join(DIR_SOURCE_ROOT,
'third_party/llvm-build/Release+Asserts/',
'lib/clang/*/lib/linux/',
'libclang_rt.asan-arm-android.so'))
assert len(libs) == 1
- self._lib = libs[0]
-
- def CopyFiles(self):
- """Copies ASan tools to the device."""
subprocess.call([os.path.join(DIR_SOURCE_ROOT,
'tools/android/asan/asan_device_setup.sh'),
- '--device', str(self._device),
- '--lib', self._lib,
+ '--device', str(device),
+ '--lib', libs[0],
'--extra-options', AddressSanitizerTool.EXTRA_OPTIONS])
- self._device.WaitUntilFullyBooted()
+ device.WaitUntilFullyBooted()
def GetTestWrapper(self):
return AddressSanitizerTool.WRAPPER_NAME
@@ -164,18 +165,19 @@
self._wrap_properties = ['wrap.com.google.android.apps.ch',
'wrap.org.chromium.native_test']
- def CopyFiles(self):
+ @classmethod
+ def CopyFiles(cls, device):
"""Copies Valgrind tools to the device."""
- self._device.RunShellCommand(
+ device.RunShellCommand(
'rm -r %s; mkdir %s' % (ValgrindTool.VG_DIR, ValgrindTool.VG_DIR))
- self._device.RunShellCommand(
+ device.RunShellCommand(
'rm -r %s; mkdir %s' % (ValgrindTool.VGLOGS_DIR,
ValgrindTool.VGLOGS_DIR))
- files = self.GetFilesForTool()
- for f in files:
- self._device.PushChangedFiles(
- os.path.join(DIR_SOURCE_ROOT, f),
+ files = cls.GetFilesForTool()
+ device.PushChangedFiles(
+ [((os.path.join(DIR_SOURCE_ROOT, f),
os.path.join(ValgrindTool.VG_DIR, os.path.basename(f)))
+ for f in files)])
def SetupEnvironment(self):
"""Sets up device environment."""
@@ -192,7 +194,8 @@
self._device.RunShellCommand('setprop %s ""' % (prop,))
SetChromeTimeoutScale(self._device, None)
- def GetFilesForTool(self):
+ @staticmethod
+ def GetFilesForTool():
"""Returns a list of file names for the tool."""
raise NotImplementedError()
@@ -211,7 +214,8 @@
def __init__(self, device):
super(MemcheckTool, self).__init__(device)
- def GetFilesForTool(self):
+ @staticmethod
+ def GetFilesForTool():
"""Returns a list of file names for the tool."""
return ['tools/valgrind/android/vg-chrome-wrapper.sh',
'tools/valgrind/memcheck/suppressions.txt',
@@ -232,7 +236,8 @@
def __init__(self, device):
super(TSanTool, self).__init__(device)
- def GetFilesForTool(self):
+ @staticmethod
+ def GetFilesForTool():
"""Returns a list of file names for the tool."""
return ['tools/valgrind/android/vg-chrome-wrapper-tsan.sh',
'tools/valgrind/tsan/suppressions.txt',
@@ -276,3 +281,22 @@
print 'Unknown tool %s, available tools: %s' % (
tool_name, ', '.join(sorted(TOOL_REGISTRY.keys())))
sys.exit(1)
+
+def PushFilesForTool(tool_name, device):
+ """Pushes the files required for |tool_name| to |device|.
+
+ Args:
+ tool_name: Name of the tool to create.
+ device: A DeviceUtils instance.
+ """
+ if not tool_name:
+ return
+
+ clazz = TOOL_REGISTRY.get(tool_name)
+ if clazz:
+ clazz.CopyFiles(device)
+ else:
+ print 'Unknown tool %s, available tools: %s' % (
+ tool_name, ', '.join(sorted(TOOL_REGISTRY.keys())))
+ sys.exit(1)
+
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 5303463..92c9798 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -57,6 +57,9 @@
const='Release', dest='build_type',
help=('If set, run test suites under out/Release.'
' Default is env var BUILDTYPE or Debug.'))
+ group.add_option('--build-directory', dest='build_directory',
+ help=('Path to the directory in which build files are'
+ ' located (should not include build type)'))
group.add_option('-c', dest='cleanup_test_files',
help='Cleanup test files on the device after run',
action='store_true')
@@ -93,6 +96,8 @@
"""Processes and handles all common options."""
run_tests_helper.SetLogLevel(options.verbose_count)
constants.SetBuildType(options.build_type)
+ if options.build_directory:
+ constants.SetBuildDirectory(options.build_directory)
def AddGTestOptions(option_parser):
diff --git a/build/android/tests/multiple_proguards/src/dummy/NativeLibraries.java b/build/android/tests/multiple_proguards/src/dummy/NativeLibraries.java
index 56cd734..2f7db71 100644
--- a/build/android/tests/multiple_proguards/src/dummy/NativeLibraries.java
+++ b/build/android/tests/multiple_proguards/src/dummy/NativeLibraries.java
@@ -9,9 +9,9 @@
* NativeLibraries to build, but doesn't include it in its jar file.
*/
public class NativeLibraries {
- public static boolean USE_LINKER = false;
- public static boolean USE_LIBRARY_IN_ZIP_FILE = false;
- public static boolean ENABLE_LINKER_TESTS = false;
+ public static boolean sUseLinker = false;
+ public static boolean sUseLibraryInZipFile = false;
+ public static boolean sEnableLinkerTests = false;
static final String[] LIBRARIES = {};
- static String VERSION_NUMBER = "";
+ static String sVersionNumber = "";
}
diff --git a/build/apk_test.gypi b/build/apk_test.gypi
index 95cce37..f800dd7 100644
--- a/build/apk_test.gypi
+++ b/build/apk_test.gypi
@@ -20,6 +20,7 @@
{
'dependencies': [
'<(DEPTH)/base/base.gyp:base_java',
+ '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
'<(DEPTH)/tools/android/android_tools.gyp:android_tools',
],
'conditions': [
diff --git a/build/common.gypi b/build/common.gypi
index 132fd7c..20aabc2 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1416,7 +1416,7 @@
# Sets the default version name and code for Android app, by default we
# do a developer build.
'android_app_version_name%': 'Developer Build',
- 'android_app_version_code%': 0,
+ 'android_app_version_code%': 1,
# Contains data about the attached devices for gyp_managed_install.
'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
@@ -4003,6 +4003,9 @@
# Else building libyuv gives clang's register allocator issues,
# see llvm.org/PR15798 / crbug.com/233709
'-momit-leaf-frame-pointer',
+ # Align the stack on 16-byte boundaries, http://crbug.com/418554.
+ '-mstack-alignment=16',
+ '-mstackrealign',
],
}],
['clang==1 and "<(GENERATOR)"=="ninja"', {
@@ -5579,6 +5582,27 @@
],
},
}],
+ # In the android webview build, force host targets to be compiled with clang
+ # as the hermetic host gcc is very old on some platforms. This is already
+ # the default on the current development version of AOSP but we force it
+ # here in case we need to compile against an older release version. We also
+ # explicitly set it to false for target binaries to avoid causing problems
+ # for the work to enable clang by default in AOSP.
+ ['android_webview_build==1', {
+ 'target_defaults': {
+ 'target_conditions': [
+ ['_toolset=="host"', {
+ 'aosp_build_settings': {
+ 'LOCAL_CLANG': 'true',
+ },
+ }, { # else: _toolset != "host"
+ 'aosp_build_settings': {
+ 'LOCAL_CLANG': 'false',
+ },
+ }],
+ ],
+ },
+ }],
# We need a special case to handle the android webview build on mac because
# the host gcc there doesn't accept this flag, but the target gcc may
# require it.
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
index 45b61cf..e548f77 100644
--- a/build/config/BUILD.gn
+++ b/build/config/BUILD.gn
@@ -85,6 +85,9 @@
if (use_aura) {
defines += [ "USE_AURA=1" ]
}
+ if (use_pango) {
+ defines += [ "USE_PANGO=1" ]
+ }
if (use_cairo) {
defines += [ "USE_CAIRO=1" ]
}
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index 7603280..a8701fb 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -63,6 +63,7 @@
# Path to the Android NDK and SDK.
android_ndk_root = "//third_party/android_tools/ndk"
+ android_ndk_include_dir = "$android_ndk_root/usr/include"
android_sdk = "${android_sdk_root}/platforms/android-${android_sdk_version}"
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index ad97902..abd9711 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -85,11 +85,6 @@
deps += invoker.deps
}
- outputs = [
- depfile,
- build_config
- ]
-
possible_deps_configs = []
foreach(d, deps) {
dep_gen_dir = get_label_info(d, "target_gen_dir")
@@ -98,6 +93,11 @@
}
rebase_possible_deps_configs = rebase_path(possible_deps_configs)
+ outputs = [
+ depfile,
+ build_config
+ ]
+
args = [
"--type", type,
"--depfile", rebase_path(depfile, root_build_dir),
@@ -252,7 +252,7 @@
_asset_location = invoker.asset_location
}
- _version_code = "0"
+ _version_code = "1"
_version_name = "Developer Build"
_base_apk_path = _base_path + ".apk_intermediates"
@@ -565,6 +565,14 @@
if (defined(invoker.java_files)) {
_java_files = invoker.java_files
} else if (defined(invoker.DEPRECATED_java_in_dir)) {
+ _src_dir = invoker.DEPRECATED_java_in_dir + "/src"
+ _src_dir_exists = exec_script("//build/dir_exists.py",
+ [ rebase_path(_src_dir, root_build_dir) ],
+ "string")
+ assert(_src_dir_exists == "False",
+ "In GN, java_in_dir should be the fully specified java directory " +
+ "(i.e. including the trailing \"/src\")")
+
_java_files_build_rel = exec_script(
"//build/android/gyp/find.py",
[
@@ -718,10 +726,9 @@
action(target_name) {
script = "//build/android/gyp/copy_ex.py"
- depfile = "$target_gen_dir/$target_name.d"
- outputs = [
- depfile,
- ]
+
+ if (defined(invoker.deps)) { deps = invoker.deps }
+
sources = []
if (defined(invoker.sources)) {
sources += invoker.sources
@@ -732,18 +739,24 @@
inputs += invoker.inputs
}
+ depfile = "$target_gen_dir/$target_name.d"
+ outputs = [
+ depfile,
+ ]
+
args = [
"--depfile", rebase_path(depfile, root_build_dir),
"--dest", rebase_path(invoker.dest, root_build_dir),
]
- if (defined(invoker.args)) {
- args += invoker.args
- }
rebased_sources = rebase_path(sources, root_build_dir)
args += [ "--files=$rebased_sources" ]
if (defined(invoker.clear_dir) && invoker.clear_dir) {
args += ["--clear"]
}
+
+ if (defined(invoker.args)) {
+ args += invoker.args
+ }
}
}
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index bef77b2..0c9dbf2 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -34,8 +34,9 @@
assert(defined(invoker.sources))
assert(defined(invoker.jni_package))
jni_package = invoker.jni_package
- base_output_dir = "${root_gen_dir}/${target_name}/${jni_package}"
- jni_output_dir = "${base_output_dir}/jni"
+ base_output_dir = "${target_gen_dir}/${target_name}"
+ package_output_dir = "${base_output_dir}/${jni_package}"
+ jni_output_dir = "${package_output_dir}/jni"
jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h"
@@ -66,7 +67,13 @@
}
config("jni_includes_${target_name}") {
- include_dirs = [ base_output_dir ]
+ # TODO(cjhopman): #includes should probably all be relative to
+ # base_output_dir. Remove that from this config once the includes are
+ # updated.
+ include_dirs = [
+ base_output_dir,
+ package_output_dir,
+ ]
}
group(target_name) {
@@ -79,6 +86,8 @@
if (defined(invoker.public_deps)) {
public_deps = invoker.public_deps
}
+
+ if (defined(invoker.visibility)) { visibility = invoker.visibility }
}
}
@@ -469,6 +478,50 @@
}
}
+# Declare a target that packages strings.xml generated from a grd file.
+#
+# If this target is included in the deps of an android resources/library/apk,
+# the strings.xml will be included with that target.
+#
+# Variables
+# grit_output_dir: directory containing grit-generated files.
+# generated_files: list of android resource files to package.
+#
+# Example
+# java_strings_grd_prebuilt("foo_strings_grd") {
+# grit_output_dir = "$root_gen_dir/foo/grit"
+# generated_files = [
+# "values/strings.xml"
+# ]
+# }
+template("java_strings_grd_prebuilt") {
+ if (defined(invoker.testonly)) { testonly = invoker.testonly }
+
+ base_path = "$target_gen_dir/$target_name"
+ resources_zip = base_path + ".resources.zip"
+ build_config = base_path + ".build_config"
+
+ write_build_config("${target_name}__build_config") {
+ type = "android_resources"
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ }
+
+ zip("${target_name}__zip") {
+ base_dir = invoker.grit_output_dir
+ inputs = rebase_path(invoker.generated_files, ".", base_dir)
+ output = resources_zip
+ }
+
+ group(target_name) {
+ deps = [
+ ":${target_name}__build_config",
+ ":${target_name}__zip",
+ ]
+ }
+}
+
# Declare an Android library target
#
@@ -938,8 +991,9 @@
android_manifest = "//testing/android/java/AndroidManifest.xml"
unittests_outputs = [ unittests_binary ]
native_libs = [unittests_outputs[0]]
+ deps = [ "//base:base_java" ]
if (defined(invoker.deps)) {
- deps = invoker.deps
+ deps += invoker.deps
}
datadeps = [
"//tools/android/md5sum",
diff --git a/build/config/features.gni b/build/config/features.gni
index 54b6159..4ed933f 100644
--- a/build/config/features.gni
+++ b/build/config/features.gni
@@ -123,7 +123,7 @@
use_cups = is_desktop_linux || is_mac
-enable_themes = !is_android && !is_chromeos
+enable_themes = !is_android && !is_ios
# TODO(scottmg) remove this when we've fixed printing.
win_pdf_metafile_for_printing = true
diff --git a/build/config/ui.gni b/build/config/ui.gni
index 9c159a2..f23cd00 100644
--- a/build/config/ui.gni
+++ b/build/config/ui.gni
@@ -58,7 +58,7 @@
use_ozone_evdev = use_ozone
-use_glib = is_linux
+use_glib = is_linux && !use_ozone
use_clipboard_aurax11 = is_linux && use_aura && use_x11
diff --git a/build/install-chroot.sh b/build/install-chroot.sh
index 2b523cb..ae97d53 100755
--- a/build/install-chroot.sh
+++ b/build/install-chroot.sh
@@ -504,6 +504,10 @@
session="$(schroot -c "${chroot}" -b)"
export CHROOT_SESSION_ID="${session}"
+# Set GOMA_TMP_DIR for better handling of goma inside chroot.
+export GOMA_TMP_DIR="/tmp/goma_tmp_$CHROOT_SESSION_ID"
+mkdir -p "$GOMA_TMP_DIR"
+
if [ $# -eq 0 ]; then
# Run an interactive shell session
schroot -c "${session}" -r -p
@@ -554,6 +558,8 @@
# clean up the stale files by invoking us with "--clean" after having killed
# all running processes.
schroot -c "${session}" -e
+# Since no goma processes are running, we can remove goma directory.
+rm -rf "$GOMA_TMP_DIR"
exit $rc
EOF
sudo chown root:root /usr/local/bin/"${target%bit}"
diff --git a/build/java_apk.gypi b/build/java_apk.gypi
index 52f4ab5..18e6ccf 100644
--- a/build/java_apk.gypi
+++ b/build/java_apk.gypi
@@ -358,7 +358,7 @@
'action_name': 'pack_arm_relocations',
'variables': {
'conditions': [
- ['use_chromium_linker == 1 and use_relocation_packer == 1', {
+ ['use_chromium_linker == 1 and use_relocation_packer == 1 and profiling != 1', {
'enable_packing': 1,
}, {
'enable_packing': 0,
@@ -436,6 +436,7 @@
},
'dependencies': [
'<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
+ '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
],
'actions': [
{
@@ -551,6 +552,7 @@
}],
['is_test_apk == 1', {
'dependencies': [
+ '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
'<(DEPTH)/tools/android/android_tools.gyp:android_tools',
]
}],
diff --git a/build/landmines.py b/build/landmines.py
index 96bc485..a034864 100755
--- a/build/landmines.py
+++ b/build/landmines.py
@@ -15,6 +15,7 @@
import difflib
import errno
+import gyp_environment
import logging
import optparse
import os
@@ -120,6 +121,7 @@
if landmine_utils.builder() in ('dump_dependency_json', 'eclipse'):
return 0
+ gyp_environment.SetEnvironment()
landmines = []
for s in landmine_scripts:
diff --git a/build/uiautomator_test.gypi b/build/uiautomator_test.gypi
index 0f341ab..e9bd0bf 100644
--- a/build/uiautomator_test.gypi
+++ b/build/uiautomator_test.gypi
@@ -15,6 +15,7 @@
{
'dependencies': [
+ '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
'<(DEPTH)/tools/android/android_tools.gyp:android_tools',
],
'variables': {
diff --git a/build/whitespace_file.txt b/build/whitespace_file.txt
index 3dc66ec..f11fa16 100644
--- a/build/whitespace_file.txt
+++ b/build/whitespace_file.txt
@@ -143,4 +143,3 @@
Cool whitespace change for git-cl land
Oh god the bots are red! I'm blind! Mmmm, donuts.
-**
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 960c645..74a3c4b 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -208,6 +208,13 @@
"layers/ui_resource_layer.h",
"layers/ui_resource_layer_impl.cc",
"layers/ui_resource_layer_impl.h",
+ "layers/video_frame_provider.h",
+ "layers/video_frame_provider_client_impl.cc",
+ "layers/video_frame_provider_client_impl.h",
+ "layers/video_layer.cc",
+ "layers/video_layer.h",
+ "layers/video_layer_impl.cc",
+ "layers/video_layer_impl.h",
"output/begin_frame_args.cc",
"output/begin_frame_args.h",
"output/bsp_tree.cc",
@@ -320,6 +327,7 @@
"resources/content_layer_updater.h",
"resources/eviction_tile_priority_queue.cc",
"resources/eviction_tile_priority_queue.h",
+ "resources/gpu_memory_buffer_manager.h",
"resources/gpu_raster_worker_pool.cc",
"resources/gpu_raster_worker_pool.h",
"resources/image_layer_updater.cc",
@@ -356,8 +364,6 @@
"resources/prioritized_resource.h",
"resources/prioritized_resource_manager.cc",
"resources/prioritized_resource_manager.h",
- "resources/prioritized_tile_set.cc",
- "resources/prioritized_tile_set.h",
"resources/priority_calculator.cc",
"resources/priority_calculator.h",
"resources/raster_buffer.cc",
@@ -420,6 +426,8 @@
"resources/ui_resource_client.h",
"resources/ui_resource_request.cc",
"resources/ui_resource_request.h",
+ "resources/video_resource_updater.cc",
+ "resources/video_resource_updater.h",
"resources/zero_copy_raster_worker_pool.cc",
"resources/zero_copy_raster_worker_pool.h",
"scheduler/begin_frame_source.cc",
@@ -480,6 +488,7 @@
"//base/third_party/dynamic_annotations",
"//gpu",
"//gpu/command_buffer/client:gles2_interface",
+ "//media",
"//ui/events:events_base",
"//ui/gfx",
"//ui/gfx/geometry",
@@ -548,6 +557,8 @@
"test/fake_tile_manager_client.h",
"test/fake_ui_resource_layer_tree_host_impl.cc",
"test/fake_ui_resource_layer_tree_host_impl.h",
+ "test/fake_video_frame_provider.cc",
+ "test/fake_video_frame_provider.h",
"test/geometry_test_utils.cc",
"test/geometry_test_utils.h",
"test/test_in_process_context_provider.cc",
@@ -596,6 +607,8 @@
"test/test_context_support.h",
"test/test_gles2_interface.cc",
"test/test_gles2_interface.h",
+ "test/test_gpu_memory_buffer_manager.cc",
+ "test/test_gpu_memory_buffer_manager.h",
"test/test_now_source.cc",
"test/test_now_source.h",
"test/test_occlusion_tracker.h",
@@ -692,6 +705,7 @@
"layers/tiled_layer_unittest.cc",
"layers/ui_resource_layer_impl_unittest.cc",
"layers/ui_resource_layer_unittest.cc",
+ "layers/video_layer_impl_unittest.cc",
"output/begin_frame_args_unittest.cc",
"output/delegating_renderer_unittest.cc",
"output/filter_operations_unittest.cc",
@@ -712,7 +726,6 @@
"resources/picture_pile_unittest.cc",
"resources/picture_unittest.cc",
"resources/prioritized_resource_unittest.cc",
- "resources/prioritized_tile_set_unittest.cc",
"resources/raster_worker_pool_unittest.cc",
"resources/resource_provider_unittest.cc",
"resources/resource_update_controller_unittest.cc",
@@ -722,6 +735,7 @@
"resources/texture_uploader_unittest.cc",
"resources/tile_manager_unittest.cc",
"resources/tile_priority_unittest.cc",
+ "resources/video_resource_updater_unittest.cc",
"scheduler/begin_frame_source_unittest.cc",
"scheduler/delay_based_time_source_unittest.cc",
"scheduler/scheduler_state_machine_unittest.cc",
@@ -749,6 +763,7 @@
"trees/layer_tree_host_unittest_picture.cc",
"trees/layer_tree_host_unittest_proxy.cc",
"trees/layer_tree_host_unittest_scroll.cc",
+ "trees/layer_tree_host_unittest_video.cc",
"trees/layer_tree_impl_unittest.cc",
"trees/occlusion_tracker_unittest.cc",
"trees/occlusion_unittest.cc",
@@ -775,6 +790,7 @@
"//gpu:test_support",
"//gpu/command_buffer/client:gles2_interface",
"//gpu/command_buffer/common:gles2_utils",
+ "//media",
"//testing/gmock",
"//testing/gtest",
"//ui/events:events_base",
@@ -806,6 +822,7 @@
"//gpu",
"//gpu:test_support",
"//gpu/command_buffer/common:gles2_utils",
+ "//media",
"//skia",
"//testing/gmock",
"//testing/gtest",
diff --git a/cc/PRESUBMIT.py b/cc/PRESUBMIT.py
index d749aac..6dff371 100644
--- a/cc/PRESUBMIT.py
+++ b/cc/PRESUBMIT.py
@@ -21,6 +21,10 @@
input_api.AffectedSourceFiles(source_filter)]
level = 1 # strict, but just warn
+ # TODO(danakj): Temporary, while the OVERRIDE and FINAL fixup is in progress.
+ # crbug.com/422353
+ input_api.cpplint._SetFilters('-readability/inheritance')
+
for file_name in files:
input_api.cpplint.ProcessFile(file_name, level)
diff --git a/cc/animation/animation.cc b/cc/animation/animation.cc
index 5fe5b8c..5e4bc1e 100644
--- a/cc/animation/animation.cc
+++ b/cc/animation/animation.cc
@@ -192,10 +192,11 @@
DCHECK_GE(iteration_start_, 0);
double active_time = ConvertToActiveTime(monotonic_time);
+ double start_offset = iteration_start_ * curve_->Duration();
- // Return 0 if we are before the start of the animation
+ // Return start offset if we are before the start of the animation
if (active_time < 0)
- return 0;
+ return start_offset;
// Always return zero if we have no iterations.
if (!iterations_)
@@ -207,7 +208,6 @@
double repeated_duration = iterations_ * curve_->Duration();
double active_duration = repeated_duration / std::abs(playback_rate_);
- double start_offset = iteration_start_ * curve_->Duration();
// Check if we are past active duration
if (iterations_ > 0 && active_time >= active_duration)
diff --git a/cc/animation/animation_curve.h b/cc/animation/animation_curve.h
index ca53e44..7f38af9 100644
--- a/cc/animation/animation_curve.h
+++ b/cc/animation/animation_curve.h
@@ -81,9 +81,13 @@
// Returns true if this animation is a translation.
virtual bool IsTranslation() const = 0;
- // Set |max_scale| to the maximum scale along any dimension during this
- // animation. Returns false if the maximum scale cannot be computed.
- virtual bool MaximumScale(float* max_scale) const = 0;
+ // Set |max_scale| to the maximum scale along any dimension at the end of
+ // intermediate animation target points (eg keyframe end points). When
+ // |forward_direction| is true, the animation curve assumes it plays from
+ // the first keyframe to the last, otherwise it assumes the opposite. Returns
+ // false if the maximum scale cannot be computed.
+ virtual bool MaximumTargetScale(bool forward_direction,
+ float* max_scale) const = 0;
// Partial Animation implementation.
virtual CurveType Type() const override;
diff --git a/cc/animation/animation_unittest.cc b/cc/animation/animation_unittest.cc
index 7b70178..b1592d6 100644
--- a/cc/animation/animation_unittest.cc
+++ b/cc/animation/animation_unittest.cc
@@ -619,6 +619,7 @@
TEST(AnimationTest, TrimTimeIterationStart) {
scoped_ptr<Animation> anim(CreateAnimation(2, 1, 1));
anim->set_iteration_start(0.5);
+ EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
@@ -631,6 +632,7 @@
scoped_ptr<Animation> anim(CreateAnimation(2, 1, 1));
anim->set_direction(Animation::Alternate);
anim->set_iteration_start(0.3);
+ EXPECT_EQ(0.3, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
EXPECT_EQ(0.3, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
EXPECT_EQ(0.8, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.7)));
@@ -643,6 +645,7 @@
scoped_ptr<Animation> anim(CreateAnimation(3, 1, 1));
anim->set_direction(Animation::Alternate);
anim->set_iteration_start(1);
+ EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
diff --git a/cc/animation/keyframed_animation_curve.cc b/cc/animation/keyframed_animation_curve.cc
index bcf067e..de18a2b 100644
--- a/cc/animation/keyframed_animation_curve.cc
+++ b/cc/animation/keyframed_animation_curve.cc
@@ -366,23 +366,30 @@
return true;
}
-bool KeyframedTransformAnimationCurve::MaximumScale(float* max_scale) const {
+bool KeyframedTransformAnimationCurve::MaximumTargetScale(
+ bool forward_direction,
+ float* max_scale) const {
DCHECK_GE(keyframes_.size(), 2ul);
*max_scale = 0.f;
- for (size_t i = 1; i < keyframes_.size(); ++i) {
- float min_progress = 0.f;
- float max_progress = 1.f;
- if (keyframes_[i - 1]->timing_function())
- keyframes_[i - 1]->timing_function()->Range(&min_progress, &max_progress);
- float max_scale_for_segment = 0.f;
- if (!keyframes_[i]->Value().MaximumScale(keyframes_[i - 1]->Value(),
- min_progress,
- max_progress,
- &max_scale_for_segment))
+ // If |forward_direction| is true, then skip the first frame, otherwise
+ // skip the last frame, since that is the original position in the animation.
+ size_t start = 1;
+ size_t end = keyframes_.size();
+ if (!forward_direction) {
+ --start;
+ --end;
+ }
+
+ for (size_t i = start; i < end; ++i) {
+ gfx::Vector3dF target_scale_for_segment;
+ if (!keyframes_[i]->Value().ScaleComponent(&target_scale_for_segment))
return false;
-
- *max_scale = std::max(*max_scale, max_scale_for_segment);
+ float max_scale_for_segment =
+ fmax(std::abs(target_scale_for_segment.x()),
+ fmax(std::abs(target_scale_for_segment.y()),
+ std::abs(target_scale_for_segment.z())));
+ *max_scale = fmax(*max_scale, max_scale_for_segment);
}
return true;
}
diff --git a/cc/animation/keyframed_animation_curve.h b/cc/animation/keyframed_animation_curve.h
index d596256..5d25b89 100644
--- a/cc/animation/keyframed_animation_curve.h
+++ b/cc/animation/keyframed_animation_curve.h
@@ -196,7 +196,8 @@
gfx::BoxF* bounds) const override;
virtual bool AffectsScale() const override;
virtual bool IsTranslation() const override;
- virtual bool MaximumScale(float* max_scale) const override;
+ virtual bool MaximumTargetScale(bool forward_direction,
+ float* max_scale) const override;
private:
KeyframedTransformAnimationCurve();
diff --git a/cc/animation/keyframed_animation_curve_unittest.cc b/cc/animation/keyframed_animation_curve_unittest.cc
index 9ce1fdb..7a82fa2 100644
--- a/cc/animation/keyframed_animation_curve_unittest.cc
+++ b/cc/animation/keyframed_animation_curve_unittest.cc
@@ -510,8 +510,8 @@
EXPECT_FALSE(curve->IsTranslation());
}
-// Tests that maximum scale is computed as expected.
-TEST(KeyframedAnimationCurveTest, MaximumScale) {
+// Tests that maximum target scale is computed as expected.
+TEST(KeyframedAnimationCurveTest, MaximumTargetScale) {
scoped_ptr<KeyframedTransformAnimationCurve> curve(
KeyframedTransformAnimationCurve::Create());
@@ -523,7 +523,7 @@
1.0, operations1, EaseTimingFunction::Create()));
float maximum_scale = 0.f;
- EXPECT_TRUE(curve->MaximumScale(&maximum_scale));
+ EXPECT_TRUE(curve->MaximumTargetScale(true, &maximum_scale));
EXPECT_EQ(3.f, maximum_scale);
TransformOperations operations2;
@@ -531,7 +531,7 @@
curve->AddKeyframe(TransformKeyframe::Create(
2.0, operations2, EaseTimingFunction::Create()));
- EXPECT_TRUE(curve->MaximumScale(&maximum_scale));
+ EXPECT_TRUE(curve->MaximumTargetScale(true, &maximum_scale));
EXPECT_EQ(6.f, maximum_scale);
TransformOperations operations3;
@@ -539,7 +539,26 @@
curve->AddKeyframe(TransformKeyframe::Create(
3.0, operations3, EaseTimingFunction::Create()));
- EXPECT_FALSE(curve->MaximumScale(&maximum_scale));
+ EXPECT_FALSE(curve->MaximumTargetScale(true, &maximum_scale));
+
+ // The original scale is not used in computing the max.
+ scoped_ptr<KeyframedTransformAnimationCurve> curve2(
+ KeyframedTransformAnimationCurve::Create());
+
+ TransformOperations operations4;
+ operations4.AppendScale(0.4f, 0.2f, 0.6f);
+ curve2->AddKeyframe(TransformKeyframe::Create(
+ 0.0, operations4, EaseTimingFunction::Create()));
+ TransformOperations operations5;
+ operations5.AppendScale(0.5f, 0.3f, -0.8f);
+ curve2->AddKeyframe(TransformKeyframe::Create(
+ 1.0, operations5, EaseTimingFunction::Create()));
+
+ EXPECT_TRUE(curve2->MaximumTargetScale(true, &maximum_scale));
+ EXPECT_EQ(0.8f, maximum_scale);
+
+ EXPECT_TRUE(curve2->MaximumTargetScale(false, &maximum_scale));
+ EXPECT_EQ(0.6f, maximum_scale);
}
// Tests that an animation with a curve timing function works as expected.
diff --git a/cc/animation/layer_animation_controller.cc b/cc/animation/layer_animation_controller.cc
index 911c5c4..3aad9d6 100644
--- a/cc/animation/layer_animation_controller.cc
+++ b/cc/animation/layer_animation_controller.cc
@@ -5,6 +5,7 @@
#include "cc/animation/layer_animation_controller.h"
#include <algorithm>
+#include <vector>
#include "cc/animation/animation.h"
#include "cc/animation/animation_delegate.h"
@@ -286,6 +287,7 @@
Animation::TargetProperty target_property) const {
for (size_t i = 0; i < animations_.size(); ++i) {
if (!animations_[i]->is_finished() &&
+ animations_[i]->InEffect(last_tick_time_) &&
animations_[i]->target_property() == target_property)
return true;
}
@@ -494,17 +496,30 @@
return true;
}
-bool LayerAnimationController::MaximumScale(float* max_scale) const {
+bool LayerAnimationController::MaximumTargetScale(float* max_scale) const {
*max_scale = 0.f;
for (size_t i = 0; i < animations_.size(); ++i) {
if (animations_[i]->is_finished() ||
animations_[i]->target_property() != Animation::Transform)
continue;
+ bool forward_direction = true;
+ switch (animations_[i]->direction()) {
+ case Animation::Normal:
+ case Animation::Alternate:
+ forward_direction = animations_[i]->playback_rate() >= 0.0;
+ break;
+ case Animation::Reverse:
+ case Animation::AlternateReverse:
+ forward_direction = animations_[i]->playback_rate() < 0.0;
+ break;
+ }
+
const TransformAnimationCurve* transform_animation_curve =
animations_[i]->curve()->ToTransformAnimationCurve();
float animation_scale = 0.f;
- if (!transform_animation_curve->MaximumScale(&animation_scale))
+ if (!transform_animation_curve->MaximumTargetScale(forward_direction,
+ &animation_scale))
return false;
*max_scale = std::max(*max_scale, animation_scale);
}
diff --git a/cc/animation/layer_animation_controller.h b/cc/animation/layer_animation_controller.h
index e57491a..01fce98 100644
--- a/cc/animation/layer_animation_controller.h
+++ b/cc/animation/layer_animation_controller.h
@@ -134,9 +134,10 @@
bool HasOnlyTranslationTransforms() const;
- // Sets |max_scale| to the maximum scale along any dimension during active
- // animations. Returns false if the maximum scale cannot be computed.
- bool MaximumScale(float* max_scale) const;
+ // Sets |max_scale| to the maximum scale along any dimension at any
+ // destination in active animations. Returns false if the maximum scale cannot
+ // be computed.
+ bool MaximumTargetScale(float* max_scale) const;
bool needs_to_start_animations_for_testing() {
return needs_to_start_animations_;
diff --git a/cc/animation/layer_animation_controller_unittest.cc b/cc/animation/layer_animation_controller_unittest.cc
index de21762..92456fa 100644
--- a/cc/animation/layer_animation_controller_unittest.cc
+++ b/cc/animation/layer_animation_controller_unittest.cc
@@ -1890,12 +1890,12 @@
EXPECT_TRUE(controller_impl->HasOnlyTranslationTransforms());
}
-TEST(LayerAnimationControllerTest, MaximumScale) {
+TEST(LayerAnimationControllerTest, MaximumTargetScale) {
scoped_refptr<LayerAnimationController> controller_impl(
LayerAnimationController::Create(0));
float max_scale = 0.f;
- EXPECT_TRUE(controller_impl->MaximumScale(&max_scale));
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
EXPECT_EQ(0.f, max_scale);
scoped_ptr<KeyframedTransformAnimationCurve> curve1(
@@ -1912,7 +1912,7 @@
Animation::Create(curve1.Pass(), 1, 1, Animation::Transform));
controller_impl->AddAnimation(animation.Pass());
- EXPECT_TRUE(controller_impl->MaximumScale(&max_scale));
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
EXPECT_EQ(4.f, max_scale);
scoped_ptr<KeyframedTransformAnimationCurve> curve2(
@@ -1928,7 +1928,7 @@
animation = Animation::Create(curve2.Pass(), 2, 2, Animation::Transform);
controller_impl->AddAnimation(animation.Pass());
- EXPECT_TRUE(controller_impl->MaximumScale(&max_scale));
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
EXPECT_EQ(6.f, max_scale);
scoped_ptr<KeyframedTransformAnimationCurve> curve3(
@@ -1944,7 +1944,7 @@
animation = Animation::Create(curve3.Pass(), 3, 3, Animation::Transform);
controller_impl->AddAnimation(animation.Pass());
- EXPECT_FALSE(controller_impl->MaximumScale(&max_scale));
+ EXPECT_FALSE(controller_impl->MaximumTargetScale(&max_scale));
controller_impl->GetAnimation(3, Animation::Transform)
->SetRunState(Animation::Finished, TicksFromSecondsF(0.0));
@@ -1952,11 +1952,78 @@
->SetRunState(Animation::Finished, TicksFromSecondsF(0.0));
// Only unfinished animations should be considered by
- // MaximumScale.
- EXPECT_TRUE(controller_impl->MaximumScale(&max_scale));
+ // MaximumTargetScale.
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
EXPECT_EQ(4.f, max_scale);
}
+TEST(LayerAnimationControllerTest, MaximumTargetScaleWithDirection) {
+ scoped_refptr<LayerAnimationController> controller_impl(
+ LayerAnimationController::Create(0));
+
+ scoped_ptr<KeyframedTransformAnimationCurve> curve1(
+ KeyframedTransformAnimationCurve::Create());
+ TransformOperations operations1;
+ operations1.AppendScale(1.0, 2.0, 3.0);
+ curve1->AddKeyframe(TransformKeyframe::Create(
+ 0.0, operations1, scoped_ptr<TimingFunction>()));
+ TransformOperations operations2;
+ operations2.AppendScale(4.0, 5.0, 6.0);
+ curve1->AddKeyframe(TransformKeyframe::Create(
+ 1.0, operations2, scoped_ptr<TimingFunction>()));
+
+ scoped_ptr<Animation> animation_owned(
+ Animation::Create(curve1.Pass(), 1, 1, Animation::Transform));
+ Animation* animation = animation_owned.get();
+ controller_impl->AddAnimation(animation_owned.Pass());
+
+ float max_scale = 0.f;
+
+ EXPECT_GT(animation->playback_rate(), 0.0);
+
+ // Normal direction with positive playback rate.
+ animation->set_direction(Animation::Normal);
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
+ EXPECT_EQ(6.f, max_scale);
+
+ // Alternate direction with positive playback rate.
+ animation->set_direction(Animation::Alternate);
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
+ EXPECT_EQ(6.f, max_scale);
+
+ // Reverse direction with positive playback rate.
+ animation->set_direction(Animation::Reverse);
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
+ EXPECT_EQ(3.f, max_scale);
+
+ // Alternate reverse direction.
+ animation->set_direction(Animation::Reverse);
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
+ EXPECT_EQ(3.f, max_scale);
+
+ animation->set_playback_rate(-1.0);
+
+ // Normal direction with negative playback rate.
+ animation->set_direction(Animation::Normal);
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
+ EXPECT_EQ(3.f, max_scale);
+
+ // Alternate direction with negative playback rate.
+ animation->set_direction(Animation::Alternate);
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
+ EXPECT_EQ(3.f, max_scale);
+
+ // Reverse direction with negative playback rate.
+ animation->set_direction(Animation::Reverse);
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
+ EXPECT_EQ(6.f, max_scale);
+
+ // Alternate reverse direction with negative playback rate.
+ animation->set_direction(Animation::Reverse);
+ EXPECT_TRUE(controller_impl->MaximumTargetScale(&max_scale));
+ EXPECT_EQ(6.f, max_scale);
+}
+
TEST(LayerAnimationControllerTest, NewlyPushedAnimationWaitsForActivation) {
scoped_ptr<AnimationEventsVector> events(
make_scoped_ptr(new AnimationEventsVector));
@@ -2259,5 +2326,51 @@
EXPECT_EQ(1.f, dummy_impl.opacity());
}
+TEST(LayerAnimationControllerTest, TestIsAnimatingProperty) {
+ FakeLayerAnimationValueObserver dummy;
+ scoped_refptr<LayerAnimationController> controller(
+ LayerAnimationController::Create(0));
+ controller->AddValueObserver(&dummy);
+
+ scoped_ptr<Animation> animation(CreateAnimation(
+ scoped_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 0.f, 1.f)).Pass(),
+ 1,
+ Animation::Opacity));
+ controller->AddAnimation(animation.Pass());
+ controller->Animate(kInitialTickTime);
+ EXPECT_TRUE(controller->IsAnimatingProperty(Animation::Opacity));
+ controller->UpdateState(true, nullptr);
+ EXPECT_TRUE(controller->HasActiveAnimation());
+ EXPECT_TRUE(controller->IsAnimatingProperty(Animation::Opacity));
+ EXPECT_FALSE(controller->IsAnimatingProperty(Animation::Filter));
+ EXPECT_EQ(0.f, dummy.opacity());
+}
+
+TEST(LayerAnimationControllerTest, TestIsAnimatingPropertyTimeOffsetFillMode) {
+ FakeLayerAnimationValueObserver dummy;
+ scoped_refptr<LayerAnimationController> controller(
+ LayerAnimationController::Create(0));
+ controller->AddValueObserver(&dummy);
+
+ scoped_ptr<Animation> animation(CreateAnimation(
+ scoped_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 0.f, 1.f)).Pass(),
+ 1,
+ Animation::Opacity));
+ animation->set_fill_mode(Animation::FillModeNone);
+ animation->set_time_offset(TimeDelta::FromMilliseconds(-2000));
+ controller->AddAnimation(animation.Pass());
+
+ controller->Animate(kInitialTickTime);
+ controller->UpdateState(true, nullptr);
+ EXPECT_FALSE(controller->IsAnimatingProperty(Animation::Opacity));
+ EXPECT_TRUE(controller->HasActiveAnimation());
+ EXPECT_FALSE(controller->IsAnimatingProperty(Animation::Opacity));
+ EXPECT_FALSE(controller->IsAnimatingProperty(Animation::Filter));
+
+ controller->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ controller->UpdateState(true, nullptr);
+ EXPECT_TRUE(controller->IsAnimatingProperty(Animation::Opacity));
+}
+
} // namespace
} // namespace cc
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.cc b/cc/animation/scrollbar_animation_controller_linear_fade.cc
index 90437b3..f65fd72 100644
--- a/cc/animation/scrollbar_animation_controller_linear_fade.cc
+++ b/cc/animation/scrollbar_animation_controller_linear_fade.cc
@@ -62,8 +62,9 @@
it != scrollbars->end();
++it) {
ScrollbarLayerImplBase* scrollbar = *it;
+
if (scrollbar->is_overlay_scrollbar())
- scrollbar->SetOpacity(opacity);
+ scrollbar->SetOpacity(scrollbar->can_scroll_orientation() ? opacity : 0);
}
}
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
index 99b45b3..4ffb0b2 100644
--- a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
+++ b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
@@ -7,7 +7,9 @@
#include "cc/layers/solid_color_scrollbar_layer_impl.h"
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host_impl.h"
+#include "cc/test/geometry_test_utils.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/trees/layer_tree_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -41,7 +43,7 @@
scrollbar_layer_ =
SolidColorScrollbarLayerImpl::Create(host_impl_.active_tree(),
2,
- HORIZONTAL,
+ orientation(),
kThumbThickness,
kTrackStart,
kIsLeftSideVerticalScrollbar,
@@ -54,7 +56,7 @@
scrollbar_layer_->SetScrollLayerAndClipLayerByIds(scroll_layer_ptr->id(),
clip_layer_->id());
clip_layer_->SetBounds(gfx::Size(100, 100));
- scroll_layer_ptr->SetBounds(gfx::Size(50, 50));
+ scroll_layer_ptr->SetBounds(gfx::Size(200, 200));
scrollbar_controller_ = ScrollbarAnimationControllerLinearFade::Create(
scroll_layer_ptr,
@@ -64,6 +66,8 @@
base::TimeDelta::FromSeconds(3));
}
+ virtual ScrollbarOrientation orientation() const { return HORIZONTAL; }
+
FakeImplProxy proxy_;
TestSharedBitmapManager shared_bitmap_manager_;
FakeLayerTreeHostImpl host_impl_;
@@ -76,6 +80,12 @@
int needs_frame_count_;
};
+class VerticalScrollbarAnimationControllerLinearFadeTest
+ : public ScrollbarAnimationControllerLinearFadeTest {
+ protected:
+ virtual ScrollbarOrientation orientation() const override { return VERTICAL; }
+};
+
TEST_F(ScrollbarAnimationControllerLinearFadeTest, DelayAnimationOnResize) {
scrollbar_layer_->SetOpacity(0.0f);
scrollbar_controller_->DidScrollBegin();
@@ -119,6 +129,131 @@
EXPECT_EQ(0, needs_frame_count_);
}
+TEST_F(ScrollbarAnimationControllerLinearFadeTest, HideOnResize) {
+ LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1);
+ ASSERT_TRUE(scroll_layer);
+ EXPECT_SIZE_EQ(gfx::Size(200, 200), scroll_layer->bounds());
+
+ EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation());
+
+ // Shrink along X axis, horizontal scrollbar should appear.
+ clip_layer_->SetBounds(gfx::Size(100, 200));
+ EXPECT_SIZE_EQ(gfx::Size(100, 200), clip_layer_->bounds());
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+
+ // Shrink along Y axis and expand along X, horizontal scrollbar
+ // should disappear.
+ clip_layer_->SetBounds(gfx::Size(200, 100));
+ EXPECT_SIZE_EQ(gfx::Size(200, 100), clip_layer_->bounds());
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+}
+
+TEST_F(VerticalScrollbarAnimationControllerLinearFadeTest, HideOnResize) {
+ LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1);
+ ASSERT_TRUE(scroll_layer);
+ EXPECT_SIZE_EQ(gfx::Size(200, 200), scroll_layer->bounds());
+
+ EXPECT_EQ(VERTICAL, scrollbar_layer_->orientation());
+
+ // Shrink along X axis, vertical scrollbar should remain invisible.
+ clip_layer_->SetBounds(gfx::Size(100, 200));
+ EXPECT_SIZE_EQ(gfx::Size(100, 200), clip_layer_->bounds());
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+
+ // Shrink along Y axis and expand along X, vertical scrollbar should appear.
+ clip_layer_->SetBounds(gfx::Size(200, 100));
+ EXPECT_SIZE_EQ(gfx::Size(200, 100), clip_layer_->bounds());
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+}
+
+TEST_F(ScrollbarAnimationControllerLinearFadeTest,
+ HideOnUserNonScrollableHorz) {
+ EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation());
+
+ LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1);
+ ASSERT_TRUE(scroll_layer);
+ scroll_layer->set_user_scrollable_horizontal(false);
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+}
+
+TEST_F(ScrollbarAnimationControllerLinearFadeTest,
+ ShowOnUserNonScrollableVert) {
+ EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation());
+
+ LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1);
+ ASSERT_TRUE(scroll_layer);
+ scroll_layer->set_user_scrollable_vertical(false);
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+}
+
+TEST_F(VerticalScrollbarAnimationControllerLinearFadeTest,
+ HideOnUserNonScrollableVert) {
+ EXPECT_EQ(VERTICAL, scrollbar_layer_->orientation());
+
+ LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1);
+ ASSERT_TRUE(scroll_layer);
+ scroll_layer->set_user_scrollable_vertical(false);
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+}
+
+TEST_F(VerticalScrollbarAnimationControllerLinearFadeTest,
+ ShowOnUserNonScrollableHorz) {
+ EXPECT_EQ(VERTICAL, scrollbar_layer_->orientation());
+
+ LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1);
+ ASSERT_TRUE(scroll_layer);
+ scroll_layer->set_user_scrollable_horizontal(false);
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+}
+
TEST_F(ScrollbarAnimationControllerLinearFadeTest, AwakenByScrollingGesture) {
base::TimeTicks time;
time += base::TimeDelta::FromSeconds(1);
diff --git a/cc/animation/scrollbar_animation_controller_thinning.cc b/cc/animation/scrollbar_animation_controller_thinning.cc
index 0c05709..e95b599 100644
--- a/cc/animation/scrollbar_animation_controller_thinning.cc
+++ b/cc/animation/scrollbar_animation_controller_thinning.cc
@@ -145,8 +145,12 @@
++it) {
ScrollbarLayerImplBase* scrollbar = *it;
if (scrollbar->is_overlay_scrollbar()) {
- scrollbar->SetOpacity(
- AdjustScale(opacity, scrollbar->opacity(), opacity_change_));
+ float effectiveOpacity =
+ scrollbar->can_scroll_orientation()
+ ? AdjustScale(opacity, scrollbar->opacity(), opacity_change_)
+ : 0;
+
+ scrollbar->SetOpacity(effectiveOpacity);
scrollbar->SetThumbThicknessScaleFactor(
AdjustScale(thumb_thickness_scale,
scrollbar->thumb_thickness_scale_factor(),
diff --git a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc
index cb7d33e..7836dd7 100644
--- a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc
+++ b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc
@@ -7,7 +7,9 @@
#include "cc/layers/solid_color_scrollbar_layer_impl.h"
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host_impl.h"
+#include "cc/test/geometry_test_utils.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/trees/layer_tree_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -52,7 +54,7 @@
scrollbar_layer_->SetScrollLayerAndClipLayerByIds(scroll_layer_ptr->id(),
clip_layer_->id());
clip_layer_->SetBounds(gfx::Size(100, 100));
- scroll_layer_ptr->SetBounds(gfx::Size(50, 50));
+ scroll_layer_ptr->SetBounds(gfx::Size(200, 200));
scrollbar_controller_ = ScrollbarAnimationControllerThinning::Create(
scroll_layer_ptr,
@@ -79,6 +81,38 @@
EXPECT_FLOAT_EQ(0.4f, scrollbar_layer_->thumb_thickness_scale_factor());
}
+// Check that scrollbar disappears when the layer becomes non-scrollable.
+TEST_F(ScrollbarAnimationControllerThinningTest, HideOnResize) {
+ LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1);
+ ASSERT_TRUE(scroll_layer);
+ EXPECT_SIZE_EQ(gfx::Size(200, 200), scroll_layer->bounds());
+
+ EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation());
+
+ // Shrink along X axis, horizontal scrollbar should appear.
+ clip_layer_->SetBounds(gfx::Size(100, 200));
+ EXPECT_SIZE_EQ(gfx::Size(100, 200), clip_layer_->bounds());
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+
+ // Shrink along Y axis and expand along X, horizontal scrollbar
+ // should disappear.
+ clip_layer_->SetBounds(gfx::Size(200, 100));
+ EXPECT_SIZE_EQ(gfx::Size(200, 100), clip_layer_->bounds());
+
+ scrollbar_controller_->DidScrollBegin();
+
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->opacity());
+
+ scrollbar_controller_->DidScrollEnd();
+}
+
// Scroll content. Confirm the scrollbar gets dark and then becomes light
// after stopping.
TEST_F(ScrollbarAnimationControllerThinningTest, AwakenByProgrammaticScroll) {
diff --git a/cc/animation/transform_operations.cc b/cc/animation/transform_operations.cc
index 6d8ad0f..7c328af 100644
--- a/cc/animation/transform_operations.cc
+++ b/cc/animation/transform_operations.cc
@@ -114,41 +114,6 @@
return true;
}
-bool TransformOperations::MaximumScale(const TransformOperations& from,
- SkMScalar min_progress,
- SkMScalar max_progress,
- float* max_scale) const {
- if (!MatchesTypes(from))
- return false;
-
- gfx::Vector3dF from_scale;
- gfx::Vector3dF to_scale;
-
- if (!from.ScaleComponent(&from_scale) || !ScaleComponent(&to_scale))
- return false;
-
- gfx::Vector3dF scale_at_min_progress(
- std::abs(gfx::Tween::FloatValueBetween(
- min_progress, from_scale.x(), to_scale.x())),
- std::abs(gfx::Tween::FloatValueBetween(
- min_progress, from_scale.y(), to_scale.y())),
- std::abs(gfx::Tween::FloatValueBetween(
- min_progress, from_scale.z(), to_scale.z())));
- gfx::Vector3dF scale_at_max_progress(
- std::abs(gfx::Tween::FloatValueBetween(
- max_progress, from_scale.x(), to_scale.x())),
- std::abs(gfx::Tween::FloatValueBetween(
- max_progress, from_scale.y(), to_scale.y())),
- std::abs(gfx::Tween::FloatValueBetween(
- max_progress, from_scale.z(), to_scale.z())));
-
- gfx::Vector3dF max_scale_3d = scale_at_min_progress;
- max_scale_3d.SetToMax(scale_at_max_progress);
- *max_scale =
- std::max(max_scale_3d.x(), std::max(max_scale_3d.y(), max_scale_3d.z()));
- return true;
-}
-
bool TransformOperations::ScaleComponent(gfx::Vector3dF* scale) const {
*scale = gfx::Vector3dF(1.f, 1.f, 1.f);
bool has_scale_component = false;
diff --git a/cc/animation/transform_operations.h b/cc/animation/transform_operations.h
index f086eb1..1c110ff 100644
--- a/cc/animation/transform_operations.h
+++ b/cc/animation/transform_operations.h
@@ -63,14 +63,6 @@
// Returns true if these operations are only translations.
bool IsTranslation() const;
- // Sets |max_scale| to be the maximum scale in any dimension when calling
- // Blend on |from| with progress in the range [min_progress, max_progress]. If
- // this maximum scale cannot be computed, returns false.
- bool MaximumScale(const TransformOperations& from,
- SkMScalar min_progress,
- SkMScalar max_progress,
- float* max_scale) const;
-
// Returns true if this operation and its descendants have the same types
// as other and its descendants.
bool MatchesTypes(const TransformOperations& other) const;
@@ -80,6 +72,11 @@
// fails (this can happen if either matrix cannot be decomposed).
bool CanBlendWith(const TransformOperations& other) const;
+ // If these operations have no more than one scale operation, and if the only
+ // other operations are translations, sets |scale| to the scale component
+ // of these operations. Otherwise, returns false.
+ bool ScaleComponent(gfx::Vector3dF* scale) const;
+
void AppendTranslate(SkMScalar x, SkMScalar y, SkMScalar z);
void AppendRotate(SkMScalar x, SkMScalar y, SkMScalar z, SkMScalar degrees);
void AppendScale(SkMScalar x, SkMScalar y, SkMScalar z);
@@ -98,11 +95,6 @@
bool ComputeDecomposedTransform() const;
- // If these operations have no more than one scale operation, and if the only
- // other operations are translations, sets |scale| to the scale component
- // of these operations. Otherwise, returns false.
- bool ScaleComponent(gfx::Vector3dF* scale) const;
-
// For efficiency, we cache the decomposed transform.
mutable scoped_ptr<gfx::DecomposedTransform> decomposed_transform_;
mutable bool decomposed_transform_dirty_;
diff --git a/cc/animation/transform_operations_unittest.cc b/cc/animation/transform_operations_unittest.cc
index 87dd69d..208f81a 100644
--- a/cc/animation/transform_operations_unittest.cc
+++ b/cc/animation/transform_operations_unittest.cc
@@ -1402,131 +1402,83 @@
EXPECT_TRUE(operations2.IsTranslation());
}
-TEST(TransformOperationTest, MaximumScale) {
+TEST(TransformOperationTest, ScaleComponent) {
+ gfx::Vector3dF scale;
+
+ // Scale.
TransformOperations operations1;
- operations1.AppendScale(3.f, 2.f, 5.f);
- TransformOperations operations2;
- operations2.AppendScale(6.f, 5.f, 2.f);
+ operations1.AppendScale(-3.f, 2.f, 5.f);
+ EXPECT_TRUE(operations1.ScaleComponent(&scale));
+ EXPECT_EQ(gfx::Vector3dF(-3.f, 2.f, 5.f), scale);
- float max_scale = 0.f;
- EXPECT_TRUE(operations2.MaximumScale(operations1, 0.f, 1.f, &max_scale));
- // x at progress 1.f
- EXPECT_EQ(6.f, max_scale);
-
- EXPECT_TRUE(operations2.MaximumScale(operations1, -1.f, 1.f, &max_scale));
- // z at progress -1.f
- EXPECT_EQ(8.f, max_scale);
-
- EXPECT_TRUE(operations2.MaximumScale(operations1, 0.f, 2.f, &max_scale));
- // x at progress 2.f
- EXPECT_EQ(9.f, max_scale);
-
- TransformOperations operations3;
- operations3.AppendScale(1.f, 4.f, 1.f);
- TransformOperations operations4;
-
- EXPECT_TRUE(operations4.MaximumScale(operations3, 0.f, 1.f, &max_scale));
- // y at progress 0.f
- EXPECT_EQ(4.f, max_scale);
-
- EXPECT_TRUE(operations4.MaximumScale(operations3, -1.f, 1.f, &max_scale));
- // y at progress -1.f
- EXPECT_EQ(7.f, max_scale);
-
- EXPECT_TRUE(operations4.MaximumScale(operations3, 0.f, 2.f, &max_scale));
- // y at progress 0.f
- EXPECT_EQ(4.f, max_scale);
-
+ // Translate + Scale.
TransformOperations operations5;
operations5.AppendTranslate(1.f, 2.f, 3.f);
- operations5.AppendScale(1.f, 1.f, 4.f);
+ operations5.AppendScale(2.f, 5.f, 4.f);
+ EXPECT_TRUE(operations5.ScaleComponent(&scale));
+ EXPECT_EQ(gfx::Vector3dF(2.f, 5.f, 4.f), scale);
+
+ // Translate + Scale + Matrix with translate.
gfx::Transform translation_transform;
translation_transform.Translate3d(1.f, 2.f, 3.f);
operations5.AppendMatrix(translation_transform);
- TransformOperations operations6;
- operations6.AppendTranslate(2.f, 3.f, 4.f);
- operations6.AppendScale(2.f, 5.f, 1.f);
- operations6.AppendMatrix(translation_transform);
-
- EXPECT_TRUE(operations6.MaximumScale(operations5, 0.f, 1.f, &max_scale));
- // y at progress 1.f
- EXPECT_EQ(5.f, max_scale);
-
- EXPECT_TRUE(operations6.MaximumScale(operations5, -1.f, 1.f, &max_scale));
- // z at progress -1.f
- EXPECT_EQ(7.f, max_scale);
-
- EXPECT_TRUE(operations6.MaximumScale(operations5, 0.f, 2.f, &max_scale));
- // y at progress 2.f
- EXPECT_EQ(9.f, max_scale);
+ EXPECT_TRUE(operations5.ScaleComponent(&scale));
+ EXPECT_EQ(gfx::Vector3dF(2.f, 5.f, 4.f), scale);
}
-TEST(TransformOperationTest, MaximumScaleCannotBeComputed) {
+TEST(TransformOperationTest, ScaleComponentCannotBeComputed) {
+ gfx::Vector3dF scale;
+
+ // Scale can.
TransformOperations operations1;
operations1.AppendScale(2.f, 2.f, 2.f);
+ EXPECT_TRUE(operations1.ScaleComponent(&scale));
+ EXPECT_EQ(gfx::Vector3dF(2.f, 2.f, 2.f), scale);
+
+ // Translate can.
TransformOperations operations2;
operations2.AppendTranslate(1.f, 2.f, 3.f);
+ EXPECT_TRUE(operations2.ScaleComponent(&scale));
+ EXPECT_EQ(gfx::Vector3dF(1.f, 1.f, 1.f), scale);
- float max_scale = 0.f;
-
- // Non-matching operations.
- EXPECT_FALSE(operations2.MaximumScale(operations1, 0.f, 1.f, &max_scale));
-
+ // Scale + translate can.
TransformOperations operations3;
- operations3.AppendScale(2.f, 2.f, 2.f);
+ operations3.AppendScale(2.f, 3.f, 2.f);
operations3.AppendTranslate(1.f, 2.f, 3.f);
- operations3.AppendScale(3.f, 3.f, 3.f);
+ EXPECT_TRUE(operations3.ScaleComponent(&scale));
+ EXPECT_EQ(gfx::Vector3dF(2.f, 3.f, 2.f), scale);
+
+ // Two Scales can't.
TransformOperations operations4;
- operations4.AppendScale(4.f, 4.f, 4.f);
- operations4.AppendTranslate(2.f, 3.f, 4.f);
- operations4.AppendScale(5.f, 5.f, 5.f);
+ operations4.AppendScale(2.f, 3.f, 2.f);
+ operations4.AppendScale(3.f, 2.f, 3.f);
+ EXPECT_FALSE(operations4.ScaleComponent(&scale));
- // More that one scale operation in a sequence.
- EXPECT_FALSE(operations4.MaximumScale(operations3, 0.f, 1.f, &max_scale));
-
+ // Matrix can't.
TransformOperations operations5;
operations5.AppendScale(2.f, 2.f, 2.f);
gfx::Transform scaling_transform;
scaling_transform.Scale(2.f, 2.f);
operations5.AppendMatrix(scaling_transform);
- TransformOperations operations6;
- operations6.AppendScale(3.f, 3.f, 3.f);
- gfx::Transform translation_transform;
- translation_transform.Translate3d(1.f, 2.f, 3.f);
- operations6.AppendMatrix(translation_transform);
+ EXPECT_FALSE(operations5.ScaleComponent(&scale));
- // Non-translation matrix operation.
- EXPECT_FALSE(operations6.MaximumScale(operations5, 0.f, 1.f, &max_scale));
-
+ // Scale + Rotate can't.
TransformOperations operations7;
operations7.AppendScale(2.f, 2.f, 2.f);
operations7.AppendRotate(1.f, 2.f, 3.f, 4.f);
- TransformOperations operations8;
- operations8.AppendScale(3.f, 3.f, 3.f);
- operations8.AppendRotate(3.f, 4.f, 5.f, 6.f);
+ EXPECT_FALSE(operations7.ScaleComponent(&scale));
- // Rotation operation.
- EXPECT_FALSE(operations8.MaximumScale(operations7, 0.f, 1.f, &max_scale));
-
+ // Scale + Skew can't.
TransformOperations operations9;
operations9.AppendScale(2.f, 2.f, 2.f);
operations9.AppendSkew(1.f, 2.f);
- TransformOperations operations10;
- operations10.AppendScale(3.f, 3.f, 3.f);
- operations10.AppendSkew(3.f, 4.f);
+ EXPECT_FALSE(operations9.ScaleComponent(&scale));
- // Skew operation.
- EXPECT_FALSE(operations10.MaximumScale(operations9, 0.f, 1.f, &max_scale));
-
+ // Scale + Perspective can't.
TransformOperations operations11;
operations11.AppendScale(2.f, 2.f, 2.f);
operations11.AppendPerspective(1.f);
- TransformOperations operations12;
- operations12.AppendScale(3.f, 3.f, 3.f);
- operations12.AppendPerspective(3.f);
-
- // Perspective operation.
- EXPECT_FALSE(operations12.MaximumScale(operations11, 0.f, 1.f, &max_scale));
+ EXPECT_FALSE(operations11.ScaleComponent(&scale));
}
} // namespace
diff --git a/cc/blink/web_external_texture_layer_impl.cc b/cc/blink/web_external_texture_layer_impl.cc
index e6c8a64..85aac10 100644
--- a/cc/blink/web_external_texture_layer_impl.cc
+++ b/cc/blink/web_external_texture_layer_impl.cc
@@ -25,7 +25,7 @@
WebExternalTextureLayerImpl::WebExternalTextureLayerImpl(
blink::WebExternalTextureLayerClient* client)
: client_(client) {
- cc::TextureLayerClient* cc_client = client_ ? this : NULL;
+ cc::TextureLayerClient* cc_client = client_ ? this : nullptr;
scoped_refptr<TextureLayer> layer = TextureLayer::CreateForMailbox(cc_client);
layer->SetIsDrawable(true);
layer_.reset(new WebLayerImpl(layer));
@@ -67,7 +67,7 @@
scoped_ptr<cc::SingleReleaseCallback>* release_callback,
bool use_shared_memory) {
blink::WebExternalTextureMailbox client_mailbox;
- WebExternalBitmapImpl* bitmap = NULL;
+ WebExternalBitmapImpl* bitmap = nullptr;
if (use_shared_memory)
bitmap = AllocateBitmap();
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc
index dadfd6d..e638ae4 100644
--- a/cc/blink/web_layer_impl.cc
+++ b/cc/blink/web_layer_impl.cc
@@ -27,6 +27,7 @@
#include "third_party/WebKit/public/platform/WebLayerScrollClient.h"
#include "third_party/WebKit/public/platform/WebSize.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
+#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/vector2d_conversions.h"
using cc::Animation;
@@ -47,19 +48,19 @@
} // namespace
WebLayerImpl::WebLayerImpl() : layer_(Layer::Create()) {
- web_layer_client_ = NULL;
+ web_layer_client_ = nullptr;
layer_->SetLayerClient(this);
}
WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) : layer_(layer) {
- web_layer_client_ = NULL;
+ web_layer_client_ = nullptr;
layer_->SetLayerClient(this);
}
WebLayerImpl::~WebLayerImpl() {
layer_->ClearRenderSurface();
- layer_->set_layer_animation_delegate(NULL);
- web_layer_client_ = NULL;
+ layer_->set_layer_animation_delegate(nullptr);
+ web_layer_client_ = nullptr;
}
// static
@@ -77,6 +78,10 @@
}
void WebLayerImpl::invalidateRect(const blink::WebFloatRect& rect) {
+ layer_->SetNeedsDisplayRect(gfx::ToEnclosingRect(rect));
+}
+
+void WebLayerImpl::invalidateRect(const blink::WebRect& rect) {
layer_->SetNeedsDisplayRect(rect);
}
@@ -268,15 +273,6 @@
layer_->SetForceRenderSurface(force_render_surface);
}
-void WebLayerImpl::setScrollPosition(blink::WebPoint position) {
- layer_->SetScrollOffset(gfx::ScrollOffset(position.x, position.y));
-}
-
-blink::WebPoint WebLayerImpl::scrollPosition() const {
- return gfx::PointAtOffsetFromOrigin(
- gfx::ScrollOffsetToFlooredVector2d(layer_->scroll_offset()));
-}
-
void WebLayerImpl::setScrollPositionDouble(blink::WebDoublePoint position) {
layer_->SetScrollOffset(gfx::ScrollOffset(position.x, position.y));
}
@@ -459,25 +455,25 @@
scoped_refptr<base::debug::ConvertableToTraceFormat>
WebLayerImpl::TakeDebugInfo() {
if (!web_layer_client_)
- return NULL;
+ return nullptr;
blink::WebGraphicsLayerDebugInfo* debug_info =
web_layer_client_->takeDebugInfoFor(this);
if (debug_info)
return new TracedDebugInfo(debug_info);
else
- return NULL;
+ return nullptr;
}
void WebLayerImpl::setScrollParent(blink::WebLayer* parent) {
- cc::Layer* scroll_parent = NULL;
+ cc::Layer* scroll_parent = nullptr;
if (parent)
scroll_parent = static_cast<WebLayerImpl*>(parent)->layer();
layer_->SetScrollParent(scroll_parent);
}
void WebLayerImpl::setClipParent(blink::WebLayer* parent) {
- cc::Layer* clip_parent = NULL;
+ cc::Layer* clip_parent = nullptr;
if (parent)
clip_parent = static_cast<WebLayerImpl*>(parent)->layer();
layer_->SetClipParent(clip_parent);
diff --git a/cc/blink/web_layer_impl.h b/cc/blink/web_layer_impl.h
index 75f8a55..0a5cd12 100644
--- a/cc/blink/web_layer_impl.h
+++ b/cc/blink/web_layer_impl.h
@@ -57,7 +57,9 @@
// WebLayer implementation.
virtual int id() const;
+ // TODO(danakj): Remove WebFloatRect version.
virtual void invalidateRect(const blink::WebFloatRect&);
+ virtual void invalidateRect(const blink::WebRect&);
virtual void invalidate();
virtual void addChild(blink::WebLayer* child);
virtual void insertChild(blink::WebLayer* child, size_t index);
@@ -103,10 +105,6 @@
virtual void pauseAnimation(int animation_id, double time_offset);
virtual bool hasActiveAnimation();
virtual void setForceRenderSurface(bool force);
- // TODO(miletus): Add the WebDoublePoint version to WebLayer and then remove
- // the WebPoint version from WebLayer and WebLayerImpl.
- virtual void setScrollPosition(blink::WebPoint position);
- virtual blink::WebPoint scrollPosition() const;
virtual void setScrollPositionDouble(blink::WebDoublePoint position);
virtual blink::WebDoublePoint scrollPositionDouble() const;
virtual void setScrollClipLayer(blink::WebLayer* clip_layer);
diff --git a/cc/blink/web_layer_impl_fixed_bounds.cc b/cc/blink/web_layer_impl_fixed_bounds.cc
index 5ffb660..e9e11c1 100644
--- a/cc/blink/web_layer_impl_fixed_bounds.cc
+++ b/cc/blink/web_layer_impl_fixed_bounds.cc
@@ -29,6 +29,12 @@
invalidate();
}
+void WebLayerImplFixedBounds::invalidateRect(const blink::WebRect& rect) {
+ // Partial invalidations seldom occur for such layers.
+ // Simply invalidate the whole layer to avoid transformation of coordinates.
+ invalidate();
+}
+
void WebLayerImplFixedBounds::setTransformOrigin(
const blink::WebFloatPoint3D& transform_origin) {
if (transform_origin != this->transformOrigin()) {
diff --git a/cc/blink/web_layer_impl_fixed_bounds.h b/cc/blink/web_layer_impl_fixed_bounds.h
index 07c461c..52f54cf 100644
--- a/cc/blink/web_layer_impl_fixed_bounds.h
+++ b/cc/blink/web_layer_impl_fixed_bounds.h
@@ -23,7 +23,8 @@
virtual ~WebLayerImplFixedBounds();
// WebLayerImpl overrides.
- virtual void invalidateRect(const blink::WebFloatRect& rect);
+ virtual void invalidateRect(const blink::WebFloatRect& rect) override;
+ virtual void invalidateRect(const blink::WebRect& rect) override;
virtual void setTransformOrigin(
const blink::WebFloatPoint3D& transform_origin);
virtual void setBounds(const blink::WebSize& bounds);
diff --git a/cc/cc.gyp b/cc/cc.gyp
index e0dfdcf..b5b94bc 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -355,6 +355,7 @@
'resources/content_layer_updater.h',
'resources/eviction_tile_priority_queue.cc',
'resources/eviction_tile_priority_queue.h',
+ 'resources/gpu_memory_buffer_manager.h',
'resources/gpu_raster_worker_pool.cc',
'resources/gpu_raster_worker_pool.h',
'resources/image_layer_updater.cc',
@@ -391,8 +392,6 @@
'resources/prioritized_resource.h',
'resources/prioritized_resource_manager.cc',
'resources/prioritized_resource_manager.h',
- 'resources/prioritized_tile_set.cc',
- 'resources/prioritized_tile_set.h',
'resources/priority_calculator.cc',
'resources/priority_calculator.h',
'resources/raster_buffer.cc',
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp
index 21299c0..94fe444 100644
--- a/cc/cc_tests.gyp
+++ b/cc/cc_tests.gyp
@@ -80,7 +80,6 @@
'resources/picture_pile_unittest.cc',
'resources/picture_unittest.cc',
'resources/prioritized_resource_unittest.cc',
- 'resources/prioritized_tile_set_unittest.cc',
'resources/raster_worker_pool_unittest.cc',
'resources/resource_provider_unittest.cc',
'resources/resource_update_controller_unittest.cc',
@@ -236,6 +235,8 @@
'test/test_context_support.h',
'test/test_gles2_interface.cc',
'test/test_gles2_interface.h',
+ 'test/test_gpu_memory_buffer_manager.cc',
+ 'test/test_gpu_memory_buffer_manager.h',
'test/test_now_source.cc',
'test/test_now_source.h',
'test/test_occlusion_tracker.h',
diff --git a/cc/debug/debug_rect_history.cc b/cc/debug/debug_rect_history.cc
index e8792e7..a8c5030 100644
--- a/cc/debug/debug_rect_history.cc
+++ b/cc/debug/debug_rect_history.cc
@@ -82,7 +82,7 @@
float height_scale = layer->content_bounds().height() /
static_cast<float>(layer->bounds().height());
gfx::Rect update_content_rect = gfx::ScaleToEnclosingRect(
- gfx::ToEnclosingRect(layer->update_rect()), width_scale, height_scale);
+ layer->update_rect(), width_scale, height_scale);
debug_rects_.push_back(
DebugRect(PAINT_RECT_TYPE,
MathUtil::MapEnclosingClippedRect(
diff --git a/cc/debug/invalidation_benchmark.cc b/cc/debug/invalidation_benchmark.cc
index f063fe7..87d2edd 100644
--- a/cc/debug/invalidation_benchmark.cc
+++ b/cc/debug/invalidation_benchmark.cc
@@ -28,7 +28,7 @@
scoped_ptr<base::Value> value,
const MicroBenchmark::DoneCallback& callback)
: MicroBenchmark(callback), seed_(0) {
- base::DictionaryValue* settings = NULL;
+ base::DictionaryValue* settings = nullptr;
value->GetAsDictionary(&settings);
if (!settings)
return;
@@ -111,7 +111,7 @@
}
bool InvalidationBenchmark::ProcessMessage(scoped_ptr<base::Value> value) {
- base::DictionaryValue* message = NULL;
+ base::DictionaryValue* message = nullptr;
value->GetAsDictionary(&message);
if (!message)
return false;
diff --git a/cc/debug/micro_benchmark.cc b/cc/debug/micro_benchmark.cc
index 05c5c0d..64629de 100644
--- a/cc/debug/micro_benchmark.cc
+++ b/cc/debug/micro_benchmark.cc
@@ -54,7 +54,7 @@
scoped_ptr<MicroBenchmarkImpl> MicroBenchmark::CreateBenchmarkImpl(
scoped_refptr<base::MessageLoopProxy> origin_loop) {
- return make_scoped_ptr<MicroBenchmarkImpl>(NULL);
+ return make_scoped_ptr<MicroBenchmarkImpl>(nullptr);
}
} // namespace cc
diff --git a/cc/debug/picture_record_benchmark.cc b/cc/debug/picture_record_benchmark.cc
index 2bda59d..a8a296d 100644
--- a/cc/debug/picture_record_benchmark.cc
+++ b/cc/debug/picture_record_benchmark.cc
@@ -31,13 +31,13 @@
if (!value)
return;
- base::ListValue* list = NULL;
+ base::ListValue* list = nullptr;
value->GetAsList(&list);
if (!list)
return;
for (base::ListValue::iterator it = list->begin(); it != list->end(); ++it) {
- base::DictionaryValue* dictionary = NULL;
+ base::DictionaryValue* dictionary = nullptr;
(*it)->GetAsDictionary(&dictionary);
if (!dictionary ||
!dictionary->HasKey("width") ||
diff --git a/cc/debug/rasterize_and_record_benchmark.cc b/cc/debug/rasterize_and_record_benchmark.cc
index 9d1bfe6..e83c118 100644
--- a/cc/debug/rasterize_and_record_benchmark.cc
+++ b/cc/debug/rasterize_and_record_benchmark.cc
@@ -37,9 +37,9 @@
record_repeat_count_(kDefaultRecordRepeatCount),
settings_(value.Pass()),
main_thread_benchmark_done_(false),
- host_(NULL),
+ host_(nullptr),
weak_ptr_factory_(this) {
- base::DictionaryValue* settings = NULL;
+ base::DictionaryValue* settings = nullptr;
settings_->GetAsDictionary(&settings);
if (!settings)
return;
@@ -74,7 +74,7 @@
scoped_ptr<base::Value> results_value) {
DCHECK(main_thread_benchmark_done_);
- base::DictionaryValue* results = NULL;
+ base::DictionaryValue* results = nullptr;
results_value->GetAsDictionary(&results);
DCHECK(results);
diff --git a/cc/debug/rasterize_and_record_benchmark_impl.cc b/cc/debug/rasterize_and_record_benchmark_impl.cc
index 48bdf8a..91c92b9 100644
--- a/cc/debug/rasterize_and_record_benchmark_impl.cc
+++ b/cc/debug/rasterize_and_record_benchmark_impl.cc
@@ -57,9 +57,9 @@
PicturePileImpl::Analysis analysis;
picture_pile_->AnalyzeInRect(
- content_rect_, contents_scale_, &analysis, NULL);
+ content_rect_, contents_scale_, &analysis, nullptr);
picture_pile_->RasterToBitmap(
- &canvas, content_rect_, contents_scale_, NULL);
+ &canvas, content_rect_, contents_scale_, nullptr);
is_solid_color_ = analysis.is_solid_color;
@@ -137,6 +137,10 @@
virtual WhichTree GetTree() const override { return base_client_->GetTree(); }
+ virtual bool RequiresHighResToDraw() const override {
+ return base_client_->RequiresHighResToDraw();
+ }
+
private:
PictureLayerTilingClient* base_client_;
Region invalidation_;
@@ -150,7 +154,7 @@
const MicroBenchmarkImpl::DoneCallback& callback)
: MicroBenchmarkImpl(callback, origin_loop),
rasterize_repeat_count_(kDefaultRasterizeRepeatCount) {
- base::DictionaryValue* settings = NULL;
+ base::DictionaryValue* settings = nullptr;
value->GetAsDictionary(&settings);
if (!settings)
return;
diff --git a/cc/debug/unittest_only_benchmark.cc b/cc/debug/unittest_only_benchmark.cc
index e8146ad..aa81439 100644
--- a/cc/debug/unittest_only_benchmark.cc
+++ b/cc/debug/unittest_only_benchmark.cc
@@ -19,7 +19,7 @@
if (!value)
return;
- base::DictionaryValue* settings = NULL;
+ base::DictionaryValue* settings = nullptr;
value->GetAsDictionary(&settings);
if (!settings)
return;
@@ -37,7 +37,7 @@
}
bool UnittestOnlyBenchmark::ProcessMessage(scoped_ptr<base::Value> value) {
- base::DictionaryValue* message = NULL;
+ base::DictionaryValue* message = nullptr;
value->GetAsDictionary(&message);
bool can_handle;
if (message->HasKey("can_handle")) {
@@ -55,11 +55,11 @@
scoped_ptr<MicroBenchmarkImpl> UnittestOnlyBenchmark::CreateBenchmarkImpl(
scoped_refptr<base::MessageLoopProxy> origin_loop) {
if (!create_impl_benchmark_)
- return make_scoped_ptr<MicroBenchmarkImpl>(NULL);
+ return make_scoped_ptr<MicroBenchmarkImpl>(nullptr);
return make_scoped_ptr(new UnittestOnlyBenchmarkImpl(
origin_loop,
- NULL,
+ nullptr,
base::Bind(&UnittestOnlyBenchmark::RecordImplResults,
weak_ptr_factory_.GetWeakPtr())));
}
diff --git a/cc/layers/content_layer.cc b/cc/layers/content_layer.cc
index 3bd2379..d3e9a28 100644
--- a/cc/layers/content_layer.cc
+++ b/cc/layers/content_layer.cc
@@ -44,7 +44,7 @@
ContentLayer::~ContentLayer() {}
void ContentLayer::ClearClient() {
- client_ = NULL;
+ client_ = nullptr;
UpdateDrawsContent(HasDrawableContent());
}
@@ -62,7 +62,7 @@
updater_->set_rendering_stats_instrumentation(
host->rendering_stats_instrumentation());
} else {
- updater_->set_rendering_stats_instrumentation(NULL);
+ updater_->set_rendering_stats_instrumentation(nullptr);
}
}
@@ -147,7 +147,7 @@
int height = bounds().height();
SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(width, height, NULL, 0);
+ SkCanvas* canvas = recorder.beginRecording(width, height, nullptr, 0);
client_->PaintContents(canvas,
gfx::Rect(width, height),
ContentLayerClient::GRAPHICS_CONTEXT_ENABLED);
diff --git a/cc/layers/contents_scaling_layer_unittest.cc b/cc/layers/contents_scaling_layer_unittest.cc
index 8cbd517..9865079 100644
--- a/cc/layers/contents_scaling_layer_unittest.cc
+++ b/cc/layers/contents_scaling_layer_unittest.cc
@@ -18,19 +18,19 @@
MockContentsScalingLayer()
: ContentsScalingLayer() {}
- virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) override {
+ virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override {
last_needs_display_rect_ = dirty_rect;
ContentsScalingLayer::SetNeedsDisplayRect(dirty_rect);
}
- const gfx::RectF& LastNeedsDisplayRect() const {
+ const gfx::Rect& LastNeedsDisplayRect() const {
return last_needs_display_rect_;
}
private:
virtual ~MockContentsScalingLayer() {}
- gfx::RectF last_needs_display_rect_;
+ gfx::Rect last_needs_display_rect_;
};
static void CalcDrawProps(FakeLayerTreeHost* host, float device_scale_factor) {
diff --git a/cc/layers/delegated_frame_provider_unittest.cc b/cc/layers/delegated_frame_provider_unittest.cc
index 4a3f77e..76af9a1 100644
--- a/cc/layers/delegated_frame_provider_unittest.cc
+++ b/cc/layers/delegated_frame_provider_unittest.cc
@@ -67,7 +67,7 @@
resource_collection_->SetClient(this);
}
- virtual void TearDown() override { resource_collection_->SetClient(NULL); }
+ virtual void TearDown() override { resource_collection_->SetClient(nullptr); }
virtual void UnusedResourcesAreAvailable() override {
resources_available_ = true;
@@ -106,7 +106,7 @@
EXPECT_FALSE(ReturnAndResetResourcesAvailable());
EXPECT_EQ(0u, resources_.size());
- frame_provider_ = NULL;
+ frame_provider_ = nullptr;
EXPECT_TRUE(ReturnAndResetResourcesAvailable());
EXPECT_EQ(1u, resources_.size());
@@ -132,7 +132,7 @@
EXPECT_EQ(444u, resources_[0].id);
resources_.clear();
- frame_provider_ = NULL;
+ frame_provider_ = nullptr;
EXPECT_TRUE(ReturnAndResetResourcesAvailable());
EXPECT_EQ(1u, resources_.size());
@@ -272,11 +272,11 @@
// Releasing all references to the frame provider will release
// the frame.
- observer1 = NULL;
- observer2 = NULL;
+ observer1 = nullptr;
+ observer2 = nullptr;
EXPECT_FALSE(ReturnAndResetResourcesAvailable());
- frame_provider_ = NULL;
+ frame_provider_ = nullptr;
EXPECT_TRUE(ReturnAndResetResourcesAvailable());
EXPECT_EQ(1u, resources_.size());
@@ -386,7 +386,7 @@
EXPECT_TRUE(ReturnAndResetResourcesAvailable());
resources_.clear();
- frame_provider_ = NULL;
+ frame_provider_ = nullptr;
// Nothing is returned twice.
EXPECT_FALSE(ReturnAndResetResourcesAvailable());
diff --git a/cc/layers/delegated_frame_resource_collection.cc b/cc/layers/delegated_frame_resource_collection.cc
index b0e4cbf..a1bc759 100644
--- a/cc/layers/delegated_frame_resource_collection.cc
+++ b/cc/layers/delegated_frame_resource_collection.cc
@@ -10,9 +10,7 @@
namespace cc {
DelegatedFrameResourceCollection::DelegatedFrameResourceCollection()
- : client_(NULL),
- lost_all_resources_(false),
- weak_ptr_factory_(this) {
+ : client_(nullptr), lost_all_resources_(false), weak_ptr_factory_(this) {
DCHECK(main_thread_checker_.CalledOnValidThread());
}
diff --git a/cc/layers/delegated_frame_resource_collection_unittest.cc b/cc/layers/delegated_frame_resource_collection_unittest.cc
index 99c181e..8ec7169 100644
--- a/cc/layers/delegated_frame_resource_collection_unittest.cc
+++ b/cc/layers/delegated_frame_resource_collection_unittest.cc
@@ -33,8 +33,8 @@
void DestroyResourceCollection() {
if (resource_collection_.get()) {
- resource_collection_->SetClient(NULL);
- resource_collection_ = NULL;
+ resource_collection_->SetClient(nullptr);
+ resource_collection_ = nullptr;
}
}
@@ -151,7 +151,7 @@
EXPECT_TRUE(returned_resources_[0].lost);
returned_resources_.clear();
- base::WaitableEvent* null_event = NULL;
+ base::WaitableEvent* null_event = nullptr;
thread.message_loop()->PostTask(FROM_HERE,
base::Bind(&ReturnResourcesOnThread,
return_callback,
diff --git a/cc/layers/delegated_renderer_layer.cc b/cc/layers/delegated_renderer_layer.cc
index bf90305..f95c9bd 100644
--- a/cc/layers/delegated_renderer_layer.cc
+++ b/cc/layers/delegated_renderer_layer.cc
@@ -22,7 +22,7 @@
: Layer(),
frame_provider_(frame_provider),
should_collect_new_frame_(true),
- frame_data_(NULL),
+ frame_data_(nullptr),
weak_ptrs_(this) {
frame_provider_->AddObserver(this);
}
@@ -69,7 +69,7 @@
if (frame_data_)
delegated_impl->SetFrameData(frame_data_, frame_damage_);
- frame_data_ = NULL;
+ frame_data_ = nullptr;
frame_damage_ = gfx::RectF();
}
diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc
index 86d493a..c6692d1 100644
--- a/cc/layers/delegated_renderer_layer_impl.cc
+++ b/cc/layers/delegated_renderer_layer_impl.cc
@@ -17,6 +17,7 @@
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/occlusion.h"
+#include "ui/gfx/geometry/rect_conversions.h"
namespace cc {
@@ -149,7 +150,8 @@
gfx::RectF damage_in_layer = damage_in_frame;
damage_in_layer.Scale(inverse_device_scale_factor_);
SetUpdateRect(gfx::IntersectRects(
- gfx::UnionRects(update_rect(), damage_in_layer), gfx::Rect(bounds())));
+ gfx::UnionRects(update_rect(), gfx::ToEnclosingRect(damage_in_layer)),
+ gfx::Rect(bounds())));
SetRenderPasses(&render_pass_list);
have_render_passes_to_push_ = true;
@@ -387,8 +389,8 @@
AppendQuadsData* append_quads_data,
const RenderPass* delegated_render_pass,
const gfx::Size& frame_size) const {
- const SharedQuadState* delegated_shared_quad_state = NULL;
- SharedQuadState* output_shared_quad_state = NULL;
+ const SharedQuadState* delegated_shared_quad_state = nullptr;
+ SharedQuadState* output_shared_quad_state = nullptr;
for (const auto& delegated_quad : delegated_render_pass->quad_list) {
bool is_root_delegated_render_pass =
diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc
index 832a483..26e0aec 100644
--- a/cc/layers/delegated_renderer_layer_impl_unittest.cc
+++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc
@@ -692,8 +692,8 @@
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
- const SharedQuadState* root_delegated_shared_quad_state = NULL;
- const SharedQuadState* contrib_delegated_shared_quad_state = NULL;
+ const SharedQuadState* root_delegated_shared_quad_state = nullptr;
+ const SharedQuadState* contrib_delegated_shared_quad_state = nullptr;
VerifyRenderPasses(
frame,
2,
@@ -747,8 +747,8 @@
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
- const SharedQuadState* root_delegated_shared_quad_state = NULL;
- const SharedQuadState* contrib_delegated_shared_quad_state = NULL;
+ const SharedQuadState* root_delegated_shared_quad_state = nullptr;
+ const SharedQuadState* contrib_delegated_shared_quad_state = nullptr;
VerifyRenderPasses(
frame,
2,
@@ -808,8 +808,8 @@
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
- const SharedQuadState* root_delegated_shared_quad_state = NULL;
- const SharedQuadState* contrib_delegated_shared_quad_state = NULL;
+ const SharedQuadState* root_delegated_shared_quad_state = nullptr;
+ const SharedQuadState* contrib_delegated_shared_quad_state = nullptr;
VerifyRenderPasses(
frame,
3,
@@ -856,8 +856,8 @@
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
- const SharedQuadState* root_delegated_shared_quad_state = NULL;
- const SharedQuadState* contrib_delegated_shared_quad_state = NULL;
+ const SharedQuadState* root_delegated_shared_quad_state = nullptr;
+ const SharedQuadState* contrib_delegated_shared_quad_state = nullptr;
VerifyRenderPasses(
frame,
3,
@@ -903,8 +903,8 @@
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
- const SharedQuadState* root_delegated_shared_quad_state = NULL;
- const SharedQuadState* contrib_delegated_shared_quad_state = NULL;
+ const SharedQuadState* root_delegated_shared_quad_state = nullptr;
+ const SharedQuadState* contrib_delegated_shared_quad_state = nullptr;
VerifyRenderPasses(frame,
2,
&root_delegated_shared_quad_state,
diff --git a/cc/layers/draw_properties.h b/cc/layers/draw_properties.h
index 4bbce72..23845a0 100644
--- a/cc/layers/draw_properties.h
+++ b/cc/layers/draw_properties.h
@@ -23,7 +23,7 @@
screen_space_transform_is_animating(false),
can_use_lcd_text(false),
is_clipped(false),
- render_target(NULL),
+ render_target(nullptr),
contents_scale_x(1.f),
contents_scale_y(1.f),
num_unclipped_descendants(0),
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index 85bb2f1..1dbdc64 100644
--- a/cc/layers/heads_up_display_layer_impl.cc
+++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -340,7 +340,7 @@
bounds.right(),
bounds.top() + indicator_top,
*paint);
- paint->setXfermode(NULL);
+ paint->setXfermode(nullptr);
}
SkRect HeadsUpDisplayLayerImpl::DrawFPSDisplay(
@@ -485,7 +485,7 @@
int right,
int top,
int width) const {
- if (!memory_entry_.bytes_total())
+ if (!memory_entry_.total_bytes_used)
return SkRect::MakeEmpty();
const int kPadding = 4;
@@ -495,7 +495,7 @@
const int left = bounds().width() - width - right;
const SkRect area = SkRect::MakeXYWH(left, top, width, height);
- const double megabyte = 1024.0 * 1024.0;
+ const double kMegabyte = 1024.0 * 1024.0;
SkPaint paint = CreatePaint();
DrawGraphBackground(canvas, &paint, area);
@@ -514,20 +514,14 @@
kFontHeight,
title_pos);
- std::string text =
- base::StringPrintf("%6.1f MB used",
- (memory_entry_.bytes_unreleasable +
- memory_entry_.bytes_allocated) / megabyte);
+ std::string text = base::StringPrintf(
+ "%6.1f MB used", memory_entry_.total_bytes_used / kMegabyte);
DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat1_pos);
- if (memory_entry_.bytes_over) {
+ if (!memory_entry_.had_enough_memory)
paint.setColor(SK_ColorRED);
- text = base::StringPrintf("%6.1f MB over",
- memory_entry_.bytes_over / megabyte);
- } else {
- text = base::StringPrintf("%6.1f MB max ",
- memory_entry_.total_budget_in_bytes / megabyte);
- }
+ text = base::StringPrintf("%6.1f MB max ",
+ memory_entry_.total_budget_in_bytes / kMegabyte);
DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat2_pos);
return area;
diff --git a/cc/layers/heads_up_display_unittest.cc b/cc/layers/heads_up_display_unittest.cc
index 686338e..37d40a8 100644
--- a/cc/layers/heads_up_display_unittest.cc
+++ b/cc/layers/heads_up_display_unittest.cc
@@ -57,7 +57,7 @@
case 2:
EXPECT_EQ(root_layer1_.get(), layer_tree_host()->hud_layer()->parent());
// Unset the root layer.
- layer_tree_host()->SetRootLayer(NULL);
+ layer_tree_host()->SetRootLayer(nullptr);
break;
case 3:
EXPECT_EQ(0, layer_tree_host()->hud_layer()->parent());
@@ -67,7 +67,7 @@
case 4:
EXPECT_EQ(root_layer1_.get(), layer_tree_host()->hud_layer()->parent());
// Unset the root layer.
- layer_tree_host()->SetRootLayer(NULL);
+ layer_tree_host()->SetRootLayer(nullptr);
break;
case 5:
EXPECT_EQ(0, layer_tree_host()->hud_layer()->parent());
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 08bf345..dd71307 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -45,8 +45,8 @@
layer_id_(g_next_layer_id.GetNext() + 1),
ignore_set_needs_commit_(false),
sorting_context_id_(0),
- parent_(NULL),
- layer_tree_host_(NULL),
+ parent_(nullptr),
+ layer_tree_host_(nullptr),
scroll_clip_layer_id_(INVALID_ID),
num_descendants_that_draw_content_(0),
should_scroll_on_main_thread_(false),
@@ -70,11 +70,11 @@
background_color_(0),
opacity_(1.f),
blend_mode_(SkXfermode::kSrcOver_Mode),
- scroll_parent_(NULL),
- clip_parent_(NULL),
- replica_layer_(NULL),
+ scroll_parent_(nullptr),
+ clip_parent_(nullptr),
+ replica_layer_(nullptr),
raster_scale_(0.f),
- client_(NULL) {
+ client_(nullptr) {
layer_animation_controller_ = LayerAnimationController::Create(layer_id_);
layer_animation_controller_->AddValueObserver(this);
layer_animation_controller_->set_value_provider(this);
@@ -202,13 +202,13 @@
return !layer_tree_host_->in_paint_layer_contents();
}
-gfx::Rect Layer::LayerRectToContentRect(const gfx::RectF& layer_rect) const {
- gfx::RectF content_rect =
- gfx::ScaleRect(layer_rect, contents_scale_x(), contents_scale_y());
+gfx::Rect Layer::LayerRectToContentRect(const gfx::Rect& layer_rect) const {
+ gfx::Rect content_rect = gfx::ScaleToEnclosingRect(
+ layer_rect, contents_scale_x(), contents_scale_y());
// Intersect with content rect to avoid the extra pixel because for some
// values x and y, ceil((x / y) * y) may be x + 1.
content_rect.Intersect(gfx::Rect(content_bounds()));
- return gfx::ToEnclosingRect(content_rect);
+ return content_rect;
}
skia::RefPtr<SkPicture> Layer::GetPicture() const {
@@ -226,7 +226,7 @@
}
parent_ = layer;
- SetLayerTreeHost(parent_ ? parent_->layer_tree_host() : NULL);
+ SetLayerTreeHost(parent_ ? parent_->layer_tree_host() : nullptr);
if (!layer_tree_host_)
return;
@@ -266,14 +266,14 @@
void Layer::RemoveChildOrDependent(Layer* child) {
if (mask_layer_.get() == child) {
- mask_layer_->SetParent(NULL);
- mask_layer_ = NULL;
+ mask_layer_->SetParent(nullptr);
+ mask_layer_ = nullptr;
SetNeedsFullTreeSync();
return;
}
if (replica_layer_.get() == child) {
- replica_layer_->SetParent(NULL);
- replica_layer_ = NULL;
+ replica_layer_->SetParent(nullptr);
+ replica_layer_ = nullptr;
SetNeedsFullTreeSync();
return;
}
@@ -284,7 +284,7 @@
if (iter->get() != child)
continue;
- child->SetParent(NULL);
+ child->SetParent(nullptr);
AddDrawableDescendants(-child->NumDescendantsThatDrawContent() -
(child->DrawsContent() ? 1 : 0));
children_.erase(iter);
@@ -795,7 +795,7 @@
SetNeedsCommit();
}
-void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
+void Layer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) {
if (dirty_rect.IsEmpty())
return;
@@ -912,7 +912,7 @@
layer->set_user_scrollable_horizontal(user_scrollable_horizontal_);
layer->set_user_scrollable_vertical(user_scrollable_vertical_);
- LayerImpl* scroll_parent = NULL;
+ LayerImpl* scroll_parent = nullptr;
if (scroll_parent_) {
scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id());
DCHECK(scroll_parent);
@@ -932,10 +932,10 @@
}
layer->SetScrollChildren(scroll_children);
} else {
- layer->SetScrollChildren(NULL);
+ layer->SetScrollChildren(nullptr);
}
- LayerImpl* clip_parent = NULL;
+ LayerImpl* clip_parent = nullptr;
if (clip_parent_) {
clip_parent =
layer->layer_tree_impl()->LayerById(clip_parent_->id());
@@ -954,7 +954,7 @@
}
layer->SetClipChildren(clip_children);
} else {
- layer->SetClipChildren(NULL);
+ layer->SetClipChildren(nullptr);
}
// Adjust the scroll delta to be just the scrolls that have happened since
@@ -1003,7 +1003,7 @@
// Reset any state that should be cleared for the next update.
stacking_order_changed_ = false;
- update_rect_ = gfx::RectF();
+ update_rect_ = gfx::Rect();
needs_push_properties_ = false;
num_dependents_need_push_properties_ = 0;
@@ -1077,7 +1077,7 @@
if (client_)
return client_->TakeDebugInfo();
else
- return NULL;
+ return nullptr;
}
void Layer::CreateRenderSurface() {
@@ -1189,7 +1189,7 @@
}
ScrollbarLayerInterface* Layer::ToScrollbarLayer() {
- return NULL;
+ return nullptr;
}
RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const {
@@ -1204,22 +1204,22 @@
if (scroll_children_.get()) {
std::set<Layer*> copy = *scroll_children_;
for (std::set<Layer*>::iterator it = copy.begin(); it != copy.end(); ++it)
- (*it)->SetScrollParent(NULL);
+ (*it)->SetScrollParent(nullptr);
}
DCHECK(!scroll_children_);
- SetScrollParent(NULL);
+ SetScrollParent(nullptr);
}
void Layer::RemoveFromClipTree() {
if (clip_children_.get()) {
std::set<Layer*> copy = *clip_children_;
for (std::set<Layer*>::iterator it = copy.begin(); it != copy.end(); ++it)
- (*it)->SetClipParent(NULL);
+ (*it)->SetClipParent(nullptr);
}
DCHECK(!clip_children_);
- SetClipParent(NULL);
+ SetClipParent(nullptr);
}
void Layer::AddDrawableDescendants(int num) {
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 3e83e8f..dd41669 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -100,7 +100,7 @@
// This requests the layer and its subtree be rendered and given to the
// callback. If the copy is unable to be produced (the layer is destroyed
- // first), then the callback is called with a NULL/empty result.
+ // first), then the callback is called with a nullptr/empty result.
void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> request);
bool HasCopyRequest() const {
return !copy_requests_.empty();
@@ -124,8 +124,8 @@
Layer* mask_layer() { return mask_layer_.get(); }
const Layer* mask_layer() const { return mask_layer_.get(); }
- virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect);
- void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); }
+ virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect);
+ void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); }
void SetOpacity(float opacity);
float opacity() const { return opacity_; }
@@ -422,7 +422,7 @@
virtual ScrollbarLayerInterface* ToScrollbarLayer();
- gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const;
+ gfx::Rect LayerRectToContentRect(const gfx::Rect& layer_rect) const;
virtual skia::RefPtr<SkPicture> GetPicture() const;
@@ -430,7 +430,7 @@
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl);
bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); }
- void ResetNeedsDisplayForTesting() { update_rect_ = gfx::RectF(); }
+ void ResetNeedsDisplayForTesting() { update_rect_ = gfx::Rect(); }
RenderingStatsInstrumentation* rendering_stats_instrumentation() const;
@@ -524,7 +524,7 @@
// outside the compositor's control (i.e. plugin layers), this information
// is not available and the update rect will remain empty.
// Note this rect is in layer space (not content space).
- gfx::RectF update_rect_;
+ gfx::Rect update_rect_;
scoped_refptr<Layer> mask_layer_;
diff --git a/cc/layers/layer_client.h b/cc/layers/layer_client.h
index 5a20b11..4b98a95 100644
--- a/cc/layers/layer_client.h
+++ b/cc/layers/layer_client.h
@@ -21,7 +21,8 @@
class CC_EXPORT LayerClient {
public:
// Returns a pointer to a debug info object, if one has been computed.
- // If not, returns NULL. If the returned pointer is non-NULL, the caller takes
+ // If not, returns nullptr.
+ // If the returned pointer is non-nullptr, the caller takes
// ownership of the pointer.
virtual scoped_refptr<base::debug::ConvertableToTraceFormat>
TakeDebugInfo() = 0;
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 6dfec0e..a361772 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -35,15 +35,15 @@
namespace cc {
LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
- : parent_(NULL),
- scroll_parent_(NULL),
- clip_parent_(NULL),
+ : parent_(nullptr),
+ scroll_parent_(nullptr),
+ clip_parent_(nullptr),
mask_layer_id_(-1),
replica_layer_id_(-1),
layer_id_(id),
layer_tree_impl_(tree_impl),
- scroll_offset_delegate_(NULL),
- scroll_clip_layer_(NULL),
+ scroll_offset_delegate_(nullptr),
+ scroll_clip_layer_(nullptr),
should_scroll_on_main_thread_(false),
have_wheel_event_handlers_(false),
have_scroll_event_handlers_(false),
@@ -365,11 +365,18 @@
}
gfx::Vector2dF LayerImpl::ScrollBy(const gfx::Vector2dF& scroll) {
+ gfx::Vector2dF adjusted_scroll = scroll;
+ if (layer_tree_impl()->settings().use_pinch_virtual_viewport) {
+ if (!user_scrollable_horizontal_)
+ adjusted_scroll.set_x(0);
+ if (!user_scrollable_vertical_)
+ adjusted_scroll.set_y(0);
+ }
DCHECK(scrollable());
gfx::Vector2dF min_delta = -ScrollOffsetToVector2dF(scroll_offset_);
gfx::Vector2dF max_delta = MaxScrollOffset().DeltaFrom(scroll_offset_);
// Clamp new_delta so that position + delta stays within scroll bounds.
- gfx::Vector2dF new_delta = (ScrollDelta() + scroll);
+ gfx::Vector2dF new_delta = (ScrollDelta() + adjusted_scroll);
new_delta.SetToMax(min_delta);
new_delta.SetToMin(max_delta);
gfx::Vector2dF unscrolled =
@@ -383,6 +390,11 @@
scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id);
}
+bool LayerImpl::user_scrollable(ScrollbarOrientation orientation) const {
+ return (orientation == HORIZONTAL) ? user_scrollable_horizontal_
+ : user_scrollable_vertical_;
+}
+
void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() {
// Pending tree never has sent scroll deltas
DCHECK(layer_tree_impl()->IsActiveTree());
@@ -544,7 +556,7 @@
layer->Set3dSortingContextId(sorting_context_id_);
layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_);
- LayerImpl* scroll_parent = NULL;
+ LayerImpl* scroll_parent = nullptr;
if (scroll_parent_) {
scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id());
DCHECK(scroll_parent);
@@ -564,10 +576,10 @@
}
layer->SetScrollChildren(scroll_children);
} else {
- layer->SetScrollChildren(NULL);
+ layer->SetScrollChildren(nullptr);
}
- LayerImpl* clip_parent = NULL;
+ LayerImpl* clip_parent = nullptr;
if (clip_parent_) {
clip_parent = layer->layer_tree_impl()->LayerById(
clip_parent_->id());
@@ -582,7 +594,7 @@
clip_children->insert(layer->layer_tree_impl()->LayerById((*it)->id()));
layer->SetClipChildren(clip_children);
} else {
- layer->SetClipChildren(NULL);
+ layer->SetClipChildren(nullptr);
}
layer->PassCopyRequests(©_requests_);
@@ -599,7 +611,7 @@
// Reset any state that should be cleared for the next update.
stacking_order_changed_ = false;
- update_rect_ = gfx::RectF();
+ update_rect_ = gfx::Rect();
needs_push_properties_ = false;
num_dependents_need_push_properties_ = 0;
}
@@ -716,7 +728,7 @@
void LayerImpl::ResetAllChangeTrackingForSubtree() {
layer_property_changed_ = false;
- update_rect_ = gfx::RectF();
+ update_rect_ = gfx::Rect();
damage_rect_ = gfx::RectF();
if (draw_properties_.render_surface)
@@ -771,10 +783,15 @@
return layer_tree_impl_->IsActiveTree();
}
-// TODO(aelias): Convert so that bounds returns SizeF.
gfx::Size LayerImpl::bounds() const {
- return gfx::ToCeiledSize(gfx::SizeF(bounds_.width() + bounds_delta_.x(),
- bounds_.height() + bounds_delta_.y()));
+ gfx::Vector2d delta = gfx::ToCeiledVector2d(bounds_delta_);
+ return gfx::Size(bounds_.width() + delta.x(),
+ bounds_.height() + delta.y());
+}
+
+gfx::SizeF LayerImpl::BoundsForScrolling() const {
+ return gfx::SizeF(bounds_.width() + bounds_delta_.x(),
+ bounds_.height() + bounds_delta_.y());
}
void LayerImpl::SetBounds(const gfx::Size& bounds) {
@@ -848,7 +865,7 @@
}
ScrollbarLayerImplBase* LayerImpl::ToScrollbarLayer() {
- return NULL;
+ return nullptr;
}
void LayerImpl::SetDrawsContent(bool draws_content) {
@@ -1032,7 +1049,7 @@
return transform_animation && transform_animation->is_impl_only();
}
-void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) {
+void LayerImpl::SetUpdateRect(const gfx::Rect& update_rect) {
update_rect_ = update_rect;
SetNeedsPushProperties();
}
@@ -1079,6 +1096,11 @@
scroll_offset_delegate_->IsExternalFlingActive();
}
+void LayerImpl::DidScroll() {
+ NoteLayerPropertyChangedForSubtree();
+ ScrollbarParametersDidChange(false);
+}
+
void LayerImpl::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) {
SetScrollOffsetAndDelta(scroll_offset, ScrollDelta());
}
@@ -1122,8 +1144,7 @@
}
if (changed) {
- NoteLayerPropertyChangedForSubtree();
- ScrollbarParametersDidChange(false);
+ DidScroll();
}
}
@@ -1170,7 +1191,7 @@
DCHECK(this != layer_tree_impl()->InnerViewportScrollLayer() ||
IsContainerForFixedPositionLayers());
- gfx::SizeF scaled_scroll_bounds(bounds());
+ gfx::SizeF scaled_scroll_bounds(BoundsForScrolling());
float scale_factor = 1.f;
for (LayerImpl const* current_layer = this;
@@ -1238,11 +1259,12 @@
DCHECK(scrollbar_clip_layer);
DCHECK(this != layer_tree_impl()->InnerViewportScrollLayer() ||
IsContainerForFixedPositionLayers());
- gfx::RectF clip_rect(gfx::PointF(), scrollbar_clip_layer->bounds());
+ gfx::RectF clip_rect(gfx::PointF(),
+ scrollbar_clip_layer->BoundsForScrolling());
// See comment in MaxScrollOffset() regarding the use of the content layer
// bounds here.
- gfx::RectF scroll_rect(gfx::PointF(), bounds());
+ gfx::RectF scroll_rect(gfx::PointF(), BoundsForScrolling());
if (scroll_rect.size().IsEmpty())
return;
@@ -1343,7 +1365,7 @@
if (!scrollbars_)
return;
- scrollbars_.reset(NULL);
+ scrollbars_.reset(nullptr);
}
void LayerImpl::AddScrollbar(ScrollbarLayerImplBase* layer) {
@@ -1526,7 +1548,7 @@
scoped_ptr<base::Value> debug_info_value(json_reader.ReadToValue(str));
if (debug_info_value->IsType(base::Value::TYPE_DICTIONARY)) {
- base::DictionaryValue* dictionary_value = NULL;
+ base::DictionaryValue* dictionary_value = nullptr;
bool converted_to_dictionary =
debug_info_value->GetAsDictionary(&dictionary_value);
DCHECK(converted_to_dictionary);
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 1e8fa63..76427a1 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -19,6 +19,7 @@
#include "cc/base/region.h"
#include "cc/base/scoped_ptr_vector.h"
#include "cc/input/input_handler.h"
+#include "cc/input/scrollbar.h"
#include "cc/layers/draw_properties.h"
#include "cc/layers/layer_lists.h"
#include "cc/layers/layer_position_constraint.h"
@@ -365,6 +366,9 @@
void SetBounds(const gfx::Size& bounds);
gfx::Size bounds() const;
+ // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions
+ // of pixels) due to use of single precision float.
+ gfx::SizeF BoundsForScrolling() const;
void SetBoundsDelta(const gfx::Vector2dF& bounds_delta);
gfx::Vector2dF bounds_delta() const { return bounds_delta_; }
@@ -376,6 +380,7 @@
void SetContentsScale(float contents_scale_x, float contents_scale_y);
void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate);
+ void DidScroll();
bool IsExternalFlingActive() const;
void SetScrollOffset(const gfx::ScrollOffset& scroll_offset);
@@ -407,9 +412,15 @@
void set_user_scrollable_horizontal(bool scrollable) {
user_scrollable_horizontal_ = scrollable;
}
+ bool user_scrollable_horizontal() const {
+ return user_scrollable_horizontal_;
+ }
void set_user_scrollable_vertical(bool scrollable) {
user_scrollable_vertical_ = scrollable;
}
+ bool user_scrollable_vertical() const { return user_scrollable_vertical_; }
+
+ bool user_scrollable(ScrollbarOrientation orientation) const;
void ApplySentScrollDeltasFromAbortedCommit();
void ApplyScrollDeltasSinceBeginMainFrame();
@@ -470,9 +481,8 @@
bool transform_is_invertible() const { return transform_is_invertible_; }
// Note this rect is in layer space (not content space).
- void SetUpdateRect(const gfx::RectF& update_rect);
-
- const gfx::RectF& update_rect() const { return update_rect_; }
+ void SetUpdateRect(const gfx::Rect& update_rect);
+ gfx::Rect update_rect() const { return update_rect_; }
void AddDamageRect(const gfx::RectF& damage_rect);
@@ -687,7 +697,7 @@
// Rect indicating what was repainted/updated during update.
// Note that plugin layers bypass this and leave it empty.
// Uses layer (not content) space.
- gfx::RectF update_rect_;
+ gfx::Rect update_rect_;
// This rect is in layer space.
gfx::RectF damage_rect_;
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 1d8289f..3f5ff5e 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -139,7 +139,7 @@
// These properties are internal, and should not be considered "change" when
// they are used.
EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE(
- root->SetUpdateRect(arbitrary_rect_f));
+ root->SetUpdateRect(arbitrary_rect));
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetBounds(arbitrary_size));
// Changing these properties affects the entire subtree of layers.
@@ -416,7 +416,7 @@
class LayerImplScrollTest : public testing::Test {
public:
LayerImplScrollTest()
- : host_impl_(&proxy_, &shared_bitmap_manager_), root_id_(7) {
+ : host_impl_(settings(), &proxy_, &shared_bitmap_manager_), root_id_(7) {
host_impl_.active_tree()->SetRootLayer(
LayerImpl::Create(host_impl_.active_tree(), root_id_));
host_impl_.active_tree()->root_layer()->AddChild(
@@ -436,6 +436,12 @@
LayerTreeImpl* tree() { return host_impl_.active_tree(); }
+ LayerTreeSettings settings() {
+ LayerTreeSettings settings;
+ settings.use_pinch_virtual_viewport = true;
+ return settings;
+ }
+
private:
FakeImplProxy proxy_;
TestSharedBitmapManager shared_bitmap_manager_;
@@ -527,7 +533,7 @@
EXPECT_VECTOR_EQ(fixed_offset, layer()->TotalScrollOffset());
EXPECT_VECTOR_EQ(scroll_offset, layer()->scroll_offset());
- layer()->SetScrollOffsetDelegate(NULL);
+ layer()->SetScrollOffsetDelegate(nullptr);
EXPECT_VECTOR_EQ(fixed_offset, layer()->TotalScrollOffset());
EXPECT_VECTOR_EQ(scroll_offset, layer()->scroll_offset());
@@ -574,7 +580,7 @@
EXPECT_VECTOR_EQ(gfx::Vector2dF(0, 80), layer()->TotalScrollOffset());
EXPECT_VECTOR_EQ(scroll_offset, layer()->scroll_offset());
- layer()->SetScrollOffsetDelegate(NULL);
+ layer()->SetScrollOffsetDelegate(nullptr);
EXPECT_VECTOR_EQ(gfx::Vector2dF(0, 80), layer()->TotalScrollOffset());
EXPECT_VECTOR_EQ(scroll_offset, layer()->scroll_offset());
@@ -659,9 +665,7 @@
EXPECT_VECTOR_EQ(gfx::Vector2d(), layer()->sent_scroll_delta());
}
-// The user-scrollability breaks for zoomed-in pages. So disable this.
-// http://crbug.com/322223
-TEST_F(LayerImplScrollTest, DISABLED_ScrollUserUnscrollableLayer) {
+TEST_F(LayerImplScrollTest, ScrollUserUnscrollableLayer) {
gfx::ScrollOffset scroll_offset(10, 5);
gfx::Vector2dF scroll_delta(20.5f, 8.5f);
diff --git a/cc/layers/layer_iterator.h b/cc/layers/layer_iterator.h
index fbdb53a..ba5c6aa 100644
--- a/cc/layers/layer_iterator.h
+++ b/cc/layers/layer_iterator.h
@@ -108,7 +108,7 @@
typedef typename LayerType::RenderSurfaceType RenderSurfaceType;
public:
- LayerIterator() : render_surface_layer_list_(NULL) {}
+ LayerIterator() : render_surface_layer_list_(nullptr) {}
static LayerIteratorType Begin(
const RenderSurfaceLayerList* render_surface_layer_list) {
diff --git a/cc/layers/layer_perftest.cc b/cc/layers/layer_perftest.cc
index 14afcbf..c9b8a40 100644
--- a/cc/layers/layer_perftest.cc
+++ b/cc/layers/layer_perftest.cc
@@ -45,7 +45,7 @@
}
virtual void TearDown() override {
- layer_tree_host_->SetRootLayer(NULL);
+ layer_tree_host_->SetRootLayer(nullptr);
layer_tree_host_ = nullptr;
}
@@ -75,7 +75,7 @@
// Properties changed.
timer_.Reset();
do {
- test_layer->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f));
+ test_layer->SetNeedsDisplayRect(gfx::Rect(5, 5));
test_layer->SetTransformOrigin(gfx::Point3F(0.f, 0.f, transform_origin_z));
test_layer->SetContentsOpaque(contents_opaque);
test_layer->SetDoubleSided(double_sided);
diff --git a/cc/layers/layer_position_constraint_unittest.cc b/cc/layers/layer_position_constraint_unittest.cc
index 478121b..5953f10 100644
--- a/cc/layers/layer_position_constraint_unittest.cc
+++ b/cc/layers/layer_position_constraint_unittest.cc
@@ -56,7 +56,7 @@
}
void ExecuteCalculateDrawProperties(LayerImpl* root_layer) {
- LayerImpl* page_scale_application_layer = NULL;
+ LayerImpl* page_scale_application_layer = nullptr;
ExecuteCalculateDrawProperties(
root_layer, 1.f, 1.f, page_scale_application_layer, false);
}
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 32b4b4c..a3ef621 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -14,6 +14,7 @@
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_test_common.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/single_thread_proxy.h"
@@ -40,7 +41,7 @@
class MockLayerTreeHost : public LayerTreeHost {
public:
explicit MockLayerTreeHost(FakeLayerTreeHostClient* client)
- : LayerTreeHost(client, NULL, LayerTreeSettings()) {
+ : LayerTreeHost(client, nullptr, nullptr, LayerTreeSettings()) {
InitializeSingleThreaded(client, base::MessageLoopProxy::current());
}
@@ -69,15 +70,15 @@
virtual void TearDown() override {
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AnyNumber());
- parent_ = NULL;
- child1_ = NULL;
- child2_ = NULL;
- child3_ = NULL;
- grand_child1_ = NULL;
- grand_child2_ = NULL;
- grand_child3_ = NULL;
+ parent_ = nullptr;
+ child1_ = nullptr;
+ child2_ = nullptr;
+ child3_ = nullptr;
+ grand_child1_ = nullptr;
+ grand_child2_ = nullptr;
+ grand_child3_ = nullptr;
- layer_tree_host_->SetRootLayer(NULL);
+ layer_tree_host_->SetRootLayer(nullptr);
layer_tree_host_ = nullptr;
}
@@ -151,7 +152,7 @@
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(0);
- test_layer->SetLayerTreeHost(NULL);
+ test_layer->SetLayerTreeHost(nullptr);
}
TEST_F(LayerTest, AddAndRemoveChild) {
@@ -234,7 +235,7 @@
EXPECT_EQ(child4, parent->children()[3]);
EXPECT_EQ(parent.get(), child4->parent());
- EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(NULL));
+ EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(nullptr));
}
TEST_F(LayerTest, InsertChildPastEndOfList) {
@@ -283,7 +284,7 @@
EXPECT_EQ(child2, parent->children()[0]);
EXPECT_EQ(child1, parent->children()[1]);
- EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(NULL));
+ EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(nullptr));
}
TEST_F(LayerTest, ReplaceChildWithNewChild) {
@@ -357,11 +358,11 @@
child1->reset_needs_push_properties_for_testing();
- EXPECT_SET_NEEDS_COMMIT(1, child2 = NULL);
+ EXPECT_SET_NEEDS_COMMIT(1, child2 = nullptr);
EXPECT_TRUE(child1->needs_push_properties());
- EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(NULL));
+ EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(nullptr));
}
TEST_F(LayerTest, DeleteRemovedScrollChild) {
@@ -386,11 +387,11 @@
child2->reset_needs_push_properties_for_testing();
- EXPECT_SET_NEEDS_COMMIT(1, child1 = NULL);
+ EXPECT_SET_NEEDS_COMMIT(1, child1 = nullptr);
EXPECT_TRUE(child2->needs_push_properties());
- EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(NULL));
+ EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(nullptr));
}
TEST_F(LayerTest, ReplaceChildWithSameChild) {
@@ -444,7 +445,7 @@
EXPECT_EQ(new_parent.get(), child1->parent());
EXPECT_EQ(new_parent.get(), child2->parent());
- EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(NULL));
+ EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(nullptr));
}
TEST_F(LayerTest, HasAncestor) {
@@ -536,10 +537,9 @@
gfx::Size test_bounds = gfx::Size(501, 508);
- gfx::RectF dirty1 = gfx::RectF(10.f, 15.f, 1.f, 2.f);
- gfx::RectF dirty2 = gfx::RectF(20.f, 25.f, 3.f, 4.f);
- gfx::RectF empty_dirty_rect = gfx::RectF(40.f, 45.f, 0.f, 0.f);
- gfx::RectF out_of_bounds_dirty_rect = gfx::RectF(400.f, 405.f, 500.f, 502.f);
+ gfx::Rect dirty1 = gfx::Rect(10, 15, 1, 2);
+ gfx::Rect dirty2 = gfx::Rect(20, 25, 3, 4);
+ gfx::Rect out_of_bounds_dirty_rect = gfx::Rect(400, 405, 500, 502);
// Before anything, test_layer should not be dirty.
EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
@@ -649,14 +649,14 @@
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
layer_tree_host_->SetRootLayer(test_layer));
- test_layer->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f));
+ test_layer->SetNeedsDisplayRect(gfx::Rect(5, 5));
test_layer->PushPropertiesTo(impl_layer.get());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0.f, 0.f, 5.f, 5.f),
impl_layer->update_rect());
// The LayerImpl's update_rect() should be accumulated here, since we did not
// do anything to clear it.
- test_layer->SetNeedsDisplayRect(gfx::RectF(10.f, 10.f, 5.f, 5.f));
+ test_layer->SetNeedsDisplayRect(gfx::Rect(10, 10, 5, 5));
test_layer->PushPropertiesTo(impl_layer.get());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0.f, 0.f, 15.f, 15.f),
impl_layer->update_rect());
@@ -664,7 +664,7 @@
// If we do clear the LayerImpl side, then the next update_rect() should be
// fresh without accumulation.
impl_layer->ResetAllChangeTrackingForSubtree();
- test_layer->SetNeedsDisplayRect(gfx::RectF(10.f, 10.f, 5.f, 5.f));
+ test_layer->SetNeedsDisplayRect(gfx::Rect(10, 10, 5, 5));
test_layer->PushPropertiesTo(impl_layer.get());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(10.f, 10.f, 5.f, 5.f),
impl_layer->update_rect());
@@ -845,15 +845,15 @@
EXPECT_EQ(replica.get(), replica_mask->parent());
replica->SetMaskLayer(replica_mask_replacement.get());
- EXPECT_EQ(NULL, replica_mask->parent());
+ EXPECT_EQ(nullptr, replica_mask->parent());
EXPECT_EQ(replica.get(), replica_mask_replacement->parent());
child->SetMaskLayer(mask_replacement.get());
- EXPECT_EQ(NULL, mask->parent());
+ EXPECT_EQ(nullptr, mask->parent());
EXPECT_EQ(child.get(), mask_replacement->parent());
child->SetReplicaLayer(replica_replacement.get());
- EXPECT_EQ(NULL, replica->parent());
+ EXPECT_EQ(nullptr, replica->parent());
EXPECT_EQ(child.get(), replica_replacement->parent());
EXPECT_EQ(replica.get(), replica->mask_layer()->parent());
@@ -926,13 +926,15 @@
public:
LayerTreeHostFactory()
: client_(FakeLayerTreeHostClient::DIRECT_3D),
- shared_bitmap_manager_(new TestSharedBitmapManager()) {}
+ shared_bitmap_manager_(new TestSharedBitmapManager),
+ gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager) {}
scoped_ptr<LayerTreeHost> Create() {
return LayerTreeHost::CreateSingleThreaded(
&client_,
&client_,
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
LayerTreeSettings(),
base::MessageLoopProxy::current()).Pass();
}
@@ -942,13 +944,15 @@
&client_,
&client_,
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
settings,
base::MessageLoopProxy::current()).Pass();
}
private:
FakeLayerTreeHostClient client_;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
};
void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) {
@@ -978,7 +982,7 @@
child->SetReplicaLayer(replica.get());
replica->SetMaskLayer(replica_mask.get());
- AssertLayerTreeHostMatchesForSubtree(parent.get(), NULL);
+ AssertLayerTreeHostMatchesForSubtree(parent.get(), nullptr);
LayerTreeHostFactory factory;
scoped_ptr<LayerTreeHost> layer_tree_host = factory.Create();
@@ -990,9 +994,9 @@
// Clearing the root layer should also clear out the host pointers for all
// layers in the tree.
- layer_tree_host->SetRootLayer(NULL);
+ layer_tree_host->SetRootLayer(nullptr);
- AssertLayerTreeHostMatchesForSubtree(parent.get(), NULL);
+ AssertLayerTreeHostMatchesForSubtree(parent.get(), nullptr);
}
TEST(LayerLayerTreeHostTest, AddingLayerSubtree) {
@@ -1021,7 +1025,7 @@
parent->AddChild(child);
AssertLayerTreeHostMatchesForSubtree(parent.get(), layer_tree_host.get());
- layer_tree_host->SetRootLayer(NULL);
+ layer_tree_host->SetRootLayer(nullptr);
}
TEST(LayerLayerTreeHostTest, ChangeHost) {
@@ -1052,7 +1056,7 @@
AssertLayerTreeHostMatchesForSubtree(parent.get(),
second_layer_tree_host.get());
- second_layer_tree_host->SetRootLayer(NULL);
+ second_layer_tree_host->SetRootLayer(nullptr);
}
TEST(LayerLayerTreeHostTest, ChangeHostInSubtree) {
@@ -1087,8 +1091,8 @@
second_grand_child->layer_tree_host());
// Test over, cleanup time.
- first_layer_tree_host->SetRootLayer(NULL);
- second_layer_tree_host->SetRootLayer(NULL);
+ first_layer_tree_host->SetRootLayer(nullptr);
+ second_layer_tree_host->SetRootLayer(nullptr);
}
TEST(LayerLayerTreeHostTest, ReplaceMaskAndReplicaLayer) {
@@ -1113,16 +1117,16 @@
// Replacing the mask should clear out the old mask's subtree's host pointers.
parent->SetMaskLayer(mask_replacement.get());
- EXPECT_EQ(NULL, mask->layer_tree_host());
- EXPECT_EQ(NULL, mask_child->layer_tree_host());
+ EXPECT_EQ(nullptr, mask->layer_tree_host());
+ EXPECT_EQ(nullptr, mask_child->layer_tree_host());
// Same for replacing a replica layer.
parent->SetReplicaLayer(replica_replacement.get());
- EXPECT_EQ(NULL, replica->layer_tree_host());
- EXPECT_EQ(NULL, replica_child->layer_tree_host());
+ EXPECT_EQ(nullptr, replica->layer_tree_host());
+ EXPECT_EQ(nullptr, replica_child->layer_tree_host());
// Test over, cleanup time.
- layer_tree_host->SetRootLayer(NULL);
+ layer_tree_host->SetRootLayer(nullptr);
}
TEST(LayerLayerTreeHostTest, DestroyHostWithNonNullRootLayer) {
diff --git a/cc/layers/picture_image_layer_impl_unittest.cc b/cc/layers/picture_image_layer_impl_unittest.cc
index 5c2ef4e..2851392 100644
--- a/cc/layers/picture_image_layer_impl_unittest.cc
+++ b/cc/layers/picture_image_layer_impl_unittest.cc
@@ -47,7 +47,7 @@
scoped_ptr<TestablePictureImageLayerImpl> CreateLayer(int id,
WhichTree which_tree) {
- LayerTreeImpl* tree = NULL;
+ LayerTreeImpl* tree = nullptr;
switch (which_tree) {
case ACTIVE_TREE:
tree = host_impl_.active_tree();
@@ -148,9 +148,9 @@
gfx::Rect(active_layer->bounds());
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- active_layer->WillDraw(DRAW_MODE_SOFTWARE, NULL);
+ active_layer->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
active_layer->AppendQuads(render_pass.get(), Occlusion(), &data);
- active_layer->DidDraw(NULL);
+ active_layer->DidDraw(nullptr);
EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material);
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 68d24ba..7573471 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -68,12 +68,11 @@
}
}
-void PictureLayer::SetNeedsDisplayRect(const gfx::RectF& layer_rect) {
- gfx::Rect rect = gfx::ToEnclosedRect(layer_rect);
- if (!rect.IsEmpty()) {
+void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) {
+ if (!layer_rect.IsEmpty()) {
// Clamp invalidation to the layer bounds.
- rect.Intersect(gfx::Rect(bounds()));
- pending_invalidation_.Union(rect);
+ pending_invalidation_.Union(
+ gfx::IntersectRects(layer_rect, gfx::Rect(bounds())));
}
Layer::SetNeedsDisplayRect(layer_rect);
}
@@ -184,7 +183,7 @@
int height = bounds().height();
SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(width, height, NULL, 0);
+ SkCanvas* canvas = recorder.beginRecording(width, height, nullptr, 0);
client_->PaintContents(canvas,
gfx::Rect(width, height),
ContentLayerClient::GRAPHICS_CONTEXT_ENABLED);
@@ -197,7 +196,7 @@
}
void PictureLayer::ClearClient() {
- client_ = NULL;
+ client_ = nullptr;
UpdateDrawsContent(HasDrawableContent());
}
diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h
index 978ec40..e0f6d15 100644
--- a/cc/layers/picture_layer.h
+++ b/cc/layers/picture_layer.h
@@ -28,7 +28,7 @@
LayerTreeImpl* tree_impl) override;
virtual void SetLayerTreeHost(LayerTreeHost* host) override;
virtual void PushPropertiesTo(LayerImpl* layer) override;
- virtual void SetNeedsDisplayRect(const gfx::RectF& layer_rect) override;
+ virtual void SetNeedsDisplayRect(const gfx::Rect& layer_rect) override;
virtual bool Update(ResourceUpdateQueue* queue,
const OcclusionTracker<Layer>* occlusion) override;
virtual void SetIsMask(bool is_mask) override;
@@ -61,7 +61,6 @@
// Invalidation from the last time update was called.
Region pile_invalidation_;
gfx::Rect last_updated_visible_content_rect_;
- bool is_mask_;
int update_source_frame_number_;
bool can_use_lcd_text_last_frame_;
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index de176c3..d31aa8c 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -44,11 +44,20 @@
// TileManager::BinFromTilePriority).
const float kGpuSkewportTargetTimeInFrames = 0.0f;
+// Even for really wide viewports, at some point GPU raster should use
+// less than 4 tiles to fill the viewport. This is set to 256 as a
+// sane minimum for now, but we might want to tune this for low-end.
+const int kMinHeightForGpuRasteredTile = 256;
+
+// When making odd-sized tiles, round them up to increase the chances
+// of using the same tile size.
+const int kTileRoundUp = 64;
+
} // namespace
namespace cc {
-PictureLayerImpl::Pair::Pair() : active(NULL), pending(NULL) {
+PictureLayerImpl::Pair::Pair() : active(nullptr), pending(nullptr) {
}
PictureLayerImpl::Pair::Pair(PictureLayerImpl* active_layer,
@@ -61,7 +70,7 @@
PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, int id)
: LayerImpl(tree_impl, id),
- twin_layer_(NULL),
+ twin_layer_(nullptr),
pile_(PicturePileImpl::Create()),
ideal_page_scale_(0.f),
ideal_device_scale_(0.f),
@@ -75,7 +84,8 @@
raster_source_scale_is_fixed_(false),
was_screen_space_transform_animating_(false),
needs_post_commit_initialization_(true),
- should_update_tile_priorities_(false) {
+ should_update_tile_priorities_(false),
+ only_used_low_res_last_append_quads_(false) {
layer_tree_impl()->RegisterPictureLayerImpl(this);
}
@@ -98,21 +108,12 @@
DoPostCommitInitializationIfNeeded();
PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
- // We have already synced the important bits from the the active layer, and
- // we will soon swap out its tilings and use them for recycling. However,
- // there are now tiles in this layer's tilings that were unref'd and replaced
- // with new tiles (due to invalidation). This resets all active priorities on
- // the to-be-recycled tiling to ensure replaced tiles don't linger and take
- // memory (due to a stale 'active' priority).
- if (layer_impl->tilings_)
- layer_impl->tilings_->DidBecomeRecycled();
-
LayerImpl::PushPropertiesTo(base_layer);
// When the pending tree pushes to the active tree, the pending twin
// becomes recycled.
- layer_impl->twin_layer_ = NULL;
- twin_layer_ = NULL;
+ layer_impl->twin_layer_ = nullptr;
+ twin_layer_ = nullptr;
layer_impl->pile_ = pile_;
@@ -251,10 +252,10 @@
} else if (mode == ManagedTileState::DrawInfo::PICTURE_PILE_MODE) {
color = DebugColors::PictureTileBorderColor();
width = DebugColors::PictureTileBorderWidth(layer_tree_impl());
- } else if (iter->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) {
+ } else if (iter.resolution() == HIGH_RESOLUTION) {
color = DebugColors::HighResTileBorderColor();
width = DebugColors::HighResTileBorderWidth(layer_tree_impl());
- } else if (iter->priority(ACTIVE_TREE).resolution == LOW_RESOLUTION) {
+ } else if (iter.resolution() == LOW_RESOLUTION) {
color = DebugColors::LowResTileBorderColor();
width = DebugColors::LowResTileBorderWidth(layer_tree_impl());
} else if (iter->contents_scale() > max_contents_scale) {
@@ -293,6 +294,7 @@
size_t missing_tile_count = 0u;
size_t on_demand_missing_tile_count = 0u;
+ only_used_low_res_last_append_quads_ = true;
for (PictureLayerTilingSet::CoverageIterator iter(tilings_.get(),
max_contents_scale,
scaled_visible_content_rect,
@@ -411,11 +413,16 @@
continue;
}
- if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) {
+ if (iter.resolution() != HIGH_RESOLUTION) {
append_quads_data->approximated_visible_content_area +=
visible_geometry_rect.width() * visible_geometry_rect.height();
}
+ // If we have a draw quad, but it's not low resolution, then
+ // mark that we've used something other than low res to draw.
+ if (iter.resolution() != LOW_RESOLUTION)
+ only_used_low_res_last_append_quads_ = false;
+
if (seen_tilings.empty() || seen_tilings.back() != iter.CurrentTiling())
seen_tilings.push_back(iter.CurrentTiling());
}
@@ -479,9 +486,6 @@
should_update_tile_priorities_ = true;
UpdateTilePriorities(occlusion_in_content_space);
-
- if (layer_tree_impl()->IsPendingTree())
- MarkVisibleResourcesAsRequired();
}
void PictureLayerImpl::UpdateTilePriorities(
@@ -509,17 +513,26 @@
GetViewportForTilePriorityInContentSpace();
WhichTree tree =
layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE;
+ bool can_require_tiles_for_activation =
+ !only_used_low_res_last_append_quads_ || RequiresHighResToDraw() ||
+ !layer_tree_impl()->SmoothnessTakesPriority();
for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
+ PictureLayerTiling* tiling = tilings_->tiling_at(i);
+
+ tiling->set_can_require_tiles_for_activation(
+ can_require_tiles_for_activation);
+
// Pass |occlusion_in_content_space| for |occlusion_in_layer_space| since
- // they are the same space in picture lbayer, as contents scale is always 1.
- tilings_->tiling_at(i)->UpdateTilePriorities(tree,
- viewport_rect_in_layer_space,
- ideal_contents_scale_,
- current_frame_time_in_seconds,
- occlusion_in_content_space);
+ // they are the same space in picture layer, as contents scale is always 1.
+ tiling->ComputeTilePriorityRects(tree,
+ viewport_rect_in_layer_space,
+ ideal_contents_scale_,
+ current_frame_time_in_seconds,
+ occlusion_in_content_space);
}
// Tile priorities were modified.
+ // TODO(vmpstr): See if this can be removed in favour of calling it from LTHI
layer_tree_impl()->DidModifyTilePriorities();
}
@@ -561,7 +574,7 @@
void PictureLayerImpl::DidBecomeActive() {
LayerImpl::DidBecomeActive();
- tilings_->DidBecomeActive();
+ // TODO(vmpstr): See if this can be removed in favour of calling it from LTHI
layer_tree_impl()->DidModifyTilePriorities();
}
@@ -623,7 +636,7 @@
const PictureLayerTiling* PictureLayerImpl::GetTwinTiling(
const PictureLayerTiling* tiling) const {
if (!twin_layer_)
- return NULL;
+ return nullptr;
return twin_layer_->tilings_->TilingAtScale(tiling->contents_scale());
}
@@ -631,7 +644,7 @@
const PictureLayerTiling* tiling) {
PictureLayerImpl* recycled_twin = GetRecycledTwinLayer();
if (!recycled_twin || !recycled_twin->tilings_)
- return NULL;
+ return nullptr;
return recycled_twin->tilings_->TilingAtScale(tiling->contents_scale());
}
@@ -655,6 +668,10 @@
.skewport_extrapolation_limit_in_content_pixels;
}
+bool PictureLayerImpl::RequiresHighResToDraw() const {
+ return layer_tree_impl()->RequiresHighResToDraw();
+}
+
gfx::Size PictureLayerImpl::CalculateTileSize(
const gfx::Size& content_bounds) const {
int max_texture_size =
@@ -669,48 +686,67 @@
return content_bounds;
}
- gfx::Size default_tile_size = layer_tree_impl()->settings().default_tile_size;
+ int default_tile_width = 0;
+ int default_tile_height = 0;
if (layer_tree_impl()->use_gpu_rasterization()) {
- // TODO(ernstm) crbug.com/365877: We need a unified way to override the
- // default-tile-size.
- default_tile_size =
- gfx::Size(layer_tree_impl()->device_viewport_size().width(),
- layer_tree_impl()->device_viewport_size().height() / 4);
- }
- default_tile_size.SetToMin(gfx::Size(max_texture_size, max_texture_size));
+ // For GPU rasterization, we pick an ideal tile size using the viewport
+ // so we don't need any settings. The current approach uses 4 tiles
+ // to cover the viewport vertically.
+ int viewport_width = layer_tree_impl()->device_viewport_size().width();
+ int viewport_height = layer_tree_impl()->device_viewport_size().height();
+ default_tile_width = viewport_width;
+ // Also, increase the height proportionally as the width decreases, and
+ // pad by our border texels to make the tiles exactly match the viewport.
+ int divisor = 4;
+ if (content_bounds.width() <= viewport_width / 2)
+ divisor = 2;
+ if (content_bounds.width() <= viewport_width / 4)
+ divisor = 1;
+ default_tile_height = RoundUp(viewport_height, divisor) / divisor;
+ default_tile_height += 2 * PictureLayerTiling::kBorderTexels;
+ default_tile_height =
+ std::max(default_tile_height, kMinHeightForGpuRasteredTile);
+ } else {
+ // For CPU rasterization we use tile-size settings.
+ const LayerTreeSettings& settings = layer_tree_impl()->settings();
+ int max_untiled_content_width = settings.max_untiled_layer_size.width();
+ int max_untiled_content_height = settings.max_untiled_layer_size.height();
+ default_tile_width = settings.default_tile_size.width();
+ default_tile_height = settings.default_tile_size.height();
- gfx::Size max_untiled_content_size =
- layer_tree_impl()->settings().max_untiled_layer_size;
- max_untiled_content_size.SetToMin(
- gfx::Size(max_texture_size, max_texture_size));
-
- bool any_dimension_too_large =
- content_bounds.width() > max_untiled_content_size.width() ||
- content_bounds.height() > max_untiled_content_size.height();
-
- bool any_dimension_one_tile =
- content_bounds.width() <= default_tile_size.width() ||
- content_bounds.height() <= default_tile_size.height();
-
- // If long and skinny, tile at the max untiled content size, and clamp
- // the smaller dimension to the content size, e.g. 1000x12 layer with
- // 500x500 max untiled size would get 500x12 tiles. Also do this
- // if the layer is small.
- if (any_dimension_one_tile || !any_dimension_too_large) {
- int width = std::min(
- std::max(max_untiled_content_size.width(), default_tile_size.width()),
- content_bounds.width());
- int height = std::min(
- std::max(max_untiled_content_size.height(), default_tile_size.height()),
- content_bounds.height());
- // Round up to the closest multiple of 64. This improves recycling and
- // avoids odd texture sizes.
- width = RoundUp(width, 64);
- height = RoundUp(height, 64);
- return gfx::Size(width, height);
+ // If the content width is small, increase tile size vertically.
+ // If the content height is small, increase tile size horizontally.
+ // If both are less than the untiled-size, use a single tile.
+ if (content_bounds.width() < default_tile_width)
+ default_tile_height = max_untiled_content_height;
+ if (content_bounds.height() < default_tile_height)
+ default_tile_width = max_untiled_content_width;
+ if (content_bounds.width() < max_untiled_content_width &&
+ content_bounds.height() < max_untiled_content_height) {
+ default_tile_height = max_untiled_content_height;
+ default_tile_width = max_untiled_content_width;
+ }
}
- return default_tile_size;
+ int tile_width = default_tile_width;
+ int tile_height = default_tile_height;
+
+ // Clamp the tile width/height to the content width/height to save space.
+ if (content_bounds.width() < default_tile_width) {
+ tile_width = std::min(tile_width, content_bounds.width());
+ tile_width = RoundUp(tile_width, kTileRoundUp);
+ tile_width = std::min(tile_width, default_tile_width);
+ }
+ if (content_bounds.height() < default_tile_height) {
+ tile_height = std::min(tile_height, content_bounds.height());
+ tile_height = RoundUp(tile_height, kTileRoundUp);
+ tile_height = std::min(tile_height, default_tile_height);
+ }
+
+ // Under no circumstance should we be larger than the max texture size.
+ tile_width = std::min(tile_width, max_texture_size);
+ tile_height = std::min(tile_height, max_texture_size);
+ return gfx::Size(tile_width, tile_height);
}
void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) {
@@ -792,159 +828,6 @@
return draw_info.get_resource_id();
}
-void PictureLayerImpl::MarkVisibleResourcesAsRequired() const {
- DCHECK(layer_tree_impl()->IsPendingTree());
- DCHECK(ideal_contents_scale_);
- DCHECK_GT(tilings_->num_tilings(), 0u);
-
- // The goal of this function is to find the minimum set of tiles that need to
- // be ready to draw in order to activate without flashing content from a
- // higher res on the active tree to a lower res on the pending tree.
-
- // First, early out for layers with no visible content.
- if (visible_rect_for_tile_priority_.IsEmpty())
- return;
-
- // Only mark tiles inside the viewport for tile priority as required for
- // activation. This viewport is normally the same as the draw viewport but
- // can be independently overridden by embedders like Android WebView with
- // SetExternalDrawConstraints.
- gfx::Rect rect = GetViewportForTilePriorityInContentSpace();
- rect.Intersect(visible_rect_for_tile_priority_);
-
- float min_acceptable_scale =
- std::min(raster_contents_scale_, ideal_contents_scale_);
-
- if (PictureLayerImpl* twin = twin_layer_) {
- float twin_min_acceptable_scale =
- std::min(twin->ideal_contents_scale_, twin->raster_contents_scale_);
- // Ignore 0 scale in case CalculateContentsScale() has never been
- // called for active twin.
- if (twin_min_acceptable_scale != 0.0f) {
- min_acceptable_scale =
- std::min(min_acceptable_scale, twin_min_acceptable_scale);
- }
- }
-
- PictureLayerTiling* high_res = NULL;
- PictureLayerTiling* low_res = NULL;
-
- // First pass: ready to draw tiles in acceptable but non-ideal tilings are
- // marked as required for activation so that their textures are not thrown
- // away; any non-ready tiles are not marked as required.
- Region missing_region = rect;
- for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
- PictureLayerTiling* tiling = tilings_->tiling_at(i);
- DCHECK(tiling->has_ever_been_updated());
-
- if (tiling->resolution() == LOW_RESOLUTION) {
- DCHECK(!low_res) << "There can only be one low res tiling";
- low_res = tiling;
- }
- if (tiling->contents_scale() < min_acceptable_scale)
- continue;
- if (tiling->resolution() == HIGH_RESOLUTION) {
- DCHECK(!high_res) << "There can only be one high res tiling";
- high_res = tiling;
- continue;
- }
- for (PictureLayerTiling::CoverageIterator iter(tiling, 1.f, rect); iter;
- ++iter) {
- if (!*iter || !iter->IsReadyToDraw())
- continue;
-
- missing_region.Subtract(iter.geometry_rect());
- iter->MarkRequiredForActivation();
- }
- }
- DCHECK(high_res) << "There must be one high res tiling";
-
- // If these pointers are null (because no twin, no matching tiling, or the
- // simpification just below), then high res tiles will be required to fill any
- // holes left by the first pass above. If the pointers are valid, then this
- // layer is allowed to skip any tiles that are not ready on its twin.
- const PictureLayerTiling* twin_high_res = NULL;
- const PictureLayerTiling* twin_low_res = NULL;
-
- if (twin_layer_) {
- // As a simplification, only allow activating to skip twin tiles that the
- // active layer is also missing when both this layer and its twin have
- // "simple" sets of tilings: only 2 tilings (high and low) or only 1 high
- // res tiling. This avoids having to iterate/track coverage of non-ideal
- // tilings during the last draw call on the active layer.
- if (tilings_->num_tilings() <= 2 &&
- twin_layer_->tilings_->num_tilings() <= tilings_->num_tilings()) {
- twin_low_res = low_res ? GetTwinTiling(low_res) : NULL;
- twin_high_res = high_res ? GetTwinTiling(high_res) : NULL;
- }
-
- // If this layer and its twin have different transforms, then don't compare
- // them and only allow activating to high res tiles, since tiles on each
- // layer will be in different places on screen.
- if (twin_layer_->layer_tree_impl()->RequiresHighResToDraw() ||
- bounds() != twin_layer_->bounds() ||
- draw_properties().screen_space_transform !=
- twin_layer_->draw_properties().screen_space_transform) {
- twin_high_res = NULL;
- twin_low_res = NULL;
- }
- }
-
- // As a second pass, mark as required any visible high res tiles not filled in
- // by acceptable non-ideal tiles from the first pass.
- if (MarkVisibleTilesAsRequired(
- high_res, twin_high_res, rect, missing_region)) {
- // As an optional third pass, if a high res tile was skipped because its
- // twin was also missing, then fall back to mark low res tiles as required
- // in case the active twin is substituting those for missing high res
- // content. Only suitable, when low res is enabled.
- if (low_res) {
- MarkVisibleTilesAsRequired(low_res, twin_low_res, rect, missing_region);
- }
- }
-}
-
-bool PictureLayerImpl::MarkVisibleTilesAsRequired(
- PictureLayerTiling* tiling,
- const PictureLayerTiling* optional_twin_tiling,
- const gfx::Rect& rect,
- const Region& missing_region) const {
- bool twin_had_missing_tile = false;
- for (PictureLayerTiling::CoverageIterator iter(tiling, 1.f, rect); iter;
- ++iter) {
- Tile* tile = *iter;
- // A null tile (i.e. missing recording) can just be skipped.
- if (!tile)
- continue;
-
- // If the tile is occluded, don't mark it as required for activation.
- if (tile->is_occluded(PENDING_TREE))
- continue;
-
- // If the missing region doesn't cover it, this tile is fully
- // covered by acceptable tiles at other scales.
- if (!missing_region.Intersects(iter.geometry_rect()))
- continue;
-
- // If the twin tile doesn't exist (i.e. missing recording or so far away
- // that it is outside the visible tile rect) or this tile is shared between
- // with the twin, then this tile isn't required to prevent flashing.
- if (optional_twin_tiling) {
- Tile* twin_tile = optional_twin_tiling->TileAt(iter.i(), iter.j());
- if (!twin_tile || twin_tile == tile) {
- // However if the shared tile is being used on the active tree, then
- // there's no missing content in this place, and low res is not needed.
- if (!twin_tile || !twin_tile->IsReadyToDraw())
- twin_had_missing_tile = true;
- continue;
- }
- }
-
- tile->MarkRequiredForActivation();
- }
- return twin_had_missing_tile;
-}
-
void PictureLayerImpl::DoPostCommitInitialization() {
DCHECK(needs_post_commit_initialization_);
DCHECK(layer_tree_impl()->IsPendingTree());
@@ -1015,18 +898,15 @@
} // namespace
void PictureLayerImpl::AddTilingsForRasterScale() {
- PictureLayerTiling* high_res = NULL;
- PictureLayerTiling* low_res = NULL;
+ PictureLayerTiling* high_res = nullptr;
+ PictureLayerTiling* low_res = nullptr;
- PictureLayerTiling* previous_low_res = NULL;
for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
PictureLayerTiling* tiling = tilings_->tiling_at(i);
if (tiling->contents_scale() == raster_contents_scale_)
high_res = tiling;
if (tiling->contents_scale() == low_res_raster_contents_scale_)
low_res = tiling;
- if (tiling->resolution() == LOW_RESOLUTION)
- previous_low_res = tiling;
// Reset all tilings to non-ideal until the end of this function.
tiling->set_resolution(NON_IDEAL_RESOLUTION);
@@ -1048,8 +928,6 @@
low_res = AddTiling(low_res_raster_contents_scale_);
// Set low-res if we have one.
- if (!low_res)
- low_res = previous_low_res;
if (low_res && low_res != high_res)
low_res->set_resolution(LOW_RESOLUTION);
@@ -1165,27 +1043,33 @@
// If we're not re-rasterizing during animation, rasterize at the maximum
// scale that will occur during the animation, if the maximum scale is
- // known. However, to avoid excessive memory use, don't rasterize at a scale
- // at which this layer would become larger than the viewport.
+ // known. However we want to avoid excessive memory use. If the scale is
+ // smaller than what we would choose otherwise, then it's always better off
+ // for us memory-wise. But otherwise, we don't choose a scale at which this
+ // layer's rastered content would become larger than the viewport.
if (draw_properties().screen_space_transform_is_animating &&
!ShouldAdjustRasterScaleDuringScaleAnimations()) {
bool can_raster_at_maximum_scale = false;
- if (draw_properties().maximum_animation_contents_scale > 0.f) {
- gfx::Size bounds_at_maximum_scale = gfx::ToCeiledSize(gfx::ScaleSize(
- bounds(), draw_properties().maximum_animation_contents_scale));
+ // TODO(ajuma): If we need to deal with scale-down animations starting right
+ // as a layer gets promoted, then we'd want to have the
+ // |starting_animation_contents_scale| passed in here as a separate draw
+ // property so we could try use that when the max is too large.
+ // See crbug.com/422341.
+ float maximum_scale = draw_properties().maximum_animation_contents_scale;
+ if (maximum_scale) {
+ gfx::Size bounds_at_maximum_scale =
+ gfx::ToCeiledSize(gfx::ScaleSize(bounds(), maximum_scale));
if (bounds_at_maximum_scale.GetArea() <=
layer_tree_impl()->device_viewport_size().GetArea())
can_raster_at_maximum_scale = true;
}
- if (can_raster_at_maximum_scale) {
- raster_contents_scale_ =
- std::max(raster_contents_scale_,
- draw_properties().maximum_animation_contents_scale);
- } else {
- raster_contents_scale_ =
- std::max(raster_contents_scale_,
- 1.f * ideal_page_scale_ * ideal_device_scale_);
- }
+ // Use the computed scales for the raster scale directly, do not try to use
+ // the ideal scale here. The current ideal scale may be way too large in the
+ // case of an animation with scale, and will be constantly changing.
+ if (can_raster_at_maximum_scale)
+ raster_contents_scale_ = maximum_scale;
+ else
+ raster_contents_scale_ = 1.f * ideal_page_scale_ * ideal_device_scale_;
}
// If this layer would create zero or one tiles at this content scale,
@@ -1342,8 +1226,7 @@
if (tilings_->num_tilings() == 0)
return;
- // MarkVisibleResourcesAsRequired depends on having exactly 1 high res
- // tiling to mark its tiles as being required for activation.
+ // We should only have one high res tiling.
DCHECK_EQ(1, tilings_->NumHighResTilings());
#endif
}
@@ -1504,10 +1387,16 @@
++iter) {
const Tile* tile = *iter;
// A null tile (i.e. missing recording) can just be skipped.
+ // TODO(vmpstr): Verify this is true if we create tiles in raster
+ // iterators.
if (!tile)
continue;
- if (tile->required_for_activation() && !tile->IsReadyToDraw())
+ // We can't check tile->required_for_activation, because that value might
+ // be out of date. It is updated in the raster/eviction iterators.
+ // TODO(vmpstr): Remove the comment once you can't access this information
+ // from the tile.
+ if (tiling->IsTileRequiredForActivation(tile) && !tile->IsReadyToDraw())
return false;
}
}
@@ -1516,7 +1405,7 @@
}
PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator()
- : layer_(NULL), current_stage_(arraysize(stages_)) {
+ : layer_(nullptr), current_stage_(arraysize(stages_)) {
}
PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator(
@@ -1538,19 +1427,17 @@
return;
}
- WhichTree tree = layer_->GetTree();
-
// Find high and low res tilings and initialize the iterators.
for (size_t i = 0; i < layer_->tilings_->num_tilings(); ++i) {
PictureLayerTiling* tiling = layer_->tilings_->tiling_at(i);
if (tiling->resolution() == HIGH_RESOLUTION) {
iterators_[HIGH_RES] =
- PictureLayerTiling::TilingRasterTileIterator(tiling, tree);
+ PictureLayerTiling::TilingRasterTileIterator(tiling);
}
if (tiling->resolution() == LOW_RESOLUTION) {
iterators_[LOW_RES] =
- PictureLayerTiling::TilingRasterTileIterator(tiling, tree);
+ PictureLayerTiling::TilingRasterTileIterator(tiling);
}
}
@@ -1637,7 +1524,7 @@
}
PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator()
- : layer_(NULL),
+ : layer_(nullptr),
tree_priority_(SAME_PRIORITY_FOR_BOTH_TREES),
current_category_(PictureLayerTiling::EVENTUALLY),
current_tiling_range_type_(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES),
diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h
index 98b0a6e..2fb877e 100644
--- a/cc/layers/picture_layer_impl.h
+++ b/cc/layers/picture_layer_impl.h
@@ -133,6 +133,7 @@
virtual float GetSkewportTargetTimeInSeconds() const override;
virtual int GetSkewportExtrapolationLimitInContentPixels() const override;
virtual WhichTree GetTree() const override;
+ virtual bool RequiresHighResToDraw() const override;
// PushPropertiesTo active tree => pending tree.
void SyncTiling(const PictureLayerTiling* tiling);
@@ -168,12 +169,6 @@
float MinimumContentsScale() const;
float SnappedContentsScale(float new_contents_scale);
void ResetRasterScale();
- void MarkVisibleResourcesAsRequired() const;
- bool MarkVisibleTilesAsRequired(
- PictureLayerTiling* tiling,
- const PictureLayerTiling* optional_twin_tiling,
- const gfx::Rect& rect,
- const Region& missing_region) const;
gfx::Rect GetViewportForTilePriorityInContentSpace() const;
PictureLayerImpl* GetRecycledTwinLayer();
@@ -221,6 +216,7 @@
// A sanity state check to make sure UpdateTilePriorities only gets called
// after a CalculateContentsScale/ManageTilings.
bool should_update_tile_priorities_;
+ bool only_used_low_res_last_append_quads_;
// Any draw properties derived from |transform|, |viewport|, and |clip|
// parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid
diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc
index 7d87424..aeea2bb 100644
--- a/cc/layers/picture_layer_impl_perftest.cc
+++ b/cc/layers/picture_layer_impl_perftest.cc
@@ -80,7 +80,7 @@
PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false);
while (count--) {
ASSERT_TRUE(it) << "count: " << count;
- ASSERT_TRUE(*it != NULL) << "count: " << count;
+ ASSERT_TRUE(*it != nullptr) << "count: " << count;
++it;
}
timer_.NextLap();
@@ -133,7 +133,7 @@
pending_layer_, priorities[priority_count]);
while (count--) {
ASSERT_TRUE(it) << "count: " << count;
- ASSERT_TRUE(*it != NULL) << "count: " << count;
+ ASSERT_TRUE(*it != nullptr) << "count: " << count;
++it;
}
priority_count = (priority_count + 1) % arraysize(priorities);
@@ -237,7 +237,7 @@
AddTiling(1.0f, pending_layer_, &all_tiles);
AddTiling(2.0f, pending_layer_, &all_tiles);
- ASSERT_TRUE(host_impl_.tile_manager() != NULL);
+ ASSERT_TRUE(host_impl_.tile_manager() != nullptr);
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles);
RunEvictionIteratorConstructAndIterateTest(
@@ -262,7 +262,7 @@
AddTiling(1.0f, pending_layer_, &all_tiles);
AddTiling(2.0f, pending_layer_, &all_tiles);
- ASSERT_TRUE(host_impl_.tile_manager() != NULL);
+ ASSERT_TRUE(host_impl_.tile_manager() != nullptr);
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles);
RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 72794b3..135695b 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -59,9 +59,9 @@
: proxy_(base::MessageLoopProxy::current()),
host_impl_(LowResTilingsSettings(), &proxy_, &shared_bitmap_manager_),
id_(7),
- pending_layer_(NULL),
- old_pending_layer_(NULL),
- active_layer_(NULL) {}
+ pending_layer_(nullptr),
+ old_pending_layer_(nullptr),
+ active_layer_(nullptr) {}
explicit PictureLayerImplTest(const LayerTreeSettings& settings)
: proxy_(base::MessageLoopProxy::current()),
@@ -95,7 +95,7 @@
CHECK(!host_impl_.pending_tree());
CHECK(host_impl_.recycle_tree());
old_pending_layer_ = pending_layer_;
- pending_layer_ = NULL;
+ pending_layer_ = nullptr;
active_layer_ = static_cast<FakePictureLayerImpl*>(
host_impl_.active_tree()->LayerById(id_));
}
@@ -258,7 +258,7 @@
for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) {
MockCanvas mock_canvas(1000, 1000);
active_pile->RasterDirect(
- &mock_canvas, (*tile_iter)->content_rect(), 1.0f, NULL);
+ &mock_canvas, (*tile_iter)->content_rect(), 1.0f, nullptr);
// This test verifies that when drawing the contents of a specific tile
// at content scale 1.0, the playback canvas never receives content from
@@ -1092,9 +1092,11 @@
EXPECT_BOTH_EQ(LowResTiling()->contents_scale(), low_res_factor);
EXPECT_BOTH_EQ(num_tilings(), 2u);
- // Page scale animation, new high res, but not new low res because animating.
+ // Page scale animation, new high res, but no low res. We still have
+ // a tiling at the previous scale, it's just not marked as low res.
contents_scale = 2.f;
page_scale = 2.f;
+ maximum_animation_scale = 2.f;
animating_transform = true;
SetContentsScaleOnBothLayers(contents_scale,
device_scale,
@@ -1102,7 +1104,8 @@
maximum_animation_scale,
animating_transform);
EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 2.f);
- EXPECT_BOTH_EQ(LowResTiling()->contents_scale(), low_res_factor);
+ EXPECT_FALSE(active_layer_->LowResTiling());
+ EXPECT_FALSE(pending_layer_->LowResTiling());
EXPECT_BOTH_EQ(num_tilings(), 3u);
// Stop animating, new low res gets created for final page scale.
@@ -1381,36 +1384,15 @@
AddDefaultTilingsWithInvalidation(invalidation);
AppendQuadsData data;
- active_layer_->WillDraw(DRAW_MODE_RESOURCELESS_SOFTWARE, NULL);
+ active_layer_->WillDraw(DRAW_MODE_RESOURCELESS_SOFTWARE, nullptr);
active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
- active_layer_->DidDraw(NULL);
+ active_layer_->DidDraw(nullptr);
ASSERT_EQ(1U, render_pass->quad_list.size());
EXPECT_EQ(DrawQuad::PICTURE_CONTENT,
render_pass->quad_list.front()->material);
}
-TEST_F(PictureLayerImplTest, MarkRequiredNullTiles) {
- gfx::Size tile_size(100, 100);
- gfx::Size layer_bounds(1000, 1000);
-
- scoped_refptr<FakePicturePileImpl> pending_pile =
- FakePicturePileImpl::CreateEmptyPile(tile_size, layer_bounds);
- // Layers with entirely empty piles can't get tilings.
- pending_pile->AddRecordingAt(0, 0);
-
- SetupPendingTree(pending_pile);
-
- ASSERT_TRUE(pending_layer_->CanHaveTilings());
- pending_layer_->AddTiling(1.0f);
- pending_layer_->AddTiling(2.0f);
-
- // It should be safe to call this (and MarkVisibleResourcesAsRequired)
- // on a layer with no recordings.
- host_impl_.pending_tree()->UpdateDrawProperties();
- pending_layer_->MarkVisibleResourcesAsRequired();
-}
-
TEST_F(PictureLayerImplTest, MarkRequiredOffscreenTiles) {
gfx::Size tile_size(100, 100);
gfx::Size layer_bounds(200, 200);
@@ -1434,43 +1416,22 @@
ASSERT_TRUE(pending_layer_->CanHaveTilings());
PictureLayerTiling* tiling = pending_layer_->AddTiling(1.f);
host_impl_.pending_tree()->UpdateDrawProperties();
- EXPECT_EQ(tiling->resolution(), HIGH_RESOLUTION);
EXPECT_EQ(viewport, pending_layer_->visible_rect_for_tile_priority());
- // Fake set priorities.
- for (PictureLayerTiling::CoverageIterator iter(
- tiling, pending_layer_->contents_scale_x(), gfx::Rect(layer_bounds));
- iter;
- ++iter) {
- if (!*iter)
- continue;
- Tile* tile = *iter;
- TilePriority priority;
- priority.resolution = HIGH_RESOLUTION;
- gfx::Rect tile_bounds = iter.geometry_rect();
- if (pending_layer_->visible_rect_for_tile_priority().Intersects(
- tile_bounds)) {
- priority.priority_bin = TilePriority::NOW;
- priority.distance_to_visible = 0.f;
- } else {
- priority.priority_bin = TilePriority::SOON;
- priority.distance_to_visible = 1.f;
- }
- tile->SetPriority(PENDING_TREE, priority);
- }
-
- pending_layer_->MarkVisibleResourcesAsRequired();
+ base::TimeTicks time_ticks;
+ time_ticks += base::TimeDelta::FromMilliseconds(1);
+ host_impl_.SetCurrentBeginFrameArgs(
+ CreateBeginFrameArgsForTesting(time_ticks));
+ pending_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
+ EXPECT_EQ(HIGH_RESOLUTION, tiling->resolution());
int num_visible = 0;
int num_offscreen = 0;
- for (PictureLayerTiling::CoverageIterator iter(
- tiling, pending_layer_->contents_scale_x(), gfx::Rect(layer_bounds));
- iter;
+ for (PictureLayerTiling::TilingRasterTileIterator iter(tiling); iter;
++iter) {
- if (!*iter)
- continue;
const Tile* tile = *iter;
+ DCHECK(tile);
if (tile->priority(PENDING_TREE).distance_to_visible == 0.f) {
EXPECT_TRUE(tile->required_for_activation());
num_visible++;
@@ -1527,8 +1488,6 @@
CreateBeginFrameArgsForTesting(time_ticks));
pending_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
- pending_layer_->MarkVisibleResourcesAsRequired();
-
// Intersect the two rects. Any tile outside should not be required for
// activation.
gfx::Rect viewport_for_tile_priority =
@@ -1565,13 +1524,14 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
+ active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
- active_layer_->DidDraw(NULL);
+ active_layer_->DidDraw(nullptr);
// All tiles in activation rect is ready to draw.
EXPECT_EQ(0u, data.num_missing_tiles);
EXPECT_EQ(0u, data.num_incomplete_tiles);
+ EXPECT_FALSE(active_layer_->only_used_low_res_last_append_quads());
}
TEST_F(PictureLayerImplTest, HighResTileIsComplete) {
@@ -1599,14 +1559,80 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
+ active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
- active_layer_->DidDraw(NULL);
+ active_layer_->DidDraw(nullptr);
// All high res tiles drew, nothing was incomplete.
EXPECT_EQ(9u, render_pass->quad_list.size());
EXPECT_EQ(0u, data.num_missing_tiles);
EXPECT_EQ(0u, data.num_incomplete_tiles);
+ EXPECT_FALSE(active_layer_->only_used_low_res_last_append_quads());
+}
+
+TEST_F(PictureLayerImplTest, HighResTileIsIncomplete) {
+ base::TimeTicks time_ticks;
+ time_ticks += base::TimeDelta::FromMilliseconds(1);
+ host_impl_.SetCurrentBeginFrameArgs(
+ CreateBeginFrameArgsForTesting(time_ticks));
+
+ gfx::Size tile_size(100, 100);
+ gfx::Size layer_bounds(200, 200);
+
+ host_impl_.SetViewportSize(layer_bounds);
+
+ scoped_refptr<FakePicturePileImpl> pending_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+ SetupPendingTree(pending_pile);
+ ActivateTree();
+
+ active_layer_->set_fixed_tile_size(tile_size);
+ host_impl_.active_tree()->UpdateDrawProperties();
+
+ scoped_ptr<RenderPass> render_pass = RenderPass::Create();
+ AppendQuadsData data;
+ active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
+ active_layer_->DidDraw(nullptr);
+
+ EXPECT_EQ(1u, render_pass->quad_list.size());
+ EXPECT_EQ(1u, data.num_missing_tiles);
+ EXPECT_EQ(0u, data.num_incomplete_tiles);
+ EXPECT_TRUE(active_layer_->only_used_low_res_last_append_quads());
+}
+
+TEST_F(PictureLayerImplTest, HighResTileIsIncompleteLowResComplete) {
+ base::TimeTicks time_ticks;
+ time_ticks += base::TimeDelta::FromMilliseconds(1);
+ host_impl_.SetCurrentBeginFrameArgs(
+ CreateBeginFrameArgsForTesting(time_ticks));
+
+ gfx::Size tile_size(100, 100);
+ gfx::Size layer_bounds(200, 200);
+
+ host_impl_.SetViewportSize(layer_bounds);
+
+ scoped_refptr<FakePicturePileImpl> pending_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+ SetupPendingTree(pending_pile);
+ ActivateTree();
+
+ active_layer_->set_fixed_tile_size(tile_size);
+ host_impl_.active_tree()->UpdateDrawProperties();
+ std::vector<Tile*> low_tiles =
+ active_layer_->tilings()->tiling_at(1)->AllTilesForTesting();
+ host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(low_tiles);
+
+ scoped_ptr<RenderPass> render_pass = RenderPass::Create();
+ AppendQuadsData data;
+ active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
+ active_layer_->DidDraw(nullptr);
+
+ EXPECT_EQ(1u, render_pass->quad_list.size());
+ EXPECT_EQ(0u, data.num_missing_tiles);
+ EXPECT_EQ(1u, data.num_incomplete_tiles);
+ EXPECT_TRUE(active_layer_->only_used_low_res_last_append_quads());
}
TEST_F(PictureLayerImplTest, LowResTileIsIncomplete) {
@@ -1640,14 +1666,15 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
+ active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
- active_layer_->DidDraw(NULL);
+ active_layer_->DidDraw(nullptr);
// The missing high res tile was replaced by a low res tile.
EXPECT_EQ(9u, render_pass->quad_list.size());
EXPECT_EQ(0u, data.num_missing_tiles);
EXPECT_EQ(1u, data.num_incomplete_tiles);
+ EXPECT_FALSE(active_layer_->only_used_low_res_last_append_quads());
}
TEST_F(PictureLayerImplTest,
@@ -1701,9 +1728,9 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
+ active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
- active_layer_->DidDraw(NULL);
+ active_layer_->DidDraw(nullptr);
// All high res tiles drew, and the one ideal res tile drew.
ASSERT_GT(render_pass->quad_list.size(), 9u);
@@ -1717,6 +1744,7 @@
// Neither the high res nor the ideal tiles were considered as incomplete.
EXPECT_EQ(0u, data.num_missing_tiles);
EXPECT_EQ(0u, data.num_incomplete_tiles);
+ EXPECT_FALSE(active_layer_->only_used_low_res_last_append_quads());
}
TEST_F(PictureLayerImplTest, HighResRequiredWhenUnsharedActiveAllReady) {
@@ -1733,7 +1761,9 @@
// No shared tiles and all active tiles ready, so pending can only
// activate with all high res tiles.
- pending_layer_->MarkVisibleResourcesAsRequired();
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
AssertAllTilesRequired(pending_layer_->HighResTiling());
AssertNoTilesRequired(pending_layer_->LowResTiling());
}
@@ -1753,13 +1783,16 @@
// When high res are required, even if the active tree is not ready,
// the high res tiles must be ready.
- host_impl_.active_tree()->SetRequiresHighResToDraw();
- pending_layer_->MarkVisibleResourcesAsRequired();
+ host_impl_.SetRequiresHighResToDraw();
+
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
AssertAllTilesRequired(pending_layer_->HighResTiling());
AssertNoTilesRequired(pending_layer_->LowResTiling());
}
-TEST_F(PictureLayerImplTest, NothingRequiredIfAllHighResTilesShared) {
+TEST_F(PictureLayerImplTest, AllHighResRequiredEvenIfShared) {
gfx::Size layer_bounds(400, 400);
gfx::Size tile_size(100, 100);
SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size);
@@ -1771,8 +1804,32 @@
EXPECT_FALSE(some_active_tile->IsReadyToDraw());
// All tiles shared (no invalidation), so even though the active tree's
- // tiles aren't ready, there is nothing required.
- pending_layer_->MarkVisibleResourcesAsRequired();
+ // tiles aren't ready, the high res tiles are required for activation.
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
+ AssertAllTilesRequired(pending_layer_->HighResTiling());
+ AssertNoTilesRequired(pending_layer_->LowResTiling());
+}
+
+TEST_F(PictureLayerImplTest, DisallowRequiredForActivation) {
+ gfx::Size layer_bounds(400, 400);
+ gfx::Size tile_size(100, 100);
+ SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size);
+
+ CreateHighLowResAndSetAllTilesVisible();
+
+ Tile* some_active_tile =
+ active_layer_->HighResTiling()->AllTilesForTesting()[0];
+ EXPECT_FALSE(some_active_tile->IsReadyToDraw());
+
+ pending_layer_->HighResTiling()->set_can_require_tiles_for_activation(false);
+ pending_layer_->LowResTiling()->set_can_require_tiles_for_activation(false);
+
+ // If we disallow required for activation, no tiles can be required.
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
AssertNoTilesRequired(pending_layer_->HighResTiling());
AssertNoTilesRequired(pending_layer_->LowResTiling());
}
@@ -1802,7 +1859,9 @@
// Since the active layer has no tiles at all, the pending layer doesn't
// need content in order to activate.
- pending_layer_->MarkVisibleResourcesAsRequired();
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
AssertNoTilesRequired(pending_layer_->HighResTiling());
AssertNoTilesRequired(pending_layer_->LowResTiling());
}
@@ -1827,7 +1886,9 @@
// to the case where there is no active layer, to avoid flashing content.
// This can happen if a layer exists for a while and switches from
// not being able to have content to having content.
- pending_layer_->MarkVisibleResourcesAsRequired();
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
AssertAllTilesRequired(pending_layer_->HighResTiling());
AssertNoTilesRequired(pending_layer_->LowResTiling());
}
@@ -1841,12 +1902,19 @@
pending_layer_->SetBounds(pending_layer_bounds);
CreateHighLowResAndSetAllTilesVisible();
+ // TODO(vmpstr): This is confusing. Rework the test to create different bounds
+ // on different trees instead of fudging tilings.
+ pending_layer_->HighResTiling()->ComputeTilePriorityRects(
+ PENDING_TREE, gfx::Rect(pending_layer_bounds), 1.f, 1.f, Occlusion());
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
active_layer_->SetAllTilesReady();
// Since the active layer has different bounds, the pending layer needs all
// high res tiles in order to activate.
- pending_layer_->MarkVisibleResourcesAsRequired();
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
AssertAllTilesRequired(pending_layer_->HighResTiling());
AssertNoTilesRequired(pending_layer_->LowResTiling());
}
@@ -2104,8 +2172,8 @@
// other words we want the pending layer to sync from the active layer.
pending_layer_->SetBounds(gfx::Size(1, 1));
pending_layer_->SetNeedsPostCommitInitialization();
- pending_layer_->set_twin_layer(NULL);
- active_layer_->set_twin_layer(NULL);
+ pending_layer_->set_twin_layer(nullptr);
+ active_layer_->set_twin_layer(nullptr);
EXPECT_TRUE(pending_layer_->needs_post_commit_initialization());
// Update the draw properties: sync from active tree should happen here.
@@ -2315,7 +2383,7 @@
EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 4.f);
// When animating with an unknown maximum animation scale factor, a new
- // high-res tiling should be created at the animation's initial scale.
+ // high-res tiling should be created at a source scale of 1.
animating_transform = true;
contents_scale = 2.f;
maximum_animation_scale = 0.f;
@@ -2325,7 +2393,7 @@
page_scale,
maximum_animation_scale,
animating_transform);
- EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 2.f);
+ EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), page_scale * device_scale);
// Further changes to scale during the animation should not cause a new
// high-res tiling to get created.
@@ -2336,7 +2404,7 @@
page_scale,
maximum_animation_scale,
animating_transform);
- EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 2.f);
+ EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), page_scale * device_scale);
// Once we stop animating, a new high-res tiling should be created.
animating_transform = false;
@@ -2351,8 +2419,8 @@
// When animating with a maxmium animation scale factor that is so large
// that the layer grows larger than the viewport at this scale, a new
- // high-res tiling should get created at the animation's initial scale, not
- // at its maximum scale.
+ // high-res tiling should get created at a source scale of 1, not at its
+ // maximum scale.
animating_transform = true;
contents_scale = 2.f;
maximum_animation_scale = 11.f;
@@ -2362,7 +2430,7 @@
page_scale,
maximum_animation_scale,
animating_transform);
- EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 2.f);
+ EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), page_scale * device_scale);
// Once we stop animating, a new high-res tiling should be created.
animating_transform = false;
@@ -2392,6 +2460,31 @@
// Once we stop animating, a new high-res tiling should be created.
animating_transform = false;
+ contents_scale = 12.f;
+
+ SetContentsScaleOnBothLayers(contents_scale,
+ device_scale,
+ page_scale,
+ maximum_animation_scale,
+ animating_transform);
+ EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 12.f);
+
+ // When animating toward a smaller scale, but that is still so large that the
+ // layer grows larger than the viewport at this scale, a new high-res tiling
+ // should get created at source scale 1.
+ animating_transform = true;
+ contents_scale = 11.f;
+ maximum_animation_scale = 11.f;
+
+ SetContentsScaleOnBothLayers(contents_scale,
+ device_scale,
+ page_scale,
+ maximum_animation_scale,
+ animating_transform);
+ EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), device_scale * page_scale);
+
+ // Once we stop animating, a new high-res tiling should be created.
+ animating_transform = false;
contents_scale = 11.f;
SetContentsScaleOnBothLayers(contents_scale,
@@ -2695,7 +2788,7 @@
++iter) {
if (mark_required) {
number_of_marked_tiles++;
- iter->MarkRequiredForActivation();
+ iter->set_required_for_activation(true);
} else {
number_of_unmarked_tiles++;
}
@@ -2724,7 +2817,7 @@
float expected_scales[] = {2.0f, 0.3f, 0.7f, low_res_factor, 1.0f};
size_t scale_index = 0;
bool reached_visible = false;
- Tile* last_tile = NULL;
+ Tile* last_tile = nullptr;
for (it = PictureLayerImpl::LayerEvictionTileIterator(
pending_layer_, SAME_PRIORITY_FOR_BOTH_TREES);
it;
@@ -2907,7 +3000,6 @@
CreateHighLowResAndSetAllTilesVisible();
active_layer_->SetAllTilesReady();
- pending_layer_->MarkVisibleResourcesAsRequired();
// All pending layer tiles required are not ready.
EXPECT_FALSE(pending_layer_->AllTilesRequiredForActivationAreReadyToDraw());
@@ -2935,7 +3027,6 @@
CreateHighLowResAndSetAllTilesVisible();
active_layer_->SetAllTilesReady();
- pending_layer_->MarkVisibleResourcesAsRequired();
// All pending layer tiles required are not ready.
EXPECT_FALSE(pending_layer_->AllTilesRequiredForActivationAreReadyToDraw());
@@ -2964,8 +3055,6 @@
// And all the low-res tiles in the pending layer.
pending_layer_->SetAllTilesReadyInTiling(pending_layer_->LowResTiling());
- pending_layer_->MarkVisibleResourcesAsRequired();
-
// The unshared high-res tiles are not ready, so we cannot activate.
EXPECT_FALSE(pending_layer_->AllTilesRequiredForActivationAreReadyToDraw());
@@ -2988,8 +3077,6 @@
// Initialize all high-res tiles in the active layer.
active_layer_->SetAllTilesReadyInTiling(active_layer_->HighResTiling());
- pending_layer_->MarkVisibleResourcesAsRequired();
-
// The unshared high-res tiles are not ready, so we cannot activate.
EXPECT_FALSE(pending_layer_->AllTilesRequiredForActivationAreReadyToDraw());
@@ -3064,28 +3151,7 @@
pending_layer_->tilings()->tiling_at(0)->contents_scale());
}
-TEST_F(NoLowResPictureLayerImplTest, MarkRequiredNullTiles) {
- gfx::Size tile_size(100, 100);
- gfx::Size layer_bounds(1000, 1000);
-
- scoped_refptr<FakePicturePileImpl> pending_pile =
- FakePicturePileImpl::CreateEmptyPile(tile_size, layer_bounds);
- // Layers with entirely empty piles can't get tilings.
- pending_pile->AddRecordingAt(0, 0);
-
- SetupPendingTree(pending_pile);
-
- ASSERT_TRUE(pending_layer_->CanHaveTilings());
- pending_layer_->AddTiling(1.0f);
- pending_layer_->AddTiling(2.0f);
-
- // It should be safe to call this (and MarkVisibleResourcesAsRequired)
- // on a layer with no recordings.
- host_impl_.pending_tree()->UpdateDrawProperties();
- pending_layer_->MarkVisibleResourcesAsRequired();
-}
-
-TEST_F(NoLowResPictureLayerImplTest, NothingRequiredIfAllHighResTilesShared) {
+TEST_F(NoLowResPictureLayerImplTest, AllHighResRequiredEvenIfShared) {
gfx::Size layer_bounds(400, 400);
gfx::Size tile_size(100, 100);
SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size);
@@ -3098,11 +3164,13 @@
// All tiles shared (no invalidation), so even though the active tree's
// tiles aren't ready, there is nothing required.
- pending_layer_->MarkVisibleResourcesAsRequired();
- AssertNoTilesRequired(pending_layer_->HighResTiling());
- if (host_impl_.settings().create_low_res_tiling) {
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ if (host_impl_.settings().create_low_res_tiling)
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
+ AssertAllTilesRequired(pending_layer_->HighResTiling());
+ if (host_impl_.settings().create_low_res_tiling)
AssertNoTilesRequired(pending_layer_->LowResTiling());
- }
}
TEST_F(NoLowResPictureLayerImplTest, NothingRequiredIfActiveMissingTiles) {
@@ -3131,7 +3199,10 @@
// Since the active layer has no tiles at all, the pending layer doesn't
// need content in order to activate.
- pending_layer_->MarkVisibleResourcesAsRequired();
+ pending_layer_->HighResTiling()->UpdateAllTilePrioritiesForTesting();
+ if (host_impl_.settings().create_low_res_tiling)
+ pending_layer_->LowResTiling()->UpdateAllTilePrioritiesForTesting();
+
AssertNoTilesRequired(pending_layer_->HighResTiling());
if (host_impl_.settings().create_low_res_tiling)
AssertNoTilesRequired(pending_layer_->LowResTiling());
@@ -3575,9 +3646,9 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- active_layer_->WillDraw(DRAW_MODE_HARDWARE, NULL);
+ active_layer_->WillDraw(DRAW_MODE_HARDWARE, nullptr);
active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
- active_layer_->DidDraw(NULL);
+ active_layer_->DidDraw(nullptr);
// Even when OOM, quads should be produced, and should be different material
// from quads with resource.
@@ -3605,7 +3676,7 @@
++priority_count) {
TreePriority tree_priority = static_cast<TreePriority>(priority_count);
size_t occluded_tile_count = 0u;
- Tile* last_tile = NULL;
+ Tile* last_tile = nullptr;
for (PictureLayerImpl::LayerEvictionTileIterator it =
PictureLayerImpl::LayerEvictionTileIterator(layer,
@@ -3715,7 +3786,7 @@
if (tile_is_visible)
unoccluded_tile_count++;
}
- EXPECT_EQ(unoccluded_tile_count, 20 + 2);
+ EXPECT_EQ(20 + 2, unoccluded_tile_count);
// Full occlusion.
layer1->SetPosition(gfx::Point(0, 0));
@@ -3803,6 +3874,7 @@
for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) {
PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i);
+ tiling->UpdateAllTilePrioritiesForTesting();
occluded_tile_count = 0;
for (PictureLayerTiling::CoverageIterator iter(
@@ -3842,6 +3914,7 @@
for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) {
PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i);
+ tiling->UpdateAllTilePrioritiesForTesting();
occluded_tile_count = 0;
for (PictureLayerTiling::CoverageIterator iter(
@@ -3861,10 +3934,10 @@
}
switch (i) {
case 0:
- EXPECT_EQ(occluded_tile_count, 25);
+ EXPECT_EQ(25, occluded_tile_count);
break;
case 1:
- EXPECT_EQ(occluded_tile_count, 4);
+ EXPECT_EQ(4, occluded_tile_count);
break;
default:
NOTREACHED();
@@ -3911,6 +3984,7 @@
tilings.begin();
tiling_iterator != tilings.end();
++tiling_iterator) {
+ (*tiling_iterator)->UpdateAllTilePrioritiesForTesting();
std::vector<Tile*> tiles = (*tiling_iterator)->AllTilesForTesting();
occluded_tile_count = 0;
@@ -3978,6 +4052,7 @@
for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) {
PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i);
+ tiling->UpdateAllTilePrioritiesForTesting();
for (PictureLayerTiling::CoverageIterator iter(
tiling,
@@ -4122,6 +4197,7 @@
for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) {
PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i);
tiling->CreateAllTilesForTesting();
+ tiling->UpdateAllTilePrioritiesForTesting();
size_t occluded_tile_count_on_pending = 0u;
size_t occluded_tile_count_on_active = 0u;
@@ -4156,6 +4232,7 @@
for (size_t i = 0; i < active_layer_->num_tilings(); ++i) {
PictureLayerTiling* tiling = active_layer_->tilings()->tiling_at(i);
tiling->CreateAllTilesForTesting();
+ tiling->UpdateAllTilePrioritiesForTesting();
size_t occluded_tile_count_on_pending = 0u;
size_t occluded_tile_count_on_active = 0u;
@@ -4285,9 +4362,9 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
+ active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
- active_layer_->DidDraw(NULL);
+ active_layer_->DidDraw(nullptr);
DrawQuad::Material expected = test_for_solid
? DrawQuad::Material::SOLID_COLOR
@@ -4375,5 +4452,70 @@
EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
}
+class TileSizeSettings : public ImplSidePaintingSettings {
+ public:
+ TileSizeSettings() {
+ default_tile_size = gfx::Size(100, 100);
+ max_untiled_layer_size = gfx::Size(200, 200);
+ }
+};
+
+class TileSizeTest : public PictureLayerImplTest {
+ public:
+ TileSizeTest() : PictureLayerImplTest(TileSizeSettings()) {}
+};
+
+TEST_F(TileSizeTest, TileSizes) {
+ host_impl_.CreatePendingTree();
+
+ LayerTreeImpl* pending_tree = host_impl_.pending_tree();
+ scoped_ptr<FakePictureLayerImpl> layer =
+ FakePictureLayerImpl::Create(pending_tree, id_);
+
+ host_impl_.SetViewportSize(gfx::Size(1000, 1000));
+ gfx::Size result;
+
+ host_impl_.SetUseGpuRasterization(false);
+
+ // Default tile-size for large layers.
+ result = layer->CalculateTileSize(gfx::Size(10000, 10000));
+ EXPECT_EQ(result.width(), 100);
+ EXPECT_EQ(result.height(), 100);
+ // Don't tile and round-up, when under max_untiled_layer_size.
+ result = layer->CalculateTileSize(gfx::Size(42, 42));
+ EXPECT_EQ(result.width(), 64);
+ EXPECT_EQ(result.height(), 64);
+ result = layer->CalculateTileSize(gfx::Size(191, 191));
+ EXPECT_EQ(result.width(), 192);
+ EXPECT_EQ(result.height(), 192);
+ result = layer->CalculateTileSize(gfx::Size(199, 199));
+ EXPECT_EQ(result.width(), 200);
+ EXPECT_EQ(result.height(), 200);
+
+ // Gpu-rasterization uses 25% viewport-height tiles.
+ // The +2's below are for border texels.
+ host_impl_.SetUseGpuRasterization(true);
+ host_impl_.SetViewportSize(gfx::Size(2000, 2000));
+ result = layer->CalculateTileSize(gfx::Size(10000, 10000));
+ EXPECT_EQ(result.width(), 2000);
+ EXPECT_EQ(result.height(), 500 + 2);
+
+ // Clamp and round-up, when smaller than viewport.
+ // Tile-height doubles to 50% when width shrinks to <= 50%.
+ host_impl_.SetViewportSize(gfx::Size(1000, 1000));
+ result = layer->CalculateTileSize(gfx::Size(447, 10000));
+ EXPECT_EQ(result.width(), 448);
+ EXPECT_EQ(result.height(), 500 + 2);
+
+ // Largest layer is 50% of viewport width (rounded up), and
+ // 50% of viewport in height.
+ result = layer->CalculateTileSize(gfx::Size(447, 400));
+ EXPECT_EQ(result.width(), 448);
+ EXPECT_EQ(result.height(), 448);
+ result = layer->CalculateTileSize(gfx::Size(500, 499));
+ EXPECT_EQ(result.width(), 512);
+ EXPECT_EQ(result.height(), 500 + 2);
+}
+
} // namespace
} // namespace cc
diff --git a/cc/layers/render_surface.cc b/cc/layers/render_surface.cc
index 15e1187..35dde10 100644
--- a/cc/layers/render_surface.cc
+++ b/cc/layers/render_surface.cc
@@ -18,7 +18,8 @@
screen_space_transforms_are_animating_(false),
is_clipped_(false),
contributes_to_drawn_surface_(false),
- nearest_occlusion_immune_ancestor_(NULL) {}
+ nearest_occlusion_immune_ancestor_(nullptr) {
+}
RenderSurface::~RenderSurface() {
for (size_t i = 0; i < layer_list_.size(); ++i) {
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc
index c0e4a82..18d50c5 100644
--- a/cc/layers/render_surface_impl.cc
+++ b/cc/layers/render_surface_impl.cc
@@ -34,7 +34,7 @@
is_clipped_(false),
contributes_to_drawn_surface_(false),
draw_opacity_(1),
- nearest_occlusion_immune_ancestor_(NULL),
+ nearest_occlusion_immune_ancestor_(nullptr),
target_render_surface_layer_index_history_(0),
current_layer_index_history_(0) {
damage_tracker_ = DamageTracker::Create();
@@ -184,13 +184,13 @@
LayerImpl* mask_layer = owning_layer_->mask_layer();
if (mask_layer &&
(!mask_layer->DrawsContent() || mask_layer->bounds().IsEmpty()))
- mask_layer = NULL;
+ mask_layer = nullptr;
if (!mask_layer && for_replica) {
mask_layer = owning_layer_->replica_layer()->mask_layer();
if (mask_layer &&
(!mask_layer->DrawsContent() || mask_layer->bounds().IsEmpty()))
- mask_layer = NULL;
+ mask_layer = nullptr;
}
gfx::RectF mask_uv_rect(0.f, 0.f, 1.f, 1.f);
diff --git a/cc/layers/scrollbar_layer_impl_base.cc b/cc/layers/scrollbar_layer_impl_base.cc
index 204b491..b11e981 100644
--- a/cc/layers/scrollbar_layer_impl_base.cc
+++ b/cc/layers/scrollbar_layer_impl_base.cc
@@ -17,8 +17,8 @@
bool is_left_side_vertical_scrollbar,
bool is_overlay)
: LayerImpl(tree_impl, id),
- scroll_layer_(NULL),
- clip_layer_(NULL),
+ scroll_layer_(nullptr),
+ clip_layer_(nullptr),
is_overlay_scrollbar_(is_overlay),
thumb_thickness_scale_factor_(1.f),
current_pos_(0.f),
@@ -26,7 +26,8 @@
orientation_(orientation),
is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar),
vertical_adjust_(0.f),
- visible_to_total_length_ratio_(1.f) {}
+ visible_to_total_length_ratio_(1.f) {
+}
ScrollbarLayerImplBase::~ScrollbarLayerImplBase() {}
@@ -121,6 +122,12 @@
return true;
}
+bool ScrollbarLayerImplBase::can_scroll_orientation() const {
+ if (!scroll_layer_)
+ return false;
+ return scroll_layer_->user_scrollable(orientation()) && (0 < maximum());
+}
+
bool ScrollbarLayerImplBase::SetVerticalAdjust(float vertical_adjust) {
if (vertical_adjust_ == vertical_adjust)
return false;
diff --git a/cc/layers/scrollbar_layer_impl_base.h b/cc/layers/scrollbar_layer_impl_base.h
index 7d37acc..91cff32 100644
--- a/cc/layers/scrollbar_layer_impl_base.h
+++ b/cc/layers/scrollbar_layer_impl_base.h
@@ -24,8 +24,8 @@
}
void SetScrollLayerAndClipLayerByIds(int scroll_layer_id, int clip_layer_id);
- void ClearScrollLayer() { scroll_layer_ = NULL; }
- void ClearClipLayer() { clip_layer_ = NULL; }
+ void ClearScrollLayer() { scroll_layer_ = nullptr; }
+ void ClearClipLayer() { clip_layer_ = nullptr; }
float current_pos() const { return current_pos_; }
bool SetCurrentPos(float current_pos);
@@ -44,6 +44,8 @@
return is_left_side_vertical_scrollbar_;
}
+ bool can_scroll_orientation() const;
+
virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual ScrollbarLayerImplBase* ToScrollbarLayer() override;
void PushScrollClipPropertiesTo(LayerImpl* layer);
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index 9db5d3b..fdffcfa 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -226,9 +226,9 @@
scrollbar_layer->fake_scrollbar()->set_thumb_length(4);
scrollbar_layer->UpdateThumbAndTrackGeometry();
- LayerImpl* root_clip_layer_impl = NULL;
- LayerImpl* root_layer_impl = NULL;
- PaintedScrollbarLayerImpl* scrollbar_layer_impl = NULL;
+ LayerImpl* root_clip_layer_impl = nullptr;
+ LayerImpl* root_layer_impl = nullptr;
+ PaintedScrollbarLayerImpl* scrollbar_layer_impl = nullptr;
UPDATE_AND_EXTRACT_LAYER_POINTERS();
EXPECT_EQ(gfx::Rect(10, 0, 4, 10).ToString(),
@@ -270,9 +270,9 @@
scrollbar_layer->fake_scrollbar()->set_thumb_thickness(10);
scrollbar_layer->fake_scrollbar()->set_thumb_length(4);
scrollbar_layer->UpdateThumbAndTrackGeometry();
- LayerImpl* root_clip_layer_impl = NULL;
- LayerImpl* root_layer_impl = NULL;
- PaintedScrollbarLayerImpl* scrollbar_layer_impl = NULL;
+ LayerImpl* root_clip_layer_impl = nullptr;
+ LayerImpl* root_layer_impl = nullptr;
+ PaintedScrollbarLayerImpl* scrollbar_layer_impl = nullptr;
// Thumb is at the edge of the scrollbar (should be inset to
// the start of the track within the scrollbar layer's
@@ -628,7 +628,7 @@
public:
FakeLayerTreeHost(FakeLayerTreeHostClient* client,
const LayerTreeSettings& settings)
- : LayerTreeHost(client, NULL, settings),
+ : LayerTreeHost(client, nullptr, nullptr, settings),
next_id_(1),
total_ui_resource_created_(0),
total_ui_resource_deleted_(0) {
@@ -667,7 +667,7 @@
UIResourceBitmapMap::iterator iter = ui_resource_bitmap_map_.find(id);
if (iter != ui_resource_bitmap_map_.end())
return &iter->second;
- return NULL;
+ return nullptr;
}
private:
diff --git a/cc/layers/solid_color_scrollbar_layer.cc b/cc/layers/solid_color_scrollbar_layer.cc
index 98b23a4..b2c1ed4 100644
--- a/cc/layers/solid_color_scrollbar_layer.cc
+++ b/cc/layers/solid_color_scrollbar_layer.cc
@@ -68,7 +68,7 @@
clip_layer_id_);
}
-void SolidColorScrollbarLayer::SetNeedsDisplayRect(const gfx::RectF&) {
+void SolidColorScrollbarLayer::SetNeedsDisplayRect(const gfx::Rect& rect) {
// Never needs repaint.
}
diff --git a/cc/layers/solid_color_scrollbar_layer.h b/cc/layers/solid_color_scrollbar_layer.h
index de46c54..0e48173 100644
--- a/cc/layers/solid_color_scrollbar_layer.h
+++ b/cc/layers/solid_color_scrollbar_layer.h
@@ -31,7 +31,7 @@
virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual void PushScrollClipPropertiesTo(LayerImpl* layer) override;
- virtual void SetNeedsDisplayRect(const gfx::RectF&) override;
+ virtual void SetNeedsDisplayRect(const gfx::Rect& rect) override;
// ScrollbarLayerInterface
virtual int ScrollLayerId() const override;
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index d8634ea..122aa3b 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -45,7 +45,7 @@
void TextureLayer::ClearClient() {
if (rate_limit_context_ && client_ && layer_tree_host())
layer_tree_host()->StopRateLimiter();
- client_ = NULL;
+ client_ = nullptr;
ClearTexture();
UpdateDrawsContent(HasDrawableContent());
}
@@ -173,7 +173,7 @@
mailbox, release.Pass(), requires_commit, allow_mailbox_reuse);
}
-void TextureLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
+void TextureLayer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) {
Layer::SetNeedsDisplayRect(dirty_rect);
if (rate_limit_context_ && client_ && layer_tree_host() && DrawsContent())
diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h
index 735fed9..61791ac 100644
--- a/cc/layers/texture_layer.h
+++ b/cc/layers/texture_layer.h
@@ -134,7 +134,7 @@
// TODO(danakj): Remove this when pepper doesn't need it. crbug.com/350204
void SetTextureMailboxWithoutReleaseCallback(const TextureMailbox& mailbox);
- virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) override;
+ virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override;
virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
virtual bool Update(ResourceUpdateQueue* queue,
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index 8846152..9b59b96 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -51,7 +51,7 @@
class MockLayerTreeHost : public LayerTreeHost {
public:
explicit MockLayerTreeHost(FakeLayerTreeHostClient* client)
- : LayerTreeHost(client, NULL, LayerTreeSettings()) {
+ : LayerTreeHost(client, nullptr, nullptr, LayerTreeSettings()) {
InitializeSingleThreaded(client, base::MessageLoopProxy::current());
}
@@ -184,7 +184,7 @@
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber());
- layer_tree_host_->SetRootLayer(NULL);
+ layer_tree_host_->SetRootLayer(nullptr);
layer_tree_host_ = nullptr;
}
@@ -196,7 +196,8 @@
};
TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) {
- scoped_refptr<TextureLayer> test_layer = TextureLayer::CreateForMailbox(NULL);
+ scoped_refptr<TextureLayer> test_layer =
+ TextureLayer::CreateForMailbox(nullptr);
EXPECT_SET_NEEDS_COMMIT(1, layer_tree_host_->SetRootLayer(test_layer));
// Test properties that should call SetNeedsCommit. All properties need to
@@ -215,7 +216,7 @@
const gfx::Rect layer_rect(layer_bounds);
const Region layer_region(layer_rect);
- scoped_refptr<TextureLayer> layer = TextureLayer::CreateForMailbox(NULL);
+ scoped_refptr<TextureLayer> layer = TextureLayer::CreateForMailbox(nullptr);
layer->SetBounds(layer_bounds);
layer->draw_properties().visible_content_rect = layer_rect;
layer->SetBlendBackgroundColor(true);
@@ -283,7 +284,7 @@
// Stop rate limiter when we're removed from the tree.
EXPECT_CALL(*layer_tree_host_, StopRateLimiter());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(1);
- layer_tree_host_->SetRootLayer(NULL);
+ layer_tree_host_->SetRootLayer(nullptr);
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
}
@@ -310,7 +311,8 @@
};
TEST_F(TextureLayerWithMailboxTest, ReplaceMailboxOnMainThreadBeforeCommit) {
- scoped_refptr<TextureLayer> test_layer = TextureLayer::CreateForMailbox(NULL);
+ scoped_refptr<TextureLayer> test_layer =
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber());
@@ -371,7 +373,8 @@
}
TEST_F(TextureLayerTest, SetTextureMailboxWithoutReleaseCallback) {
- scoped_refptr<TextureLayer> test_layer = TextureLayer::CreateForMailbox(NULL);
+ scoped_refptr<TextureLayer> test_layer =
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
// These use the same gpu::Mailbox, but different sync points.
@@ -452,7 +455,8 @@
};
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_BothReleaseThenMain) {
- scoped_refptr<TextureLayer> test_layer = TextureLayer::CreateForMailbox(NULL);
+ scoped_refptr<TextureLayer> test_layer =
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
main_thread_.message_loop()->PostTask(
@@ -507,7 +511,8 @@
}
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleaseBetween) {
- scoped_refptr<TextureLayer> test_layer = TextureLayer::CreateForMailbox(NULL);
+ scoped_refptr<TextureLayer> test_layer =
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
main_thread_.message_loop()->PostTask(
@@ -563,7 +568,8 @@
}
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleasedFirst) {
- scoped_refptr<TextureLayer> test_layer = TextureLayer::CreateForMailbox(NULL);
+ scoped_refptr<TextureLayer> test_layer =
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
main_thread_.message_loop()->PostTask(
@@ -619,7 +625,8 @@
}
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_SecondImplRefShortcut) {
- scoped_refptr<TextureLayer> test_layer = TextureLayer::CreateForMailbox(NULL);
+ scoped_refptr<TextureLayer> test_layer =
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
main_thread_.message_loop()->PostTask(
@@ -728,7 +735,7 @@
root_ = Layer::Create();
root_->SetBounds(bounds);
- layer_ = TextureLayer::CreateForMailbox(NULL);
+ layer_ = TextureLayer::CreateForMailbox(nullptr);
layer_->SetIsDrawable(true);
layer_->SetBounds(bounds);
@@ -851,7 +858,7 @@
root_ = Layer::Create();
root_->SetBounds(bounds);
- layer_ = TextureLayer::CreateForMailbox(NULL);
+ layer_ = TextureLayer::CreateForMailbox(nullptr);
layer_->SetIsDrawable(true);
layer_->SetBounds(bounds);
@@ -1414,7 +1421,7 @@
: public TextureLayerReleaseResourcesBase {
public:
virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
- LayerTreeImpl* tree = NULL;
+ LayerTreeImpl* tree = nullptr;
if (host_impl->settings().impl_side_painting)
tree = host_impl->pending_tree();
else
@@ -1460,7 +1467,7 @@
root_ = Layer::Create();
root_->SetBounds(bounds);
- layer_ = TextureLayer::CreateForMailbox(NULL);
+ layer_ = TextureLayer::CreateForMailbox(nullptr);
layer_->SetIsDrawable(true);
layer_->SetBounds(bounds);
@@ -1487,7 +1494,7 @@
// Delete the TextureLayer on the main thread while the mailbox is in
// the impl tree.
layer_->RemoveFromParent();
- layer_ = NULL;
+ layer_ = nullptr;
break;
}
}
@@ -1531,7 +1538,7 @@
root_ = Layer::Create();
root_->SetBounds(bounds);
- layer_ = TextureLayer::CreateForMailbox(NULL);
+ layer_ = TextureLayer::CreateForMailbox(nullptr);
layer_->SetIsDrawable(true);
layer_->SetBounds(bounds);
@@ -1561,7 +1568,7 @@
layer_->RemoveFromParent();
break;
case 2:
- layer_ = NULL;
+ layer_ = nullptr;
break;
}
}
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc
index 854a747..e4d5f7c 100644
--- a/cc/layers/tiled_layer.cc
+++ b/cc/layers/tiled_layer.cc
@@ -236,7 +236,7 @@
PrioritizedResourceManager* TiledLayer::ResourceManager() {
if (!layer_tree_host())
- return NULL;
+ return nullptr;
return layer_tree_host()->contents_texture_manager();
}
@@ -244,7 +244,7 @@
int j) const {
UpdatableTile* tile = TileAt(i, j);
if (!tile)
- return NULL;
+ return nullptr;
return tile->managed_resource();
}
@@ -288,7 +288,7 @@
return added_tile;
}
-void TiledLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
+void TiledLayer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) {
InvalidateContentRect(LayerRectToContentRect(dirty_rect));
ContentsScalingLayer::SetNeedsDisplayRect(dirty_rect);
}
@@ -464,7 +464,8 @@
// paint_rect from content space to layer space.
float width_scale = 1 / draw_properties().contents_scale_x;
float height_scale = 1 / draw_properties().contents_scale_y;
- update_rect_ = gfx::ScaleRect(update_rect, width_scale, height_scale);
+ update_rect_ =
+ gfx::ScaleToEnclosingRect(update_rect, width_scale, height_scale);
// Calling PrepareToUpdate() calls into WebKit to paint, which may have the
// side effect of disabling compositing, which causes our reference to the
@@ -712,7 +713,7 @@
&top,
&right,
&bottom);
- UpdateTiles(left, top, right, bottom, queue, NULL, &updated);
+ UpdateTiles(left, top, right, bottom, queue, nullptr, &updated);
if (updated)
return updated;
// This was an attempt to paint the entire layer so if we fail it's okay,
@@ -743,7 +744,7 @@
return updated;
// Prepaint anything that was occluded but inside the layer's visible region.
- if (!UpdateTiles(left, top, right, bottom, queue, NULL, &updated) ||
+ if (!UpdateTiles(left, top, right, bottom, queue, nullptr, &updated) ||
updated)
return updated;
@@ -773,7 +774,7 @@
while (bottom < prepaint_bottom) {
++bottom;
if (!UpdateTiles(
- left, bottom, right, bottom, queue, NULL, &updated) ||
+ left, bottom, right, bottom, queue, nullptr, &updated) ||
updated)
return updated;
}
@@ -781,8 +782,7 @@
if (deltas[i].y() < 0) {
while (top > prepaint_top) {
--top;
- if (!UpdateTiles(
- left, top, right, top, queue, NULL, &updated) ||
+ if (!UpdateTiles(left, top, right, top, queue, nullptr, &updated) ||
updated)
return updated;
}
@@ -790,8 +790,7 @@
if (deltas[i].x() < 0) {
while (left > prepaint_left) {
--left;
- if (!UpdateTiles(
- left, top, left, bottom, queue, NULL, &updated) ||
+ if (!UpdateTiles(left, top, left, bottom, queue, nullptr, &updated) ||
updated)
return updated;
}
@@ -799,8 +798,7 @@
if (deltas[i].x() > 0) {
while (right < prepaint_right) {
++right;
- if (!UpdateTiles(
- right, top, right, bottom, queue, NULL, &updated) ||
+ if (!UpdateTiles(right, top, right, bottom, queue, nullptr, &updated) ||
updated)
return updated;
}
diff --git a/cc/layers/tiled_layer.h b/cc/layers/tiled_layer.h
index e8ac89b..8a765d0 100644
--- a/cc/layers/tiled_layer.h
+++ b/cc/layers/tiled_layer.h
@@ -28,7 +28,7 @@
virtual void SetIsMask(bool is_mask) override;
virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual void ReduceMemoryUsage() override;
- virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) override;
+ virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override;
virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
override;
diff --git a/cc/layers/tiled_layer_impl_unittest.cc b/cc/layers/tiled_layer_impl_unittest.cc
index ffc89c8..3d34b9f 100644
--- a/cc/layers/tiled_layer_impl_unittest.cc
+++ b/cc/layers/tiled_layer_impl_unittest.cc
@@ -94,9 +94,9 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- EXPECT_TRUE(layer->WillDraw(DRAW_MODE_HARDWARE, NULL));
+ EXPECT_TRUE(layer->WillDraw(DRAW_MODE_HARDWARE, nullptr));
layer->AppendQuads(render_pass.get(), Occlusion(), &data);
- layer->DidDraw(NULL);
+ layer->DidDraw(nullptr);
unsigned num_tiles = num_tiles_x * num_tiles_y;
EXPECT_EQ(render_pass->quad_list.size(), num_tiles);
}
@@ -109,7 +109,7 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
- EXPECT_FALSE(layer->WillDraw(DRAW_MODE_HARDWARE, NULL));
+ EXPECT_FALSE(layer->WillDraw(DRAW_MODE_HARDWARE, nullptr));
}
// Layer with non-intersecting visible layer rect produces no quads
@@ -123,9 +123,9 @@
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- EXPECT_TRUE(layer->WillDraw(DRAW_MODE_HARDWARE, NULL));
+ EXPECT_TRUE(layer->WillDraw(DRAW_MODE_HARDWARE, nullptr));
layer->AppendQuads(render_pass.get(), Occlusion(), &data);
- layer->DidDraw(NULL);
+ layer->DidDraw(nullptr);
EXPECT_EQ(render_pass->quad_list.size(), 0u);
}
diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc
index 3af0e3f..80f42ed 100644
--- a/cc/layers/tiled_layer_unittest.cc
+++ b/cc/layers/tiled_layer_unittest.cc
@@ -81,7 +81,7 @@
SharedBitmapManager* manager,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
- : LayerTreeHost(client, manager, settings),
+ : LayerTreeHost(client, manager, NULL, settings),
output_surface_created_(false) {
LayerTreeHost::InitializeThreaded(base::MessageLoopProxy::current(),
impl_task_runner);
@@ -94,12 +94,12 @@
class TiledLayerTest : public testing::Test {
public:
TiledLayerTest()
- : proxy_(NULL),
+ : proxy_(nullptr),
output_surface_(FakeOutputSurface::Create3d()),
queue_(make_scoped_ptr(new ResourceUpdateQueue)),
impl_thread_("ImplThread"),
fake_layer_tree_host_client_(FakeLayerTreeHostClient::DIRECT_3D),
- occlusion_(NULL) {
+ occlusion_(nullptr) {
settings_.max_partial_texture_updates = std::numeric_limits<size_t>::max();
settings_.layer_transforms_should_scale_layer_contents = true;
}
@@ -125,7 +125,8 @@
impl_thread_and_main_thread_blocked(proxy_);
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
- NULL,
+ nullptr,
+ nullptr,
0,
false,
1,
@@ -161,7 +162,7 @@
impl_thread_and_main_thread_blocked(proxy_);
DCHECK(queue_);
scoped_ptr<ResourceUpdateController> update_controller =
- ResourceUpdateController::Create(NULL,
+ ResourceUpdateController::Create(nullptr,
proxy_->ImplThreadTaskRunner(),
queue_.Pass(),
resource_provider_.get());
@@ -722,7 +723,7 @@
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
@@ -910,7 +911,7 @@
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
// Update rect is 200x300 (tile size of 100x100). Scaled this gives 400x240.
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 400, 240), layer->update_rect());
@@ -922,7 +923,7 @@
resource_manager_->PrioritizeTextures();
layer->InvalidateContentRect(content_bounds);
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(layer_bounds), layer->update_rect());
UpdateTextures();
@@ -933,7 +934,7 @@
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(60, 80, 20, 8), layer->update_rect());
}
@@ -950,7 +951,7 @@
layer->SetBounds(gfx::Size(100, 100));
CalcDrawProps(&render_surface_layer_list);
layer->draw_properties().visible_content_rect = gfx::Rect(0, 0, 100, 100);
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
UpdateTextures();
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 100, 100),
layer->last_needs_display_rect());
@@ -959,7 +960,7 @@
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
@@ -978,7 +979,7 @@
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
@@ -1048,7 +1049,7 @@
ResourceManagerClearAllMemory(layer_tree_host_->contents_texture_manager(),
resource_provider_.get());
- layer_tree_host_->SetRootLayer(NULL);
+ layer_tree_host_->SetRootLayer(nullptr);
}
TEST_F(TiledLayerTest, ResizeToSmaller) {
@@ -1064,7 +1065,7 @@
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
layer->SetBounds(gfx::Size(200, 200));
layer->InvalidateContentRect(gfx::Rect(0, 0, 200, 200));
@@ -1085,7 +1086,7 @@
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
}
class TiledLayerPartialUpdateTest : public TiledLayerTest {
@@ -1198,7 +1199,7 @@
ResourceManagerClearAllMemory(layer_tree_host_->contents_texture_manager(),
resource_provider_.get());
- layer_tree_host_->SetRootLayer(NULL);
+ layer_tree_host_->SetRootLayer(nullptr);
}
TEST_F(TiledLayerTest, TilesPaintedWithoutOcclusion) {
@@ -1215,7 +1216,7 @@
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
EXPECT_EQ(2, layer->fake_layer_updater()->update_count());
}
@@ -1639,7 +1640,7 @@
ResourceManagerClearAllMemory(layer_tree_host_->contents_texture_manager(),
resource_provider_.get());
- layer_tree_host_->SetRootLayer(NULL);
+ layer_tree_host_->SetRootLayer(nullptr);
}
class TrackingLayerPainter : public LayerPainter {
@@ -1705,7 +1706,7 @@
layer->SavePaintProperties();
// Update the whole tile.
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
layer->tracking_layer_painter()->ResetPaintedRect();
EXPECT_RECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect());
@@ -1714,7 +1715,7 @@
// Invalidate the entire layer in content space. When painting, the rect given
// to webkit should match the layer's bounds.
layer->InvalidateContentRect(content_rect);
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
// Rounding leads to an extra pixel.
gfx::Rect expanded_layer_rect(layer_rect);
@@ -1744,7 +1745,7 @@
layer->SavePaintProperties();
// Update the whole tile.
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
layer->tracking_layer_painter()->ResetPaintedRect();
EXPECT_RECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect());
@@ -1753,7 +1754,7 @@
// Invalidate the entire layer in layer space. When painting, the rect given
// to webkit should match the layer's bounds.
layer->SetNeedsDisplayRect(layer_rect);
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), nullptr);
// Rounding leads to an extra pixel.
gfx::Rect expanded_layer_rect(layer_rect);
diff --git a/cc/layers/video_frame_provider.h b/cc/layers/video_frame_provider.h
new file mode 100644
index 0000000..784d951
--- /dev/null
+++ b/cc/layers/video_frame_provider.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
+#define CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
+
+#include "base/memory/ref_counted.h"
+
+namespace media {
+class VideoFrame;
+}
+
+namespace cc {
+
+// Threading notes: This class may be used in a multi threaded manner.
+// Specifically, the implementation may call GetCurrentFrame() or
+// PutCurrentFrame() from the compositor thread. If so, the caller is
+// responsible for making sure Client::DidReceiveFrame() and
+// Client::DidUpdateMatrix() are only called from this same thread.
+class VideoFrameProvider {
+ public:
+ virtual ~VideoFrameProvider() {}
+
+ class Client {
+ public:
+ // Provider will call this method to tell the client to stop using it.
+ // StopUsingProvider() may be called from any thread. The client should
+ // block until it has PutCurrentFrame() any outstanding frames.
+ virtual void StopUsingProvider() = 0;
+
+ // Notifies the provider's client that a call to GetCurrentFrame() will
+ // return new data.
+ virtual void DidReceiveFrame() = 0;
+
+ // Notifies the provider's client of a new UV transform matrix to be used.
+ virtual void DidUpdateMatrix(const float* matrix) = 0;
+
+ protected:
+ virtual ~Client() {}
+ };
+
+ // May be called from any thread, but there must be some external guarantee
+ // that the provider is not destroyed before this call returns.
+ virtual void SetVideoFrameProviderClient(Client* client) = 0;
+
+ // This function places a lock on the current frame and returns a pointer to
+ // it. Calls to this method should always be followed with a call to
+ // PutCurrentFrame().
+ // Only the current provider client should call this function.
+ virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() = 0;
+
+ // This function releases the lock on the video frame. It should always be
+ // called after GetCurrentFrame(). Frames passed into this method
+ // should no longer be referenced after the call is made. Only the current
+ // provider client should call this function.
+ virtual void PutCurrentFrame(
+ const scoped_refptr<media::VideoFrame>& frame) = 0;
+};
+
+} // namespace cc
+
+#endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_frame_provider_client_impl.cc
new file mode 100644
index 0000000..50333c1
--- /dev/null
+++ b/cc/layers/video_frame_provider_client_impl.cc
@@ -0,0 +1,95 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/layers/video_frame_provider_client_impl.h"
+
+#include "base/debug/trace_event.h"
+#include "cc/base/math_util.h"
+#include "cc/layers/video_layer_impl.h"
+#include "media/base/video_frame.h"
+
+namespace cc {
+
+// static
+scoped_refptr<VideoFrameProviderClientImpl>
+ VideoFrameProviderClientImpl::Create(
+ VideoFrameProvider* provider) {
+ return make_scoped_refptr(
+ new VideoFrameProviderClientImpl(provider));
+}
+
+VideoFrameProviderClientImpl::~VideoFrameProviderClientImpl() {}
+
+VideoFrameProviderClientImpl::VideoFrameProviderClientImpl(
+ VideoFrameProvider* provider)
+ : active_video_layer_(nullptr), provider_(provider) {
+ // This only happens during a commit on the compositor thread while the main
+ // thread is blocked. That makes this a thread-safe call to set the video
+ // frame provider client that does not require a lock. The same is true of
+ // the call to Stop().
+ provider_->SetVideoFrameProviderClient(this);
+
+ // This matrix is the default transformation for stream textures, and flips
+ // on the Y axis.
+ stream_texture_matrix_ = gfx::Transform(
+ 1.0, 0.0, 0.0, 0.0,
+ 0.0, -1.0, 0.0, 1.0,
+ 0.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0);
+}
+
+void VideoFrameProviderClientImpl::Stop() {
+ if (!provider_)
+ return;
+ provider_->SetVideoFrameProviderClient(nullptr);
+ provider_ = nullptr;
+}
+
+scoped_refptr<media::VideoFrame>
+VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() {
+ provider_lock_.Acquire(); // Balanced by call to ReleaseLock().
+ if (!provider_)
+ return nullptr;
+
+ return provider_->GetCurrentFrame();
+}
+
+void VideoFrameProviderClientImpl::PutCurrentFrame(
+ const scoped_refptr<media::VideoFrame>& frame) {
+ provider_lock_.AssertAcquired();
+ provider_->PutCurrentFrame(frame);
+}
+
+void VideoFrameProviderClientImpl::ReleaseLock() {
+ provider_lock_.AssertAcquired();
+ provider_lock_.Release();
+}
+
+void VideoFrameProviderClientImpl::StopUsingProvider() {
+ // Block the provider from shutting down until this client is done
+ // using the frame.
+ base::AutoLock locker(provider_lock_);
+ provider_ = nullptr;
+}
+
+void VideoFrameProviderClientImpl::DidReceiveFrame() {
+ TRACE_EVENT1("cc",
+ "VideoFrameProviderClientImpl::DidReceiveFrame",
+ "active_video_layer",
+ !!active_video_layer_);
+ if (active_video_layer_)
+ active_video_layer_->SetNeedsRedraw();
+}
+
+void VideoFrameProviderClientImpl::DidUpdateMatrix(const float* matrix) {
+ stream_texture_matrix_ = gfx::Transform(
+ matrix[0], matrix[4], matrix[8], matrix[12],
+ matrix[1], matrix[5], matrix[9], matrix[13],
+ matrix[2], matrix[6], matrix[10], matrix[14],
+ matrix[3], matrix[7], matrix[11], matrix[15]);
+ if (active_video_layer_)
+ active_video_layer_->SetNeedsRedraw();
+}
+
+} // namespace cc
diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc
index 5e37397..8251a09 100644
--- a/cc/layers/video_layer_impl.cc
+++ b/cc/layers/video_layer_impl.cc
@@ -41,7 +41,9 @@
VideoLayerImpl::VideoLayerImpl(LayerTreeImpl* tree_impl,
int id,
media::VideoRotation video_rotation)
- : LayerImpl(tree_impl, id), frame_(NULL), video_rotation_(video_rotation) {
+ : LayerImpl(tree_impl, id),
+ frame_(nullptr),
+ video_rotation_(video_rotation) {
}
VideoLayerImpl::~VideoLayerImpl() {
@@ -351,7 +353,7 @@
}
provider_client_impl_->PutCurrentFrame(frame_);
- frame_ = NULL;
+ frame_ = nullptr;
provider_client_impl_->ReleaseLock();
}
@@ -361,7 +363,7 @@
}
void VideoLayerImpl::SetNeedsRedraw() {
- SetUpdateRect(gfx::UnionRects(update_rect(), gfx::RectF(bounds())));
+ SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds())));
layer_tree_impl()->SetNeedsRedraw();
}
diff --git a/cc/output/compositor_frame_metadata.h b/cc/output/compositor_frame_metadata.h
index e9dd706..a6fe2d4 100644
--- a/cc/output/compositor_frame_metadata.h
+++ b/cc/output/compositor_frame_metadata.h
@@ -46,6 +46,10 @@
ViewportSelectionBound selection_end;
std::vector<ui::LatencyInfo> latency_info;
+
+ // A set of SurfaceSequences that this frame satisfies (always in the same
+ // namespace as the current Surface).
+ std::vector<uint32_t> satisfies_sequences;
};
} // namespace cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 1d65027..ac449a4 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -13,6 +13,7 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "cc/base/math_util.h"
+#include "cc/layers/video_layer_impl.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_metadata.h"
#include "cc/output/context_provider.h"
@@ -337,6 +338,7 @@
capabilities_.allow_rasterize_on_demand = true;
use_sync_query_ = context_caps.gpu.sync_query;
+ use_blend_minmax_ = context_caps.gpu.blend_minmax;
InitializeSharedObjects();
}
@@ -697,21 +699,32 @@
return image;
}
-bool GLRenderer::ShouldApplyBlendModeUsingBlendFunc(const DrawQuad* quad) {
- SkXfermode::Mode blend_mode = quad->shared_quad_state->blend_mode;
- return blend_mode == SkXfermode::kScreen_Mode ||
+bool GLRenderer::CanApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode) {
+ return (use_blend_minmax_ && blend_mode == SkXfermode::kLighten_Mode) ||
+ blend_mode == SkXfermode::kScreen_Mode ||
blend_mode == SkXfermode::kSrcOver_Mode;
}
-void GLRenderer::ApplyBlendModeUsingBlendFunc(const DrawQuad* quad) {
- DCHECK(ShouldApplyBlendModeUsingBlendFunc(quad));
- if (quad->shared_quad_state->blend_mode == SkXfermode::kScreen_Mode) {
+void GLRenderer::ApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode) {
+ DCHECK(CanApplyBlendModeUsingBlendFunc(blend_mode));
+
+ // Any modes set here must be reset in RestoreBlendFuncToDefault
+ if (blend_mode == SkXfermode::kScreen_Mode) {
GLC(gl_, gl_->BlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE));
+ } else if (blend_mode == SkXfermode::kLighten_Mode) {
+ GLC(gl_, gl_->BlendFunc(GL_ONE, GL_ONE));
+ GLC(gl_, gl_->BlendEquation(GL_MAX_EXT));
}
}
-void GLRenderer::RestoreBlendFuncToDefault() {
+void GLRenderer::RestoreBlendFuncToDefault(SkXfermode::Mode blend_mode) {
+ if (blend_mode == SkXfermode::kSrcOver_Mode)
+ return;
+
GLC(gl_, gl_->BlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
+
+ if (blend_mode == SkXfermode::kLighten_Mode)
+ GLC(gl_, gl_->BlendEquation(GL_FUNC_ADD));
}
static skia::RefPtr<SkImage> ApplyBlendModeWithBackdrop(
@@ -1011,8 +1024,10 @@
void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
const RenderPassDrawQuad* quad) {
+ SkXfermode::Mode blend_mode = quad->shared_quad_state->blend_mode;
SetBlendEnabled(quad->ShouldDrawWithBlending() ||
- ShouldApplyBlendModeUsingBlendFunc(quad));
+ (!IsDefaultBlendMode(blend_mode) &&
+ CanApplyBlendModeUsingBlendFunc(blend_mode)));
ScopedResource* contents_texture =
render_pass_textures_.get(quad->render_pass_id);
@@ -1031,7 +1046,7 @@
if (!contents_device_transform.GetInverse(&contents_device_transform_inverse))
return;
- bool need_background_texture = !ShouldApplyBlendModeUsingBlendFunc(quad) ||
+ bool need_background_texture = !CanApplyBlendModeUsingBlendFunc(blend_mode) ||
ShouldApplyBackgroundFilters(frame, quad);
scoped_ptr<ScopedResource> background_texture;
@@ -1107,34 +1122,36 @@
}
}
- // If blending is applied using shaders, the background texture with
- // filters will be used as backdrop for blending operation, so we don't
- // need to copy it to the frame buffer.
- if (background_texture && !ShouldApplyBlendModeUsingBlendFunc(quad)) {
- filter_bitmap =
- ApplyBlendModeWithBackdrop(ScopedUseGrContext::Create(this, frame),
- resource_provider_,
- filter_bitmap,
- contents_texture,
- background_texture.get(),
- quad->shared_quad_state->blend_mode);
- } else if (background_texture) {
- // Draw the background texture if it has some filters applied.
- DCHECK(ShouldApplyBackgroundFilters(frame, quad));
- DCHECK(background_texture->size() == quad->rect.size());
- ResourceProvider::ScopedReadLockGL lock(resource_provider_,
- background_texture->id());
+ if (background_texture) {
+ if (CanApplyBlendModeUsingBlendFunc(blend_mode)) {
+ // Draw the background texture if it has some filters applied.
+ DCHECK(ShouldApplyBackgroundFilters(frame, quad));
+ DCHECK(background_texture->size() == quad->rect.size());
+ ResourceProvider::ScopedReadLockGL lock(resource_provider_,
+ background_texture->id());
- // The background_texture is oriented the same as the frame buffer. The
- // transform we are copying with has a vertical flip, so flip the contents
- // in the shader to maintain orientation
- bool flip_vertically = true;
+ // The background_texture is oriented the same as the frame buffer. The
+ // transform we are copying with has a vertical flip, so flip the contents
+ // in the shader to maintain orientation
+ bool flip_vertically = true;
- CopyTextureToFramebuffer(frame,
- lock.texture_id(),
- quad->rect,
- quad->quadTransform(),
- flip_vertically);
+ CopyTextureToFramebuffer(frame,
+ lock.texture_id(),
+ quad->rect,
+ quad->quadTransform(),
+ flip_vertically);
+ } else {
+ // If blending is applied using shaders, the background texture with
+ // filters will be used as backdrop for blending operation, so we don't
+ // need to copy it to the frame buffer.
+ filter_bitmap =
+ ApplyBlendModeWithBackdrop(ScopedUseGrContext::Create(this, frame),
+ resource_provider_,
+ filter_bitmap,
+ contents_texture,
+ background_texture.get(),
+ quad->shared_quad_state->blend_mode);
+ }
}
bool clipped = false;
@@ -1177,8 +1194,8 @@
contents_resource_lock->target());
}
- if (ShouldApplyBlendModeUsingBlendFunc(quad))
- ApplyBlendModeUsingBlendFunc(quad);
+ if (CanApplyBlendModeUsingBlendFunc(blend_mode))
+ ApplyBlendModeUsingBlendFunc(blend_mode);
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
gl_,
@@ -1427,8 +1444,8 @@
if (filter_bitmap)
GLC(gl_, gl_->Flush());
- if (ShouldApplyBlendModeUsingBlendFunc(quad))
- RestoreBlendFuncToDefault();
+ if (CanApplyBlendModeUsingBlendFunc(blend_mode))
+ RestoreBlendFuncToDefault(blend_mode);
}
struct SolidColorProgramUniforms {
diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h
index 2cfc47f..8e53d70 100644
--- a/cc/output/gl_renderer.h
+++ b/cc/output/gl_renderer.h
@@ -143,9 +143,12 @@
const CheckerboardDrawQuad* quad);
void DrawDebugBorderQuad(const DrawingFrame* frame,
const DebugBorderDrawQuad* quad);
- static bool ShouldApplyBlendModeUsingBlendFunc(const DrawQuad* quad);
- void ApplyBlendModeUsingBlendFunc(const DrawQuad* quad);
- void RestoreBlendFuncToDefault();
+ static bool IsDefaultBlendMode(SkXfermode::Mode blend_mode) {
+ return blend_mode == SkXfermode::kSrcOver_Mode;
+ }
+ bool CanApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode);
+ void ApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode);
+ void RestoreBlendFuncToDefault(SkXfermode::Mode blend_mode);
gfx::Rect GetBackdropBoundingBoxForRenderPassQuad(
DrawingFrame* frame,
@@ -436,6 +439,7 @@
ScopedPtrDeque<SyncQuery> available_sync_queries_;
scoped_ptr<SyncQuery> current_sync_query_;
bool use_sync_query_;
+ bool use_blend_minmax_;
SkBitmap on_demand_tile_raster_bitmap_;
ResourceProvider::ResourceId on_demand_tile_raster_resource_id_;
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index 45b6d2a..d6f7522 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -156,6 +156,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -192,6 +193,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -485,6 +487,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -527,6 +530,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -566,6 +570,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -618,6 +623,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -663,6 +669,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -750,6 +757,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -821,6 +829,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -912,6 +921,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -1010,6 +1020,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -1108,6 +1119,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -1299,6 +1311,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -1678,6 +1691,7 @@
resource_provider_ = ResourceProvider::Create(&output_surface_,
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc
index 2dd5a21..3502927 100644
--- a/cc/output/output_surface.cc
+++ b/cc/output/output_surface.cc
@@ -4,33 +4,16 @@
#include "cc/output/output_surface.h"
-#include <algorithm>
-#include <set>
-#include <string>
-#include <vector>
-
#include "base/bind.h"
#include "base/debug/trace_event.h"
-#include "base/logging.h"
#include "base/message_loop/message_loop.h"
-#include "base/metrics/histogram.h"
-#include "base/strings/string_split.h"
-#include "base/strings/string_util.h"
-#include "cc/output/compositor_frame.h"
-#include "cc/output/compositor_frame_ack.h"
#include "cc/output/managed_memory_policy.h"
#include "cc/output/output_surface_client.h"
-#include "cc/scheduler/delay_based_time_source.h"
#include "gpu/GLES2/gl2extchromium.h"
-#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
-#include "ui/gfx/frame_time.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
-using std::set;
-using std::string;
-using std::vector;
namespace cc {
@@ -222,33 +205,6 @@
context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0);
}
-void OutputSurface::SwapBuffers(CompositorFrame* frame) {
- if (frame->software_frame_data) {
- PostSwapBuffersComplete();
- client_->DidSwapBuffers();
- return;
- }
-
- DCHECK(context_provider_.get());
- DCHECK(frame->gl_frame_data);
-
- if (frame->gl_frame_data->sub_buffer_rect ==
- gfx::Rect(frame->gl_frame_data->size)) {
- context_provider_->ContextSupport()->Swap();
- } else {
- context_provider_->ContextSupport()->PartialSwapBuffers(
- frame->gl_frame_data->sub_buffer_rect);
- }
- uint32_t sync_point =
- context_provider_->ContextGL()->InsertSyncPointCHROMIUM();
- context_provider_->ContextSupport()->SignalSyncPoint(
- sync_point,
- base::Bind(&OutputSurface::OnSwapBuffersComplete,
- weak_ptr_factory_.GetWeakPtr()));
-
- client_->DidSwapBuffers();
-}
-
void OutputSurface::PostSwapBuffersComplete() {
base::MessageLoop::current()->PostTask(
FROM_HERE,
diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h
index c79f770..2cc43a3 100644
--- a/cc/output/output_surface.h
+++ b/cc/output/output_surface.h
@@ -12,7 +12,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "cc/base/cc_export.h"
-#include "cc/base/rolling_time_delta_history.h"
#include "cc/output/context_provider.h"
#include "cc/output/overlay_candidate_validator.h"
#include "cc/output/software_output_device.h"
@@ -113,8 +112,10 @@
// The implementation may destroy or steal the contents of the CompositorFrame
// passed in (though it will not take ownership of the CompositorFrame
- // itself).
- virtual void SwapBuffers(CompositorFrame* frame);
+ // itself). For successful swaps, the implementation must call
+ // OutputSurfaceClient::DidSwapBuffers() and eventually
+ // DidSwapBuffersComplete().
+ virtual void SwapBuffers(CompositorFrame* frame) = 0;
virtual void OnSwapBuffersComplete();
// Notifies frame-rate smoothness preference. If true, all non-critical
diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc
index aca1d27..b70e344 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -32,6 +32,11 @@
scoped_ptr<SoftwareOutputDevice> software_device)
: OutputSurface(context_provider, software_device.Pass()) {}
+ virtual void SwapBuffers(CompositorFrame* frame) override {
+ client_->DidSwapBuffers();
+ client_->DidSwapBuffersComplete();
+ }
+
bool InitializeNewContext3d(
scoped_refptr<ContextProvider> new_context_provider) {
return InitializeAndSetContext3d(new_context_provider);
diff --git a/cc/output/overlay_unittest.cc b/cc/output/overlay_unittest.cc
index 698b42b..245caec 100644
--- a/cc/output/overlay_unittest.cc
+++ b/cc/output/overlay_unittest.cc
@@ -102,11 +102,19 @@
explicit OverlayOutputSurface(scoped_refptr<ContextProvider> context_provider)
: OutputSurface(context_provider) {}
+ // OutputSurface implementation
+ virtual void SwapBuffers(CompositorFrame* frame) override;
+
void InitWithSingleOverlayValidator() {
overlay_candidate_validator_.reset(new SingleOverlayValidator);
}
};
+void OverlayOutputSurface::SwapBuffers(CompositorFrame* frame) {
+ client_->DidSwapBuffers();
+ client_->DidSwapBuffersComplete();
+}
+
scoped_ptr<RenderPass> CreateRenderPass() {
RenderPassId id(1, 0);
gfx::Rect output_rect(0, 0, 256, 256);
@@ -236,8 +244,15 @@
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
- &output_surface, shared_bitmap_manager.get(), NULL, 0, false, 1, false));
+ scoped_ptr<ResourceProvider> resource_provider(
+ ResourceProvider::Create(&output_surface,
+ shared_bitmap_manager.get(),
+ NULL,
+ NULL,
+ 0,
+ false,
+ 1,
+ false));
scoped_ptr<DefaultOverlayProcessor> overlay_processor(
new DefaultOverlayProcessor(&output_surface, resource_provider.get()));
@@ -258,6 +273,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -572,7 +588,7 @@
output_surface_.reset(new OverlayOutputSurface(provider_));
CHECK(output_surface_->BindToClient(&output_surface_client_));
resource_provider_ = ResourceProvider::Create(
- output_surface_.get(), NULL, NULL, 0, false, 1, false);
+ output_surface_.get(), NULL, NULL, NULL, 0, false, 1, false);
provider_->support()->SetScheduleOverlayPlaneCallback(base::Bind(
&MockOverlayScheduler::Schedule, base::Unretained(&scheduler_)));
diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
index 6d5af36..6a770e6 100644
--- a/cc/output/renderer_pixeltest.cc
+++ b/cc/output/renderer_pixeltest.cc
@@ -12,6 +12,7 @@
#include "cc/test/fake_picture_pile_impl.h"
#include "cc/test/pixel_test.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "media/base/video_frame.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkMatrix.h"
@@ -383,6 +384,346 @@
FuzzyPixelOffByOneComparator(true)));
}
+class VideoGLRendererPixelTest : public GLRendererPixelTest {
+ protected:
+ void CreateTestYUVVideoDrawQuad_Striped(const SharedQuadState* shared_state,
+ media::VideoFrame::Format format,
+ bool is_transparent,
+ const gfx::RectF& tex_coord_rect,
+ RenderPass* render_pass) {
+ const gfx::Rect rect(this->device_viewport_size_);
+
+ scoped_refptr<media::VideoFrame> video_frame =
+ media::VideoFrame::CreateFrame(
+ format, rect.size(), rect, rect.size(), base::TimeDelta());
+
+ // YUV values representing a striped pattern, for validating texture
+ // coordinates for sampling.
+ uint8_t y_value = 0;
+ uint8_t u_value = 0;
+ uint8_t v_value = 0;
+ for (int i = 0; i < video_frame->rows(media::VideoFrame::kYPlane); ++i) {
+ uint8_t* y_row = video_frame->data(media::VideoFrame::kYPlane) +
+ video_frame->stride(media::VideoFrame::kYPlane) * i;
+ for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kYPlane);
+ ++j) {
+ y_row[j] = (y_value += 1);
+ }
+ }
+ for (int i = 0; i < video_frame->rows(media::VideoFrame::kUPlane); ++i) {
+ uint8_t* u_row = video_frame->data(media::VideoFrame::kUPlane) +
+ video_frame->stride(media::VideoFrame::kUPlane) * i;
+ uint8_t* v_row = video_frame->data(media::VideoFrame::kVPlane) +
+ video_frame->stride(media::VideoFrame::kVPlane) * i;
+ for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kUPlane);
+ ++j) {
+ u_row[j] = (u_value += 3);
+ v_row[j] = (v_value += 5);
+ }
+ }
+ CreateTestYUVVideoDrawQuad_FromVideoFrame(
+ shared_state, video_frame, is_transparent, tex_coord_rect, render_pass);
+ }
+
+ void CreateTestYUVVideoDrawQuad_Solid(const SharedQuadState* shared_state,
+ media::VideoFrame::Format format,
+ bool is_transparent,
+ const gfx::RectF& tex_coord_rect,
+ uint8 y,
+ uint8 u,
+ uint8 v,
+ RenderPass* render_pass) {
+ const gfx::Rect rect(this->device_viewport_size_);
+
+ scoped_refptr<media::VideoFrame> video_frame =
+ media::VideoFrame::CreateFrame(
+ format, rect.size(), rect, rect.size(), base::TimeDelta());
+
+ // YUV values of a solid, constant, color. Useful for testing that color
+ // space/color range are being handled properly.
+ memset(video_frame->data(media::VideoFrame::kYPlane),
+ y,
+ video_frame->stride(media::VideoFrame::kYPlane) *
+ video_frame->rows(media::VideoFrame::kYPlane));
+ memset(video_frame->data(media::VideoFrame::kUPlane),
+ u,
+ video_frame->stride(media::VideoFrame::kUPlane) *
+ video_frame->rows(media::VideoFrame::kUPlane));
+ memset(video_frame->data(media::VideoFrame::kVPlane),
+ v,
+ video_frame->stride(media::VideoFrame::kVPlane) *
+ video_frame->rows(media::VideoFrame::kVPlane));
+
+ CreateTestYUVVideoDrawQuad_FromVideoFrame(
+ shared_state, video_frame, is_transparent, tex_coord_rect, render_pass);
+ }
+
+ void CreateTestYUVVideoDrawQuad_FromVideoFrame(
+ const SharedQuadState* shared_state,
+ scoped_refptr<media::VideoFrame> video_frame,
+ bool is_transparent,
+ const gfx::RectF& tex_coord_rect,
+ RenderPass* render_pass) {
+ const bool with_alpha = (video_frame->format() == media::VideoFrame::YV12A);
+ const YUVVideoDrawQuad::ColorSpace color_space =
+ (video_frame->format() == media::VideoFrame::YV12J
+ ? YUVVideoDrawQuad::REC_601_JPEG
+ : YUVVideoDrawQuad::REC_601);
+ const gfx::Rect rect(this->device_viewport_size_);
+ const gfx::Rect opaque_rect(0, 0, 0, 0);
+
+ if (with_alpha)
+ memset(video_frame->data(media::VideoFrame::kAPlane),
+ is_transparent ? 0 : 128,
+ video_frame->stride(media::VideoFrame::kAPlane) *
+ video_frame->rows(media::VideoFrame::kAPlane));
+
+ VideoFrameExternalResources resources =
+ video_resource_updater_->CreateExternalResourcesFromVideoFrame(
+ video_frame);
+
+ EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type);
+ EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()),
+ resources.mailboxes.size());
+ EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()),
+ resources.release_callbacks.size());
+
+ ResourceProvider::ResourceId y_resource =
+ resource_provider_->CreateResourceFromTextureMailbox(
+ resources.mailboxes[media::VideoFrame::kYPlane],
+ SingleReleaseCallbackImpl::Create(
+ resources.release_callbacks[media::VideoFrame::kYPlane]));
+ ResourceProvider::ResourceId u_resource =
+ resource_provider_->CreateResourceFromTextureMailbox(
+ resources.mailboxes[media::VideoFrame::kUPlane],
+ SingleReleaseCallbackImpl::Create(
+ resources.release_callbacks[media::VideoFrame::kUPlane]));
+ ResourceProvider::ResourceId v_resource =
+ resource_provider_->CreateResourceFromTextureMailbox(
+ resources.mailboxes[media::VideoFrame::kVPlane],
+ SingleReleaseCallbackImpl::Create(
+ resources.release_callbacks[media::VideoFrame::kVPlane]));
+ ResourceProvider::ResourceId a_resource = 0;
+ if (with_alpha) {
+ a_resource = resource_provider_->CreateResourceFromTextureMailbox(
+ resources.mailboxes[media::VideoFrame::kAPlane],
+ SingleReleaseCallbackImpl::Create(
+ resources.release_callbacks[media::VideoFrame::kAPlane]));
+ }
+
+ YUVVideoDrawQuad* yuv_quad =
+ render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
+ yuv_quad->SetNew(shared_state,
+ rect,
+ opaque_rect,
+ rect,
+ tex_coord_rect,
+ y_resource,
+ u_resource,
+ v_resource,
+ a_resource,
+ color_space);
+ }
+
+ virtual void SetUp() override {
+ GLRendererPixelTest::SetUp();
+ video_resource_updater_.reset(new VideoResourceUpdater(
+ output_surface_->context_provider(), resource_provider_.get()));
+ }
+
+ private:
+ scoped_ptr<VideoResourceUpdater> video_resource_updater_;
+};
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ CreateTestYUVVideoDrawQuad_Striped(shared_state,
+ media::VideoFrame::YV12,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(
+ this->RunPixelTest(&pass_list,
+ base::FilePath(FILE_PATH_LITERAL("yuv_stripes.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, OffsetYUVRect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ // Intentionally sets frame format to I420 for testing coverage.
+ CreateTestYUVVideoDrawQuad_Striped(shared_state,
+ media::VideoFrame::I420,
+ false,
+ gfx::RectF(0.125f, 0.25f, 0.75f, 0.5f),
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(
+ &pass_list,
+ base::FilePath(FILE_PATH_LITERAL("yuv_stripes_offset.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ // In MPEG color range YUV values of (15,128,128) should produce black.
+ CreateTestYUVVideoDrawQuad_Solid(shared_state,
+ media::VideoFrame::YV12,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ 15,
+ 128,
+ 128,
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ // If we didn't get black out of the YUV values above, then we probably have a
+ // color range issue.
+ EXPECT_TRUE(this->RunPixelTest(&pass_list,
+ base::FilePath(FILE_PATH_LITERAL("black.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ // YUV of (149,43,21) should be green (0,255,0) in RGB.
+ CreateTestYUVVideoDrawQuad_Solid(shared_state,
+ media::VideoFrame::YV12J,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ 149,
+ 43,
+ 21,
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(&pass_list,
+ base::FilePath(FILE_PATH_LITERAL("green.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ // Dark grey in JPEG color range (in MPEG, this is black).
+ CreateTestYUVVideoDrawQuad_Solid(shared_state,
+ media::VideoFrame::YV12J,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ 15,
+ 128,
+ 128,
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(
+ this->RunPixelTest(&pass_list,
+ base::FilePath(FILE_PATH_LITERAL("dark_grey.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ CreateTestYUVVideoDrawQuad_Striped(shared_state,
+ media::VideoFrame::YV12A,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get());
+
+ SolidColorDrawQuad* color_quad =
+ pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
+ color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false);
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(
+ &pass_list,
+ base::FilePath(FILE_PATH_LITERAL("yuv_stripes_alpha.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ CreateTestYUVVideoDrawQuad_Striped(shared_state,
+ media::VideoFrame::YV12A,
+ true,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get());
+
+ SolidColorDrawQuad* color_quad =
+ pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
+ color_quad->SetNew(shared_state, rect, rect, SK_ColorBLACK, false);
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(
+ &pass_list,
+ base::FilePath(FILE_PATH_LITERAL("black.png")),
+ ExactPixelComparator(true)));
+}
+
TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) {
gfx::Rect viewport_rect(this->device_viewport_size_);
@@ -882,12 +1223,11 @@
// This RenderPassDrawQuad does not include the full |viewport_rect| which is
// the size of the child render pass.
- gfx::Rect sub_rect = gfx::Rect(50, 50, 100, 100);
+ gfx::Rect sub_rect = gfx::Rect(50, 50, 200, 100);
EXPECT_NE(sub_rect.x(), child_pass->output_rect.x());
EXPECT_NE(sub_rect.y(), child_pass->output_rect.y());
EXPECT_NE(sub_rect.right(), child_pass->output_rect.right());
EXPECT_NE(sub_rect.bottom(), child_pass->output_rect.bottom());
- EXPECT_TRUE(child_pass->output_rect.Contains(sub_rect));
// Set up a mask on the RenderPassDrawQuad.
RenderPassDrawQuad* mask_quad =
@@ -897,10 +1237,10 @@
sub_rect,
child_pass_id,
mask_resource_id,
- gfx::RectF(1.f, 1.f), // mask_uv_rect
- FilterOperations(), // foreground filters
- gfx::Vector2dF(), // filters scale
- FilterOperations()); // background filters
+ gfx::RectF(0.5f, 0.5f, 2.f, 1.f), // mask_uv_rect
+ FilterOperations(), // foreground filters
+ gfx::Vector2dF(), // filters scale
+ FilterOperations()); // background filters
// White background behind the masked render pass.
SolidColorDrawQuad* white =
@@ -917,7 +1257,7 @@
EXPECT_TRUE(this->RunPixelTest(
&pass_list,
- base::FilePath(FILE_PATH_LITERAL("image_mask_of_layer.png")),
+ base::FilePath(FILE_PATH_LITERAL("mask_bottom_right.png")),
ExactPixelComparator(true)));
}
diff --git a/cc/output/renderer_unittest.cc b/cc/output/renderer_unittest.cc
index 99ff89d..8f0a0ef 100644
--- a/cc/output/renderer_unittest.cc
+++ b/cc/output/renderer_unittest.cc
@@ -15,6 +15,29 @@
namespace cc {
namespace {
+class TestOutputSurface : public OutputSurface {
+ public:
+ explicit TestOutputSurface(
+ const scoped_refptr<ContextProvider>& context_provider);
+ virtual ~TestOutputSurface() override;
+
+ // OutputSurface implementation
+ virtual void SwapBuffers(CompositorFrame* frame) override;
+};
+
+TestOutputSurface::TestOutputSurface(
+ const scoped_refptr<ContextProvider>& context_provider)
+ : OutputSurface(context_provider) {
+}
+
+TestOutputSurface::~TestOutputSurface() {
+}
+
+void TestOutputSurface::SwapBuffers(CompositorFrame* frame) {
+ client_->DidSwapBuffers();
+ client_->DidSwapBuffersComplete();
+}
+
class MockContextProvider : public TestContextProvider {
public:
explicit MockContextProvider(scoped_ptr<TestWebGraphicsContext3D> context)
@@ -57,10 +80,10 @@
virtual void SetUp() {
context_provider_ =
new MockContextProvider(TestWebGraphicsContext3D::Create());
- output_surface_.reset(new OutputSurface(context_provider_));
+ output_surface_.reset(new TestOutputSurface(context_provider_));
output_surface_->BindToClient(&output_surface_client_);
resource_provider_ = ResourceProvider::Create(
- output_surface_.get(), NULL, NULL, 0, false, 1, false);
+ output_surface_.get(), NULL, NULL, NULL, 0, false, 1, false);
renderer_ = CreateRenderer<T>(&renderer_client_,
&tree_settings_,
output_surface_.get(),
diff --git a/cc/output/software_renderer_unittest.cc b/cc/output/software_renderer_unittest.cc
index 5dfc158..2896be1 100644
--- a/cc/output/software_renderer_unittest.cc
+++ b/cc/output/software_renderer_unittest.cc
@@ -39,6 +39,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h
index 1460458..e0fc758 100644
--- a/cc/quads/yuv_video_draw_quad.h
+++ b/cc/quads/yuv_video_draw_quad.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
+#include "cc/layers/video_layer_impl.h"
#include "cc/quads/draw_quad.h"
namespace cc {
diff --git a/cc/resources/bitmap_raster_worker_pool.cc b/cc/resources/bitmap_raster_worker_pool.cc
index 404f67f..e86129f 100644
--- a/cc/resources/bitmap_raster_worker_pool.cc
+++ b/cc/resources/bitmap_raster_worker_pool.cc
@@ -10,6 +10,7 @@
#include "base/debug/trace_event_argument.h"
#include "base/strings/stringprintf.h"
#include "cc/debug/traced_value.h"
+#include "cc/resources/picture_pile_impl.h"
#include "cc/resources/raster_buffer.h"
#include "cc/resources/resource.h"
@@ -23,10 +24,12 @@
: lock_(resource_provider, resource->id()) {}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
- return skia::SharePtr(lock_.sk_canvas());
+ virtual void Playback(const PicturePileImpl* picture_pile,
+ const gfx::Rect& rect,
+ float scale,
+ RenderingStatsInstrumentation* stats) override {
+ picture_pile->RasterToBitmap(lock_.sk_canvas(), rect, scale, stats);
}
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {}
private:
ResourceProvider::ScopedWriteLockSoftware lock_;
diff --git a/cc/resources/gpu_memory_buffer_manager.h b/cc/resources/gpu_memory_buffer_manager.h
new file mode 100644
index 0000000..1e114c3
--- /dev/null
+++ b/cc/resources/gpu_memory_buffer_manager.h
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_RESOURCES_GPU_MEMORY_BUFFER_MANAGER_H_
+#define CC_RESOURCES_GPU_MEMORY_BUFFER_MANAGER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "cc/base/cc_export.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+#include "ui/gfx/size.h"
+
+namespace cc {
+
+class CC_EXPORT GpuMemoryBufferManager {
+ public:
+ // Allocates a GpuMemoryBuffer that can be shared with another process.
+ virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
+ const gfx::Size& size,
+ gfx::GpuMemoryBuffer::Format format,
+ gfx::GpuMemoryBuffer::Usage usage) = 0;
+
+ // Returns a GpuMemoryBuffer instance given a ClientBuffer. Returns NULL on
+ // failure.
+ virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer(
+ ClientBuffer buffer) = 0;
+
+ protected:
+ virtual ~GpuMemoryBufferManager() {}
+};
+
+} // namespace cc
+
+#endif // CC_RESOURCES_GPU_MEMORY_BUFFER_MANAGER_H_
diff --git a/cc/resources/gpu_raster_worker_pool.cc b/cc/resources/gpu_raster_worker_pool.cc
index 229a3f7..2d1e888 100644
--- a/cc/resources/gpu_raster_worker_pool.cc
+++ b/cc/resources/gpu_raster_worker_pool.cc
@@ -8,6 +8,7 @@
#include "base/debug/trace_event.h"
#include "cc/output/context_provider.h"
+#include "cc/resources/picture_pile_impl.h"
#include "cc/resources/raster_buffer.h"
#include "cc/resources/resource.h"
#include "cc/resources/resource_provider.h"
@@ -17,7 +18,6 @@
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrContext.h"
-#include "third_party/skia/include/utils/SkNullCanvas.h"
namespace cc {
namespace {
@@ -32,27 +32,24 @@
multi_picture_draw_(multi_picture_draw) {}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
- if (!lock_.sk_surface())
- return skia::AdoptRef(SkCreateNullCanvas());
-
- skia::RefPtr<SkCanvas> canvas = skia::SharePtr(recorder_.beginRecording(
- resource_->size().width(), resource_->size().height()));
-
- // Balanced with restore() call in ReleaseSkCanvas. save()/restore() calls
- // are needed to ensure that canvas returns to its previous state after use.
- canvas->save();
- return canvas;
- }
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {
+ virtual void Playback(const PicturePileImpl* picture_pile,
+ const gfx::Rect& rect,
+ float scale,
+ RenderingStatsInstrumentation* stats) override {
if (!lock_.sk_surface())
return;
- // Balanced with save() call in AcquireSkCanvas.
+ SkPictureRecorder recorder;
+ gfx::Size size = resource_->size();
+ skia::RefPtr<SkCanvas> canvas =
+ skia::SharePtr(recorder.beginRecording(size.width(), size.height()));
+
+ canvas->save();
+ picture_pile->RasterToBitmap(canvas.get(), rect, scale, stats);
canvas->restore();
// Add the canvas and recorded picture to |multi_picture_draw_|.
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder_.endRecording());
+ skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
multi_picture_draw_->add(lock_.sk_surface()->getCanvas(), picture.get());
}
@@ -60,7 +57,6 @@
ResourceProvider::ScopedWriteLockGr lock_;
const Resource* resource_;
SkMultiPictureDraw* multi_picture_draw_;
- SkPictureRecorder recorder_;
DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
};
diff --git a/cc/resources/memory_history.cc b/cc/resources/memory_history.cc
index a2f8b6e..4dc49c8 100644
--- a/cc/resources/memory_history.cc
+++ b/cc/resources/memory_history.cc
@@ -24,7 +24,7 @@
*max = 0;
for (RingBufferType::Iterator it = ring_buffer_.Begin(); it; ++it) {
- size_t bytes_total = it->bytes_total();
+ size_t bytes_total = it->total_bytes_used;
if (bytes_total < *min)
*min = bytes_total;
diff --git a/cc/resources/memory_history.h b/cc/resources/memory_history.h
index daca10f..570a3d0 100644
--- a/cc/resources/memory_history.h
+++ b/cc/resources/memory_history.h
@@ -22,17 +22,12 @@
struct Entry {
Entry()
: total_budget_in_bytes(0),
- bytes_allocated(0),
- bytes_unreleasable(0),
- bytes_over(0) {}
+ total_bytes_used(0),
+ had_enough_memory(false) {}
size_t total_budget_in_bytes;
- size_t bytes_allocated;
- size_t bytes_unreleasable;
- size_t bytes_over;
- size_t bytes_total() const {
- return bytes_allocated + bytes_unreleasable + bytes_over;
- }
+ size_t total_bytes_used;
+ bool had_enough_memory;
};
void SaveEntry(const Entry& entry);
diff --git a/cc/resources/one_copy_raster_worker_pool.cc b/cc/resources/one_copy_raster_worker_pool.cc
index fba320f..a297451 100644
--- a/cc/resources/one_copy_raster_worker_pool.cc
+++ b/cc/resources/one_copy_raster_worker_pool.cc
@@ -14,7 +14,7 @@
#include "cc/resources/resource_pool.h"
#include "cc/resources/scoped_resource.h"
#include "gpu/command_buffer/client/gles2_interface.h"
-#include "third_party/skia/include/utils/SkNullCanvas.h"
+#include "ui/gfx/gpu_memory_buffer.h"
namespace cc {
namespace {
@@ -30,8 +30,7 @@
raster_resource_(resource_pool->AcquireResource(resource->size())),
lock_(new ResourceProvider::ScopedWriteLockGpuMemoryBuffer(
resource_provider_,
- raster_resource_->id())),
- buffer_(NULL) {}
+ raster_resource_->id())) {}
virtual ~RasterBufferImpl() {
// First unlock raster resource.
@@ -46,24 +45,23 @@
}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
- buffer_ = lock_->gpu_memory_buffer();
- if (!buffer_)
- return skia::AdoptRef(SkCreateNullCanvas());
-
- RasterWorkerPool::AcquireBitmapForBuffer(&bitmap_,
- buffer_,
- resource_->format(),
- resource_->size(),
- lock_->stride());
- return skia::AdoptRef(new SkCanvas(bitmap_));
- }
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {
- if (!buffer_)
+ virtual void Playback(const PicturePileImpl* picture_pile,
+ const gfx::Rect& rect,
+ float scale,
+ RenderingStatsInstrumentation* stats) override {
+ gfx::GpuMemoryBuffer* gpu_memory_buffer = lock_->gpu_memory_buffer();
+ if (!gpu_memory_buffer)
return;
- RasterWorkerPool::ReleaseBitmapForBuffer(
- &bitmap_, buffer_, resource_->format());
+ RasterWorkerPool::PlaybackToMemory(gpu_memory_buffer->Map(),
+ resource_->format(),
+ resource_->size(),
+ gpu_memory_buffer->GetStride(),
+ picture_pile,
+ rect,
+ scale,
+ stats);
+ gpu_memory_buffer->Unmap();
}
private:
@@ -72,8 +70,6 @@
const Resource* resource_;
scoped_ptr<ScopedResource> raster_resource_;
scoped_ptr<ResourceProvider::ScopedWriteLockGpuMemoryBuffer> lock_;
- void* buffer_;
- SkBitmap bitmap_;
DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
};
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index ee17dc8..a6c46a1 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -54,13 +54,6 @@
TreePriority tree_priority_;
};
-void ReleaseTile(Tile* tile, WhichTree tree) {
- // Reset priority as tile is ref-counted and might still be used
- // even though we no longer hold a reference to it here anymore.
- tile->SetPriority(tree, TilePriority());
- tile->set_shared(false);
-}
-
} // namespace
scoped_ptr<PictureLayerTiling> PictureLayerTiling::Create(
@@ -79,8 +72,10 @@
layer_bounds_(layer_bounds),
resolution_(NON_IDEAL_RESOLUTION),
client_(client),
- tiling_data_(gfx::Size(), gfx::Size(), true),
+ tiling_data_(gfx::Size(), gfx::Size(), kBorderTexels),
last_impl_frame_time_in_seconds_(0.0),
+ content_to_screen_scale_(0.f),
+ can_require_tiles_for_activation_(false),
has_visible_rect_tiles_(false),
has_skewport_rect_tiles_(false),
has_soon_border_rect_tiles_(false),
@@ -107,7 +102,7 @@
PictureLayerTiling::~PictureLayerTiling() {
for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
- ReleaseTile(it->second.get(), client_->GetTree());
+ it->second->set_shared(false);
}
void PictureLayerTiling::SetClient(PictureLayerTilingClient* client) {
@@ -133,6 +128,8 @@
gfx::ScaleToEnclosingRect(paint_rect, 1.0f / contents_scale_);
if (!client_->GetInvalidation()->Intersects(rect)) {
DCHECK(!candidate_tile->is_shared());
+ DCHECK_EQ(i, candidate_tile->tiling_i_index());
+ DCHECK_EQ(j, candidate_tile->tiling_j_index());
candidate_tile->set_shared(true);
tiles_[key] = candidate_tile;
return candidate_tile;
@@ -144,6 +141,7 @@
scoped_refptr<Tile> tile = client_->CreateTile(this, tile_rect);
if (tile.get()) {
DCHECK(!tile->is_shared());
+ tile->set_tiling_index(i, j);
tiles_[key] = tile;
}
return tile.get();
@@ -466,7 +464,7 @@
TileMap::iterator found = tiles_.find(TileMapKey(i, j));
if (found == tiles_.end())
return false;
- ReleaseTile(found->second.get(), client_->GetTree());
+ found->second->set_shared(false);
tiles_.erase(found);
if (recycled_twin) {
// Recycled twin does not also have a recycled twin, so pass NULL.
@@ -479,7 +477,7 @@
live_tiles_rect_ = gfx::Rect();
PictureLayerTiling* recycled_twin = client_->GetRecycledTwinTiling(this);
for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- ReleaseTile(it->second.get(), client_->GetTree());
+ it->second->set_shared(false);
if (recycled_twin)
recycled_twin->RemoveTileAt(it->first.first, it->first.second, NULL);
}
@@ -534,7 +532,7 @@
return skewport;
}
-void PictureLayerTiling::UpdateTilePriorities(
+void PictureLayerTiling::ComputeTilePriorityRects(
WhichTree tree,
const gfx::Rect& viewport_in_layer_space,
float ideal_contents_scale,
@@ -555,16 +553,18 @@
return;
}
+ // Calculate the skewport.
+ gfx::Rect skewport = ComputeSkewport(current_frame_time_in_seconds,
+ visible_rect_in_content_space);
+ DCHECK(skewport.Contains(visible_rect_in_content_space));
+
+ // Calculate the eventually/live tiles rect.
size_t max_tiles_for_interest_area = client_->GetMaxTilesForInterestArea();
gfx::Size tile_size = tiling_data_.max_texture_size();
int64 eventually_rect_area =
max_tiles_for_interest_area * tile_size.width() * tile_size.height();
- gfx::Rect skewport = ComputeSkewport(current_frame_time_in_seconds,
- visible_rect_in_content_space);
- DCHECK(skewport.Contains(visible_rect_in_content_space));
-
gfx::Rect eventually_rect =
ExpandRectEquallyToAreaBoundedBy(visible_rect_in_content_space,
eventually_rect_area,
@@ -576,6 +576,13 @@
<< "tiling_size: " << tiling_size().ToString()
<< " eventually_rect: " << eventually_rect.ToString();
+ // Calculate the soon border rect.
+ content_to_screen_scale_ = ideal_contents_scale / contents_scale_;
+ gfx::Rect soon_border_rect = visible_rect_in_content_space;
+ float border = kSoonBorderDistanceInScreenPixels / content_to_screen_scale_;
+ soon_border_rect.Inset(-border, -border, -border, -border);
+
+ // Update the tiling state.
SetLiveTilesRect(eventually_rect);
last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds;
@@ -583,104 +590,20 @@
eviction_tiles_cache_valid_ = false;
- TilePriority now_priority(resolution_, TilePriority::NOW, 0);
- float content_to_screen_scale = ideal_contents_scale / contents_scale_;
-
- // Assign now priority to all visible tiles.
- bool include_borders = false;
- has_visible_rect_tiles_ = false;
- for (TilingData::Iterator iter(
- &tiling_data_, visible_rect_in_content_space, include_borders);
- iter;
- ++iter) {
- TileMap::iterator find = tiles_.find(iter.index());
- if (find == tiles_.end())
- continue;
- has_visible_rect_tiles_ = true;
- Tile* tile = find->second.get();
-
- tile->SetPriority(tree, now_priority);
-
- // Set whether tile is occluded or not.
- gfx::Rect tile_query_rect = ScaleToEnclosingRect(
- IntersectRects(tile->content_rect(), visible_rect_in_content_space),
- 1.0f / contents_scale_);
- bool is_occluded = occlusion_in_layer_space.IsOccluded(tile_query_rect);
- tile->set_is_occluded(tree, is_occluded);
- }
-
- // Assign soon priority to skewport tiles.
- has_skewport_rect_tiles_ = false;
- for (TilingData::DifferenceIterator iter(
- &tiling_data_, skewport, visible_rect_in_content_space);
- iter;
- ++iter) {
- TileMap::iterator find = tiles_.find(iter.index());
- if (find == tiles_.end())
- continue;
- has_skewport_rect_tiles_ = true;
- Tile* tile = find->second.get();
-
- gfx::Rect tile_bounds =
- tiling_data_.TileBounds(iter.index_x(), iter.index_y());
-
- float distance_to_visible =
- visible_rect_in_content_space.ManhattanInternalDistance(tile_bounds) *
- content_to_screen_scale;
-
- TilePriority priority(resolution_, TilePriority::SOON, distance_to_visible);
- tile->SetPriority(tree, priority);
- }
-
- // Assign eventually priority to interest rect tiles.
- has_eventually_rect_tiles_ = false;
- for (TilingData::DifferenceIterator iter(
- &tiling_data_, eventually_rect, skewport);
- iter;
- ++iter) {
- TileMap::iterator find = tiles_.find(iter.index());
- if (find == tiles_.end())
- continue;
- has_eventually_rect_tiles_ = true;
- Tile* tile = find->second.get();
-
- gfx::Rect tile_bounds =
- tiling_data_.TileBounds(iter.index_x(), iter.index_y());
-
- float distance_to_visible =
- visible_rect_in_content_space.ManhattanInternalDistance(tile_bounds) *
- content_to_screen_scale;
- TilePriority priority(
- resolution_, TilePriority::EVENTUALLY, distance_to_visible);
- tile->SetPriority(tree, priority);
- }
-
- // Upgrade the priority on border tiles to be SOON.
- gfx::Rect soon_border_rect = visible_rect_in_content_space;
- float border = kSoonBorderDistanceInScreenPixels / content_to_screen_scale;
- soon_border_rect.Inset(-border, -border, -border, -border);
- has_soon_border_rect_tiles_ = false;
- for (TilingData::DifferenceIterator iter(
- &tiling_data_, soon_border_rect, skewport);
- iter;
- ++iter) {
- TileMap::iterator find = tiles_.find(iter.index());
- if (find == tiles_.end())
- continue;
- has_soon_border_rect_tiles_ = true;
- Tile* tile = find->second.get();
-
- TilePriority priority(resolution_,
- TilePriority::SOON,
- tile->priority(tree).distance_to_visible);
- tile->SetPriority(tree, priority);
- }
-
- // Update iteration rects.
current_visible_rect_ = visible_rect_in_content_space;
current_skewport_rect_ = skewport;
current_soon_border_rect_ = soon_border_rect;
current_eventually_rect_ = eventually_rect;
+ current_occlusion_in_layer_space_ = occlusion_in_layer_space;
+
+ // Update has_*_tiles state.
+ gfx::Rect tiling_rect(tiling_size());
+
+ has_visible_rect_tiles_ = tiling_rect.Intersects(current_visible_rect_);
+ has_skewport_rect_tiles_ = tiling_rect.Intersects(current_skewport_rect_);
+ has_soon_border_rect_tiles_ =
+ tiling_rect.Intersects(current_soon_border_rect_);
+ has_eventually_rect_tiles_ = tiling_rect.Intersects(current_eventually_rect_);
}
void PictureLayerTiling::SetLiveTilesRect(
@@ -741,29 +664,130 @@
#endif
}
-void PictureLayerTiling::DidBecomeRecycled() {
- // DidBecomeActive below will set the active priority for tiles that are
- // still in the tree. Calling this first on an active tiling that is becoming
- // recycled takes care of tiles that are no longer in the active tree (eg.
- // due to a pending invalidation).
- for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- it->second->SetPriority(ACTIVE_TREE, TilePriority());
+bool PictureLayerTiling::IsTileOccluded(const Tile* tile) const {
+ DCHECK(tile);
+
+ if (!current_occlusion_in_layer_space_.HasOcclusion())
+ return false;
+
+ gfx::Rect tile_query_rect =
+ gfx::IntersectRects(tile->content_rect(), current_visible_rect_);
+
+ // Explicitly check if the tile is outside the viewport. If so, we need to
+ // return false, since occlusion for this tile is unknown.
+ // TODO(vmpstr): Since the current visible rect is really a viewport in
+ // layer space, we should probably clip tile query rect to tiling bounds
+ // or live tiles rect.
+ if (tile_query_rect.IsEmpty())
+ return false;
+
+ if (contents_scale_ != 1.f) {
+ tile_query_rect =
+ gfx::ScaleToEnclosingRect(tile_query_rect, 1.0f / contents_scale_);
}
+
+ return current_occlusion_in_layer_space_.IsOccluded(tile_query_rect);
}
-void PictureLayerTiling::DidBecomeActive() {
- PicturePileImpl* active_pile = client_->GetPile();
- for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- it->second->SetPriority(ACTIVE_TREE, it->second->priority(PENDING_TREE));
- it->second->SetPriority(PENDING_TREE, TilePriority());
+bool PictureLayerTiling::IsTileRequiredForActivation(const Tile* tile) const {
+ DCHECK_EQ(PENDING_TREE, client_->GetTree());
- // Tile holds a ref onto a picture pile. If the tile never gets invalidated
- // and recreated, then that picture pile ref could exist indefinitely. To
- // prevent this, ask the client to update the pile to its own ref. This
- // will cause PicturePileImpls to get deleted once the corresponding
- // PictureLayerImpl and any in flight raster jobs go out of scope.
- it->second->set_picture_pile(active_pile);
+ // Note that although this function will determine whether tile is required
+ // for activation assuming that it is in visible (ie in the viewport). That is
+ // to say, even if the tile is outside of the viewport, it will be treated as
+ // if it was inside (there are no explicit checks for this). Hence, this
+ // function is only called for visible tiles to ensure we don't block
+ // activation on tiles outside of the viewport.
+
+ // If we are not allowed to mark tiles as required for activation, then don't
+ // do it.
+ if (!can_require_tiles_for_activation_)
+ return false;
+
+ if (resolution_ != HIGH_RESOLUTION)
+ return false;
+
+ if (IsTileOccluded(tile))
+ return false;
+
+ if (client_->RequiresHighResToDraw())
+ return true;
+
+ const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this);
+ if (!twin_tiling)
+ return true;
+
+ if (twin_tiling->layer_bounds() != layer_bounds())
+ return true;
+
+ if (twin_tiling->current_visible_rect_ != current_visible_rect_)
+ return true;
+
+ Tile* twin_tile =
+ twin_tiling->TileAt(tile->tiling_i_index(), tile->tiling_j_index());
+ // If twin tile is missing, it might not have a recording, so we don't need
+ // this tile to be required for activation.
+ if (!twin_tile)
+ return false;
+
+ return true;
+}
+
+void PictureLayerTiling::UpdateTileAndTwinPriority(Tile* tile) const {
+ UpdateTilePriority(tile);
+
+ const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this);
+ if (!tile->is_shared() || !twin_tiling) {
+ WhichTree tree = client_->GetTree();
+ WhichTree twin_tree = tree == ACTIVE_TREE ? PENDING_TREE : ACTIVE_TREE;
+ tile->SetPriority(twin_tree, TilePriority());
+ tile->set_is_occluded(twin_tree, false);
+ if (twin_tree == PENDING_TREE)
+ tile->set_required_for_activation(false);
+ return;
}
+
+ twin_tiling->UpdateTilePriority(tile);
+}
+
+void PictureLayerTiling::UpdateTilePriority(Tile* tile) const {
+ // TODO(vmpstr): This code should return the priority instead of setting it on
+ // the tile. This should be a part of the change to move tile priority from
+ // tiles into iterators.
+ WhichTree tree = client_->GetTree();
+
+ DCHECK_EQ(TileAt(tile->tiling_i_index(), tile->tiling_j_index()), tile);
+ gfx::Rect tile_bounds =
+ tiling_data_.TileBounds(tile->tiling_i_index(), tile->tiling_j_index());
+
+ if (current_visible_rect_.Intersects(tile_bounds)) {
+ tile->SetPriority(tree, TilePriority(resolution_, TilePriority::NOW, 0));
+ if (tree == PENDING_TREE)
+ tile->set_required_for_activation(IsTileRequiredForActivation(tile));
+ tile->set_is_occluded(tree, IsTileOccluded(tile));
+ return;
+ }
+
+ if (tree == PENDING_TREE)
+ tile->set_required_for_activation(false);
+ tile->set_is_occluded(tree, false);
+
+ DCHECK_GT(content_to_screen_scale_, 0.f);
+ float distance_to_visible =
+ current_visible_rect_.ManhattanInternalDistance(tile_bounds) *
+ content_to_screen_scale_;
+
+ if (current_soon_border_rect_.Intersects(tile_bounds) ||
+ current_skewport_rect_.Intersects(tile_bounds)) {
+ tile->SetPriority(
+ tree,
+ TilePriority(resolution_, TilePriority::SOON, distance_to_visible));
+ return;
+ }
+
+ tile->SetPriority(
+ tree,
+ TilePriority(resolution_, TilePriority::EVENTUALLY, distance_to_visible));
}
void PictureLayerTiling::GetAllTilesForTracing(
@@ -954,9 +978,8 @@
eviction_tiles_eventually_and_required_for_activation_.clear();
for (TileMap::iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- // TODO(vmpstr): This should update the priority if UpdateTilePriorities
- // changes not to do this.
Tile* tile = it->second.get();
+ UpdateTileAndTwinPriority(tile);
const TilePriority& priority =
tile->priority_for_tree_priority(tree_priority);
switch (priority.priority_bin) {
@@ -1031,9 +1054,8 @@
: tiling_(NULL), current_tile_(NULL) {}
PictureLayerTiling::TilingRasterTileIterator::TilingRasterTileIterator(
- PictureLayerTiling* tiling,
- WhichTree tree)
- : tiling_(tiling), phase_(VISIBLE_RECT), tree_(tree), current_tile_(NULL) {
+ PictureLayerTiling* tiling)
+ : tiling_(tiling), phase_(VISIBLE_RECT), current_tile_(NULL) {
if (!tiling_->has_visible_rect_tiles_) {
AdvancePhase();
return;
@@ -1049,8 +1071,11 @@
current_tile_ =
tiling_->TileAt(visible_iterator_.index_x(), visible_iterator_.index_y());
- if (!current_tile_ || !TileNeedsRaster(current_tile_))
+ if (!current_tile_ || !TileNeedsRaster(current_tile_)) {
++(*this);
+ return;
+ }
+ tiling_->UpdateTileAndTwinPriority(current_tile_);
}
PictureLayerTiling::TilingRasterTileIterator::~TilingRasterTileIterator() {}
@@ -1111,6 +1136,9 @@
break;
}
} while (!spiral_iterator_);
+
+ if (current_tile_)
+ tiling_->UpdateTileAndTwinPriority(current_tile_);
}
PictureLayerTiling::TilingRasterTileIterator&
@@ -1148,6 +1176,9 @@
}
current_tile_ = tiling_->TileAt(next_index.first, next_index.second);
}
+
+ if (current_tile_)
+ tiling_->UpdateTileAndTwinPriority(current_tile_);
return *this;
}
diff --git a/cc/resources/picture_layer_tiling.h b/cc/resources/picture_layer_tiling.h
index 2d0ae37..3b60edd 100644
--- a/cc/resources/picture_layer_tiling.h
+++ b/cc/resources/picture_layer_tiling.h
@@ -50,6 +50,7 @@
virtual float GetSkewportTargetTimeInSeconds() const = 0;
virtual int GetSkewportExtrapolationLimitInContentPixels() const = 0;
virtual WhichTree GetTree() const = 0;
+ virtual bool RequiresHighResToDraw() const = 0;
protected:
virtual ~PictureLayerTilingClient() {}
@@ -57,6 +58,8 @@
class CC_EXPORT PictureLayerTiling {
public:
+ static const int kBorderTexels = 1;
+
enum EvictionCategory {
EVENTUALLY,
EVENTUALLY_AND_REQUIRED_FOR_ACTIVATION,
@@ -69,7 +72,7 @@
class CC_EXPORT TilingRasterTileIterator {
public:
TilingRasterTileIterator();
- TilingRasterTileIterator(PictureLayerTiling* tiling, WhichTree tree);
+ explicit TilingRasterTileIterator(PictureLayerTiling* tiling);
~TilingRasterTileIterator();
operator bool() const { return !!current_tile_; }
@@ -101,13 +104,12 @@
void AdvancePhase();
bool TileNeedsRaster(Tile* tile) const {
- return !tile->is_occluded(tree_) && !tile->IsReadyToDraw();
+ return tile->NeedsRaster() && !tiling_->IsTileOccluded(tile);
}
PictureLayerTiling* tiling_;
Phase phase_;
- WhichTree tree_;
Tile* current_tile_;
TilingData::Iterator visible_iterator_;
@@ -148,6 +150,9 @@
void SetClient(PictureLayerTilingClient* client);
void set_resolution(TileResolution resolution) { resolution_ = resolution; }
TileResolution resolution() const { return resolution_; }
+ void set_can_require_tiles_for_activation(bool can_require_tiles) {
+ can_require_tiles_for_activation_ = can_require_tiles;
+ }
gfx::Size tiling_size() const { return tiling_data_.tiling_size(); }
gfx::Rect live_tiles_rect() const { return live_tiles_rect_; }
@@ -167,12 +172,16 @@
std::vector<Tile*> AllTilesForTesting() const {
std::vector<Tile*> all_tiles;
- for (TileMap::const_iterator it = tiles_.begin();
- it != tiles_.end(); ++it)
+ for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
all_tiles.push_back(it->second.get());
return all_tiles;
}
+ void UpdateAllTilePrioritiesForTesting() {
+ for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
+ UpdateTileAndTwinPriority(it->second.get());
+ }
+
std::vector<scoped_refptr<Tile> > AllRefTilesForTesting() const {
std::vector<scoped_refptr<Tile> > all_tiles;
for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
@@ -180,10 +189,22 @@
return all_tiles;
}
+ void SetAllTilesOccludedForTesting() {
+ gfx::Rect viewport_in_layer_space =
+ ScaleToEnclosingRect(current_visible_rect_, 1.0f / contents_scale_);
+ current_occlusion_in_layer_space_ =
+ Occlusion(gfx::Transform(),
+ SimpleEnclosedRegion(viewport_in_layer_space),
+ SimpleEnclosedRegion(viewport_in_layer_space));
+ }
+
const gfx::Rect& GetCurrentVisibleRectForTesting() const {
return current_visible_rect_;
}
+ bool IsTileOccluded(const Tile* tile) const;
+ bool IsTileRequiredForActivation(const Tile* tile) const;
+
// Iterate over all tiles to fill content_rect. Even if tiles are invalid
// (i.e. no valid resource) this tiling should still iterate over them.
// The union of all geometry_rect calls for each element iterated over should
@@ -235,23 +256,11 @@
void Reset();
- void UpdateTilePriorities(WhichTree tree,
- const gfx::Rect& viewport_in_layer_space,
- float ideal_contents_scale,
- double current_frame_time_in_seconds,
- const Occlusion& occlusion_in_layer_space);
-
- // Copies the src_tree priority into the dst_tree priority for all tiles.
- // The src_tree priority is reset to the lowest priority possible. This
- // also updates the pile on each tile to be the current client's pile.
- void DidBecomeActive();
-
- // Resets the active priority for all tiles in a tiling, when an active
- // tiling is becoming recycled. This may include some tiles which are
- // not in the the pending tiling (due to invalidations). This must
- // be called before DidBecomeActive, as it resets the active priority
- // while DidBecomeActive promotes pending priority on a similar set of tiles.
- void DidBecomeRecycled();
+ void ComputeTilePriorityRects(WhichTree tree,
+ const gfx::Rect& viewport_in_layer_space,
+ float ideal_contents_scale,
+ double current_frame_time_in_seconds,
+ const Occlusion& occlusion_in_layer_space);
bool NeedsUpdateForFrameAtTime(double frame_time_in_seconds) {
return frame_time_in_seconds != last_impl_frame_time_in_seconds_;
@@ -315,6 +324,9 @@
void DoInvalidate(const Region& layer_region,
bool recreate_invalidated_tiles);
+ void UpdateTileAndTwinPriority(Tile* tile) const;
+ void UpdateTilePriority(Tile* tile) const;
+
// Given properties.
float contents_scale_;
gfx::Size layer_bounds_;
@@ -329,6 +341,9 @@
// State saved for computing velocities based upon finite differences.
double last_impl_frame_time_in_seconds_;
gfx::Rect last_visible_rect_in_content_space_;
+ float content_to_screen_scale_;
+
+ bool can_require_tiles_for_activation_;
// Iteration rects in content space
gfx::Rect current_visible_rect_;
@@ -341,6 +356,8 @@
bool has_soon_border_rect_tiles_;
bool has_eventually_rect_tiles_;
+ Occlusion current_occlusion_in_layer_space_;
+
// TODO(reveman): Remove this in favour of an array of eviction_tiles_ when we
// change all enums to have a consistent way of getting the count/last
// element.
diff --git a/cc/resources/picture_layer_tiling_perftest.cc b/cc/resources/picture_layer_tiling_perftest.cc
index 32cc9bb..33ee5f8 100644
--- a/cc/resources/picture_layer_tiling_perftest.cc
+++ b/cc/resources/picture_layer_tiling_perftest.cc
@@ -37,6 +37,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -68,18 +69,19 @@
"invalidation", "", test_name, timer_.LapsPerSecond(), "runs/s", true);
}
- void RunUpdateTilePrioritiesStationaryTest(const std::string& test_name,
- const gfx::Transform& transform) {
+ void RunComputeTilePriorityRectsStationaryTest(
+ const std::string& test_name,
+ const gfx::Transform& transform) {
gfx::Rect viewport_rect(0, 0, 1024, 768);
timer_.Reset();
do {
- picture_layer_tiling_->UpdateTilePriorities(
+ picture_layer_tiling_->ComputeTilePriorityRects(
PENDING_TREE, viewport_rect, 1.f, timer_.NumLaps() + 1, Occlusion());
timer_.NextLap();
} while (!timer_.HasTimeLimitExpired());
- perf_test::PrintResult("update_tile_priorities_stationary",
+ perf_test::PrintResult("compute_tile_priority_rects_stationary",
"",
test_name,
timer_.LapsPerSecond(),
@@ -87,8 +89,9 @@
true);
}
- void RunUpdateTilePrioritiesScrollingTest(const std::string& test_name,
- const gfx::Transform& transform) {
+ void RunComputeTilePriorityRectsScrollingTest(
+ const std::string& test_name,
+ const gfx::Transform& transform) {
gfx::Size viewport_size(1024, 768);
gfx::Rect viewport_rect(viewport_size);
int xoffsets[] = {10, 0, -10, 0};
@@ -99,7 +102,7 @@
timer_.Reset();
do {
- picture_layer_tiling_->UpdateTilePriorities(
+ picture_layer_tiling_->ComputeTilePriorityRects(
PENDING_TREE, viewport_rect, 1.f, timer_.NumLaps() + 1, Occlusion());
viewport_rect = gfx::Rect(viewport_rect.x() + xoffsets[offsetIndex],
@@ -114,7 +117,7 @@
timer_.NextLap();
} while (!timer_.HasTimeLimitExpired());
- perf_test::PrintResult("update_tile_priorities_scrolling",
+ perf_test::PrintResult("compute_tile_priority_rects_scrolling",
"",
test_name,
timer_.LapsPerSecond(),
@@ -128,13 +131,13 @@
picture_layer_tiling_ =
PictureLayerTiling::Create(1, bounds, &picture_layer_tiling_client_);
picture_layer_tiling_client_.set_tree(ACTIVE_TREE);
- picture_layer_tiling_->UpdateTilePriorities(
+ picture_layer_tiling_->ComputeTilePriorityRects(
ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
timer_.Reset();
do {
PictureLayerTiling::TilingRasterTileIterator it(
- picture_layer_tiling_.get(), ACTIVE_TREE);
+ picture_layer_tiling_.get());
timer_.NextLap();
} while (!timer_.HasTimeLimitExpired());
@@ -153,14 +156,14 @@
picture_layer_tiling_ =
PictureLayerTiling::Create(1, bounds, &picture_layer_tiling_client_);
picture_layer_tiling_client_.set_tree(ACTIVE_TREE);
- picture_layer_tiling_->UpdateTilePriorities(
+ picture_layer_tiling_->ComputeTilePriorityRects(
ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
timer_.Reset();
do {
int count = num_tiles;
PictureLayerTiling::TilingRasterTileIterator it(
- picture_layer_tiling_.get(), ACTIVE_TREE);
+ picture_layer_tiling_.get());
while (count--) {
ASSERT_TRUE(it) << "count: " << count;
ASSERT_TRUE(*it != NULL) << "count: " << count;
@@ -183,7 +186,7 @@
picture_layer_tiling_ =
PictureLayerTiling::Create(1, bounds, &picture_layer_tiling_client_);
picture_layer_tiling_client_.set_tree(ACTIVE_TREE);
- picture_layer_tiling_->UpdateTilePriorities(
+ picture_layer_tiling_->ComputeTilePriorityRects(
ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
timer_.Reset();
@@ -215,7 +218,7 @@
picture_layer_tiling_ =
PictureLayerTiling::Create(1, bounds, &picture_layer_tiling_client_);
picture_layer_tiling_client_.set_tree(ACTIVE_TREE);
- picture_layer_tiling_->UpdateTilePriorities(
+ picture_layer_tiling_->ComputeTilePriorityRects(
ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES,
@@ -295,22 +298,22 @@
#if defined(OS_ANDROID)
// TODO(vmpstr): Investigate why this is noisy (crbug.com/310220).
-TEST_F(PictureLayerTilingPerfTest, DISABLED_UpdateTilePriorities) {
+TEST_F(PictureLayerTilingPerfTest, DISABLED_ComputeTilePriorityRects) {
#else
-TEST_F(PictureLayerTilingPerfTest, UpdateTilePriorities) {
+TEST_F(PictureLayerTilingPerfTest, ComputeTilePriorityRects) {
#endif // defined(OS_ANDROID)
gfx::Transform transform;
- RunUpdateTilePrioritiesStationaryTest("no_transform", transform);
- RunUpdateTilePrioritiesScrollingTest("no_transform", transform);
+ RunComputeTilePriorityRectsStationaryTest("no_transform", transform);
+ RunComputeTilePriorityRectsScrollingTest("no_transform", transform);
transform.Rotate(10);
- RunUpdateTilePrioritiesStationaryTest("rotation", transform);
- RunUpdateTilePrioritiesScrollingTest("rotation", transform);
+ RunComputeTilePriorityRectsStationaryTest("rotation", transform);
+ RunComputeTilePriorityRectsScrollingTest("rotation", transform);
transform.ApplyPerspectiveDepth(10);
- RunUpdateTilePrioritiesStationaryTest("perspective", transform);
- RunUpdateTilePrioritiesScrollingTest("perspective", transform);
+ RunComputeTilePriorityRectsStationaryTest("perspective", transform);
+ RunComputeTilePriorityRectsScrollingTest("perspective", transform);
}
TEST_F(PictureLayerTilingPerfTest, TilingRasterTileIteratorConstruct) {
diff --git a/cc/resources/picture_layer_tiling_set.cc b/cc/resources/picture_layer_tiling_set.cc
index d6594df..1806ebc 100644
--- a/cc/resources/picture_layer_tiling_set.cc
+++ b/cc/resources/picture_layer_tiling_set.cc
@@ -218,7 +218,14 @@
return *tiling_iter_;
}
-PictureLayerTiling* PictureLayerTilingSet::CoverageIterator::CurrentTiling() {
+TileResolution PictureLayerTilingSet::CoverageIterator::resolution() const {
+ const PictureLayerTiling* tiling = CurrentTiling();
+ DCHECK(tiling);
+ return tiling->resolution();
+}
+
+PictureLayerTiling* PictureLayerTilingSet::CoverageIterator::CurrentTiling()
+ const {
if (current_tiling_ < 0)
return NULL;
if (static_cast<size_t>(current_tiling_) >= set_->tilings_.size())
@@ -307,16 +314,6 @@
region_iter_.has_rect();
}
-void PictureLayerTilingSet::DidBecomeActive() {
- for (size_t i = 0; i < tilings_.size(); ++i)
- tilings_[i]->DidBecomeActive();
-}
-
-void PictureLayerTilingSet::DidBecomeRecycled() {
- for (size_t i = 0; i < tilings_.size(); ++i)
- tilings_[i]->DidBecomeRecycled();
-}
-
void PictureLayerTilingSet::AsValueInto(base::debug::TracedValue* state) const {
for (size_t i = 0; i < tilings_.size(); ++i) {
state->BeginDictionary();
diff --git a/cc/resources/picture_layer_tiling_set.h b/cc/resources/picture_layer_tiling_set.h
index f19c1b8..63f3110 100644
--- a/cc/resources/picture_layer_tiling_set.h
+++ b/cc/resources/picture_layer_tiling_set.h
@@ -74,9 +74,6 @@
// Remove all tiles; keep all tilings.
void RemoveAllTiles();
- void DidBecomeActive();
- void DidBecomeRecycled();
-
// For a given rect, iterates through tiles that can fill it. If no
// set of tiles with resources can fill the rect, then it will iterate
// through null tiles with valid geometry_rect() until the rect is full.
@@ -104,7 +101,8 @@
CoverageIterator& operator++();
operator bool() const;
- PictureLayerTiling* CurrentTiling();
+ TileResolution resolution() const;
+ PictureLayerTiling* CurrentTiling() const;
private:
int NextTiling() const;
diff --git a/cc/resources/picture_layer_tiling_set_unittest.cc b/cc/resources/picture_layer_tiling_set_unittest.cc
index e566d11..f8cba03 100644
--- a/cc/resources/picture_layer_tiling_set_unittest.cc
+++ b/cc/resources/picture_layer_tiling_set_unittest.cc
@@ -206,6 +206,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
diff --git a/cc/resources/picture_layer_tiling_unittest.cc b/cc/resources/picture_layer_tiling_unittest.cc
index 1a242a3..2ff5f8e 100644
--- a/cc/resources/picture_layer_tiling_unittest.cc
+++ b/cc/resources/picture_layer_tiling_unittest.cc
@@ -40,11 +40,11 @@
float layer_contents_scale,
double current_frame_time_in_seconds) {
for (size_t i = 0; i < set->num_tilings(); ++i) {
- set->tiling_at(i)->UpdateTilePriorities(tree,
- visible_layer_rect,
- layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ set->tiling_at(i)->ComputeTilePriorityRects(tree,
+ visible_layer_rect,
+ layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
}
}
@@ -538,7 +538,8 @@
client.SetTileSize(gfx::Size(100, 100));
tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client);
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion());
// Move viewport down 50 pixels in 0.5 seconds.
gfx::Rect down_skewport =
@@ -604,7 +605,8 @@
client.set_tree(ACTIVE_TREE);
tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client);
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion());
// Move viewport down 50 pixels in 0.5 seconds.
gfx::Rect down_skewport =
@@ -671,7 +673,9 @@
gfx::Rect viewport_in_content_space =
gfx::ToEnclosedRect(gfx::ScaleRect(viewport, 0.25f));
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
gfx::Rect soon_rect = viewport;
soon_rect.Inset(-312.f, -312.f, -312.f, -312.f);
@@ -755,7 +759,9 @@
EXPECT_EQ(25, skewport.width());
EXPECT_EQ(35, skewport.height());
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.f, 2.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 1.f, 2.0, Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
have_now = false;
have_eventually = false;
@@ -806,7 +812,9 @@
EXPECT_FLOAT_EQ(4.f, priority.distance_to_visible);
// Change the underlying layer scale.
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 2.0f, 3.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 2.0f, 3.0, Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE);
EXPECT_FLOAT_EQ(136.f, priority.distance_to_visible);
@@ -819,7 +827,9 @@
// Test additional scales.
tiling = TestablePictureLayerTiling::Create(0.2f, layer_bounds, &client);
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.0f, 4.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 1.0f, 4.0, Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE);
EXPECT_FLOAT_EQ(110.f, priority.distance_to_visible);
@@ -830,7 +840,9 @@
priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE);
EXPECT_FLOAT_EQ(60.f, priority.distance_to_visible);
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 0.5f, 5.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 0.5f, 5.0, Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE);
EXPECT_FLOAT_EQ(55.f, priority.distance_to_visible);
@@ -1078,7 +1090,9 @@
client.set_tree(ACTIVE_TREE);
tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client);
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
PictureLayerTiling::TilingRasterTileIterator empty_iterator;
EXPECT_FALSE(empty_iterator);
@@ -1096,7 +1110,7 @@
// 3. Third iteration ensures that no tiles are returned, since they were all
// marked as ready to draw.
for (int i = 0; i < 3; ++i) {
- PictureLayerTiling::TilingRasterTileIterator it(tiling.get(), ACTIVE_TREE);
+ PictureLayerTiling::TilingRasterTileIterator it(tiling.get());
// There are 3 bins in TilePriority.
bool have_tiles[3] = {};
@@ -1182,9 +1196,11 @@
client.set_tree(ACTIVE_TREE);
tiling = TestablePictureLayerTiling::Create(1.f, layer_bounds, &client);
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
- tiling->UpdateTilePriorities(
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
ACTIVE_TREE, moved_viewport, 1.0f, 2.0, Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
gfx::Rect soon_rect = moved_viewport;
soon_rect.Inset(-312.f, -312.f, -312.f, -312.f);
@@ -1194,9 +1210,7 @@
Tile* last_tile = NULL;
int eventually_bin_order_correct_count = 0;
int eventually_bin_order_incorrect_count = 0;
- for (PictureLayerTiling::TilingRasterTileIterator it(tiling.get(),
- ACTIVE_TREE);
- it;
+ for (PictureLayerTiling::TilingRasterTileIterator it(tiling.get()); it;
++it) {
if (!last_tile)
last_tile = *it;
@@ -1244,8 +1258,15 @@
scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d();
CHECK(output_surface->BindToClient(&output_surface_client));
TestSharedBitmapManager shared_bitmap_manager;
- scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create(
- output_surface.get(), &shared_bitmap_manager, NULL, 0, false, 1, false);
+ scoped_ptr<ResourceProvider> resource_provider =
+ ResourceProvider::Create(output_surface.get(),
+ &shared_bitmap_manager,
+ NULL,
+ NULL,
+ 0,
+ false,
+ 1,
+ false);
FakePictureLayerTilingClient client(resource_provider.get());
scoped_ptr<TestablePictureLayerTiling> tiling;
@@ -1257,7 +1278,9 @@
client.set_tree(ACTIVE_TREE);
tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client);
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
+ tiling->ComputeTilePriorityRects(
+ ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
PictureLayerTiling::TilingRasterTileIterator empty_iterator;
EXPECT_FALSE(empty_iterator);
@@ -1330,7 +1353,7 @@
VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false));
client_.set_tree(ACTIVE_TREE);
- tiling_->UpdateTilePriorities(
+ tiling_->ComputeTilePriorityRects(
ACTIVE_TREE,
gfx::Rect(layer_bounds), // visible content rect
1.f, // current contents scale
@@ -1339,11 +1362,11 @@
VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true));
// Make the viewport rect empty. All tiles are killed and become zombies.
- tiling_->UpdateTilePriorities(ACTIVE_TREE,
- gfx::Rect(), // visible content rect
- 1.f, // current contents scale
- 2.0, // current frame time
- Occlusion());
+ tiling_->ComputeTilePriorityRects(ACTIVE_TREE,
+ gfx::Rect(), // visible content rect
+ 1.f, // current contents scale
+ 2.0, // current frame time
+ Occlusion());
VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false));
}
@@ -1356,7 +1379,7 @@
gfx::Rect giant_rect(-10000000, -10000000, 1000000000, 1000000000);
client_.set_tree(ACTIVE_TREE);
- tiling_->UpdateTilePriorities(
+ tiling_->ComputeTilePriorityRects(
ACTIVE_TREE,
gfx::Rect(layer_bounds), // visible content rect
1.f, // current contents scale
@@ -1365,11 +1388,11 @@
VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true));
// If the visible content rect is empty, it should still have live tiles.
- tiling_->UpdateTilePriorities(ACTIVE_TREE,
- giant_rect, // visible content rect
- 1.f, // current contents scale
- 2.0, // current frame time
- Occlusion());
+ tiling_->ComputeTilePriorityRects(ACTIVE_TREE,
+ giant_rect, // visible content rect
+ 1.f, // current contents scale
+ 2.0, // current frame time
+ Occlusion());
VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true));
}
@@ -1385,11 +1408,11 @@
EXPECT_FALSE(viewport_rect.Intersects(gfx::Rect(layer_bounds)));
client_.set_tree(ACTIVE_TREE);
- tiling_->UpdateTilePriorities(ACTIVE_TREE,
- viewport_rect, // visible content rect
- 1.f, // current contents scale
- 1.0, // current frame time
- Occlusion());
+ tiling_->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_rect, // visible content rect
+ 1.f, // current contents scale
+ 1.0, // current frame time
+ Occlusion());
VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true));
}
@@ -1415,11 +1438,11 @@
client_.set_tree(ACTIVE_TREE);
set_max_tiles_for_interest_area(1);
- tiling_->UpdateTilePriorities(ACTIVE_TREE,
- visible_rect, // visible content rect
- 1.f, // current contents scale
- 1.0, // current frame time
- Occlusion());
+ tiling_->ComputeTilePriorityRects(ACTIVE_TREE,
+ visible_rect, // visible content rect
+ 1.f, // current contents scale
+ 1.0, // current frame time
+ Occlusion());
VerifyTiles(1.f,
gfx::Rect(layer_bounds),
base::Bind(&TilesIntersectingRectExist, visible_rect, true));
@@ -1464,7 +1487,7 @@
gfx::Rect(layer_bounds),
base::Bind(&TileExists, false));
- // UpdateTilePriorities on the pending tiling at the same frame time. The
+ // ComputeTilePriorityRects on the pending tiling at the same frame time. The
// pending tiling should get tiles.
UpdateAllTilePriorities(&pending_set,
PENDING_TREE,
@@ -1478,7 +1501,7 @@
base::Bind(&TileExists, true));
}
-TEST(UpdateTilePrioritiesTest, VisibleTiles) {
+TEST(ComputeTilePriorityRectsTest, VisibleTiles) {
// The TilePriority of visible tiles should have zero distance_to_visible
// and time_to_visible.
@@ -1501,11 +1524,12 @@
current_layer_bounds,
&client);
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- current_layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ current_layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
ASSERT_TRUE(tiling->TileAt(0, 0));
ASSERT_TRUE(tiling->TileAt(0, 1));
@@ -1529,7 +1553,7 @@
EXPECT_FLOAT_EQ(TilePriority::NOW, priority.priority_bin);
}
-TEST(UpdateTilePrioritiesTest, OffscreenTiles) {
+TEST(ComputeTilePriorityRectsTest, OffscreenTiles) {
// The TilePriority of offscreen tiles (without movement) should have nonzero
// distance_to_visible and infinite time_to_visible.
@@ -1556,11 +1580,12 @@
current_layer_bounds,
&client);
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- current_layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ current_layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
ASSERT_TRUE(tiling->TileAt(0, 0));
ASSERT_TRUE(tiling->TileAt(0, 1));
@@ -1594,7 +1619,7 @@
EXPECT_GT(right.distance_to_visible, left.distance_to_visible);
}
-TEST(UpdateTilePrioritiesTest, PartiallyOffscreenLayer) {
+TEST(ComputeTilePriorityRectsTest, PartiallyOffscreenLayer) {
// Sanity check that a layer with some tiles visible and others offscreen has
// correct TilePriorities for each tile.
@@ -1621,11 +1646,12 @@
current_layer_bounds,
&client);
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- current_layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ current_layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
ASSERT_TRUE(tiling->TileAt(0, 0));
ASSERT_TRUE(tiling->TileAt(0, 1));
@@ -1649,9 +1675,9 @@
EXPECT_NE(TilePriority::NOW, priority.priority_bin);
}
-TEST(UpdateTilePrioritiesTest, PartiallyOffscreenRotatedLayer) {
+TEST(ComputeTilePriorityRectsTest, PartiallyOffscreenRotatedLayer) {
// Each tile of a layer may be affected differently by a transform; Check
- // that UpdateTilePriorities correctly accounts for the transform between
+ // that ComputeTilePriorityRects correctly accounts for the transform between
// layer space and screen space.
FakePictureLayerTilingClient client;
@@ -1680,11 +1706,12 @@
current_layer_bounds,
&client);
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- current_layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ current_layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
ASSERT_TRUE(tiling->TileAt(0, 0));
ASSERT_TRUE(tiling->TileAt(0, 1));
@@ -1717,7 +1744,7 @@
EXPECT_EQ(bottom_right.distance_to_visible, top_right.distance_to_visible);
}
-TEST(UpdateTilePrioritiesTest, PerspectiveLayer) {
+TEST(ComputeTilePriorityRectsTest, PerspectiveLayer) {
// Perspective transforms need to take a different code path.
// This test checks tile priorities of a perspective layer.
@@ -1763,11 +1790,12 @@
current_layer_bounds,
&client);
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- current_layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ current_layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
ASSERT_TRUE(tiling->TileAt(0, 0));
ASSERT_TRUE(tiling->TileAt(0, 1));
@@ -1805,7 +1833,7 @@
EXPECT_GT(bottom_left.distance_to_visible, top_left.distance_to_visible);
}
-TEST(UpdateTilePrioritiesTest, PerspectiveLayerClippedByW) {
+TEST(ComputeTilePriorityRectsTest, PerspectiveLayerClippedByW) {
// Perspective transforms need to take a different code path.
// This test checks tile priorities of a perspective layer.
@@ -1856,11 +1884,12 @@
current_layer_bounds,
&client);
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- current_layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ current_layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
ASSERT_TRUE(tiling->TileAt(0, 0));
ASSERT_TRUE(tiling->TileAt(0, 1));
@@ -1888,7 +1917,7 @@
EXPECT_NE(TilePriority::NOW, priority.priority_bin);
}
-TEST(UpdateTilePrioritiesTest, BasicMotion) {
+TEST(ComputeTilePriorityRectsTest, BasicMotion) {
// Test that time_to_visible is computed correctly when
// there is some motion.
@@ -1920,18 +1949,19 @@
&client);
// previous ("last") frame
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- last_layer_contents_scale,
- last_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ last_layer_contents_scale,
+ last_frame_time_in_seconds,
+ Occlusion());
// current frame
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- current_layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ current_layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
ASSERT_TRUE(tiling->TileAt(0, 0));
ASSERT_TRUE(tiling->TileAt(0, 1));
@@ -1957,9 +1987,9 @@
EXPECT_NE(TilePriority::NOW, priority.priority_bin);
}
-TEST(UpdateTilePrioritiesTest, RotationMotion) {
+TEST(ComputeTilePriorityRectsTest, RotationMotion) {
// Each tile of a layer may be affected differently by a transform; Check
- // that UpdateTilePriorities correctly accounts for the transform between
+ // that ComputeTilePriorityRects correctly accounts for the transform between
// layer space and screen space.
FakePictureLayerTilingClient client;
@@ -1998,18 +2028,19 @@
&client);
// previous ("last") frame
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- last_layer_contents_scale,
- last_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ last_layer_contents_scale,
+ last_frame_time_in_seconds,
+ Occlusion());
// current frame
- tiling->UpdateTilePriorities(ACTIVE_TREE,
- viewport_in_layer_space,
- current_layer_contents_scale,
- current_frame_time_in_seconds,
- Occlusion());
+ tiling->ComputeTilePriorityRects(ACTIVE_TREE,
+ viewport_in_layer_space,
+ current_layer_contents_scale,
+ current_frame_time_in_seconds,
+ Occlusion());
+ tiling->UpdateAllTilePrioritiesForTesting();
ASSERT_TRUE(tiling->TileAt(0, 0));
ASSERT_TRUE(tiling->TileAt(0, 1));
@@ -2029,35 +2060,6 @@
EXPECT_EQ(TilePriority::NOW, priority.priority_bin);
}
-TEST(PictureLayerTilingTest, ResetClearsPriorities) {
- FakePictureLayerTilingClient client;
- scoped_ptr<TestablePictureLayerTiling> tiling;
-
- client.SetTileSize(gfx::Size(100, 100));
- client.set_tree(ACTIVE_TREE);
- tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale
- gfx::Size(100, 100),
- &client);
- tiling->UpdateTilePriorities(
- ACTIVE_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion());
-
- std::vector<scoped_refptr<Tile> > tiles = tiling->AllRefTilesForTesting();
- ASSERT_GT(tiles.size(), 0u);
- for (std::vector<scoped_refptr<Tile> >::const_iterator it = tiles.begin();
- it != tiles.end();
- ++it) {
- EXPECT_NE(TilePriority(), (*it)->priority(ACTIVE_TREE));
- }
-
- tiling->Reset();
- for (std::vector<scoped_refptr<Tile> >::const_iterator it = tiles.begin();
- it != tiles.end();
- ++it) {
- EXPECT_EQ(TilePriority(), (*it)->priority(ACTIVE_TREE));
- }
- tiles.clear();
-}
-
TEST(PictureLayerTilingTest, RecycledTilesCleared) {
// This test performs the following:
// Setup:
@@ -2079,7 +2081,7 @@
gfx::Size(10000, 10000),
&active_client);
// Create all tiles on this tiling.
- active_tiling->UpdateTilePriorities(
+ active_tiling->ComputeTilePriorityRects(
ACTIVE_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion());
FakePictureLayerTilingClient recycle_client;
@@ -2094,7 +2096,7 @@
&recycle_client);
// Create all tiles on the second tiling. All tiles should be shared.
- recycle_tiling->UpdateTilePriorities(
+ recycle_tiling->ComputeTilePriorityRects(
PENDING_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion());
// Set the second tiling as recycled.
@@ -2108,14 +2110,14 @@
EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0));
// Move the viewport far away from the (0, 0) tile.
- active_tiling->UpdateTilePriorities(
+ active_tiling->ComputeTilePriorityRects(
ACTIVE_TREE, gfx::Rect(9000, 9000, 100, 100), 1.0f, 2.0, Occlusion());
// Ensure the tile was deleted on both tilings.
EXPECT_FALSE(active_tiling->TileAt(0, 0));
EXPECT_FALSE(recycle_tiling->TileAt(0, 0));
// Move the viewport back to (0, 0) tile.
- active_tiling->UpdateTilePriorities(
+ active_tiling->ComputeTilePriorityRects(
ACTIVE_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 3.0, Occlusion());
// Ensure that we now have a tile here, but the recycle tiling does not.
@@ -2133,7 +2135,7 @@
gfx::Size(100, 100),
&active_client);
// Create all tiles on this tiling.
- active_tiling->UpdateTilePriorities(
+ active_tiling->ComputeTilePriorityRects(
ACTIVE_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion());
FakePictureLayerTilingClient recycle_client;
@@ -2148,7 +2150,7 @@
&recycle_client);
// Create all tiles on the recycle tiling. All tiles should be shared.
- recycle_tiling->UpdateTilePriorities(
+ recycle_tiling->ComputeTilePriorityRects(
PENDING_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion());
// Set the second tiling as recycled.
diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc
index 4858d24..1b6a50c 100644
--- a/cc/resources/picture_pile.cc
+++ b/cc/resources/picture_pile.cc
@@ -378,46 +378,56 @@
}
}
- Region invalidation_expanded_to_full_tiles;
- for (Region::Iterator i(*invalidation); i.has_rect(); i.next()) {
- gfx::Rect invalid_rect = i.rect();
-
+ // Detect cases where the full pile is invalidated, in this situation we
+ // can just drop/invalidate everything.
+ if (invalidation->Contains(gfx::Rect(old_tiling_size)) ||
+ invalidation->Contains(gfx::Rect(tiling_size()))) {
+ for (auto& it : picture_map_)
+ updated = it.second.Invalidate(frame_number) || updated;
+ } else {
// Expand invalidation that is outside tiles that intersect the interest
// rect. These tiles are no longer valid and should be considerered fully
// invalid, so we can know to not keep around raster tiles that intersect
// with these recording tiles.
- gfx::Rect invalid_rect_outside_interest_rect_tiles = invalid_rect;
- // TODO(danakj): We should have a Rect-subtract-Rect-to-2-rects operator
- // instead of using Rect::Subtract which gives you the bounding box of the
- // subtraction.
- invalid_rect_outside_interest_rect_tiles.Subtract(interest_rect_over_tiles);
- invalidation_expanded_to_full_tiles.Union(tiling_.ExpandRectToTileBounds(
- invalid_rect_outside_interest_rect_tiles));
+ Region invalidation_expanded_to_full_tiles;
- // Split this inflated invalidation across tile boundaries and apply it
- // to all tiles that it touches.
- bool include_borders = true;
- for (TilingData::Iterator iter(&tiling_, invalid_rect, include_borders);
- iter;
- ++iter) {
- const PictureMapKey& key = iter.index();
+ for (Region::Iterator i(*invalidation); i.has_rect(); i.next()) {
+ gfx::Rect invalid_rect = i.rect();
- PictureMap::iterator picture_it = picture_map_.find(key);
- if (picture_it == picture_map_.end())
- continue;
+ gfx::Rect invalid_rect_outside_interest_rect_tiles = invalid_rect;
+ // TODO(danakj): We should have a Rect-subtract-Rect-to-2-rects operator
+ // instead of using Rect::Subtract which gives you the bounding box of the
+ // subtraction.
+ invalid_rect_outside_interest_rect_tiles.Subtract(
+ interest_rect_over_tiles);
+ invalidation_expanded_to_full_tiles.Union(tiling_.ExpandRectToTileBounds(
+ invalid_rect_outside_interest_rect_tiles));
- // Inform the grid cell that it has been invalidated in this frame.
- updated = picture_it->second.Invalidate(frame_number) || updated;
- // Invalidate drops the picture so the whole tile better be invalidated if
- // it won't be re-recorded below.
- DCHECK_IMPLIES(!tiling_.TileBounds(key.first, key.second)
- .Intersects(interest_rect_over_tiles),
- invalidation_expanded_to_full_tiles.Contains(
- tiling_.TileBounds(key.first, key.second)));
+ // Split this inflated invalidation across tile boundaries and apply it
+ // to all tiles that it touches.
+ bool include_borders = true;
+ for (TilingData::Iterator iter(&tiling_, invalid_rect, include_borders);
+ iter;
+ ++iter) {
+ const PictureMapKey& key = iter.index();
+
+ PictureMap::iterator picture_it = picture_map_.find(key);
+ if (picture_it == picture_map_.end())
+ continue;
+
+ // Inform the grid cell that it has been invalidated in this frame.
+ updated = picture_it->second.Invalidate(frame_number) || updated;
+ // Invalidate drops the picture so the whole tile better be invalidated
+ // if it won't be re-recorded below.
+ DCHECK_IMPLIES(!tiling_.TileBounds(key.first, key.second)
+ .Intersects(interest_rect_over_tiles),
+ invalidation_expanded_to_full_tiles.Contains(
+ tiling_.TileBounds(key.first, key.second)));
+ }
}
+ invalidation->Union(invalidation_expanded_to_full_tiles);
}
- invalidation->Union(invalidation_expanded_to_full_tiles);
invalidation->Union(resize_invalidation);
// Make a list of all invalid tiles; we will attempt to
diff --git a/cc/resources/picture_pile_unittest.cc b/cc/resources/picture_pile_unittest.cc
index 15cb3d3..8d798d9 100644
--- a/cc/resources/picture_pile_unittest.cc
+++ b/cc/resources/picture_pile_unittest.cc
@@ -193,6 +193,28 @@
}
}
+TEST_F(PicturePileTest, InvalidateOnFullLayer) {
+ UpdateWholePile();
+
+ // Everything was invalidated once so far.
+ for (auto& it : pile_->picture_map()) {
+ EXPECT_FLOAT_EQ(
+ 1.0f / TestPicturePile::PictureInfo::INVALIDATION_FRAMES_TRACKED,
+ it.second.GetInvalidationFrequencyForTesting());
+ }
+
+ // Invalidate everything,
+ Region invalidation = tiling_rect();
+ UpdateAndExpandInvalidation(&invalidation, tiling_size(), tiling_rect());
+
+ // Everything was invalidated again.
+ for (auto& it : pile_->picture_map()) {
+ EXPECT_FLOAT_EQ(
+ 2.0f / TestPicturePile::PictureInfo::INVALIDATION_FRAMES_TRACKED,
+ it.second.GetInvalidationFrequencyForTesting());
+ }
+}
+
TEST_F(PicturePileTest, StopRecordingOffscreenInvalidations) {
gfx::Size new_tiling_size =
gfx::ToCeiledSize(gfx::ScaleSize(pile_->tiling_size(), 4.f));
@@ -364,6 +386,66 @@
EXPECT_EQ(Region().ToString(), invalidation.ToString());
}
+TEST_F(PicturePileTest, BigFullLayerInvalidation) {
+ gfx::Size huge_layer_size(100000000, 100000000);
+ gfx::Rect viewport(300000, 400000, 5000, 6000);
+
+ // Resize the pile.
+ Region invalidation;
+ UpdateAndExpandInvalidation(&invalidation, huge_layer_size, viewport);
+
+ // Invalidating a huge layer should be fast.
+ base::TimeTicks start = base::TimeTicks::Now();
+ invalidation = gfx::Rect(huge_layer_size);
+ UpdateAndExpandInvalidation(&invalidation, huge_layer_size, viewport);
+ base::TimeTicks end = base::TimeTicks::Now();
+ base::TimeDelta length = end - start;
+ // This is verrrry generous to avoid flake.
+ EXPECT_LT(length.InSeconds(), 5);
+}
+
+TEST_F(PicturePileTest, BigFullLayerInvalidationWithResizeGrow) {
+ gfx::Size huge_layer_size(100000000, 100000000);
+ gfx::Rect viewport(300000, 400000, 5000, 6000);
+
+ // Resize the pile.
+ Region invalidation;
+ UpdateAndExpandInvalidation(&invalidation, huge_layer_size, viewport);
+
+ // Resize the pile even larger, while invalidating everything in the old size.
+ // Invalidating the whole thing should be fast.
+ base::TimeTicks start = base::TimeTicks::Now();
+ gfx::Size bigger_layer_size(huge_layer_size.width() * 2,
+ huge_layer_size.height() * 2);
+ invalidation = gfx::Rect(huge_layer_size);
+ UpdateAndExpandInvalidation(&invalidation, bigger_layer_size, viewport);
+ base::TimeTicks end = base::TimeTicks::Now();
+ base::TimeDelta length = end - start;
+ // This is verrrry generous to avoid flake.
+ EXPECT_LT(length.InSeconds(), 5);
+}
+
+TEST_F(PicturePileTest, BigFullLayerInvalidationWithResizeShrink) {
+ gfx::Size huge_layer_size(100000000, 100000000);
+ gfx::Rect viewport(300000, 400000, 5000, 6000);
+
+ // Resize the pile.
+ Region invalidation;
+ UpdateAndExpandInvalidation(&invalidation, huge_layer_size, viewport);
+
+ // Resize the pile smaller, while invalidating everything in the new size.
+ // Invalidating the whole thing should be fast.
+ base::TimeTicks start = base::TimeTicks::Now();
+ gfx::Size smaller_layer_size(huge_layer_size.width() - 1000,
+ huge_layer_size.height() - 1000);
+ invalidation = gfx::Rect(smaller_layer_size);
+ UpdateAndExpandInvalidation(&invalidation, smaller_layer_size, viewport);
+ base::TimeTicks end = base::TimeTicks::Now();
+ base::TimeDelta length = end - start;
+ // This is verrrry generous to avoid flake.
+ EXPECT_LT(length.InSeconds(), 5);
+}
+
TEST_F(PicturePileTest, InvalidationOutsideRecordingRect) {
gfx::Size huge_layer_size(10000000, 20000000);
gfx::Rect viewport(300000, 400000, 5000, 6000);
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
index 693f643..36bbe0d 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -14,7 +14,6 @@
#include "cc/resources/raster_buffer.h"
#include "cc/resources/resource.h"
#include "gpu/command_buffer/client/gles2_interface.h"
-#include "third_party/skia/include/utils/SkNullCanvas.h"
namespace cc {
namespace {
@@ -25,10 +24,10 @@
const Resource* resource)
: resource_provider_(resource_provider),
resource_(resource),
- buffer_(NULL),
+ memory_(NULL),
stride_(0) {
resource_provider_->AcquirePixelBuffer(resource_->id());
- buffer_ = resource_provider_->MapPixelBuffer(resource_->id(), &stride_);
+ memory_ = resource_provider_->MapPixelBuffer(resource_->id(), &stride_);
}
virtual ~RasterBufferImpl() {
@@ -36,28 +35,28 @@
}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
- if (!buffer_)
- return skia::AdoptRef(SkCreateNullCanvas());
-
- RasterWorkerPool::AcquireBitmapForBuffer(
- &bitmap_, buffer_, resource_->format(), resource_->size(), stride_);
- return skia::AdoptRef(new SkCanvas(bitmap_));
- }
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {
- if (!buffer_)
+ virtual void Playback(const PicturePileImpl* picture_pile,
+ const gfx::Rect& rect,
+ float scale,
+ RenderingStatsInstrumentation* stats) override {
+ if (!memory_)
return;
- RasterWorkerPool::ReleaseBitmapForBuffer(
- &bitmap_, buffer_, resource_->format());
+ RasterWorkerPool::PlaybackToMemory(memory_,
+ resource_->format(),
+ resource_->size(),
+ stride_,
+ picture_pile,
+ rect,
+ scale,
+ stats);
}
private:
ResourceProvider* resource_provider_;
const Resource* resource_;
- uint8_t* buffer_;
+ uint8_t* memory_;
int stride_;
- SkBitmap bitmap_;
DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
};
diff --git a/cc/resources/prioritized_resource_manager.h b/cc/resources/prioritized_resource_manager.h
index 092b1d7..681fee3 100644
--- a/cc/resources/prioritized_resource_manager.h
+++ b/cc/resources/prioritized_resource_manager.h
@@ -19,16 +19,6 @@
#include "cc/trees/proxy.h"
#include "ui/gfx/size.h"
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-template <> struct hash<cc::PrioritizedResource*> {
- size_t operator()(cc::PrioritizedResource* ptr) const {
- return hash<size_t>()(reinterpret_cast<size_t>(ptr));
- }
-};
-} // namespace BASE_HASH_NAMESPACE
-#endif // COMPILER
-
namespace cc {
class PriorityCalculator;
diff --git a/cc/resources/prioritized_resource_unittest.cc b/cc/resources/prioritized_resource_unittest.cc
index 05e87d9..5109a60 100644
--- a/cc/resources/prioritized_resource_unittest.cc
+++ b/cc/resources/prioritized_resource_unittest.cc
@@ -31,6 +31,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
diff --git a/cc/resources/prioritized_tile_set.cc b/cc/resources/prioritized_tile_set.cc
deleted file mode 100644
index d0104cb..0000000
--- a/cc/resources/prioritized_tile_set.cc
+++ /dev/null
@@ -1,155 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/resources/prioritized_tile_set.h"
-
-#include <algorithm>
-
-#include "cc/resources/managed_tile_state.h"
-#include "cc/resources/tile.h"
-
-namespace cc {
-
-class BinComparator {
- public:
- bool operator()(const Tile* a,
- const Tile* b) const {
- const ManagedTileState& ams = a->managed_state();
- const ManagedTileState& bms = b->managed_state();
-
- if (ams.priority_bin != bms.priority_bin)
- return ams.priority_bin < bms.priority_bin;
-
- if (ams.required_for_activation != bms.required_for_activation)
- return ams.required_for_activation;
-
- if (ams.resolution != bms.resolution)
- return ams.resolution < bms.resolution;
-
- if (ams.distance_to_visible != bms.distance_to_visible)
- return ams.distance_to_visible < bms.distance_to_visible;
-
- gfx::Rect a_rect = a->content_rect();
- gfx::Rect b_rect = b->content_rect();
- if (a_rect.y() != b_rect.y())
- return a_rect.y() < b_rect.y();
- return a_rect.x() < b_rect.x();
- }
-};
-
-namespace {
-
-bool TilePriorityTieBreaker(const Tile* tile_i, const Tile* tile_j) {
- // When two tiles has same priority use Id as tie breaker.
- return tile_i->id() < tile_j->id();
-}
-
-typedef std::vector<Tile*> TileVector;
-
-void SortBinTiles(ManagedTileBin bin, TileVector* tiles) {
- switch (bin) {
- case NEVER_BIN:
- break;
- case NOW_AND_READY_TO_DRAW_BIN:
- std::sort(tiles->begin(), tiles->end(), TilePriorityTieBreaker);
- break;
- case NOW_BIN:
- case SOON_BIN:
- case EVENTUALLY_AND_ACTIVE_BIN:
- case EVENTUALLY_BIN:
- case AT_LAST_AND_ACTIVE_BIN:
- case AT_LAST_BIN:
- std::sort(tiles->begin(), tiles->end(), BinComparator());
- break;
- default:
- NOTREACHED();
- }
-}
-
-} // namespace
-
-PrioritizedTileSet::PrioritizedTileSet() {
- for (int bin = 0; bin < NUM_BINS; ++bin)
- bin_sorted_[bin] = true;
-}
-
-PrioritizedTileSet::~PrioritizedTileSet() {}
-
-void PrioritizedTileSet::InsertTile(Tile* tile, ManagedTileBin bin) {
- tiles_[bin].push_back(tile);
- bin_sorted_[bin] = false;
-}
-
-void PrioritizedTileSet::Clear() {
- for (int bin = 0; bin < NUM_BINS; ++bin) {
- tiles_[bin].clear();
- bin_sorted_[bin] = true;
- }
-}
-
-bool PrioritizedTileSet::IsEmpty() {
- for (int bin = 0; bin < NUM_BINS; ++bin)
- if (!tiles_[bin].empty())
- return false;
-
- return true;
-}
-
-void PrioritizedTileSet::SortBinIfNeeded(ManagedTileBin bin) {
- if (!bin_sorted_[bin]) {
- SortBinTiles(bin, &tiles_[bin]);
- bin_sorted_[bin] = true;
- }
-}
-
-PrioritizedTileSet::Iterator::Iterator(
- PrioritizedTileSet* tile_set, bool use_priority_ordering)
- : tile_set_(tile_set),
- current_bin_(NOW_AND_READY_TO_DRAW_BIN),
- use_priority_ordering_(use_priority_ordering) {
- if (use_priority_ordering_)
- tile_set_->SortBinIfNeeded(current_bin_);
- iterator_ = tile_set->tiles_[current_bin_].begin();
- if (iterator_ == tile_set_->tiles_[current_bin_].end())
- AdvanceList();
-}
-
-PrioritizedTileSet::Iterator::~Iterator() {}
-
-void PrioritizedTileSet::Iterator::DisablePriorityOrdering() {
- use_priority_ordering_ = false;
-}
-
-PrioritizedTileSet::Iterator&
-PrioritizedTileSet::Iterator::operator++() {
- // We can't increment past the end of the tiles.
- DCHECK(iterator_ != tile_set_->tiles_[current_bin_].end());
-
- ++iterator_;
- if (iterator_ == tile_set_->tiles_[current_bin_].end())
- AdvanceList();
- return *this;
-}
-
-Tile* PrioritizedTileSet::Iterator::operator*() {
- DCHECK(iterator_ != tile_set_->tiles_[current_bin_].end());
- return *iterator_;
-}
-
-void PrioritizedTileSet::Iterator::AdvanceList() {
- DCHECK(iterator_ == tile_set_->tiles_[current_bin_].end());
-
- while (current_bin_ != NEVER_BIN) {
- current_bin_ = static_cast<ManagedTileBin>(current_bin_ + 1);
-
- if (use_priority_ordering_)
- tile_set_->SortBinIfNeeded(current_bin_);
-
- iterator_ = tile_set_->tiles_[current_bin_].begin();
- if (iterator_ != tile_set_->tiles_[current_bin_].end())
- break;
- }
-}
-
-} // namespace cc
diff --git a/cc/resources/prioritized_tile_set.h b/cc/resources/prioritized_tile_set.h
deleted file mode 100644
index 2d4693e..0000000
--- a/cc/resources/prioritized_tile_set.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_RESOURCES_PRIORITIZED_TILE_SET_H_
-#define CC_RESOURCES_PRIORITIZED_TILE_SET_H_
-
-#include <vector>
-
-#include "cc/base/cc_export.h"
-#include "cc/resources/managed_tile_state.h"
-
-namespace cc {
-class Tile;
-
-class CC_EXPORT PrioritizedTileSet {
- public:
- PrioritizedTileSet();
- ~PrioritizedTileSet();
-
- void InsertTile(Tile* tile, ManagedTileBin bin);
- void Clear();
- bool IsEmpty();
-
- class CC_EXPORT Iterator {
- public:
- Iterator(PrioritizedTileSet* set, bool use_priority_ordering);
-
- ~Iterator();
-
- void DisablePriorityOrdering();
-
- Iterator& operator++();
- Tile* operator->() { return *(*this); }
- Tile* operator*();
- operator bool() const {
- return iterator_ != tile_set_->tiles_[current_bin_].end();
- }
-
- private:
- void AdvanceList();
-
- PrioritizedTileSet* tile_set_;
- ManagedTileBin current_bin_;
- std::vector<Tile*>::iterator iterator_;
- bool use_priority_ordering_;
- };
-
- private:
- friend class Iterator;
-
- void SortBinIfNeeded(ManagedTileBin bin);
-
- std::vector<Tile*> tiles_[NUM_BINS];
- bool bin_sorted_[NUM_BINS];
-};
-
-} // namespace cc
-
-#endif // CC_RESOURCES_PRIORITIZED_TILE_SET_H_
diff --git a/cc/resources/prioritized_tile_set_unittest.cc b/cc/resources/prioritized_tile_set_unittest.cc
deleted file mode 100644
index e9ed478..0000000
--- a/cc/resources/prioritized_tile_set_unittest.cc
+++ /dev/null
@@ -1,774 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <algorithm>
-#include <vector>
-
-#include "cc/resources/managed_tile_state.h"
-#include "cc/resources/prioritized_tile_set.h"
-#include "cc/resources/tile.h"
-#include "cc/test/fake_output_surface.h"
-#include "cc/test/fake_output_surface_client.h"
-#include "cc/test/fake_picture_pile_impl.h"
-#include "cc/test/fake_tile_manager.h"
-#include "cc/test/fake_tile_manager_client.h"
-#include "cc/test/test_shared_bitmap_manager.h"
-#include "cc/test/test_tile_priorities.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cc {
-
-class BinComparator {
- public:
- bool operator()(const scoped_refptr<Tile>& a,
- const scoped_refptr<Tile>& b) const {
- const ManagedTileState& ams = a->managed_state();
- const ManagedTileState& bms = b->managed_state();
-
- if (ams.priority_bin != bms.priority_bin)
- return ams.priority_bin < bms.priority_bin;
-
- if (ams.required_for_activation != bms.required_for_activation)
- return ams.required_for_activation;
-
- if (ams.resolution != bms.resolution)
- return ams.resolution < bms.resolution;
-
- if (ams.distance_to_visible != bms.distance_to_visible)
- return ams.distance_to_visible < bms.distance_to_visible;
-
- gfx::Rect a_rect = a->content_rect();
- gfx::Rect b_rect = b->content_rect();
- if (a_rect.y() != b_rect.y())
- return a_rect.y() < b_rect.y();
- return a_rect.x() < b_rect.x();
- }
-};
-
-namespace {
-
-class PrioritizedTileSetTest : public testing::Test {
- public:
- PrioritizedTileSetTest() {
- output_surface_ = FakeOutputSurface::Create3d().Pass();
- CHECK(output_surface_->BindToClient(&output_surface_client_));
-
- shared_bitmap_manager_.reset(new TestSharedBitmapManager());
- resource_provider_ = ResourceProvider::Create(output_surface_.get(),
- shared_bitmap_manager_.get(),
- NULL,
- 0,
- false,
- 1,
- false).Pass();
- resource_pool_ = ResourcePool::Create(
- resource_provider_.get(), GL_TEXTURE_2D, RGBA_8888);
- tile_manager_.reset(
- new FakeTileManager(&tile_manager_client_, resource_pool_.get()));
- picture_pile_ = FakePicturePileImpl::CreateInfiniteFilledPile();
- }
-
- scoped_refptr<Tile> CreateTile() {
- return tile_manager_->CreateTile(picture_pile_.get(),
- settings_.default_tile_size,
- gfx::Rect(),
- 1.0,
- 0,
- 0,
- 0);
- }
- void ReleaseTiles(std::vector<scoped_refptr<Tile> >* tiles) {
- for (std::vector<scoped_refptr<Tile> >::iterator it = tiles->begin();
- it != tiles->end();
- it++) {
- Tile* tile = it->get();
- tile->SetPriority(ACTIVE_TREE, TilePriority());
- tile->SetPriority(PENDING_TREE, TilePriority());
- }
- }
-
- private:
- LayerTreeSettings settings_;
- FakeOutputSurfaceClient output_surface_client_;
- scoped_ptr<FakeOutputSurface> output_surface_;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
- scoped_ptr<ResourceProvider> resource_provider_;
- scoped_ptr<ResourcePool> resource_pool_;
- FakeTileManagerClient tile_manager_client_;
- scoped_ptr<FakeTileManager> tile_manager_;
- scoped_refptr<FakePicturePileImpl> picture_pile_;
-};
-
-TEST_F(PrioritizedTileSetTest, EmptyIterator) {
- // Creating an iterator to an empty set should work (but create iterator that
- // isn't valid).
-
- PrioritizedTileSet set;
-
- PrioritizedTileSet::Iterator it(&set, true);
- EXPECT_FALSE(it);
-}
-
-TEST_F(PrioritizedTileSetTest, NonEmptyIterator) {
- PrioritizedTileSet set;
- scoped_refptr<Tile> tile = CreateTile();
- set.InsertTile(tile.get(), NOW_BIN);
-
- PrioritizedTileSet::Iterator it(&set, true);
- EXPECT_TRUE(it);
- EXPECT_TRUE(*it == tile.get());
- ++it;
- EXPECT_FALSE(it);
-}
-
-TEST_F(PrioritizedTileSetTest, NowAndReadyToDrawBin) {
- // Ensure that tiles in NOW_AND_READY_TO_DRAW_BIN aren't sorted.
-
- PrioritizedTileSet set;
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- std::vector<scoped_refptr<Tile> > tiles;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
- tiles.push_back(tile);
- set.InsertTile(tile.get(), NOW_AND_READY_TO_DRAW_BIN);
- }
- }
-
- // Tiles should appear in the same order as inserted.
- int i = 0;
- for (PrioritizedTileSet::Iterator it(&set, true);
- it;
- ++it) {
- EXPECT_TRUE(*it == tiles[i].get());
- ++i;
- }
- EXPECT_EQ(20, i);
-
- ReleaseTiles(&tiles);
-}
-
-TEST_F(PrioritizedTileSetTest, NowBin) {
- // Ensure that tiles in NOW_BIN are sorted according to BinComparator.
-
- PrioritizedTileSet set;
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- std::vector<scoped_refptr<Tile> > tiles;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
- tiles.push_back(tile);
- set.InsertTile(tile.get(), NOW_BIN);
- }
- }
-
- // Tiles should appear in BinComparator order.
- std::sort(tiles.begin(), tiles.end(), BinComparator());
-
- int i = 0;
- for (PrioritizedTileSet::Iterator it(&set, true);
- it;
- ++it) {
- EXPECT_TRUE(*it == tiles[i].get());
- ++i;
- }
- EXPECT_EQ(20, i);
-
- ReleaseTiles(&tiles);
-}
-
-TEST_F(PrioritizedTileSetTest, SoonBin) {
- // Ensure that tiles in SOON_BIN are sorted according to BinComparator.
-
- PrioritizedTileSet set;
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- std::vector<scoped_refptr<Tile> > tiles;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
- tiles.push_back(tile);
- set.InsertTile(tile.get(), SOON_BIN);
- }
- }
-
- // Tiles should appear in BinComparator order.
- std::sort(tiles.begin(), tiles.end(), BinComparator());
-
- int i = 0;
- for (PrioritizedTileSet::Iterator it(&set, true);
- it;
- ++it) {
- EXPECT_TRUE(*it == tiles[i].get());
- ++i;
- }
- EXPECT_EQ(20, i);
-
- ReleaseTiles(&tiles);
-}
-
-TEST_F(PrioritizedTileSetTest, SoonBinNoPriority) {
- // Ensure that when not using priority iterator, SOON_BIN tiles
- // are not sorted.
-
- PrioritizedTileSet set;
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- std::vector<scoped_refptr<Tile> > tiles;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
- tiles.push_back(tile);
- set.InsertTile(tile.get(), SOON_BIN);
- }
- }
-
- int i = 0;
- for (PrioritizedTileSet::Iterator it(&set, false);
- it;
- ++it) {
- EXPECT_TRUE(*it == tiles[i].get());
- ++i;
- }
- EXPECT_EQ(20, i);
-
- ReleaseTiles(&tiles);
-}
-
-TEST_F(PrioritizedTileSetTest, EventuallyAndActiveBin) {
- // Ensure that EVENTUALLY_AND_ACTIVE_BIN tiles are sorted.
-
- PrioritizedTileSet set;
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- std::vector<scoped_refptr<Tile> > tiles;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
- tiles.push_back(tile);
- set.InsertTile(tile.get(), EVENTUALLY_AND_ACTIVE_BIN);
- }
- }
-
- // Tiles should appear in BinComparator order.
- std::sort(tiles.begin(), tiles.end(), BinComparator());
-
- int i = 0;
- for (PrioritizedTileSet::Iterator it(&set, true);
- it;
- ++it) {
- EXPECT_TRUE(*it == tiles[i].get());
- ++i;
- }
- EXPECT_EQ(20, i);
-
- ReleaseTiles(&tiles);
-}
-
-TEST_F(PrioritizedTileSetTest, EventuallyBin) {
- // Ensure that EVENTUALLY_BIN tiles are sorted.
-
- PrioritizedTileSet set;
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- std::vector<scoped_refptr<Tile> > tiles;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
- tiles.push_back(tile);
- set.InsertTile(tile.get(), EVENTUALLY_BIN);
- }
- }
-
- // Tiles should appear in BinComparator order.
- std::sort(tiles.begin(), tiles.end(), BinComparator());
-
- int i = 0;
- for (PrioritizedTileSet::Iterator it(&set, true);
- it;
- ++it) {
- EXPECT_TRUE(*it == tiles[i].get());
- ++i;
- }
- EXPECT_EQ(20, i);
-
- ReleaseTiles(&tiles);
-}
-
-TEST_F(PrioritizedTileSetTest, AtLastAndActiveBin) {
- // Ensure that AT_LAST_AND_ACTIVE_BIN tiles are sorted.
-
- PrioritizedTileSet set;
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- std::vector<scoped_refptr<Tile> > tiles;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
- tiles.push_back(tile);
- set.InsertTile(tile.get(), AT_LAST_AND_ACTIVE_BIN);
- }
- }
-
- // Tiles should appear in BinComparator order.
- std::sort(tiles.begin(), tiles.end(), BinComparator());
-
- int i = 0;
- for (PrioritizedTileSet::Iterator it(&set, true);
- it;
- ++it) {
- EXPECT_TRUE(*it == tiles[i].get());
- ++i;
- }
- EXPECT_EQ(20, i);
-
- ReleaseTiles(&tiles);
-}
-
-TEST_F(PrioritizedTileSetTest, AtLastBin) {
- // Ensure that AT_LAST_BIN tiles are sorted.
-
- PrioritizedTileSet set;
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- std::vector<scoped_refptr<Tile> > tiles;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
- tiles.push_back(tile);
- set.InsertTile(tile.get(), AT_LAST_BIN);
- }
- }
-
- // Tiles should appear in BinComparator order.
- std::sort(tiles.begin(), tiles.end(), BinComparator());
-
- int i = 0;
- for (PrioritizedTileSet::Iterator it(&set, true);
- it;
- ++it) {
- EXPECT_TRUE(*it == tiles[i].get());
- ++i;
- }
- EXPECT_EQ(20, i);
-
- ReleaseTiles(&tiles);
-}
-
-TEST_F(PrioritizedTileSetTest, TilesForEachBin) {
- // Aggregate test with one tile for each of the bins, which
- // should appear in order of the bins.
-
- scoped_refptr<Tile> now_and_ready_to_draw_bin = CreateTile();
- scoped_refptr<Tile> now_bin = CreateTile();
- scoped_refptr<Tile> soon_bin = CreateTile();
- scoped_refptr<Tile> eventually_and_active_bin = CreateTile();
- scoped_refptr<Tile> eventually_bin = CreateTile();
- scoped_refptr<Tile> at_last_bin = CreateTile();
- scoped_refptr<Tile> at_last_and_active_bin = CreateTile();
-
- PrioritizedTileSet set;
- set.InsertTile(soon_bin.get(), SOON_BIN);
- set.InsertTile(at_last_and_active_bin.get(), AT_LAST_AND_ACTIVE_BIN);
- set.InsertTile(eventually_bin.get(), EVENTUALLY_BIN);
- set.InsertTile(now_bin.get(), NOW_BIN);
- set.InsertTile(eventually_and_active_bin.get(), EVENTUALLY_AND_ACTIVE_BIN);
- set.InsertTile(at_last_bin.get(), AT_LAST_BIN);
- set.InsertTile(now_and_ready_to_draw_bin.get(), NOW_AND_READY_TO_DRAW_BIN);
-
- // Tiles should appear in order.
- PrioritizedTileSet::Iterator it(&set, true);
- EXPECT_TRUE(*it == now_and_ready_to_draw_bin.get());
- ++it;
- EXPECT_TRUE(*it == now_bin.get());
- ++it;
- EXPECT_TRUE(*it == soon_bin.get());
- ++it;
- EXPECT_TRUE(*it == eventually_and_active_bin.get());
- ++it;
- EXPECT_TRUE(*it == eventually_bin.get());
- ++it;
- EXPECT_TRUE(*it == at_last_and_active_bin.get());
- ++it;
- EXPECT_TRUE(*it == at_last_bin.get());
- ++it;
- EXPECT_FALSE(it);
-}
-
-TEST_F(PrioritizedTileSetTest, ManyTilesForEachBin) {
- // Aggregate test with many tiles in each of the bins of various
- // priorities. Ensure that they are all returned in a sorted order.
-
- std::vector<scoped_refptr<Tile> > now_and_ready_to_draw_bins;
- std::vector<scoped_refptr<Tile> > now_bins;
- std::vector<scoped_refptr<Tile> > soon_bins;
- std::vector<scoped_refptr<Tile> > eventually_and_active_bins;
- std::vector<scoped_refptr<Tile> > eventually_bins;
- std::vector<scoped_refptr<Tile> > at_last_bins;
- std::vector<scoped_refptr<Tile> > at_last_and_active_bins;
-
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- PrioritizedTileSet set;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
-
- now_and_ready_to_draw_bins.push_back(tile);
- now_bins.push_back(tile);
- soon_bins.push_back(tile);
- eventually_and_active_bins.push_back(tile);
- eventually_bins.push_back(tile);
- at_last_bins.push_back(tile);
- at_last_and_active_bins.push_back(tile);
-
- set.InsertTile(tile.get(), NOW_AND_READY_TO_DRAW_BIN);
- set.InsertTile(tile.get(), NOW_BIN);
- set.InsertTile(tile.get(), SOON_BIN);
- set.InsertTile(tile.get(), EVENTUALLY_AND_ACTIVE_BIN);
- set.InsertTile(tile.get(), EVENTUALLY_BIN);
- set.InsertTile(tile.get(), AT_LAST_BIN);
- set.InsertTile(tile.get(), AT_LAST_AND_ACTIVE_BIN);
- }
- }
-
- PrioritizedTileSet::Iterator it(&set, true);
- std::vector<scoped_refptr<Tile> >::iterator vector_it;
-
- // Now and ready are not sorted.
- for (vector_it = now_and_ready_to_draw_bins.begin();
- vector_it != now_and_ready_to_draw_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // Now bins are sorted.
- std::sort(now_bins.begin(), now_bins.end(), BinComparator());
- for (vector_it = now_bins.begin(); vector_it != now_bins.end(); ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // Soon bins are sorted.
- std::sort(soon_bins.begin(), soon_bins.end(), BinComparator());
- for (vector_it = soon_bins.begin(); vector_it != soon_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // Eventually and active bins are sorted.
- std::sort(eventually_and_active_bins.begin(),
- eventually_and_active_bins.end(),
- BinComparator());
- for (vector_it = eventually_and_active_bins.begin();
- vector_it != eventually_and_active_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // Eventually bins are sorted.
- std::sort(eventually_bins.begin(), eventually_bins.end(), BinComparator());
- for (vector_it = eventually_bins.begin(); vector_it != eventually_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // At last and active bins are sorted.
- std::sort(at_last_and_active_bins.begin(),
- at_last_and_active_bins.end(),
- BinComparator());
- for (vector_it = at_last_and_active_bins.begin();
- vector_it != at_last_and_active_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // At last bins are sorted.
- std::sort(at_last_bins.begin(), at_last_bins.end(), BinComparator());
- for (vector_it = at_last_bins.begin(); vector_it != at_last_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- EXPECT_FALSE(it);
-
- ReleaseTiles(&now_and_ready_to_draw_bins);
- ReleaseTiles(&now_bins);
- ReleaseTiles(&soon_bins);
- ReleaseTiles(&eventually_and_active_bins);
- ReleaseTiles(&eventually_bins);
- ReleaseTiles(&at_last_bins);
- ReleaseTiles(&at_last_and_active_bins);
-}
-
-TEST_F(PrioritizedTileSetTest, ManyTilesForEachBinDisablePriority) {
- // Aggregate test with many tiles for each of the bins. Tiles should
- // appear in order, until DisablePriorityOrdering is called. After that
- // tiles should appear in the order they were inserted.
-
- std::vector<scoped_refptr<Tile> > now_and_ready_to_draw_bins;
- std::vector<scoped_refptr<Tile> > now_bins;
- std::vector<scoped_refptr<Tile> > soon_bins;
- std::vector<scoped_refptr<Tile> > eventually_and_active_bins;
- std::vector<scoped_refptr<Tile> > eventually_bins;
- std::vector<scoped_refptr<Tile> > at_last_bins;
- std::vector<scoped_refptr<Tile> > at_last_and_active_bins;
-
- TilePriority priorities[4] = {
- TilePriorityForEventualBin(),
- TilePriorityForNowBin(),
- TilePriority(),
- TilePriorityForSoonBin()};
-
- PrioritizedTileSet set;
- for (int priority = 0; priority < 4; ++priority) {
- for (int i = 0; i < 5; ++i) {
- scoped_refptr<Tile> tile = CreateTile();
- tile->SetPriority(ACTIVE_TREE, priorities[priority]);
- tile->SetPriority(PENDING_TREE, priorities[priority]);
-
- now_and_ready_to_draw_bins.push_back(tile);
- now_bins.push_back(tile);
- soon_bins.push_back(tile);
- eventually_and_active_bins.push_back(tile);
- eventually_bins.push_back(tile);
- at_last_bins.push_back(tile);
- at_last_and_active_bins.push_back(tile);
-
- set.InsertTile(tile.get(), NOW_AND_READY_TO_DRAW_BIN);
- set.InsertTile(tile.get(), NOW_BIN);
- set.InsertTile(tile.get(), SOON_BIN);
- set.InsertTile(tile.get(), EVENTUALLY_AND_ACTIVE_BIN);
- set.InsertTile(tile.get(), EVENTUALLY_BIN);
- set.InsertTile(tile.get(), AT_LAST_BIN);
- set.InsertTile(tile.get(), AT_LAST_AND_ACTIVE_BIN);
- }
- }
-
- PrioritizedTileSet::Iterator it(&set, true);
- std::vector<scoped_refptr<Tile> >::iterator vector_it;
-
- // Now and ready are not sorted.
- for (vector_it = now_and_ready_to_draw_bins.begin();
- vector_it != now_and_ready_to_draw_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // Now bins are sorted.
- std::sort(now_bins.begin(), now_bins.end(), BinComparator());
- for (vector_it = now_bins.begin(); vector_it != now_bins.end(); ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // Soon bins are sorted.
- std::sort(soon_bins.begin(), soon_bins.end(), BinComparator());
- for (vector_it = soon_bins.begin(); vector_it != soon_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // After we disable priority ordering, we already have sorted the next vector.
- it.DisablePriorityOrdering();
-
- // Eventually and active bins are sorted.
- std::sort(eventually_and_active_bins.begin(),
- eventually_and_active_bins.end(),
- BinComparator());
- for (vector_it = eventually_and_active_bins.begin();
- vector_it != eventually_and_active_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // Eventually bins are not sorted.
- for (vector_it = eventually_bins.begin(); vector_it != eventually_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // At last and active bins are not sorted.
- for (vector_it = at_last_and_active_bins.begin();
- vector_it != at_last_and_active_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- // At last bins are not sorted.
- for (vector_it = at_last_bins.begin(); vector_it != at_last_bins.end();
- ++vector_it) {
- EXPECT_TRUE(vector_it->get() == *it);
- ++it;
- }
-
- EXPECT_FALSE(it);
-
- ReleaseTiles(&now_and_ready_to_draw_bins);
- ReleaseTiles(&now_bins);
- ReleaseTiles(&soon_bins);
- ReleaseTiles(&eventually_and_active_bins);
- ReleaseTiles(&eventually_bins);
- ReleaseTiles(&at_last_bins);
- ReleaseTiles(&at_last_and_active_bins);
-}
-
-TEST_F(PrioritizedTileSetTest, TilesForFirstAndLastBins) {
- // Make sure that if we have empty lists between two non-empty lists,
- // we just get two tiles from the iterator.
-
- scoped_refptr<Tile> now_and_ready_to_draw_bin = CreateTile();
- scoped_refptr<Tile> at_last_bin = CreateTile();
-
- PrioritizedTileSet set;
- set.InsertTile(at_last_bin.get(), AT_LAST_BIN);
- set.InsertTile(now_and_ready_to_draw_bin.get(), NOW_AND_READY_TO_DRAW_BIN);
-
- // Only two tiles should appear and they should appear in order.
- PrioritizedTileSet::Iterator it(&set, true);
- EXPECT_TRUE(*it == now_and_ready_to_draw_bin.get());
- ++it;
- EXPECT_TRUE(*it == at_last_bin.get());
- ++it;
- EXPECT_FALSE(it);
-}
-
-TEST_F(PrioritizedTileSetTest, MultipleIterators) {
- // Ensure that multiple iterators don't interfere with each other.
-
- scoped_refptr<Tile> now_and_ready_to_draw_bin = CreateTile();
- scoped_refptr<Tile> now_bin = CreateTile();
- scoped_refptr<Tile> soon_bin = CreateTile();
- scoped_refptr<Tile> eventually_bin = CreateTile();
- scoped_refptr<Tile> at_last_bin = CreateTile();
-
- PrioritizedTileSet set;
- set.InsertTile(soon_bin.get(), SOON_BIN);
- set.InsertTile(eventually_bin.get(), EVENTUALLY_BIN);
- set.InsertTile(now_bin.get(), NOW_BIN);
- set.InsertTile(at_last_bin.get(), AT_LAST_BIN);
- set.InsertTile(now_and_ready_to_draw_bin.get(), NOW_AND_READY_TO_DRAW_BIN);
-
- // Tiles should appear in order.
- PrioritizedTileSet::Iterator it(&set, true);
- EXPECT_TRUE(*it == now_and_ready_to_draw_bin.get());
- ++it;
- EXPECT_TRUE(*it == now_bin.get());
- ++it;
- EXPECT_TRUE(*it == soon_bin.get());
- ++it;
- EXPECT_TRUE(*it == eventually_bin.get());
- ++it;
- EXPECT_TRUE(*it == at_last_bin.get());
- ++it;
- EXPECT_FALSE(it);
-
- // Creating multiple iterators shouldn't affect old iterators.
- PrioritizedTileSet::Iterator second_it(&set, true);
- EXPECT_TRUE(second_it);
- EXPECT_FALSE(it);
-
- ++second_it;
- EXPECT_TRUE(second_it);
- ++second_it;
- EXPECT_TRUE(second_it);
- EXPECT_FALSE(it);
-
- PrioritizedTileSet::Iterator third_it(&set, true);
- EXPECT_TRUE(third_it);
- ++second_it;
- ++second_it;
- EXPECT_TRUE(second_it);
- EXPECT_TRUE(third_it);
- EXPECT_FALSE(it);
-
- ++third_it;
- ++third_it;
- EXPECT_TRUE(third_it);
- EXPECT_TRUE(*third_it == soon_bin.get());
- EXPECT_TRUE(second_it);
- EXPECT_TRUE(*second_it == at_last_bin.get());
- EXPECT_FALSE(it);
-
- ++second_it;
- EXPECT_TRUE(third_it);
- EXPECT_FALSE(second_it);
- EXPECT_FALSE(it);
-
- set.Clear();
-
- PrioritizedTileSet::Iterator empty_it(&set, true);
- EXPECT_FALSE(empty_it);
-}
-
-} // namespace
-} // namespace cc
-
diff --git a/cc/resources/raster_buffer.h b/cc/resources/raster_buffer.h
index d148b72..df7ea5f 100644
--- a/cc/resources/raster_buffer.h
+++ b/cc/resources/raster_buffer.h
@@ -6,19 +6,21 @@
#define CC_RESOURCES_RASTER_BUFFER_H_
#include "cc/base/cc_export.h"
-#include "skia/ext/refptr.h"
-
-class SkCanvas;
+#include "ui/gfx/geometry/rect.h"
namespace cc {
+class PicturePileImpl;
+class RenderingStatsInstrumentation;
class CC_EXPORT RasterBuffer {
public:
RasterBuffer();
virtual ~RasterBuffer();
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() = 0;
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) = 0;
+ virtual void Playback(const PicturePileImpl* picture_pile,
+ const gfx::Rect& rect,
+ float scale,
+ RenderingStatsInstrumentation* stats) = 0;
};
} // namespace cc
diff --git a/cc/resources/raster_tile_priority_queue.cc b/cc/resources/raster_tile_priority_queue.cc
index 64a4a91..3eee941 100644
--- a/cc/resources/raster_tile_priority_queue.cc
+++ b/cc/resources/raster_tile_priority_queue.cc
@@ -69,8 +69,23 @@
const PictureLayerImpl::LayerRasterTileIterator* pending_iterator,
const Tile* shared_tile) {
switch (tree_priority) {
- case SMOOTHNESS_TAKES_PRIORITY:
+ case SMOOTHNESS_TAKES_PRIORITY: {
+ const Tile* active_tile = shared_tile ? shared_tile : **active_iterator;
+ const Tile* pending_tile = shared_tile ? shared_tile : **pending_iterator;
+
+ const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE);
+ const TilePriority& pending_priority =
+ pending_tile->priority(PENDING_TREE);
+
+ // If we're down to eventually bin tiles on the active tree, process the
+ // pending tree to allow tiles required for activation to be initialized
+ // when memory policy only allows prepaint.
+ if (active_priority.priority_bin == TilePriority::EVENTUALLY &&
+ pending_priority.priority_bin == TilePriority::NOW) {
+ return PENDING_TREE;
+ }
return ACTIVE_TREE;
+ }
case NEW_CONTENT_TAKES_PRIORITY:
return PENDING_TREE;
case SAME_PRIORITY_FOR_BOTH_TREES: {
@@ -152,6 +167,8 @@
tree_priority == SMOOTHNESS_TAKES_PRIORITY)
: PictureLayerImpl::LayerRasterTileIterator()),
has_both_layers(layer_pair.active && layer_pair.pending) {
+ if (has_both_layers)
+ SkipTilesReturnedByTwin(tree_priority);
}
RasterTilePriorityQueue::PairedPictureLayerQueue::~PairedPictureLayerQueue() {
@@ -185,31 +202,37 @@
DCHECK(returned_tiles_for_debug.insert(**next_iterator).second);
++(*next_iterator);
- if (has_both_layers) {
- // We have both layers (active and pending) thus we can encounter shared
- // tiles twice (from the active iterator and from the pending iterator).
- for (; !IsEmpty(); ++(*next_iterator)) {
- next_tree = NextTileIteratorTree(tree_priority);
- next_iterator =
- next_tree == ACTIVE_TREE ? &active_iterator : &pending_iterator;
-
- // Accept all non-shared tiles.
- const Tile* tile = **next_iterator;
- if (!tile->is_shared())
- break;
-
- // Accept a shared tile if the next tree is the higher priority one
- // corresponding the iterator (active or pending) which usually (but due
- // to spiral iterators not always) returns the shared tile first.
- if (next_tree == HigherPriorityTree(tree_priority, NULL, NULL, tile))
- break;
- }
- }
+ if (has_both_layers)
+ SkipTilesReturnedByTwin(tree_priority);
// If no empty, use Top to do DCHECK the next iterator.
DCHECK(IsEmpty() || Top(tree_priority));
}
+void RasterTilePriorityQueue::PairedPictureLayerQueue::SkipTilesReturnedByTwin(
+ TreePriority tree_priority) {
+ // We have both layers (active and pending) thus we can encounter shared
+ // tiles twice (from the active iterator and from the pending iterator).
+ while (!IsEmpty()) {
+ WhichTree next_tree = NextTileIteratorTree(tree_priority);
+ PictureLayerImpl::LayerRasterTileIterator* next_iterator =
+ next_tree == ACTIVE_TREE ? &active_iterator : &pending_iterator;
+
+ // Accept all non-shared tiles.
+ const Tile* tile = **next_iterator;
+ if (!tile->is_shared())
+ break;
+
+ // Accept a shared tile if the next tree is the higher priority one
+ // corresponding the iterator (active or pending) which usually (but due
+ // to spiral iterators not always) returns the shared tile first.
+ if (next_tree == HigherPriorityTree(tree_priority, nullptr, nullptr, tile))
+ break;
+
+ ++(*next_iterator);
+ }
+}
+
WhichTree
RasterTilePriorityQueue::PairedPictureLayerQueue::NextTileIteratorTree(
TreePriority tree_priority) const {
@@ -223,7 +246,7 @@
// Now both iterators have tiles, so we have to decide based on tree priority.
return HigherPriorityTree(
- tree_priority, &active_iterator, &pending_iterator, NULL);
+ tree_priority, &active_iterator, &pending_iterator, nullptr);
}
} // namespace cc
diff --git a/cc/resources/raster_tile_priority_queue.h b/cc/resources/raster_tile_priority_queue.h
index a7ec9e0..5b3b565 100644
--- a/cc/resources/raster_tile_priority_queue.h
+++ b/cc/resources/raster_tile_priority_queue.h
@@ -28,6 +28,7 @@
void Pop(TreePriority tree_priority);
WhichTree NextTileIteratorTree(TreePriority tree_priority) const;
+ void SkipTilesReturnedByTwin(TreePriority tree_priority);
PictureLayerImpl::LayerRasterTileIterator active_iterator;
PictureLayerImpl::LayerRasterTileIterator pending_iterator;
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc
index 65b3767..9b4abe1 100644
--- a/cc/resources/raster_worker_pool.cc
+++ b/cc/resources/raster_worker_pool.cc
@@ -11,6 +11,7 @@
#include "base/strings/stringprintf.h"
#include "base/threading/simple_thread.h"
#include "cc/base/scoped_ptr_deque.h"
+#include "cc/resources/picture_pile_impl.h"
namespace cc {
namespace {
@@ -195,14 +196,18 @@
}
// static
-void RasterWorkerPool::AcquireBitmapForBuffer(SkBitmap* bitmap,
- void* buffer,
- ResourceFormat buffer_format,
- const gfx::Size& size,
- int stride) {
- switch (buffer_format) {
+void RasterWorkerPool::PlaybackToMemory(void* memory,
+ ResourceFormat format,
+ const gfx::Size& size,
+ int stride,
+ const PicturePileImpl* picture_pile,
+ const gfx::Rect& rect,
+ float scale,
+ RenderingStatsInstrumentation* stats) {
+ SkBitmap bitmap;
+ switch (format) {
case RGBA_4444:
- bitmap->allocN32Pixels(size.width(), size.height());
+ bitmap.allocN32Pixels(size.width(), size.height());
break;
case RGBA_8888:
case BGRA_8888: {
@@ -210,7 +215,7 @@
SkImageInfo::MakeN32Premul(size.width(), size.height());
if (!stride)
stride = info.minRowBytes();
- bitmap->installPixels(info, buffer, stride);
+ bitmap.installPixels(info, memory, stride);
break;
}
case ALPHA_8:
@@ -220,25 +225,22 @@
NOTREACHED();
break;
}
-}
-// static
-void RasterWorkerPool::ReleaseBitmapForBuffer(SkBitmap* bitmap,
- void* buffer,
- ResourceFormat buffer_format) {
- SkColorType buffer_color_type = ResourceFormatToSkColorType(buffer_format);
- if (buffer_color_type != bitmap->colorType()) {
- SkImageInfo dst_info = bitmap->info();
+ SkCanvas canvas(bitmap);
+ picture_pile->RasterToBitmap(&canvas, rect, scale, stats);
+
+ SkColorType buffer_color_type = ResourceFormatToSkColorType(format);
+ if (buffer_color_type != bitmap.colorType()) {
+ SkImageInfo dst_info = bitmap.info();
dst_info.fColorType = buffer_color_type;
// TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the
// bitmap data. There will be no need to call SkAlign4 once crbug.com/293728
// is fixed.
const size_t dst_row_bytes = SkAlign4(dst_info.minRowBytes());
DCHECK_EQ(0u, dst_row_bytes % 4);
- bool success = bitmap->readPixels(dst_info, buffer, dst_row_bytes, 0, 0);
+ bool success = bitmap.readPixels(dst_info, memory, dst_row_bytes, 0, 0);
DCHECK_EQ(true, success);
}
- bitmap->reset();
}
} // namespace cc
diff --git a/cc/resources/raster_worker_pool.h b/cc/resources/raster_worker_pool.h
index 1863ce4..d3c2e35 100644
--- a/cc/resources/raster_worker_pool.h
+++ b/cc/resources/raster_worker_pool.h
@@ -6,6 +6,7 @@
#define CC_RESOURCES_RASTER_WORKER_POOL_H_
#include "cc/resources/rasterizer.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
namespace base {
@@ -13,6 +14,8 @@
}
namespace cc {
+class PicturePileImpl;
+class RenderingStatsInstrumentation;
class CC_EXPORT RasterWorkerPool {
public:
@@ -61,16 +64,16 @@
const ImageDecodeTask::Vector& decode_tasks,
unsigned priority);
- // Utility functions that transparently create a temporary bitmap and copy
- // pixels to buffer when necessary.
- static void AcquireBitmapForBuffer(SkBitmap* bitmap,
- void* buffer,
- ResourceFormat format,
- const gfx::Size& size,
- int stride);
- static void ReleaseBitmapForBuffer(SkBitmap* bitmap,
- void* buffer,
- ResourceFormat format);
+ // Utility function that will create a temporary bitmap and copy pixels to
+ // |memory| when necessary.
+ static void PlaybackToMemory(void* memory,
+ ResourceFormat format,
+ const gfx::Size& size,
+ int stride,
+ const PicturePileImpl* picture_pile,
+ const gfx::Rect& rect,
+ float scale,
+ RenderingStatsInstrumentation* stats);
// Type-checking downcast routine.
virtual Rasterizer* AsRasterizer() = 0;
diff --git a/cc/resources/raster_worker_pool_perftest.cc b/cc/resources/raster_worker_pool_perftest.cc
index e84e8af..b491e9b 100644
--- a/cc/resources/raster_worker_pool_perftest.cc
+++ b/cc/resources/raster_worker_pool_perftest.cc
@@ -21,6 +21,7 @@
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.h"
#include "cc/test/test_context_support.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_web_graphics_context_3d.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -32,10 +33,10 @@
class PerfGLES2Interface : public gpu::gles2::GLES2InterfaceStub {
// Overridden from gpu::gles2::GLES2Interface:
- virtual GLuint CreateImageCHROMIUM(GLsizei width,
+ virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) override {
+ GLenum internalformat) override {
return 1u;
}
virtual void GenBuffers(GLsizei n, GLuint* buffers) override {
@@ -399,9 +400,14 @@
void Create3dOutputSurfaceAndResourceProvider() {
output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass();
CHECK(output_surface_->BindToClient(&output_surface_client_));
- resource_provider_ =
- ResourceProvider::Create(
- output_surface_.get(), NULL, NULL, 0, false, 1, false).Pass();
+ resource_provider_ = ResourceProvider::Create(output_surface_.get(),
+ NULL,
+ &gpu_memory_buffer_manager_,
+ NULL,
+ 0,
+ false,
+ 1,
+ false).Pass();
}
void CreateSoftwareOutputSurfaceAndResourceProvider() {
@@ -411,6 +417,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
&shared_bitmap_manager_,
NULL,
+ NULL,
0,
false,
1,
@@ -436,6 +443,7 @@
scoped_ptr<ResourcePool> staging_resource_pool_;
scoped_ptr<RasterWorkerPool> raster_worker_pool_;
+ TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
TestSharedBitmapManager shared_bitmap_manager_;
};
@@ -483,7 +491,7 @@
CHECK(output_surface_->BindToClient(&output_surface_client_));
resource_provider_ =
ResourceProvider::Create(
- output_surface_.get(), NULL, NULL, 0, false, 1, false).Pass();
+ output_surface_.get(), NULL, NULL, NULL, 0, false, 1, false).Pass();
}
void RunBuildRasterTaskQueueTest(const std::string& test_name,
diff --git a/cc/resources/raster_worker_pool_unittest.cc b/cc/resources/raster_worker_pool_unittest.cc
index 3c39c05..e652cd6 100644
--- a/cc/resources/raster_worker_pool_unittest.cc
+++ b/cc/resources/raster_worker_pool_unittest.cc
@@ -22,6 +22,8 @@
#include "cc/resources/zero_copy_raster_worker_pool.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.h"
+#include "cc/test/fake_picture_pile_impl.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_web_graphics_context_3d.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -50,14 +52,15 @@
TestRasterTaskImpl(const Resource* resource,
const Reply& reply,
ImageDecodeTask::Vector* dependencies)
- : RasterTask(resource, dependencies), reply_(reply) {}
+ : RasterTask(resource, dependencies),
+ reply_(reply),
+ picture_pile_(FakePicturePileImpl::CreateEmptyPile(gfx::Size(1, 1),
+ gfx::Size(1, 1))) {}
// Overridden from Task:
virtual void RunOnWorkerThread() override {
- skia::RefPtr<SkCanvas> canvas = raster_buffer_->AcquireSkCanvas();
- DCHECK(canvas);
- canvas->drawColor(SK_ColorWHITE);
- raster_buffer_->ReleaseSkCanvas(canvas);
+ raster_buffer_->Playback(
+ picture_pile_.get(), gfx::Rect(0, 0, 1, 1), 1.0, NULL);
}
// Overridden from RasterizerTask:
@@ -77,6 +80,7 @@
private:
const Reply reply_;
scoped_ptr<RasterBuffer> raster_buffer_;
+ scoped_refptr<PicturePileImpl> picture_pile_;
DISALLOW_COPY_AND_ASSIGN(TestRasterTaskImpl);
};
@@ -269,9 +273,14 @@
CHECK(output_surface_->BindToClient(&output_surface_client_));
TestWebGraphicsContext3D* context3d = context_provider_->TestContext3d();
context3d->set_support_sync_query(true);
- resource_provider_ =
- ResourceProvider::Create(
- output_surface_.get(), NULL, NULL, 0, false, 1, false).Pass();
+ resource_provider_ = ResourceProvider::Create(output_surface_.get(),
+ NULL,
+ &gpu_memory_buffer_manager_,
+ NULL,
+ 0,
+ false,
+ 1,
+ false).Pass();
}
void CreateSoftwareOutputSurfaceAndResourceProvider() {
@@ -281,6 +290,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
&shared_bitmap_manager_,
NULL,
+ NULL,
0,
false,
1,
@@ -309,6 +319,7 @@
scoped_ptr<ResourceProvider> resource_provider_;
scoped_ptr<ResourcePool> staging_resource_pool_;
scoped_ptr<RasterWorkerPool> raster_worker_pool_;
+ TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
TestSharedBitmapManager shared_bitmap_manager_;
base::CancelableClosure timeout_;
int timeout_seconds_;
@@ -334,7 +345,6 @@
return;
TestWebGraphicsContext3D* context3d = context_provider_->TestContext3d();
- context3d->set_times_map_image_chromium_succeeds(0);
context3d->set_times_map_buffer_chromium_succeeds(0);
AppendTask(0u);
ScheduleTasks();
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index abb8541..ded3477 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -14,6 +14,7 @@
#include "base/strings/string_util.h"
#include "cc/base/util.h"
#include "cc/output/gl_renderer.h" // For the GLC() macro.
+#include "cc/resources/gpu_memory_buffer_manager.h"
#include "cc/resources/platform_color.h"
#include "cc/resources/returned_resource.h"
#include "cc/resources/shared_bitmap_manager.h"
@@ -26,6 +27,7 @@
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "ui/gfx/frame_time.h"
+#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/vector2d.h"
@@ -111,6 +113,23 @@
return kSkia8888_GrPixelConfig;
}
+gfx::GpuMemoryBuffer::Format ToGpuMemoryBufferFormat(ResourceFormat format) {
+ switch (format) {
+ case RGBA_8888:
+ return gfx::GpuMemoryBuffer::Format::RGBA_8888;
+ case BGRA_8888:
+ return gfx::GpuMemoryBuffer::Format::BGRA_8888;
+ case RGBA_4444:
+ case ALPHA_8:
+ case LUMINANCE_8:
+ case RGB_565:
+ case ETC1:
+ break;
+ }
+ NOTREACHED();
+ return gfx::GpuMemoryBuffer::Format::RGBA_8888;
+}
+
class ScopedSetActiveTexture {
public:
ScopedSetActiveTexture(GLES2Interface* gl, GLenum unit)
@@ -239,7 +258,8 @@
hint(TextureHintImmutable),
type(InvalidType),
format(RGBA_8888),
- shared_bitmap(NULL) {
+ shared_bitmap(NULL),
+ gpu_memory_buffer(NULL) {
}
ResourceProvider::Resource::~Resource() {}
@@ -285,7 +305,8 @@
hint(hint),
type(GLTexture),
format(format),
- shared_bitmap(NULL) {
+ shared_bitmap(NULL),
+ gpu_memory_buffer(NULL) {
DCHECK(wrap_mode == GL_CLAMP_TO_EDGE || wrap_mode == GL_REPEAT);
DCHECK_EQ(origin == Internal, !!texture_pool);
}
@@ -328,7 +349,8 @@
hint(TextureHintImmutable),
type(Bitmap),
format(RGBA_8888),
- shared_bitmap(bitmap) {
+ shared_bitmap(bitmap),
+ gpu_memory_buffer(NULL) {
DCHECK(wrap_mode == GL_CLAMP_TO_EDGE || wrap_mode == GL_REPEAT);
DCHECK(origin == Delegated || pixels);
if (bitmap)
@@ -373,7 +395,8 @@
type(Bitmap),
format(RGBA_8888),
shared_bitmap_id(bitmap_id),
- shared_bitmap(NULL) {
+ shared_bitmap(NULL),
+ gpu_memory_buffer(NULL) {
DCHECK(wrap_mode == GL_CLAMP_TO_EDGE || wrap_mode == GL_REPEAT);
}
@@ -384,6 +407,7 @@
scoped_ptr<ResourceProvider> ResourceProvider::Create(
OutputSurface* output_surface,
SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
BlockingTaskRunner* blocking_main_thread_task_runner,
int highp_threshold_min,
bool use_rgba_4444_texture_format,
@@ -392,6 +416,7 @@
scoped_ptr<ResourceProvider> resource_provider(
new ResourceProvider(output_surface,
shared_bitmap_manager,
+ gpu_memory_buffer_manager,
blocking_main_thread_task_runner,
highp_threshold_min,
use_rgba_4444_texture_format,
@@ -698,6 +723,12 @@
if (resource->pixels) {
DCHECK(resource->origin == Resource::Internal);
delete[] resource->pixels;
+ resource->pixels = NULL;
+ }
+ if (resource->gpu_memory_buffer) {
+ DCHECK(resource->origin != Resource::External);
+ delete resource->gpu_memory_buffer;
+ resource->gpu_memory_buffer = NULL;
}
resources_.erase(it);
}
@@ -924,16 +955,14 @@
DCHECK_EQ(GLTexture, resource->type);
DCHECK(CanLockForWrite(id));
- if (!resource->image_id) {
+ if (!resource->gpu_memory_buffer) {
+ scoped_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer =
+ gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer(
+ resource->size,
+ ToGpuMemoryBufferFormat(resource->format),
+ gfx::GpuMemoryBuffer::MAP);
+ resource->gpu_memory_buffer = gpu_memory_buffer.release();
resource->allocated = true;
- GLES2Interface* gl = ContextGL();
- DCHECK(gl);
- resource->image_id =
- gl->CreateImageCHROMIUM(resource->size.width(),
- resource->size.height(),
- TextureToStorageFormat(resource->format),
- GL_IMAGE_MAP_CHROMIUM);
- DCHECK(resource->image_id);
}
resource->locked_for_write = true;
@@ -947,6 +976,16 @@
DCHECK(resource->origin == Resource::Internal);
DCHECK_EQ(GLTexture, resource->type);
+ if (!resource->image_id) {
+ GLES2Interface* gl = ContextGL();
+ DCHECK(gl);
+ resource->image_id =
+ gl->CreateImageCHROMIUM(resource->gpu_memory_buffer->AsClientBuffer(),
+ resource->size.width(),
+ resource->size.height(),
+ GL_RGBA);
+ }
+
resource->locked_for_write = false;
resource->dirty_image = true;
@@ -1089,17 +1128,13 @@
ResourceProvider::ResourceId resource_id)
: resource_provider_(resource_provider),
resource_id_(resource_id),
- image_id_(resource_provider->LockForWriteToGpuMemoryBuffer(resource_id)
- ->image_id),
gpu_memory_buffer_(
- resource_provider->ContextGL()->MapImageCHROMIUM(image_id_)) {
- resource_provider->ContextGL()->GetImageParameterivCHROMIUM(
- image_id_, GL_IMAGE_ROWBYTES_CHROMIUM, &stride_);
+ resource_provider->LockForWriteToGpuMemoryBuffer(resource_id)
+ ->gpu_memory_buffer) {
}
ResourceProvider::ScopedWriteLockGpuMemoryBuffer::
~ScopedWriteLockGpuMemoryBuffer() {
- resource_provider_->ContextGL()->UnmapImageCHROMIUM(image_id_);
resource_provider_->UnlockForWriteToGpuMemoryBuffer(resource_id_);
}
@@ -1119,6 +1154,7 @@
ResourceProvider::ResourceProvider(
OutputSurface* output_surface,
SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
BlockingTaskRunner* blocking_main_thread_task_runner,
int highp_threshold_min,
bool use_rgba_4444_texture_format,
@@ -1126,6 +1162,7 @@
bool use_distance_field_text)
: output_surface_(output_surface),
shared_bitmap_manager_(shared_bitmap_manager),
+ gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
blocking_main_thread_task_runner_(blocking_main_thread_task_runner),
lost_output_surface_(false),
highp_threshold_min_(highp_threshold_min),
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index c548866..dc8e7b6 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -42,12 +42,14 @@
}
namespace gfx {
+class GpuMemoryBuffer;
class Rect;
class Vector2d;
}
namespace cc {
class BlockingTaskRunner;
+class GpuMemoryBufferManager;
class IdAllocator;
class SharedBitmap;
class SharedBitmapManager;
@@ -77,6 +79,7 @@
static scoped_ptr<ResourceProvider> Create(
OutputSurface* output_surface,
SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
BlockingTaskRunner* blocking_main_thread_task_runner,
int highp_threshold_min,
bool use_rgba_4444_texture_format,
@@ -309,15 +312,12 @@
ResourceProvider::ResourceId resource_id);
~ScopedWriteLockGpuMemoryBuffer();
- void* gpu_memory_buffer() { return gpu_memory_buffer_; }
- int stride() const { return stride_; }
+ gfx::GpuMemoryBuffer* gpu_memory_buffer() { return gpu_memory_buffer_; }
private:
ResourceProvider* resource_provider_;
ResourceProvider::ResourceId resource_id_;
- unsigned image_id_;
- void* gpu_memory_buffer_;
- int stride_;
+ gfx::GpuMemoryBuffer* gpu_memory_buffer_;
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer);
};
@@ -456,6 +456,7 @@
ResourceFormat format;
SharedBitmapId shared_bitmap_id;
SharedBitmap* shared_bitmap;
+ gfx::GpuMemoryBuffer* gpu_memory_buffer;
skia::RefPtr<SkSurface> sk_surface;
};
typedef base::hash_map<ResourceId, Resource> ResourceMap;
@@ -483,6 +484,7 @@
ResourceProvider(OutputSurface* output_surface,
SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
BlockingTaskRunner* blocking_main_thread_task_runner,
int highp_threshold_min,
bool use_rgba_4444_texture_format,
@@ -531,6 +533,7 @@
OutputSurface* output_surface_;
SharedBitmapManager* shared_bitmap_manager_;
+ GpuMemoryBufferManager* gpu_memory_buffer_manager_;
BlockingTaskRunner* blocking_main_thread_task_runner_;
bool lost_output_surface_;
int highp_threshold_min_;
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc
index 6dac574..25ca028 100644
--- a/cc/resources/resource_provider_unittest.cc
+++ b/cc/resources/resource_provider_unittest.cc
@@ -19,6 +19,7 @@
#include "cc/resources/single_release_callback.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_texture.h"
#include "cc/test/test_web_graphics_context_3d.h"
@@ -28,6 +29,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
+#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/rect.h"
using testing::Mock;
@@ -413,11 +415,13 @@
CHECK(output_surface_->BindToClient(&output_surface_client_));
CHECK(child_output_surface_->BindToClient(&child_output_surface_client_));
- shared_bitmap_manager_.reset(new TestSharedBitmapManager());
+ shared_bitmap_manager_.reset(new TestSharedBitmapManager);
+ gpu_memory_buffer_manager_.reset(new TestGpuMemoryBufferManager);
resource_provider_ =
ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
main_thread_task_runner_.get(),
0,
false,
@@ -426,6 +430,7 @@
child_resource_provider_ =
ResourceProvider::Create(child_output_surface_.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
main_thread_task_runner_.get(),
0,
false,
@@ -506,6 +511,7 @@
scoped_ptr<ResourceProvider> resource_provider_;
scoped_ptr<ResourceProvider> child_resource_provider_;
scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
};
void CheckCreateResource(ResourceProvider::ResourceType expected_default_type,
@@ -1160,6 +1166,7 @@
scoped_ptr<ResourceProvider> child_resource_provider(
ResourceProvider::Create(child_output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -1643,6 +1650,7 @@
ResourceProvider::Create(child_output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -1661,6 +1669,7 @@
ResourceProvider::Create(parent_output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -2292,6 +2301,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -2379,6 +2389,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -2434,6 +2445,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -2493,6 +2505,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -2566,6 +2579,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
main_thread_task_runner_.get(),
0,
false,
@@ -2618,6 +2632,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
main_thread_task_runner_.get(),
0,
false,
@@ -2703,6 +2718,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -2778,6 +2794,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -2837,6 +2854,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -2935,11 +2953,9 @@
GLsizei image_size,
const void* data));
MOCK_METHOD1(waitAsyncTexImage2DCHROMIUM, void(GLenum));
- MOCK_METHOD4(createImageCHROMIUM, GLuint(GLsizei, GLsizei, GLenum, GLenum));
+ MOCK_METHOD4(createImageCHROMIUM,
+ GLuint(ClientBuffer, GLsizei, GLsizei, GLenum));
MOCK_METHOD1(destroyImageCHROMIUM, void(GLuint));
- MOCK_METHOD1(mapImageCHROMIUM, void*(GLuint));
- MOCK_METHOD3(getImageParameterivCHROMIUM, void(GLuint, GLenum, GLint*));
- MOCK_METHOD1(unmapImageCHROMIUM, void(GLuint));
MOCK_METHOD2(bindTexImage2DCHROMIUM, void(GLenum, GLint));
MOCK_METHOD2(releaseTexImage2DCHROMIUM, void(GLenum, GLint));
@@ -2965,6 +2981,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3045,6 +3062,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3105,6 +3123,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3164,6 +3183,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3211,6 +3231,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3258,6 +3279,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3303,6 +3325,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3312,24 +3335,9 @@
id = resource_provider->CreateResource(
size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureHintImmutable, format);
- const int kStride = 8;
- uint8 buffer_data[kStride * kHeight];
- EXPECT_CALL(
- *context,
- createImageCHROMIUM(kWidth, kHeight, GL_RGBA8_OES, GL_IMAGE_MAP_CHROMIUM))
+ EXPECT_CALL(*context, createImageCHROMIUM(_, kWidth, kHeight, GL_RGBA))
.WillOnce(Return(kImageId))
.RetiresOnSaturation();
- EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
- .WillOnce(Return(buffer_data))
- .RetiresOnSaturation();
- EXPECT_CALL(*context, getImageParameterivCHROMIUM(kImageId,
- GL_IMAGE_ROWBYTES_CHROMIUM,
- _))
- .WillOnce(SetArgPointee<2>(kStride))
- .RetiresOnSaturation();
- EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId))
- .Times(1)
- .RetiresOnSaturation();
{
ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock(
resource_provider.get(), id);
@@ -3351,17 +3359,6 @@
EXPECT_EQ(kTextureId, lock_gl.texture_id());
}
- EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
- .WillOnce(Return(buffer_data))
- .RetiresOnSaturation();
- EXPECT_CALL(
- *context,
- getImageParameterivCHROMIUM(kImageId, GL_IMAGE_ROWBYTES_CHROMIUM, _))
- .WillOnce(SetArgPointee<2>(kStride))
- .RetiresOnSaturation();
- EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId))
- .Times(1)
- .RetiresOnSaturation();
{
ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock(
resource_provider.get(), id);
@@ -3416,6 +3413,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3425,24 +3423,9 @@
source_id = resource_provider->CreateResource(
size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureHintImmutable, format);
- const int kStride = 8;
- uint8 buffer_data[kStride * kHeight];
- EXPECT_CALL(
- *context,
- createImageCHROMIUM(kWidth, kHeight, GL_RGBA8_OES, GL_IMAGE_MAP_CHROMIUM))
+ EXPECT_CALL(*context, createImageCHROMIUM(_, kWidth, kHeight, GL_RGBA))
.WillOnce(Return(kImageId))
.RetiresOnSaturation();
- EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
- .WillOnce(Return(buffer_data))
- .RetiresOnSaturation();
- EXPECT_CALL(
- *context,
- getImageParameterivCHROMIUM(kImageId, GL_IMAGE_ROWBYTES_CHROMIUM, _))
- .WillOnce(SetArgPointee<2>(kStride))
- .RetiresOnSaturation();
- EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId))
- .Times(1)
- .RetiresOnSaturation();
{
ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock(
resource_provider.get(), source_id);
@@ -3514,6 +3497,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -3552,6 +3536,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3588,6 +3573,7 @@
scoped_ptr<ResourceProvider> resource_provider(
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
NULL,
0,
false,
@@ -3650,6 +3636,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
kTextureAllocationChunkSize,
@@ -3670,6 +3657,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
kTextureAllocationChunkSize,
diff --git a/cc/resources/resource_update_controller_unittest.cc b/cc/resources/resource_update_controller_unittest.cc
index 18ad507..361050d 100644
--- a/cc/resources/resource_update_controller_unittest.cc
+++ b/cc/resources/resource_update_controller_unittest.cc
@@ -128,6 +128,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
diff --git a/cc/resources/scoped_resource_unittest.cc b/cc/resources/scoped_resource_unittest.cc
index f671479..04d6329 100644
--- a/cc/resources/scoped_resource_unittest.cc
+++ b/cc/resources/scoped_resource_unittest.cc
@@ -25,6 +25,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -51,6 +52,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -80,6 +82,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -120,6 +123,7 @@
ResourceProvider::Create(output_surface.get(),
shared_bitmap_manager.get(),
NULL,
+ NULL,
0,
false,
1,
diff --git a/cc/resources/texture_uploader.cc b/cc/resources/texture_uploader.cc
index eb4e6c0..8c7010b 100644
--- a/cc/resources/texture_uploader.cc
+++ b/cc/resources/texture_uploader.cc
@@ -116,6 +116,12 @@
}
void TextureUploader::BeginQuery() {
+ // Check to see if any of the pending queries are free before allocating a
+ // new one. If this is not done, queries may be allocated without bound.
+ // http://crbug.com/398072
+ if (available_queries_.empty())
+ ProcessQueries();
+
if (available_queries_.empty())
available_queries_.push_back(Query::Create(gl_));
diff --git a/cc/resources/tile.cc b/cc/resources/tile.cc
index ff7a7a2..e994a5e 100644
--- a/cc/resources/tile.cc
+++ b/cc/resources/tile.cc
@@ -33,6 +33,9 @@
source_frame_number_(source_frame_number),
flags_(flags),
is_shared_(false),
+ tiling_i_index_(-1),
+ tiling_j_index_(-1),
+ required_for_activation_(false),
id_(s_next_id_++) {
set_picture_pile(picture_pile);
for (int i = 0; i < NUM_TREES; i++)
@@ -45,22 +48,6 @@
"cc::Tile", this);
}
-void Tile::SetPriority(WhichTree tree, const TilePriority& priority) {
- if (priority == priority_[tree])
- return;
-
- priority_[tree] = priority;
- tile_manager_->DidChangeTilePriority(this);
-}
-
-void Tile::MarkRequiredForActivation() {
- if (priority_[PENDING_TREE].required_for_activation)
- return;
-
- priority_[PENDING_TREE].required_for_activation = true;
- tile_manager_->DidChangeTilePriority(this);
-}
-
void Tile::AsValueInto(base::debug::TracedValue* res) const {
TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this);
diff --git a/cc/resources/tile.h b/cc/resources/tile.h
index ec0b9a2..e61b5c5 100644
--- a/cc/resources/tile.h
+++ b/cc/resources/tile.h
@@ -58,8 +58,11 @@
priority_[PENDING_TREE]);
}
- void SetPriority(WhichTree tree, const TilePriority& priority);
+ void SetPriority(WhichTree tree, const TilePriority& priority) {
+ priority_[tree] = priority;
+ }
+ // TODO(vmpstr): Move this to the iterators.
void set_is_occluded(WhichTree tree, bool is_occluded) {
is_occluded_[tree] = is_occluded;
}
@@ -83,10 +86,10 @@
}
}
- void MarkRequiredForActivation();
-
- bool required_for_activation() const {
- return priority_[PENDING_TREE].required_for_activation;
+ // TODO(vmpstr): Move this to the iterators.
+ bool required_for_activation() const { return required_for_activation_; }
+ void set_required_for_activation(bool is_required) {
+ required_for_activation_ = is_required;
}
bool use_picture_analysis() const {
@@ -94,6 +97,11 @@
}
bool HasResources() const { return managed_state_.draw_info.has_resource(); }
+ bool NeedsRaster() const {
+ return managed_state_.draw_info.mode() ==
+ ManagedTileState::DrawInfo::PICTURE_PILE_MODE ||
+ !managed_state_.draw_info.IsReadyToDraw();
+ }
void AsValueInto(base::debug::TracedValue* dict) const;
@@ -126,6 +134,13 @@
gfx::Size size() const { return size_; }
+ void set_tiling_index(int i, int j) {
+ tiling_i_index_ = i;
+ tiling_j_index_ = j;
+ }
+ int tiling_i_index() const { return tiling_i_index_; }
+ int tiling_j_index() const { return tiling_j_index_; }
+
private:
friend class TileManager;
friend class PrioritizedTileSet;
@@ -162,6 +177,9 @@
int source_frame_number_;
int flags_;
bool is_shared_;
+ int tiling_i_index_;
+ int tiling_j_index_;
+ bool required_for_activation_;
Id id_;
static Id s_next_id_;
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index d121840..84a925f 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -20,8 +20,6 @@
#include "cc/resources/raster_buffer.h"
#include "cc/resources/rasterizer.h"
#include "cc/resources/tile.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/core/SkPixelRef.h"
#include "ui/gfx/rect_conversions.h"
namespace cc {
@@ -114,9 +112,6 @@
devtools_instrumentation::ScopedLayerTask layer_task(
devtools_instrumentation::kRasterTask, layer_id_);
- skia::RefPtr<SkCanvas> canvas = raster_buffer_->AcquireSkCanvas();
- DCHECK(canvas);
-
base::TimeDelta prev_rasterize_time =
rendering_stats_->impl_thread_rendering_stats().rasterize_time;
@@ -127,8 +122,9 @@
RenderingStatsInstrumentation* stats =
tile_resolution_ == HIGH_RESOLUTION ? rendering_stats_ : NULL;
DCHECK(picture_pile);
- picture_pile->RasterToBitmap(
- canvas.get(), content_rect_, contents_scale_, stats);
+
+ raster_buffer_->Playback(
+ picture_pile_.get(), content_rect_, contents_scale_, stats);
if (rendering_stats_->record_rendering_stats()) {
base::TimeDelta current_rasterize_time =
@@ -140,8 +136,6 @@
100000,
100);
}
-
- raster_buffer_->ReleaseSkCanvas(canvas);
}
PicturePileImpl::Analysis analysis_;
@@ -203,110 +197,6 @@
const size_t kScheduledRasterTasksLimit = 32u;
-// Memory limit policy works by mapping some bin states to the NEVER bin.
-const ManagedTileBin kBinPolicyMap[NUM_TILE_MEMORY_LIMIT_POLICIES][NUM_BINS] = {
- // [ALLOW_NOTHING]
- {NEVER_BIN, // [NOW_AND_READY_TO_DRAW_BIN]
- NEVER_BIN, // [NOW_BIN]
- NEVER_BIN, // [SOON_BIN]
- NEVER_BIN, // [EVENTUALLY_AND_ACTIVE_BIN]
- NEVER_BIN, // [EVENTUALLY_BIN]
- NEVER_BIN, // [AT_LAST_AND_ACTIVE_BIN]
- NEVER_BIN, // [AT_LAST_BIN]
- NEVER_BIN // [NEVER_BIN]
- },
- // [ALLOW_ABSOLUTE_MINIMUM]
- {NOW_AND_READY_TO_DRAW_BIN, // [NOW_AND_READY_TO_DRAW_BIN]
- NOW_BIN, // [NOW_BIN]
- NEVER_BIN, // [SOON_BIN]
- NEVER_BIN, // [EVENTUALLY_AND_ACTIVE_BIN]
- NEVER_BIN, // [EVENTUALLY_BIN]
- NEVER_BIN, // [AT_LAST_AND_ACTIVE_BIN]
- NEVER_BIN, // [AT_LAST_BIN]
- NEVER_BIN // [NEVER_BIN]
- },
- // [ALLOW_PREPAINT_ONLY]
- {NOW_AND_READY_TO_DRAW_BIN, // [NOW_AND_READY_TO_DRAW_BIN]
- NOW_BIN, // [NOW_BIN]
- SOON_BIN, // [SOON_BIN]
- NEVER_BIN, // [EVENTUALLY_AND_ACTIVE_BIN]
- NEVER_BIN, // [EVENTUALLY_BIN]
- NEVER_BIN, // [AT_LAST_AND_ACTIVE_BIN]
- NEVER_BIN, // [AT_LAST_BIN]
- NEVER_BIN // [NEVER_BIN]
- },
- // [ALLOW_ANYTHING]
- {NOW_AND_READY_TO_DRAW_BIN, // [NOW_AND_READY_TO_DRAW_BIN]
- NOW_BIN, // [NOW_BIN]
- SOON_BIN, // [SOON_BIN]
- EVENTUALLY_AND_ACTIVE_BIN, // [EVENTUALLY_AND_ACTIVE_BIN]
- EVENTUALLY_BIN, // [EVENTUALLY_BIN]
- AT_LAST_AND_ACTIVE_BIN, // [AT_LAST_AND_ACTIVE_BIN]
- AT_LAST_BIN, // [AT_LAST_BIN]
- NEVER_BIN // [NEVER_BIN]
- }};
-
-// Ready to draw works by mapping NOW_BIN to NOW_AND_READY_TO_DRAW_BIN.
-const ManagedTileBin kBinReadyToDrawMap[2][NUM_BINS] = {
- // Not ready
- {NOW_AND_READY_TO_DRAW_BIN, // [NOW_AND_READY_TO_DRAW_BIN]
- NOW_BIN, // [NOW_BIN]
- SOON_BIN, // [SOON_BIN]
- EVENTUALLY_AND_ACTIVE_BIN, // [EVENTUALLY_AND_ACTIVE_BIN]
- EVENTUALLY_BIN, // [EVENTUALLY_BIN]
- AT_LAST_AND_ACTIVE_BIN, // [AT_LAST_AND_ACTIVE_BIN]
- AT_LAST_BIN, // [AT_LAST_BIN]
- NEVER_BIN // [NEVER_BIN]
- },
- // Ready
- {NOW_AND_READY_TO_DRAW_BIN, // [NOW_AND_READY_TO_DRAW_BIN]
- NOW_AND_READY_TO_DRAW_BIN, // [NOW_BIN]
- SOON_BIN, // [SOON_BIN]
- EVENTUALLY_AND_ACTIVE_BIN, // [EVENTUALLY_AND_ACTIVE_BIN]
- EVENTUALLY_BIN, // [EVENTUALLY_BIN]
- AT_LAST_AND_ACTIVE_BIN, // [AT_LAST_AND_ACTIVE_BIN]
- AT_LAST_BIN, // [AT_LAST_BIN]
- NEVER_BIN // [NEVER_BIN]
- }};
-
-// Active works by mapping some bin stats to equivalent _ACTIVE_BIN state.
-const ManagedTileBin kBinIsActiveMap[2][NUM_BINS] = {
- // Inactive
- {NOW_AND_READY_TO_DRAW_BIN, // [NOW_AND_READY_TO_DRAW_BIN]
- NOW_BIN, // [NOW_BIN]
- SOON_BIN, // [SOON_BIN]
- EVENTUALLY_AND_ACTIVE_BIN, // [EVENTUALLY_AND_ACTIVE_BIN]
- EVENTUALLY_BIN, // [EVENTUALLY_BIN]
- AT_LAST_AND_ACTIVE_BIN, // [AT_LAST_AND_ACTIVE_BIN]
- AT_LAST_BIN, // [AT_LAST_BIN]
- NEVER_BIN // [NEVER_BIN]
- },
- // Active
- {NOW_AND_READY_TO_DRAW_BIN, // [NOW_AND_READY_TO_DRAW_BIN]
- NOW_BIN, // [NOW_BIN]
- SOON_BIN, // [SOON_BIN]
- EVENTUALLY_AND_ACTIVE_BIN, // [EVENTUALLY_AND_ACTIVE_BIN]
- EVENTUALLY_AND_ACTIVE_BIN, // [EVENTUALLY_BIN]
- AT_LAST_AND_ACTIVE_BIN, // [AT_LAST_AND_ACTIVE_BIN]
- AT_LAST_AND_ACTIVE_BIN, // [AT_LAST_BIN]
- NEVER_BIN // [NEVER_BIN]
- }};
-
-// Determine bin based on three categories of tiles: things we need now,
-// things we need soon, and eventually.
-inline ManagedTileBin BinFromTilePriority(const TilePriority& prio) {
- if (prio.priority_bin == TilePriority::NOW)
- return NOW_BIN;
-
- if (prio.priority_bin == TilePriority::SOON)
- return SOON_BIN;
-
- if (prio.distance_to_visible == std::numeric_limits<float>::infinity())
- return NEVER_BIN;
-
- return EVENTUALLY_BIN;
-}
-
} // namespace
RasterTaskCompletionStats::RasterTaskCompletionStats()
@@ -345,12 +235,7 @@
task_runner_(task_runner),
resource_pool_(resource_pool),
rasterizer_(rasterizer),
- prioritized_tiles_dirty_(false),
- all_tiles_that_need_to_be_rasterized_have_memory_(true),
- all_tiles_required_for_activation_have_memory_(true),
- bytes_releasable_(0),
- resources_releasable_(0),
- ever_exceeded_memory_budget_(false),
+ all_tiles_that_need_to_be_rasterized_are_scheduled_(true),
rendering_stats_instrumentation_(rendering_stats_instrumentation),
did_initialize_visible_tile_(false),
did_check_for_completed_tasks_since_last_schedule_tasks_(true),
@@ -376,26 +261,14 @@
rasterizer_->Shutdown();
rasterizer_->CheckForCompletedTasks();
- prioritized_tiles_.Clear();
-
FreeResourcesForReleasedTiles();
CleanUpReleasedTiles();
-
- DCHECK_EQ(0u, bytes_releasable_);
- DCHECK_EQ(0u, resources_releasable_);
}
void TileManager::Release(Tile* tile) {
- DCHECK(TilePriority() == tile->combined_priority());
-
- prioritized_tiles_dirty_ = true;
released_tiles_.push_back(tile);
}
-void TileManager::DidChangeTilePriority(Tile* tile) {
- prioritized_tiles_dirty_ = true;
-}
-
TaskSetCollection TileManager::TasksThatShouldBeForcedToComplete() const {
TaskSetCollection tasks_that_should_be_forced_to_complete;
if (global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY)
@@ -413,10 +286,6 @@
}
void TileManager::CleanUpReleasedTiles() {
- // Make sure |prioritized_tiles_| doesn't contain any of the tiles
- // we're about to delete.
- DCHECK(prioritized_tiles_.IsEmpty());
-
std::vector<Tile*>::iterator it = released_tiles_.begin();
while (it != released_tiles_.end()) {
Tile* tile = *it;
@@ -443,19 +312,6 @@
}
}
-void TileManager::UpdatePrioritizedTileSetIfNeeded() {
- if (!prioritized_tiles_dirty_)
- return;
-
- prioritized_tiles_.Clear();
-
- FreeResourcesForReleasedTiles();
- CleanUpReleasedTiles();
-
- GetTilesWithAssignedBins(&prioritized_tiles_);
- prioritized_tiles_dirty_ = false;
-}
-
void TileManager::DidFinishRunningTasks(TaskSet task_set) {
if (task_set == ALL) {
TRACE_EVENT1("cc", "TileManager::DidFinishRunningTasks", "task_set", "ALL");
@@ -465,7 +321,7 @@
// When OOM, keep re-assigning memory until we reach a steady state
// where top-priority tiles are initialized.
- if (all_tiles_that_need_to_be_rasterized_have_memory_ &&
+ if (all_tiles_that_need_to_be_rasterized_are_scheduled_ &&
!memory_usage_above_limit)
return;
@@ -473,8 +329,7 @@
did_check_for_completed_tasks_since_last_schedule_tasks_ = true;
TileVector tiles_that_need_to_be_rasterized;
- AssignGpuMemoryToTiles(&prioritized_tiles_,
- &tiles_that_need_to_be_rasterized);
+ AssignGpuMemoryToTiles(&tiles_that_need_to_be_rasterized);
// |tiles_that_need_to_be_rasterized| will be empty when we reach a
// steady memory state. Keep scheduling tasks until we reach this state.
@@ -499,9 +354,14 @@
// Use on-demand raster for any required-for-activation tiles that have not
// been been assigned memory after reaching a steady memory state. This
- // ensures that we activate even when OOM.
- for (TileMap::iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- Tile* tile = it->second;
+ // ensures that we activate even when OOM. Note that we have to rebuilt the
+ // queue in case the last AssignGpuMemoryToTiles evicted some tiles that
+ // would otherwise not be picked up by the old raster queue.
+ raster_priority_queue_.Reset();
+ client_->BuildRasterQueue(&raster_priority_queue_,
+ global_state_.tree_priority);
+ while (!raster_priority_queue_.IsEmpty()) {
+ Tile* tile = raster_priority_queue_.Top();
ManagedTileState& mts = tile->managed_state();
if (tile->required_for_activation() && !mts.draw_info.IsReadyToDraw()) {
@@ -512,6 +372,7 @@
mts.draw_info.set_rasterize_on_demand();
client_->NotifyTileStateChanged(tile);
}
+ raster_priority_queue_.Pop();
}
DCHECK(IsReadyToActivate());
@@ -520,139 +381,18 @@
}
if (task_set == REQUIRED_FOR_ACTIVATION) {
- TRACE_EVENT2("cc",
+ TRACE_EVENT1("cc",
"TileManager::DidFinishRunningTasks",
"task_set",
- "REQUIRED_FOR_ACTIVATION",
- "all_tiles_required_for_activation_have_memory",
- all_tiles_required_for_activation_have_memory_);
- // This is only a true indication that all tiles required for
- // activation are initialized when no tiles are OOM. We need to
- // wait for DidFinishRunningTasks() to be called, try to re-assign
- // memory and in worst case use on-demand raster when tiles
- // required for activation are OOM.
- if (!all_tiles_required_for_activation_have_memory_)
- return;
-
+ "REQUIRED_FOR_ACTIVATION");
ready_to_activate_check_notifier_.Schedule();
}
}
-void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) {
- TRACE_EVENT0("cc", "TileManager::GetTilesWithAssignedBins");
-
- const TileMemoryLimitPolicy memory_policy = global_state_.memory_limit_policy;
- const TreePriority tree_priority = global_state_.tree_priority;
-
- // For each tree, bin into different categories of tiles.
- for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- Tile* tile = it->second;
- ManagedTileState& mts = tile->managed_state();
-
- bool tile_is_ready_to_draw = mts.draw_info.IsReadyToDraw();
- bool tile_is_active = tile_is_ready_to_draw || mts.raster_task.get();
-
- // Get the active priority and bin.
- TilePriority active_priority = tile->priority(ACTIVE_TREE);
- ManagedTileBin active_bin = BinFromTilePriority(active_priority);
-
- // Get the pending priority and bin.
- TilePriority pending_priority = tile->priority(PENDING_TREE);
- ManagedTileBin pending_bin = BinFromTilePriority(pending_priority);
-
- bool pending_is_low_res = pending_priority.resolution == LOW_RESOLUTION;
- bool pending_is_non_ideal =
- pending_priority.resolution == NON_IDEAL_RESOLUTION;
- bool active_is_non_ideal =
- active_priority.resolution == NON_IDEAL_RESOLUTION;
-
- // Adjust bin state based on if ready to draw.
- active_bin = kBinReadyToDrawMap[tile_is_ready_to_draw][active_bin];
- pending_bin = kBinReadyToDrawMap[tile_is_ready_to_draw][pending_bin];
-
- // Adjust bin state based on if active.
- active_bin = kBinIsActiveMap[tile_is_active][active_bin];
- pending_bin = kBinIsActiveMap[tile_is_active][pending_bin];
-
- // We never want to paint new non-ideal tiles, as we always have
- // a high-res tile covering that content (paint that instead).
- if (!tile_is_ready_to_draw && active_is_non_ideal)
- active_bin = NEVER_BIN;
- if (!tile_is_ready_to_draw && pending_is_non_ideal)
- pending_bin = NEVER_BIN;
-
- ManagedTileBin tree_bin[NUM_TREES];
- tree_bin[ACTIVE_TREE] = kBinPolicyMap[memory_policy][active_bin];
- tree_bin[PENDING_TREE] = kBinPolicyMap[memory_policy][pending_bin];
-
- // Adjust pending bin state for low res tiles. This prevents pending tree
- // low-res tiles from being initialized before high-res tiles.
- if (pending_is_low_res)
- tree_bin[PENDING_TREE] = std::max(tree_bin[PENDING_TREE], EVENTUALLY_BIN);
-
- TilePriority tile_priority;
- switch (tree_priority) {
- case SAME_PRIORITY_FOR_BOTH_TREES:
- mts.bin = std::min(tree_bin[ACTIVE_TREE], tree_bin[PENDING_TREE]);
- tile_priority = tile->combined_priority();
- break;
- case SMOOTHNESS_TAKES_PRIORITY:
- mts.bin = tree_bin[ACTIVE_TREE];
- tile_priority = active_priority;
- break;
- case NEW_CONTENT_TAKES_PRIORITY:
- mts.bin = tree_bin[PENDING_TREE];
- tile_priority = pending_priority;
- break;
- default:
- NOTREACHED();
- }
-
- // Bump up the priority if we determined it's NEVER_BIN on one tree,
- // but is still required on the other tree.
- bool is_in_never_bin_on_both_trees = tree_bin[ACTIVE_TREE] == NEVER_BIN &&
- tree_bin[PENDING_TREE] == NEVER_BIN;
-
- if (mts.bin == NEVER_BIN && !is_in_never_bin_on_both_trees)
- mts.bin = tile_is_active ? AT_LAST_AND_ACTIVE_BIN : AT_LAST_BIN;
-
- mts.resolution = tile_priority.resolution;
- mts.priority_bin = tile_priority.priority_bin;
- mts.distance_to_visible = tile_priority.distance_to_visible;
- mts.required_for_activation = tile_priority.required_for_activation;
-
- mts.visible_and_ready_to_draw =
- tree_bin[ACTIVE_TREE] == NOW_AND_READY_TO_DRAW_BIN;
-
- // Tiles that are required for activation shouldn't be in NEVER_BIN unless
- // smoothness takes priority or memory policy allows nothing to be
- // initialized.
- DCHECK(!mts.required_for_activation || mts.bin != NEVER_BIN ||
- tree_priority == SMOOTHNESS_TAKES_PRIORITY ||
- memory_policy == ALLOW_NOTHING);
-
- // If the tile is in NEVER_BIN and it does not have an active task, then we
- // can release the resources early. If it does have the task however, we
- // should keep it in the prioritized tile set to ensure that AssignGpuMemory
- // can visit it.
- if (mts.bin == NEVER_BIN && !mts.raster_task.get()) {
- FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile);
- continue;
- }
-
- // Insert the tile into a priority set.
- tiles->InsertTile(tile, mts.bin);
- }
-}
-
void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) {
TRACE_EVENT0("cc", "TileManager::ManageTiles");
- // Update internal state.
- if (state != global_state_) {
- global_state_ = state;
- prioritized_tiles_dirty_ = true;
- }
+ global_state_ = state;
// We need to call CheckForCompletedTasks() once in-between each call
// to ScheduleTasks() to prevent canceled tasks from being scheduled.
@@ -661,11 +401,11 @@
did_check_for_completed_tasks_since_last_schedule_tasks_ = true;
}
- UpdatePrioritizedTileSetIfNeeded();
+ FreeResourcesForReleasedTiles();
+ CleanUpReleasedTiles();
TileVector tiles_that_need_to_be_rasterized;
- AssignGpuMemoryToTiles(&prioritized_tiles_,
- &tiles_that_need_to_be_rasterized);
+ AssignGpuMemoryToTiles(&tiles_that_need_to_be_rasterized);
// Finally, schedule rasterizer tasks.
ScheduleTasks(tiles_that_need_to_be_rasterized);
@@ -718,8 +458,70 @@
state->EndDictionary();
}
+void TileManager::RebuildEvictionQueueIfNeeded() {
+ if (eviction_priority_queue_is_up_to_date_)
+ return;
+
+ eviction_priority_queue_.Reset();
+ client_->BuildEvictionQueue(&eviction_priority_queue_,
+ global_state_.tree_priority);
+ eviction_priority_queue_is_up_to_date_ = true;
+}
+
+bool TileManager::FreeTileResourcesUntilUsageIsWithinLimit(
+ const MemoryUsage& limit,
+ MemoryUsage* usage) {
+ while (usage->Exceeds(limit)) {
+ RebuildEvictionQueueIfNeeded();
+ if (eviction_priority_queue_.IsEmpty())
+ return false;
+
+ Tile* tile = eviction_priority_queue_.Top();
+ *usage -= MemoryUsage::FromTile(tile);
+ FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile);
+ eviction_priority_queue_.Pop();
+ }
+ return true;
+}
+
+bool TileManager::FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit(
+ const MemoryUsage& limit,
+ const TilePriority& other_priority,
+ MemoryUsage* usage) {
+ while (usage->Exceeds(limit)) {
+ RebuildEvictionQueueIfNeeded();
+ if (eviction_priority_queue_.IsEmpty())
+ return false;
+
+ Tile* tile = eviction_priority_queue_.Top();
+ if (!other_priority.IsHigherPriorityThan(tile->combined_priority()))
+ return false;
+
+ *usage -= MemoryUsage::FromTile(tile);
+ FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile);
+ eviction_priority_queue_.Pop();
+ }
+ return true;
+}
+
+bool TileManager::TilePriorityViolatesMemoryPolicy(
+ const TilePriority& priority) {
+ switch (global_state_.memory_limit_policy) {
+ case ALLOW_NOTHING:
+ return true;
+ case ALLOW_ABSOLUTE_MINIMUM:
+ return priority.priority_bin > TilePriority::NOW;
+ case ALLOW_PREPAINT_ONLY:
+ return priority.priority_bin > TilePriority::SOON;
+ case ALLOW_ANYTHING:
+ return priority.distance_to_visible ==
+ std::numeric_limits<float>::infinity();
+ }
+ NOTREACHED();
+ return true;
+}
+
void TileManager::AssignGpuMemoryToTiles(
- PrioritizedTileSet* tiles,
TileVector* tiles_that_need_to_be_rasterized) {
TRACE_EVENT0("cc", "TileManager::AssignGpuMemoryToTiles");
@@ -732,167 +534,100 @@
// Now give memory out to the tiles until we're out, and build
// the needs-to-be-rasterized queue.
- all_tiles_that_need_to_be_rasterized_have_memory_ = true;
- all_tiles_required_for_activation_have_memory_ = true;
-
- // Cast to prevent overflow.
- int64 soft_bytes_available =
- static_cast<int64>(bytes_releasable_) +
- static_cast<int64>(global_state_.soft_memory_limit_in_bytes) -
- static_cast<int64>(resource_pool_->acquired_memory_usage_bytes());
- int64 hard_bytes_available =
- static_cast<int64>(bytes_releasable_) +
- static_cast<int64>(global_state_.hard_memory_limit_in_bytes) -
- static_cast<int64>(resource_pool_->acquired_memory_usage_bytes());
- int resources_available = resources_releasable_ +
- global_state_.num_resources_limit -
- resource_pool_->acquired_resource_count();
- size_t soft_bytes_allocatable =
- std::max(static_cast<int64>(0), soft_bytes_available);
- size_t hard_bytes_allocatable =
- std::max(static_cast<int64>(0), hard_bytes_available);
- size_t resources_allocatable = std::max(0, resources_available);
-
- size_t bytes_that_exceeded_memory_budget = 0;
- size_t soft_bytes_left = soft_bytes_allocatable;
- size_t hard_bytes_left = hard_bytes_allocatable;
-
- size_t resources_left = resources_allocatable;
- bool oomed_soft = false;
- bool oomed_hard = false;
- bool have_hit_soft_memory = false; // Soft memory comes after hard.
-
unsigned schedule_priority = 1u;
- for (PrioritizedTileSet::Iterator it(tiles, true); it; ++it) {
- Tile* tile = *it;
+ all_tiles_that_need_to_be_rasterized_are_scheduled_ = true;
+ bool had_enough_memory_to_schedule_tiles_needed_now = true;
+
+ MemoryUsage hard_memory_limit(global_state_.hard_memory_limit_in_bytes,
+ global_state_.num_resources_limit);
+ MemoryUsage soft_memory_limit(global_state_.soft_memory_limit_in_bytes,
+ global_state_.num_resources_limit);
+ MemoryUsage memory_usage(resource_pool_->acquired_memory_usage_bytes(),
+ resource_pool_->acquired_resource_count());
+
+ eviction_priority_queue_is_up_to_date_ = false;
+ raster_priority_queue_.Reset();
+ client_->BuildRasterQueue(&raster_priority_queue_,
+ global_state_.tree_priority);
+
+ while (!raster_priority_queue_.IsEmpty()) {
+ Tile* tile = raster_priority_queue_.Top();
+ TilePriority priority = tile->combined_priority();
+
+ if (TilePriorityViolatesMemoryPolicy(priority))
+ break;
+
+ // We won't be able to schedule this tile, so break out early.
+ if (tiles_that_need_to_be_rasterized->size() >=
+ kScheduledRasterTasksLimit) {
+ all_tiles_that_need_to_be_rasterized_are_scheduled_ = false;
+ break;
+ }
+
ManagedTileState& mts = tile->managed_state();
mts.scheduled_priority = schedule_priority++;
- // If this tile doesn't need a resource, then nothing to do.
- if (!mts.draw_info.requires_resource())
- continue;
+ DCHECK(mts.draw_info.mode() ==
+ ManagedTileState::DrawInfo::PICTURE_PILE_MODE ||
+ !mts.draw_info.IsReadyToDraw());
- // If the tile is not needed, free it up.
- if (mts.bin == NEVER_BIN) {
- FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile);
- continue;
+ // If the tile already has a raster_task, then the memory used by it is
+ // already accounted for in memory_usage. Otherwise, we'll have to acquire
+ // more memory to create a raster task.
+ MemoryUsage memory_required_by_tile_to_be_scheduled;
+ if (!mts.raster_task.get()) {
+ memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig(
+ tile->size(), resource_pool_->resource_format());
}
- const bool tile_uses_hard_limit = mts.bin <= NOW_BIN;
- const size_t bytes_if_allocated = BytesConsumedIfAllocated(tile);
- const size_t tile_bytes_left =
- (tile_uses_hard_limit) ? hard_bytes_left : soft_bytes_left;
+ bool tile_is_needed_now = priority.priority_bin == TilePriority::NOW;
- // Hard-limit is reserved for tiles that would cause a calamity
- // if they were to go away, so by definition they are the highest
- // priority memory, and must be at the front of the list.
- DCHECK(!(have_hit_soft_memory && tile_uses_hard_limit));
- have_hit_soft_memory |= !tile_uses_hard_limit;
+ // This is the memory limit that will be used by this tile. Depending on
+ // the tile priority, it will be one of hard_memory_limit or
+ // soft_memory_limit.
+ MemoryUsage& tile_memory_limit =
+ tile_is_needed_now ? hard_memory_limit : soft_memory_limit;
- size_t tile_bytes = 0;
- size_t tile_resources = 0;
+ bool memory_usage_is_within_limit =
+ FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit(
+ tile_memory_limit - memory_required_by_tile_to_be_scheduled,
+ priority,
+ &memory_usage);
- // It costs to maintain a resource.
- if (mts.draw_info.resource_) {
- tile_bytes += bytes_if_allocated;
- tile_resources++;
+ // If we couldn't fit the tile into our current memory limit, then we're
+ // done.
+ if (!memory_usage_is_within_limit) {
+ if (tile_is_needed_now)
+ had_enough_memory_to_schedule_tiles_needed_now = false;
+ all_tiles_that_need_to_be_rasterized_are_scheduled_ = false;
+ break;
}
- // Allow lower priority tiles with initialized resources to keep
- // their memory by only assigning memory to new raster tasks if
- // they can be scheduled.
- bool reached_scheduled_raster_tasks_limit =
- tiles_that_need_to_be_rasterized->size() >= kScheduledRasterTasksLimit;
- if (!reached_scheduled_raster_tasks_limit) {
- // If we don't have the required version, and it's not in flight
- // then we'll have to pay to create a new task.
- if (!mts.draw_info.resource_ && !mts.raster_task.get()) {
- tile_bytes += bytes_if_allocated;
- tile_resources++;
- }
- }
-
- // Tile is OOM.
- if (tile_bytes > tile_bytes_left || tile_resources > resources_left) {
- FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile);
-
- // This tile was already on screen and now its resources have been
- // released. In order to prevent checkerboarding, set this tile as
- // rasterize on demand immediately.
- if (mts.visible_and_ready_to_draw)
- mts.draw_info.set_rasterize_on_demand();
-
- oomed_soft = true;
- if (tile_uses_hard_limit) {
- oomed_hard = true;
- bytes_that_exceeded_memory_budget += tile_bytes;
- }
- } else {
- resources_left -= tile_resources;
- hard_bytes_left -= tile_bytes;
- soft_bytes_left =
- (soft_bytes_left > tile_bytes) ? soft_bytes_left - tile_bytes : 0;
- if (mts.draw_info.resource_)
- continue;
- }
-
- DCHECK(!mts.draw_info.resource_);
-
- // Tile shouldn't be rasterized if |tiles_that_need_to_be_rasterized|
- // has reached it's limit or we've failed to assign gpu memory to this
- // or any higher priority tile. Preventing tiles that fit into memory
- // budget to be rasterized when higher priority tile is oom is
- // important for two reasons:
- // 1. Tile size should not impact raster priority.
- // 2. Tiles with existing raster task could otherwise incorrectly
- // be added as they are not affected by |bytes_allocatable|.
- bool can_schedule_tile =
- !oomed_soft && !reached_scheduled_raster_tasks_limit;
-
- if (!can_schedule_tile) {
- all_tiles_that_need_to_be_rasterized_have_memory_ = false;
- if (tile->required_for_activation())
- all_tiles_required_for_activation_have_memory_ = false;
- it.DisablePriorityOrdering();
- continue;
- }
-
+ memory_usage += memory_required_by_tile_to_be_scheduled;
tiles_that_need_to_be_rasterized->push_back(tile);
+ raster_priority_queue_.Pop();
}
- // OOM reporting uses hard-limit, soft-OOM is normal depending on limit.
- ever_exceeded_memory_budget_ |= oomed_hard;
- if (ever_exceeded_memory_budget_) {
- TRACE_COUNTER_ID2("cc",
- "over_memory_budget",
- this,
- "budget",
- global_state_.hard_memory_limit_in_bytes,
- "over",
- bytes_that_exceeded_memory_budget);
- }
- did_oom_on_last_assign_ = oomed_hard;
- UMA_HISTOGRAM_BOOLEAN("TileManager.ExceededMemoryBudget", oomed_hard);
+ // Note that we should try and further reduce memory in case the above loop
+ // didn't reduce memory. This ensures that we always release as many resources
+ // as possible to stay within the memory limit.
+ FreeTileResourcesUntilUsageIsWithinLimit(hard_memory_limit, &memory_usage);
+
+ UMA_HISTOGRAM_BOOLEAN("TileManager.ExceededMemoryBudget",
+ !had_enough_memory_to_schedule_tiles_needed_now);
+ did_oom_on_last_assign_ = !had_enough_memory_to_schedule_tiles_needed_now;
+
memory_stats_from_last_assign_.total_budget_in_bytes =
global_state_.hard_memory_limit_in_bytes;
- memory_stats_from_last_assign_.bytes_allocated =
- hard_bytes_allocatable - hard_bytes_left;
- memory_stats_from_last_assign_.bytes_unreleasable =
- resource_pool_->acquired_memory_usage_bytes() - bytes_releasable_;
- memory_stats_from_last_assign_.bytes_over = bytes_that_exceeded_memory_budget;
+ memory_stats_from_last_assign_.total_bytes_used = memory_usage.memory_bytes();
+ memory_stats_from_last_assign_.had_enough_memory =
+ had_enough_memory_to_schedule_tiles_needed_now;
}
void TileManager::FreeResourcesForTile(Tile* tile) {
ManagedTileState& mts = tile->managed_state();
- if (mts.draw_info.resource_) {
+ if (mts.draw_info.resource_)
resource_pool_->ReleaseResource(mts.draw_info.resource_.Pass());
-
- DCHECK_GE(bytes_releasable_, BytesConsumedIfAllocated(tile));
- DCHECK_GE(resources_releasable_, 1u);
-
- bytes_releasable_ -= BytesConsumedIfAllocated(tile);
- --resources_releasable_;
- }
}
void TileManager::FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(
@@ -1062,9 +797,6 @@
} else {
mts.draw_info.set_use_resource();
mts.draw_info.resource_ = resource.Pass();
-
- bytes_releasable_ += BytesConsumedIfAllocated(tile);
- ++resources_releasable_;
}
if (tile->priority(ACTIVE_TREE).distance_to_visible == 0.f)
@@ -1092,7 +824,6 @@
tiles_[tile->id()] = tile.get();
used_layer_counts_[tile->layer_id()]++;
- prioritized_tiles_dirty_ = true;
return tile;
}
@@ -1124,4 +855,54 @@
client_->NotifyReadyToActivate();
}
+TileManager::MemoryUsage::MemoryUsage() : memory_bytes_(0), resource_count_(0) {
+}
+
+TileManager::MemoryUsage::MemoryUsage(int64 memory_bytes, int resource_count)
+ : memory_bytes_(memory_bytes), resource_count_(resource_count) {
+}
+
+// static
+TileManager::MemoryUsage TileManager::MemoryUsage::FromConfig(
+ const gfx::Size& size,
+ ResourceFormat format) {
+ return MemoryUsage(Resource::MemorySizeBytes(size, format), 1);
+}
+
+// static
+TileManager::MemoryUsage TileManager::MemoryUsage::FromTile(const Tile* tile) {
+ const ManagedTileState& mts = tile->managed_state();
+ if (mts.draw_info.resource_) {
+ return MemoryUsage::FromConfig(tile->size(),
+ mts.draw_info.resource_->format());
+ }
+ return MemoryUsage();
+}
+
+TileManager::MemoryUsage& TileManager::MemoryUsage::operator+=(
+ const MemoryUsage& other) {
+ memory_bytes_ += other.memory_bytes_;
+ resource_count_ += other.resource_count_;
+ return *this;
+}
+
+TileManager::MemoryUsage& TileManager::MemoryUsage::operator-=(
+ const MemoryUsage& other) {
+ memory_bytes_ -= other.memory_bytes_;
+ resource_count_ -= other.resource_count_;
+ return *this;
+}
+
+TileManager::MemoryUsage TileManager::MemoryUsage::operator-(
+ const MemoryUsage& other) {
+ MemoryUsage result = *this;
+ result -= other;
+ return result;
+}
+
+bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const {
+ return memory_bytes_ > limit.memory_bytes_ ||
+ resource_count_ > limit.resource_count_;
+}
+
} // namespace cc
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index d8d219b..94f1033 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -21,7 +21,6 @@
#include "cc/resources/managed_tile_state.h"
#include "cc/resources/memory_history.h"
#include "cc/resources/picture_pile_impl.h"
-#include "cc/resources/prioritized_tile_set.h"
#include "cc/resources/raster_tile_priority_queue.h"
#include "cc/resources/rasterizer.h"
#include "cc/resources/resource_pool.h"
@@ -128,9 +127,6 @@
mts.draw_info.resource_ =
resource_pool_->AcquireResource(tiles[i]->size());
-
- bytes_releasable_ += BytesConsumedIfAllocated(tiles[i]);
- ++resources_releasable_;
}
}
@@ -143,18 +139,12 @@
void SetGlobalStateForTesting(
const GlobalStateThatImpactsTilePriority& state) {
- // Soft limit is used for resource pool such that
- // memory returns to soft limit after going over.
- if (state != global_state_) {
- global_state_ = state;
- prioritized_tiles_dirty_ = true;
- }
+ global_state_ = state;
}
void SetRasterizerForTesting(Rasterizer* rasterizer);
void FreeResourcesAndCleanUpReleasedTilesForTesting() {
- prioritized_tiles_.Clear();
FreeResourcesForReleasedTiles();
CleanUpReleasedTiles();
}
@@ -175,14 +165,11 @@
Rasterizer* rasterizer,
RenderingStatsInstrumentation* rendering_stats_instrumentation);
- // Methods called by Tile
- friend class Tile;
- void DidChangeTilePriority(Tile* tile);
-
void FreeResourcesForReleasedTiles();
void CleanUpReleasedTiles();
// Overriden from RefCountedManager<Tile>:
+ friend class Tile;
virtual void Release(Tile* tile) override;
// Overriden from RasterizerClient:
@@ -196,11 +183,29 @@
virtual void ScheduleTasks(
const TileVector& tiles_that_need_to_be_rasterized);
- void AssignGpuMemoryToTiles(PrioritizedTileSet* tiles,
- TileVector* tiles_that_need_to_be_rasterized);
- void GetTilesWithAssignedBins(PrioritizedTileSet* tiles);
+ void AssignGpuMemoryToTiles(TileVector* tiles_that_need_to_be_rasterized);
private:
+ class MemoryUsage {
+ public:
+ MemoryUsage();
+ MemoryUsage(int64 memory_bytes, int resource_count);
+
+ static MemoryUsage FromConfig(const gfx::Size& size, ResourceFormat format);
+ static MemoryUsage FromTile(const Tile* tile);
+
+ MemoryUsage& operator+=(const MemoryUsage& other);
+ MemoryUsage& operator-=(const MemoryUsage& other);
+ MemoryUsage operator-(const MemoryUsage& other);
+
+ bool Exceeds(const MemoryUsage& limit) const;
+ int64 memory_bytes() const { return memory_bytes_; }
+
+ private:
+ int64 memory_bytes_;
+ int resource_count_;
+ };
+
void OnImageDecodeTaskCompleted(int layer_id,
SkPixelRef* pixel_ref,
bool was_canceled);
@@ -209,18 +214,20 @@
const PicturePileImpl::Analysis& analysis,
bool was_canceled);
- inline size_t BytesConsumedIfAllocated(const Tile* tile) const {
- return Resource::MemorySizeBytes(tile->size(),
- resource_pool_->resource_format());
- }
-
void FreeResourcesForTile(Tile* tile);
void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile);
scoped_refptr<ImageDecodeTask> CreateImageDecodeTask(Tile* tile,
SkPixelRef* pixel_ref);
scoped_refptr<RasterTask> CreateRasterTask(Tile* tile);
- void UpdatePrioritizedTileSetIfNeeded();
+ void RebuildEvictionQueueIfNeeded();
+ bool FreeTileResourcesUntilUsageIsWithinLimit(const MemoryUsage& limit,
+ MemoryUsage* usage);
+ bool FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit(
+ const MemoryUsage& limit,
+ const TilePriority& oother_priority,
+ MemoryUsage* usage);
+ bool TilePriorityViolatesMemoryPolicy(const TilePriority& priority);
bool IsReadyToActivate() const;
void CheckIfReadyToActivate();
@@ -233,16 +240,7 @@
typedef base::hash_map<Tile::Id, Tile*> TileMap;
TileMap tiles_;
- PrioritizedTileSet prioritized_tiles_;
- bool prioritized_tiles_dirty_;
-
- bool all_tiles_that_need_to_be_rasterized_have_memory_;
- bool all_tiles_required_for_activation_have_memory_;
-
- size_t bytes_releasable_;
- size_t resources_releasable_;
-
- bool ever_exceeded_memory_budget_;
+ bool all_tiles_that_need_to_be_rasterized_are_scheduled_;
MemoryHistory::Entry memory_stats_from_last_assign_;
RenderingStatsInstrumentation* rendering_stats_instrumentation_;
@@ -272,6 +270,10 @@
UniqueNotifier ready_to_activate_check_notifier_;
+ RasterTilePriorityQueue raster_priority_queue_;
+ EvictionTilePriorityQueue eviction_priority_queue_;
+ bool eviction_priority_queue_is_up_to_date_;
+
DISALLOW_COPY_AND_ASSIGN(TileManager);
};
diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc
index b0d57e6..46f2e14 100644
--- a/cc/resources/tile_manager_unittest.cc
+++ b/cc/resources/tile_manager_unittest.cc
@@ -22,465 +22,6 @@
namespace cc {
namespace {
-class TileManagerTest : public testing::TestWithParam<bool>,
- public TileManagerClient {
- public:
- typedef std::vector<scoped_refptr<Tile> > TileVector;
-
- TileManagerTest()
- : memory_limit_policy_(ALLOW_ANYTHING),
- max_tiles_(0),
- ready_to_activate_(false) {}
-
- void Initialize(int max_tiles,
- TileMemoryLimitPolicy memory_limit_policy,
- TreePriority tree_priority) {
- output_surface_ = FakeOutputSurface::Create3d();
- CHECK(output_surface_->BindToClient(&output_surface_client_));
-
- shared_bitmap_manager_.reset(new TestSharedBitmapManager());
- resource_provider_ = ResourceProvider::Create(output_surface_.get(),
- shared_bitmap_manager_.get(),
- NULL,
- 0,
- false,
- 1,
- false);
- resource_pool_ = ResourcePool::Create(
- resource_provider_.get(), GL_TEXTURE_2D, RGBA_8888);
- tile_manager_ =
- make_scoped_ptr(new FakeTileManager(this, resource_pool_.get()));
-
- memory_limit_policy_ = memory_limit_policy;
- max_tiles_ = max_tiles;
- picture_pile_ = FakePicturePileImpl::CreateInfiniteFilledPile();
-
- SetTreePriority(tree_priority);
- }
-
- void SetTreePriority(TreePriority tree_priority) {
- GlobalStateThatImpactsTilePriority state;
- gfx::Size tile_size = settings_.default_tile_size;
-
- if (UsingMemoryLimit()) {
- state.soft_memory_limit_in_bytes =
- max_tiles_ * 4 * tile_size.width() * tile_size.height();
- state.num_resources_limit = 100;
- } else {
- state.soft_memory_limit_in_bytes = 100 * 1000 * 1000;
- state.num_resources_limit = max_tiles_;
- }
- state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2;
- state.memory_limit_policy = memory_limit_policy_;
- state.tree_priority = tree_priority;
-
- global_state_ = state;
- resource_pool_->SetResourceUsageLimits(state.soft_memory_limit_in_bytes,
- state.soft_memory_limit_in_bytes,
- state.num_resources_limit);
- tile_manager_->SetGlobalStateForTesting(state);
- }
-
- virtual void TearDown() override {
- tile_manager_.reset(NULL);
- picture_pile_ = NULL;
-
- testing::Test::TearDown();
- }
-
- // TileManagerClient implementation.
- virtual const std::vector<PictureLayerImpl*>& GetPictureLayers()
- const override {
- return picture_layers_;
- }
- virtual void NotifyReadyToActivate() override { ready_to_activate_ = true; }
- virtual void NotifyTileStateChanged(const Tile* tile) override {}
- virtual void BuildRasterQueue(RasterTilePriorityQueue* queue,
- TreePriority priority) override {}
- virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue,
- TreePriority priority) override {}
-
- TileVector CreateTilesWithSize(int count,
- TilePriority active_priority,
- TilePriority pending_priority,
- const gfx::Size& tile_size) {
- TileVector tiles;
- for (int i = 0; i < count; ++i) {
- scoped_refptr<Tile> tile = tile_manager_->CreateTile(picture_pile_.get(),
- tile_size,
- gfx::Rect(),
- 1.0,
- 0,
- 0,
- 0);
- tile->SetPriority(ACTIVE_TREE, active_priority);
- tile->SetPriority(PENDING_TREE, pending_priority);
- tiles.push_back(tile);
- }
- return tiles;
- }
-
- TileVector CreateTiles(int count,
- TilePriority active_priority,
- TilePriority pending_priority) {
- return CreateTilesWithSize(
- count, active_priority, pending_priority, settings_.default_tile_size);
- }
-
- void ReleaseTiles(TileVector* tiles) {
- for (TileVector::iterator it = tiles->begin(); it != tiles->end(); it++) {
- Tile* tile = it->get();
- tile->SetPriority(ACTIVE_TREE, TilePriority());
- tile->SetPriority(PENDING_TREE, TilePriority());
- }
- }
-
- FakeTileManager* tile_manager() { return tile_manager_.get(); }
-
- int AssignedMemoryCount(const TileVector& tiles) {
- int has_memory_count = 0;
- for (TileVector::const_iterator it = tiles.begin(); it != tiles.end();
- ++it) {
- if (tile_manager_->HasBeenAssignedMemory(it->get()))
- ++has_memory_count;
- }
- return has_memory_count;
- }
-
- bool ready_to_activate() const { return ready_to_activate_; }
-
- // The parametrization specifies whether the max tile limit should
- // be applied to memory or resources.
- bool UsingResourceLimit() { return !GetParam(); }
- bool UsingMemoryLimit() { return GetParam(); }
-
- protected:
- GlobalStateThatImpactsTilePriority global_state_;
-
- private:
- LayerTreeSettings settings_;
- scoped_ptr<FakeTileManager> tile_manager_;
- scoped_refptr<FakePicturePileImpl> picture_pile_;
- FakeOutputSurfaceClient output_surface_client_;
- scoped_ptr<FakeOutputSurface> output_surface_;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
- scoped_ptr<ResourceProvider> resource_provider_;
- scoped_ptr<ResourcePool> resource_pool_;
- TileMemoryLimitPolicy memory_limit_policy_;
- int max_tiles_;
- bool ready_to_activate_;
- std::vector<PictureLayerImpl*> picture_layers_;
-};
-
-TEST_P(TileManagerTest, EnoughMemoryAllowAnything) {
- // A few tiles of each type of priority, with enough memory for all tiles.
-
- Initialize(10, ALLOW_ANYTHING, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_now =
- CreateTiles(3, TilePriorityForNowBin(), TilePriority());
- TileVector pending_now =
- CreateTiles(3, TilePriority(), TilePriorityForNowBin());
- TileVector active_pending_soon =
- CreateTiles(3, TilePriorityForSoonBin(), TilePriorityForSoonBin());
- TileVector never_bin = CreateTiles(1, TilePriority(), TilePriority());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(3, AssignedMemoryCount(active_now));
- EXPECT_EQ(3, AssignedMemoryCount(pending_now));
- EXPECT_EQ(3, AssignedMemoryCount(active_pending_soon));
- EXPECT_EQ(0, AssignedMemoryCount(never_bin));
-
- ReleaseTiles(&active_now);
- ReleaseTiles(&pending_now);
- ReleaseTiles(&active_pending_soon);
- ReleaseTiles(&never_bin);
-}
-
-TEST_P(TileManagerTest, EnoughMemoryAllowPrepaintOnly) {
- // A few tiles of each type of priority, with enough memory for all tiles,
- // with the exception of never bin.
-
- Initialize(10, ALLOW_PREPAINT_ONLY, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_now =
- CreateTiles(3, TilePriorityForNowBin(), TilePriority());
- TileVector pending_now =
- CreateTiles(3, TilePriority(), TilePriorityForNowBin());
- TileVector active_pending_soon =
- CreateTiles(3, TilePriorityForSoonBin(), TilePriorityForSoonBin());
- TileVector never_bin = CreateTiles(1, TilePriority(), TilePriority());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(3, AssignedMemoryCount(active_now));
- EXPECT_EQ(3, AssignedMemoryCount(pending_now));
- EXPECT_EQ(3, AssignedMemoryCount(active_pending_soon));
- EXPECT_EQ(0, AssignedMemoryCount(never_bin));
-
- ReleaseTiles(&active_now);
- ReleaseTiles(&pending_now);
- ReleaseTiles(&active_pending_soon);
- ReleaseTiles(&never_bin);
-}
-
-TEST_P(TileManagerTest, EnoughMemoryPendingLowResAllowAbsoluteMinimum) {
- // A few low-res tiles required for activation, with enough memory for all
- // tiles.
-
- Initialize(5, ALLOW_ABSOLUTE_MINIMUM, SAME_PRIORITY_FOR_BOTH_TREES);
- TileVector pending_low_res =
- CreateTiles(5, TilePriority(), TilePriorityLowRes());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(5, AssignedMemoryCount(pending_low_res));
- ReleaseTiles(&pending_low_res);
-}
-
-TEST_P(TileManagerTest, EnoughMemoryAllowAbsoluteMinimum) {
- // A few tiles of each type of priority, with enough memory for all tiles,
- // with the exception of never and soon bins.
-
- Initialize(10, ALLOW_ABSOLUTE_MINIMUM, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_now =
- CreateTiles(3, TilePriorityForNowBin(), TilePriority());
- TileVector pending_now =
- CreateTiles(3, TilePriority(), TilePriorityForNowBin());
- TileVector active_pending_soon =
- CreateTiles(3, TilePriorityForSoonBin(), TilePriorityForSoonBin());
- TileVector never_bin = CreateTiles(1, TilePriority(), TilePriority());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(3, AssignedMemoryCount(active_now));
- EXPECT_EQ(3, AssignedMemoryCount(pending_now));
- EXPECT_EQ(0, AssignedMemoryCount(active_pending_soon));
- EXPECT_EQ(0, AssignedMemoryCount(never_bin));
-
- ReleaseTiles(&active_now);
- ReleaseTiles(&pending_now);
- ReleaseTiles(&active_pending_soon);
- ReleaseTiles(&never_bin);
-}
-
-TEST_P(TileManagerTest, EnoughMemoryAllowNothing) {
- // A few tiles of each type of priority, with enough memory for all tiles,
- // but allow nothing should not assign any memory.
-
- Initialize(10, ALLOW_NOTHING, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_now =
- CreateTiles(3, TilePriorityForNowBin(), TilePriority());
- TileVector pending_now =
- CreateTiles(3, TilePriority(), TilePriorityForNowBin());
- TileVector active_pending_soon =
- CreateTiles(3, TilePriorityForSoonBin(), TilePriorityForSoonBin());
- TileVector never_bin = CreateTiles(1, TilePriority(), TilePriority());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(0, AssignedMemoryCount(active_now));
- EXPECT_EQ(0, AssignedMemoryCount(pending_now));
- EXPECT_EQ(0, AssignedMemoryCount(active_pending_soon));
- EXPECT_EQ(0, AssignedMemoryCount(never_bin));
-
- ReleaseTiles(&active_now);
- ReleaseTiles(&pending_now);
- ReleaseTiles(&active_pending_soon);
- ReleaseTiles(&never_bin);
-}
-
-TEST_P(TileManagerTest, PartialOOMMemoryToPending) {
- // 5 tiles on active tree eventually bin, 5 tiles on pending tree that are
- // required for activation, but only enough memory for 8 tiles. The result
- // is all pending tree tiles get memory, and 3 of the active tree tiles
- // get memory. None of these tiles is needed to avoid calimity (flickering or
- // raster-on-demand) so the soft memory limit is used.
-
- Initialize(8, ALLOW_ANYTHING, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_tree_tiles =
- CreateTiles(5, TilePriorityForEventualBin(), TilePriority());
- TileVector pending_tree_tiles =
- CreateTiles(5, TilePriority(), TilePriorityRequiredForActivation());
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(5, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(3, AssignedMemoryCount(pending_tree_tiles));
-
- SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(3, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(5, AssignedMemoryCount(pending_tree_tiles));
-
- ReleaseTiles(&active_tree_tiles);
- ReleaseTiles(&pending_tree_tiles);
-}
-
-TEST_P(TileManagerTest, PartialOOMMemoryToActive) {
- // 5 tiles on active tree eventually bin, 5 tiles on pending tree now bin,
- // but only enough memory for 8 tiles. The result is all active tree tiles
- // get memory, and 3 of the pending tree tiles get memory.
- // The pending tiles are not needed to avoid calimity (flickering or
- // raster-on-demand) and the active tiles fit, so the soft limit is used.
-
- Initialize(8, ALLOW_ANYTHING, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_tree_tiles =
- CreateTiles(5, TilePriorityForNowBin(), TilePriority());
- TileVector pending_tree_tiles =
- CreateTiles(5, TilePriority(), TilePriorityForNowBin());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(5, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(3, AssignedMemoryCount(pending_tree_tiles));
-
- ReleaseTiles(&active_tree_tiles);
- ReleaseTiles(&pending_tree_tiles);
-}
-
-TEST_P(TileManagerTest, TotalOOMMemoryToPending) {
- // 10 tiles on active tree eventually bin, 10 tiles on pending tree that are
- // required for activation, but only enough tiles for 4 tiles. The result
- // is 4 pending tree tiles get memory, and none of the active tree tiles
- // get memory.
-
- Initialize(4, ALLOW_ANYTHING, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_tree_tiles =
- CreateTiles(10, TilePriorityForEventualBin(), TilePriority());
- TileVector pending_tree_tiles =
- CreateTiles(10, TilePriority(), TilePriorityRequiredForActivation());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(4, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(0, AssignedMemoryCount(pending_tree_tiles));
-
- SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- if (UsingResourceLimit()) {
- EXPECT_EQ(0, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(4, AssignedMemoryCount(pending_tree_tiles));
- } else {
- // Pending tiles are now required to avoid calimity (flickering or
- // raster-on-demand). Hard-limit is used and double the tiles fit.
- EXPECT_EQ(0, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(8, AssignedMemoryCount(pending_tree_tiles));
- }
-
- ReleaseTiles(&active_tree_tiles);
- ReleaseTiles(&pending_tree_tiles);
-}
-
-TEST_P(TileManagerTest, TotalOOMActiveSoonMemoryToPending) {
- // 10 tiles on active tree soon bin, 10 tiles on pending tree that are
- // required for activation, but only enough tiles for 4 tiles. The result
- // is 4 pending tree tiles get memory, and none of the active tree tiles
- // get memory.
-
- Initialize(4, ALLOW_ANYTHING, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_tree_tiles =
- CreateTiles(10, TilePriorityForSoonBin(), TilePriority());
- TileVector pending_tree_tiles =
- CreateTiles(10, TilePriority(), TilePriorityRequiredForActivation());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- EXPECT_EQ(4, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(0, AssignedMemoryCount(pending_tree_tiles));
-
- SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- if (UsingResourceLimit()) {
- EXPECT_EQ(0, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(4, AssignedMemoryCount(pending_tree_tiles));
- } else {
- // Pending tiles are now required to avoid calimity (flickering or
- // raster-on-demand). Hard-limit is used and double the tiles fit.
- EXPECT_EQ(0, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(8, AssignedMemoryCount(pending_tree_tiles));
- }
-
- ReleaseTiles(&active_tree_tiles);
- ReleaseTiles(&pending_tree_tiles);
-}
-
-TEST_P(TileManagerTest, TotalOOMMemoryToActive) {
- // 10 tiles on active tree eventually bin, 10 tiles on pending tree now bin,
- // but only enough memory for 4 tiles. The result is 4 active tree tiles
- // get memory, and none of the pending tree tiles get memory.
-
- Initialize(4, ALLOW_ANYTHING, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_tree_tiles =
- CreateTiles(10, TilePriorityForNowBin(), TilePriority());
- TileVector pending_tree_tiles =
- CreateTiles(10, TilePriority(), TilePriorityForNowBin());
-
- tile_manager()->AssignMemoryToTiles(global_state_);
-
- if (UsingResourceLimit()) {
- EXPECT_EQ(4, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(0, AssignedMemoryCount(pending_tree_tiles));
- } else {
- // Active tiles are required to avoid calimity (flickering or
- // raster-on-demand). Hard-limit is used and double the tiles fit.
- EXPECT_EQ(8, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(0, AssignedMemoryCount(pending_tree_tiles));
- }
-
- ReleaseTiles(&active_tree_tiles);
- ReleaseTiles(&pending_tree_tiles);
-}
-
-TEST_P(TileManagerTest, TotalOOMMemoryToNewContent) {
- // 10 tiles on active tree now bin, 10 tiles on pending tree now bin,
- // but only enough memory for 8 tiles. Any tile missing would cause
- // a calamity (flickering or raster-on-demand). Depending on mode,
- // we should use varying amounts of the higher hard memory limit.
- if (UsingResourceLimit())
- return;
-
- Initialize(8, ALLOW_ANYTHING, SMOOTHNESS_TAKES_PRIORITY);
- TileVector active_tree_tiles =
- CreateTiles(10, TilePriorityForNowBin(), TilePriority());
- TileVector pending_tree_tiles =
- CreateTiles(10, TilePriority(), TilePriorityForNowBin());
-
- // Active tiles are required to avoid calimity. The hard-limit is used and all
- // active-tiles fit. No pending tiles are needed to avoid calamity so only 10
- // tiles total are used.
- tile_manager()->AssignMemoryToTiles(global_state_);
- EXPECT_EQ(10, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(0, AssignedMemoryCount(pending_tree_tiles));
-
- // Even the hard-limit won't save us now. All tiles are required to avoid
- // a clamity but we only have 16. The tiles will be distribted randomly
- // given they are identical, in practice depending on their screen location.
- SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
- tile_manager()->AssignMemoryToTiles(global_state_);
- EXPECT_EQ(16,
- AssignedMemoryCount(active_tree_tiles) +
- AssignedMemoryCount(pending_tree_tiles));
-
- // The pending tree is now more important. Active tiles will take higher
- // priority if they are ready-to-draw in practice. Importantly though,
- // pending tiles also utilize the hard-limit.
- SetTreePriority(NEW_CONTENT_TAKES_PRIORITY);
- tile_manager()->AssignMemoryToTiles(global_state_);
- EXPECT_EQ(0, AssignedMemoryCount(active_tree_tiles));
- EXPECT_EQ(10, AssignedMemoryCount(pending_tree_tiles));
-
- ReleaseTiles(&active_tree_tiles);
- ReleaseTiles(&pending_tree_tiles);
-}
-
-// If true, the max tile limit should be applied as bytes; if false,
-// as num_resources_limit.
-INSTANTIATE_TEST_CASE_P(TileManagerTests,
- TileManagerTest,
- ::testing::Values(true, false));
-
class LowResTilingsSettings : public ImplSidePaintingSettings {
public:
LowResTilingsSettings() { create_low_res_tiling = true; }
@@ -646,13 +187,13 @@
// Renew all of the tile priorities.
gfx::Rect viewport(50, 50, 100, 100);
- pending_layer_->HighResTiling()->UpdateTilePriorities(
+ pending_layer_->HighResTiling()->ComputeTilePriorityRects(
PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
- pending_layer_->LowResTiling()->UpdateTilePriorities(
+ pending_layer_->LowResTiling()->ComputeTilePriorityRects(
PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
- active_layer_->HighResTiling()->UpdateTilePriorities(
+ active_layer_->HighResTiling()->ComputeTilePriorityRects(
ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
- active_layer_->LowResTiling()->UpdateTilePriorities(
+ active_layer_->LowResTiling()->ComputeTilePriorityRects(
ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
// Populate all tiles directly from the tilings.
@@ -680,7 +221,7 @@
Tile* last_tile = NULL;
smoothness_tiles.clear();
tile_count = 0;
- size_t increasing_distance_tiles = 0u;
+ size_t correct_order_tiles = 0u;
// Here we expect to get increasing ACTIVE_TREE priority_bin.
queue.Reset();
host_impl_.BuildRasterQueue(&queue, SMOOTHNESS_TAKES_PRIORITY);
@@ -693,11 +234,19 @@
EXPECT_LE(last_tile->priority(ACTIVE_TREE).priority_bin,
tile->priority(ACTIVE_TREE).priority_bin);
+ bool skip_updating_last_tile = false;
if (last_tile->priority(ACTIVE_TREE).priority_bin ==
tile->priority(ACTIVE_TREE).priority_bin) {
- increasing_distance_tiles +=
+ correct_order_tiles +=
last_tile->priority(ACTIVE_TREE).distance_to_visible <=
tile->priority(ACTIVE_TREE).distance_to_visible;
+ } else if (tile->priority(ACTIVE_TREE).priority_bin ==
+ TilePriority::EVENTUALLY &&
+ tile->priority(PENDING_TREE).priority_bin == TilePriority::NOW) {
+ // Since we'd return pending tree now tiles before the eventually tiles on
+ // the active tree, update the value.
+ ++correct_order_tiles;
+ skip_updating_last_tile = true;
}
if (tile->priority(ACTIVE_TREE).priority_bin == TilePriority::NOW &&
@@ -707,7 +256,8 @@
EXPECT_EQ(LOW_RESOLUTION, last_tile->priority(ACTIVE_TREE).resolution);
}
- last_tile = tile;
+ if (!skip_updating_last_tile)
+ last_tile = tile;
++tile_count;
smoothness_tiles.insert(tile);
queue.Pop();
@@ -717,11 +267,11 @@
EXPECT_EQ(all_tiles, smoothness_tiles);
// Since we don't guarantee increasing distance due to spiral iterator, we
// should check that we're _mostly_ right.
- EXPECT_GT(increasing_distance_tiles, 3 * tile_count / 4);
+ EXPECT_GT(correct_order_tiles, 3 * tile_count / 4);
std::set<Tile*> new_content_tiles;
last_tile = NULL;
- increasing_distance_tiles = 0u;
+ size_t increasing_distance_tiles = 0u;
// Here we expect to get increasing PENDING_TREE priority_bin.
queue.Reset();
host_impl_.BuildRasterQueue(&queue, NEW_CONTENT_TAKES_PRIORITY);
@@ -821,13 +371,13 @@
// Renew all of the tile priorities.
gfx::Rect viewport(50, 50, 100, 100);
- pending_layer_->HighResTiling()->UpdateTilePriorities(
+ pending_layer_->HighResTiling()->ComputeTilePriorityRects(
PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
- pending_layer_->LowResTiling()->UpdateTilePriorities(
+ pending_layer_->LowResTiling()->ComputeTilePriorityRects(
PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
- active_layer_->HighResTiling()->UpdateTilePriorities(
+ active_layer_->HighResTiling()->ComputeTilePriorityRects(
ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
- active_layer_->LowResTiling()->UpdateTilePriorities(
+ active_layer_->LowResTiling()->ComputeTilePriorityRects(
ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion());
// Populate all tiles directly from the tilings.
@@ -855,8 +405,6 @@
tile_manager()->InitializeTilesWithResourcesForTesting(
std::vector<Tile*>(all_tiles.begin(), all_tiles.end()));
- pending_layer_->MarkVisibleResourcesAsRequired();
-
Tile* last_tile = NULL;
smoothness_tiles.clear();
tile_count = 0;
@@ -965,41 +513,38 @@
// Renew all of the tile priorities.
gfx::Rect viewport(layer_bounds);
- pending_layer_->HighResTiling()->UpdateTilePriorities(
+ pending_layer_->HighResTiling()->ComputeTilePriorityRects(
PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
- pending_layer_->LowResTiling()->UpdateTilePriorities(
+ pending_layer_->LowResTiling()->ComputeTilePriorityRects(
PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
- pending_child_layer->HighResTiling()->UpdateTilePriorities(
+ pending_child_layer->HighResTiling()->ComputeTilePriorityRects(
PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
- pending_child_layer->LowResTiling()->UpdateTilePriorities(
+ pending_child_layer->LowResTiling()->ComputeTilePriorityRects(
PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
// Populate all tiles directly from the tilings.
all_tiles.clear();
std::vector<Tile*> pending_high_res_tiles =
pending_layer_->HighResTiling()->AllTilesForTesting();
- for (size_t i = 0; i < pending_high_res_tiles.size(); ++i)
- all_tiles.insert(pending_high_res_tiles[i]);
+ all_tiles.insert(pending_high_res_tiles.begin(),
+ pending_high_res_tiles.end());
std::vector<Tile*> pending_low_res_tiles =
pending_layer_->LowResTiling()->AllTilesForTesting();
- for (size_t i = 0; i < pending_low_res_tiles.size(); ++i)
- all_tiles.insert(pending_low_res_tiles[i]);
+ all_tiles.insert(pending_low_res_tiles.begin(), pending_low_res_tiles.end());
// Set all tiles on the pending_child_layer as occluded on the pending tree.
std::vector<Tile*> pending_child_high_res_tiles =
pending_child_layer->HighResTiling()->AllTilesForTesting();
- for (size_t i = 0; i < pending_child_high_res_tiles.size(); ++i) {
- pending_child_high_res_tiles[i]->set_is_occluded(PENDING_TREE, true);
- all_tiles.insert(pending_child_high_res_tiles[i]);
- }
+ pending_child_layer->HighResTiling()->SetAllTilesOccludedForTesting();
+ all_tiles.insert(pending_child_high_res_tiles.begin(),
+ pending_child_high_res_tiles.end());
std::vector<Tile*> pending_child_low_res_tiles =
pending_child_layer->LowResTiling()->AllTilesForTesting();
- for (size_t i = 0; i < pending_child_low_res_tiles.size(); ++i) {
- pending_child_low_res_tiles[i]->set_is_occluded(PENDING_TREE, true);
- all_tiles.insert(pending_child_low_res_tiles[i]);
- }
+ pending_child_layer->LowResTiling()->SetAllTilesOccludedForTesting();
+ all_tiles.insert(pending_child_low_res_tiles.begin(),
+ pending_child_low_res_tiles.end());
tile_manager()->InitializeTilesWithResourcesForTesting(
std::vector<Tile*>(all_tiles.begin(), all_tiles.end()));
diff --git a/cc/resources/tile_priority.h b/cc/resources/tile_priority.h
index 7831eab..433abad 100644
--- a/cc/resources/tile_priority.h
+++ b/cc/resources/tile_priority.h
@@ -44,7 +44,6 @@
TilePriority()
: resolution(NON_IDEAL_RESOLUTION),
- required_for_activation(false),
priority_bin(EVENTUALLY),
distance_to_visible(std::numeric_limits<float>::infinity()) {}
@@ -52,7 +51,6 @@
PriorityBin bin,
float distance_to_visible)
: resolution(resolution),
- required_for_activation(false),
priority_bin(bin),
distance_to_visible(distance_to_visible) {}
@@ -66,9 +64,6 @@
else
resolution = NON_IDEAL_RESOLUTION;
- required_for_activation =
- active.required_for_activation || pending.required_for_activation;
-
if (active.priority_bin < pending.priority_bin) {
priority_bin = active.priority_bin;
distance_to_visible = active.distance_to_visible;
@@ -87,8 +82,7 @@
bool operator ==(const TilePriority& other) const {
return resolution == other.resolution &&
priority_bin == other.priority_bin &&
- distance_to_visible == other.distance_to_visible &&
- required_for_activation == other.required_for_activation;
+ distance_to_visible == other.distance_to_visible;
}
bool operator !=(const TilePriority& other) const {
@@ -102,7 +96,6 @@
}
TileResolution resolution;
- bool required_for_activation;
PriorityBin priority_bin;
float distance_to_visible;
};
@@ -120,11 +113,7 @@
ALLOW_PREPAINT_ONLY = 2, // Grande.
// You're the only thing in town. Go crazy.
- ALLOW_ANYTHING = 3, // Venti.
- NUM_TILE_MEMORY_LIMIT_POLICIES = 4,
-
- // NOTE: Be sure to update TreePriorityAsValue and kBinPolicyMap when adding
- // or reordering fields.
+ ALLOW_ANYTHING = 3 // Venti.
};
std::string TileMemoryLimitPolicyToString(TileMemoryLimitPolicy policy);
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc
index c40d4a2..bb6238c 100644
--- a/cc/resources/video_resource_updater_unittest.cc
+++ b/cc/resources/video_resource_updater_unittest.cc
@@ -32,6 +32,7 @@
ResourceProvider::Create(output_surface3d_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
diff --git a/cc/resources/zero_copy_raster_worker_pool.cc b/cc/resources/zero_copy_raster_worker_pool.cc
index 0d9c21a..c9533f8 100644
--- a/cc/resources/zero_copy_raster_worker_pool.cc
+++ b/cc/resources/zero_copy_raster_worker_pool.cc
@@ -12,7 +12,7 @@
#include "cc/debug/traced_value.h"
#include "cc/resources/raster_buffer.h"
#include "cc/resources/resource.h"
-#include "third_party/skia/include/utils/SkNullCanvas.h"
+#include "ui/gfx/gpu_memory_buffer.h"
namespace cc {
namespace {
@@ -21,36 +21,31 @@
public:
RasterBufferImpl(ResourceProvider* resource_provider,
const Resource* resource)
- : lock_(resource_provider, resource->id()),
- resource_(resource),
- buffer_(NULL) {}
+ : lock_(resource_provider, resource->id()), resource_(resource) {}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
- buffer_ = lock_.gpu_memory_buffer();
- if (!buffer_)
- return skia::AdoptRef(SkCreateNullCanvas());
-
- RasterWorkerPool::AcquireBitmapForBuffer(&bitmap_,
- buffer_,
- resource_->format(),
- resource_->size(),
- lock_.stride());
- return skia::AdoptRef(new SkCanvas(bitmap_));
- }
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {
- if (!buffer_)
+ virtual void Playback(const PicturePileImpl* picture_pile,
+ const gfx::Rect& rect,
+ float scale,
+ RenderingStatsInstrumentation* stats) override {
+ gfx::GpuMemoryBuffer* gpu_memory_buffer = lock_.gpu_memory_buffer();
+ if (!gpu_memory_buffer)
return;
- RasterWorkerPool::ReleaseBitmapForBuffer(
- &bitmap_, buffer_, resource_->format());
+ RasterWorkerPool::PlaybackToMemory(gpu_memory_buffer->Map(),
+ resource_->format(),
+ resource_->size(),
+ gpu_memory_buffer->GetStride(),
+ picture_pile,
+ rect,
+ scale,
+ stats);
+ gpu_memory_buffer->Unmap();
}
private:
ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock_;
const Resource* resource_;
- void* buffer_;
- SkBitmap bitmap_;
DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
};
diff --git a/cc/scheduler/begin_frame_source.cc b/cc/scheduler/begin_frame_source.cc
index a5d859f..4a9f184 100644
--- a/cc/scheduler/begin_frame_source.cc
+++ b/cc/scheduler/begin_frame_source.cc
@@ -458,14 +458,15 @@
dict->SetString("active_source", "NULL");
}
+ dict->BeginArray("sources");
for (std::set<BeginFrameSource*>::const_iterator it = source_list_.begin();
it != source_list_.end();
++it) {
- dict->BeginDictionary(
- base::SizeTToString(std::distance(source_list_.begin(), it)).c_str());
+ dict->BeginDictionary();
(*it)->AsValueInto(dict);
dict->EndDictionary();
}
+ dict->EndArray();
}
// protected methods
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index 44d7d77..5b15a5a 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -682,9 +682,16 @@
state_machine_.AsValueInto(state, Now());
state->EndDictionary();
- state->BeginDictionary("frame_source_");
- frame_source_->AsValueInto(state);
- state->EndDictionary();
+ // Only trace frame sources when explicitly enabled - http://crbug.com/420607
+ bool frame_tracing_enabled = false;
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED(
+ TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"),
+ &frame_tracing_enabled);
+ if (frame_tracing_enabled) {
+ state->BeginDictionary("frame_source_");
+ frame_source_->AsValueInto(state);
+ state->EndDictionary();
+ }
state->BeginDictionary("scheduler_state");
state->SetDouble("time_until_anticipated_draw_time_ms",
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 74a4f06..a6904ae 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -43,7 +43,6 @@
has_pending_tree_(false),
pending_tree_is_ready_for_activation_(false),
active_tree_needs_first_draw_(false),
- did_commit_after_animating_(false),
did_create_and_initialize_first_output_surface_(false),
impl_latency_takes_priority_(false),
skip_next_begin_main_frame_to_reduce_latency_(false),
@@ -226,7 +225,6 @@
pending_tree_is_ready_for_activation_);
state->SetBoolean("active_tree_needs_first_draw",
active_tree_needs_first_draw_);
- state->SetBoolean("did_commit_after_animating", did_commit_after_animating_);
state->SetBoolean("did_create_and_initialize_first_output_surface",
did_create_and_initialize_first_output_surface_);
state->SetBoolean("impl_latency_takes_priority",
@@ -253,10 +251,6 @@
skip_next_begin_main_frame_to_reduce_latency_ = false;
}
-bool SchedulerStateMachine::HasAnimatedThisFrame() const {
- return last_frame_number_animate_performed_ == current_frame_number_;
-}
-
bool SchedulerStateMachine::HasSentBeginMainFrameThisFrame() const {
return current_frame_number_ ==
last_frame_number_begin_main_frame_sent_;
@@ -326,7 +320,7 @@
if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_IDLE)
return false;
- // We want to clear the pipeline of any pending draws and activations
+ // We want to clear the pipline of any pending draws and activations
// before starting output surface initialization. This allows us to avoid
// weird corner cases where we abort draws or force activation while we
// are initializing the output surface.
@@ -341,17 +335,12 @@
bool SchedulerStateMachine::ShouldDraw() const {
// If we need to abort draws, we should do so ASAP since the draw could
// be blocking other important actions (like output surface initialization),
- // from occurring. If we are waiting for the first draw, then perform the
+ // from occuring. If we are waiting for the first draw, then perfom the
// aborted draw to keep things moving. If we are not waiting for the first
// draw however, we don't want to abort for no reason.
if (PendingDrawsShouldBeAborted())
return active_tree_needs_first_draw_;
- // If a commit has occurred after the animate call, we need to call animate
- // again before we should draw.
- if (did_commit_after_animating_)
- return false;
-
// After this line, we only want to send a swap request once per frame.
if (HasRequestedSwapThisFrame())
return false;
@@ -423,8 +412,7 @@
if (!can_draw_)
return false;
- // If a commit occurred after our last call, we need to do animation again.
- if (HasAnimatedThisFrame() && !did_commit_after_animating_)
+ if (last_frame_number_animate_performed_ == current_frame_number_)
return false;
if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING &&
@@ -486,6 +474,14 @@
if (!HasInitializedOutputSurface())
return false;
+ // SwapAck throttle the BeginMainFrames unless we just swapped.
+ // TODO(brianderson): Remove this restriction to improve throughput.
+ bool just_swapped_in_deadline =
+ begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE &&
+ HasSwappedThisFrame();
+ if (pending_swaps_ >= max_pending_swaps_ && !just_swapped_in_deadline)
+ return false;
+
if (skip_begin_main_frame_to_reduce_latency_)
return false;
@@ -568,7 +564,6 @@
case ACTION_ANIMATE:
last_frame_number_animate_performed_ = current_frame_number_;
needs_animate_ = false;
- did_commit_after_animating_ = false;
// TODO(skyostil): Instead of assuming this, require the client to tell
// us.
SetNeedsRedraw();
@@ -624,9 +619,6 @@
void SchedulerStateMachine::UpdateStateOnCommit(bool commit_was_aborted) {
commit_count_++;
- if (!commit_was_aborted && HasAnimatedThisFrame())
- did_commit_after_animating_ = true;
-
if (commit_was_aborted || settings_.main_frame_before_activation_enabled) {
commit_state_ = COMMIT_STATE_IDLE;
} else {
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index 887e4c7..018f10e 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -260,7 +260,6 @@
bool ShouldManageTiles() const;
void AdvanceCurrentFrameNumber();
- bool HasAnimatedThisFrame() const;
bool HasSentBeginMainFrameThisFrame() const;
bool HasUpdatedVisibleTilesThisFrame() const;
bool HasRequestedSwapThisFrame() const;
@@ -308,7 +307,6 @@
bool has_pending_tree_;
bool pending_tree_is_ready_for_activation_;
bool active_tree_needs_first_draw_;
- bool did_commit_after_animating_;
bool did_create_and_initialize_first_output_surface_;
bool impl_latency_takes_priority_;
bool skip_next_begin_main_frame_to_reduce_latency_;
diff --git a/cc/scheduler/scheduler_state_machine_unittest.cc b/cc/scheduler/scheduler_state_machine_unittest.cc
index e19678d..fc82fb6 100644
--- a/cc/scheduler/scheduler_state_machine_unittest.cc
+++ b/cc/scheduler/scheduler_state_machine_unittest.cc
@@ -10,7 +10,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#define EXPECT_ACTION_UPDATE_STATE(action) \
- EXPECT_EQ(action, state.NextAction()) << state.AsValue()->ToString(); \
+ EXPECT_STREQ(SchedulerStateMachine::ActionToString(action), \
+ SchedulerStateMachine::ActionToString(state.NextAction())) \
+ << state.AsValue()->ToString(); \
if (action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE || \
action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED) { \
EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, \
@@ -1671,9 +1673,16 @@
// Finish the previous commit and draw it.
FinishPreviousCommitAndDrawWithoutExitingDeadline(&state);
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+
+ // Verify we do not send another BeginMainFrame if was are swap throttled
+ // and did not just swap.
state.SetNeedsCommit();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+ state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+ EXPECT_FALSE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
+ state.OnBeginImplFrameDeadline();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
}
@@ -1752,39 +1761,6 @@
SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
}
-TEST(SchedulerStateMachineTest, TestAnimateAfterCommitBeforeDraw) {
- SchedulerSettings settings;
- settings.impl_side_painting = true;
- StateMachine state(settings);
- state.SetCanStart();
- state.UpdateState(state.NextAction());
- state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
- state.SetVisible(true);
- state.SetCanDraw(true);
-
- // Check that animations are updated before we start a commit.
- state.SetNeedsAnimate();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- state.SetNeedsCommit();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- EXPECT_TRUE(state.BeginFrameNeeded());
-
- state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
-
- state.NotifyBeginMainFrameStarted();
- state.NotifyReadyToCommit();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
-
- state.OnBeginImplFrameDeadlinePending();
- state.OnBeginImplFrameDeadline();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
-}
-
TEST(SchedulerStateMachineTest, TestSetNeedsAnimateAfterAnimate) {
SchedulerSettings settings;
settings.impl_side_painting = true;
@@ -1812,46 +1788,5 @@
SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
}
-TEST(SchedulerStateMachineTest, TestBeginMainFrameNotSwapThrottled) {
- SchedulerSettings settings;
- settings.impl_side_painting = true;
- StateMachine state(settings);
- state.SetCanStart();
- state.UpdateState(state.NextAction());
- state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
- state.SetVisible(true);
- state.SetCanDraw(true);
- state.SetNeedsCommit();
-
- // Begin frame and finish without interruption;
- state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- state.NotifyBeginMainFrameStarted();
- state.NotifyReadyToCommit();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- state.NotifyReadyToActivate();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- state.OnBeginImplFrameDeadline();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- // Make sure we're not swap throttled
- state.DidSwapBuffers();
- state.DidSwapBuffersComplete();
-
- // Verify we send another begin frame
- state.SetNeedsCommit();
- state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-}
-
} // namespace
} // namespace cc
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
index 9c459b5..add50ca 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -1331,12 +1331,11 @@
EXPECT_TRUE(client.needs_begin_frames());
client.Reset();
- // While swap throttled, BeginRetroFrames should trigger BeginImplFrames and
- // BeginMainFrame, but not draw.
+ // While swap throttled, BeginRetroFrames should trigger BeginImplFrames
+ // but not a BeginMainFrame or draw.
scheduler->SetNeedsCommit();
client.task_runner().RunPendingTasks(); // Run posted BeginRetroFrame.
- EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
- EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 1);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frames());
client.Reset();
@@ -1351,7 +1350,7 @@
// Take us out of a swap throttled state.
scheduler->DidSwapBuffersComplete();
- EXPECT_EQ(0, client.num_actions_());
+ EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 0, 1);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frames());
client.Reset();
@@ -1511,19 +1510,18 @@
EXPECT_FALSE(client.needs_begin_frames());
client.Reset();
- // While swap throttled, BeginFrames should trigger BeginImplFrames and
- // BeginMainFrame, but not draw.
+ // While swap throttled, BeginFrames should trigger BeginImplFrames,
+ // but not a BeginMainFrame or draw.
scheduler->SetNeedsCommit();
client.task_runner().RunPendingTasks(); // Run posted BeginFrame.
- EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
- EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 1);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frames());
client.Reset();
// Take us out of a swap throttled state.
scheduler->DidSwapBuffersComplete();
- EXPECT_EQ(0, client.num_actions_());
+ EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 0, 1);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frames());
client.Reset();
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc
index cf317b4..a395f5c 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -23,10 +23,12 @@
Display::Display(DisplayClient* client,
SurfaceManager* manager,
- SharedBitmapManager* bitmap_manager)
+ SharedBitmapManager* bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager)
: client_(client),
manager_(manager),
bitmap_manager_(bitmap_manager),
+ gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
blocking_main_thread_task_runner_(
BlockingTaskRunner::Create(base::MessageLoopProxy::current())),
texture_mailbox_deleter_(
@@ -60,6 +62,7 @@
scoped_ptr<ResourceProvider> resource_provider =
ResourceProvider::Create(output_surface_.get(),
bitmap_manager_,
+ gpu_memory_buffer_manager_,
blocking_main_thread_task_runner_.get(),
highp_threshold_min,
use_rgba_4444_texture_format,
diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h
index 16bdd98..451a119 100644
--- a/cc/surfaces/display.h
+++ b/cc/surfaces/display.h
@@ -41,7 +41,8 @@
public:
Display(DisplayClient* client,
SurfaceManager* manager,
- SharedBitmapManager* bitmap_manager);
+ SharedBitmapManager* bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager);
virtual ~Display();
bool Initialize(scoped_ptr<OutputSurface> output_surface);
@@ -85,6 +86,7 @@
DisplayClient* client_;
SurfaceManager* manager_;
SharedBitmapManager* bitmap_manager_;
+ GpuMemoryBufferManager* gpu_memory_buffer_manager_;
SurfaceId current_surface_id_;
gfx::Size current_surface_size_;
LayerTreeSettings settings_;
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index d58ed4c..4d32d72 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -7,6 +7,7 @@
#include "cc/output/compositor_frame.h"
#include "cc/output/copy_output_request.h"
#include "cc/surfaces/surface_factory.h"
+#include "cc/surfaces/surface_manager.h"
namespace cc {
@@ -17,7 +18,7 @@
Surface::Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory)
: surface_id_(id),
size_(size),
- factory_(factory),
+ factory_(factory->AsWeakPtr()),
frame_index_(kFrameIndexStart) {
}
@@ -28,7 +29,7 @@
(*it)->SendEmptyResult();
}
copy_requests_.clear();
- if (current_frame_) {
+ if (current_frame_ && factory_) {
ReturnedResourceArray current_resources;
TransferableResource::ReturnResources(
current_frame_->delegated_frame_data->resource_list,
@@ -39,6 +40,7 @@
void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame,
const base::Closure& callback) {
+ DCHECK(factory_);
for (ScopedPtrVector<CopyOutputRequest>::iterator it = copy_requests_.begin();
it != copy_requests_.end();
++it) {
@@ -63,6 +65,8 @@
if (!draw_callback_.is_null())
draw_callback_.Run();
draw_callback_ = callback;
+ factory_->manager()->DidSatisfySequences(
+ surface_id_, ¤t_frame_->metadata.satisfies_sequences);
}
void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) {
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h
index 718fef4..0df5c17 100644
--- a/cc/surfaces/surface.h
+++ b/cc/surfaces/surface.h
@@ -11,6 +11,7 @@
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "cc/base/scoped_ptr_vector.h"
#include "cc/output/copy_output_request.h"
#include "cc/surfaces/surface_id.h"
@@ -50,12 +51,12 @@
void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info);
void RunDrawCallbacks();
- SurfaceFactory* factory() { return factory_; }
+ base::WeakPtr<SurfaceFactory> factory() { return factory_; }
private:
SurfaceId surface_id_;
gfx::Size size_;
- SurfaceFactory* factory_;
+ base::WeakPtr<SurfaceFactory> factory_;
// TODO(jamesr): Support multiple frames in flight.
scoped_ptr<CompositorFrame> current_frame_;
int frame_index_;
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index ff1aeba..00e5b4d 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -1037,6 +1037,7 @@
resource_provider_ = ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index ab7186a..dcf1130 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -29,17 +29,26 @@
void SurfaceFactory::Destroy(SurfaceId surface_id) {
OwningSurfaceMap::iterator it = surface_map_.find(surface_id);
DCHECK(it != surface_map_.end());
- DCHECK(it->second->factory() == this);
+ DCHECK(it->second->factory().get() == this);
manager_->DeregisterSurface(surface_id);
surface_map_.erase(it);
}
+void SurfaceFactory::DestroyOnSequence(
+ SurfaceId surface_id,
+ const std::set<SurfaceSequence>& dependency_set) {
+ OwningSurfaceMap::iterator it = surface_map_.find(surface_id);
+ DCHECK(it != surface_map_.end());
+ DCHECK(it->second->factory().get() == this);
+ manager_->DestroyOnSequence(surface_map_.take_and_erase(it), dependency_set);
+}
+
void SurfaceFactory::SubmitFrame(SurfaceId surface_id,
scoped_ptr<CompositorFrame> frame,
const base::Closure& callback) {
OwningSurfaceMap::iterator it = surface_map_.find(surface_id);
DCHECK(it != surface_map_.end());
- DCHECK(it->second->factory() == this);
+ DCHECK(it->second->factory().get() == this);
it->second->QueueFrame(frame.Pass(), callback);
manager_->SurfaceModified(surface_id);
}
@@ -52,7 +61,7 @@
copy_request->SendEmptyResult();
return;
}
- DCHECK(it->second->factory() == this);
+ DCHECK(it->second->factory().get() == this);
it->second->RequestCopyOfOutput(copy_request.Pass());
manager_->SurfaceModified(surface_id);
}
diff --git a/cc/surfaces/surface_factory.h b/cc/surfaces/surface_factory.h
index 2516015..3eb4f43 100644
--- a/cc/surfaces/surface_factory.h
+++ b/cc/surfaces/surface_factory.h
@@ -11,6 +11,7 @@
#include "base/memory/weak_ptr.h"
#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surface_resource_holder.h"
+#include "cc/surfaces/surface_sequence.h"
#include "cc/surfaces/surfaces_export.h"
namespace gfx {
@@ -37,6 +38,8 @@
void Create(SurfaceId surface_id, const gfx::Size& size);
void Destroy(SurfaceId surface_id);
+ void DestroyOnSequence(SurfaceId surface_id,
+ const std::set<SurfaceSequence>& dependency_set);
// A frame can only be submitted to a surface created by this factory,
// although the frame may reference surfaces created by other factories.
// The callback is called the first time this frame is used to draw.
@@ -52,6 +55,8 @@
void RefResources(const TransferableResourceArray& resources);
void UnrefResources(const ReturnedResourceArray& resources);
+ SurfaceManager* manager() { return manager_; }
+
private:
SurfaceManager* manager_;
SurfaceFactoryClient* client_;
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index 5cb83fe..ba2a888 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -372,5 +372,32 @@
factory_.SubmitFrame(id, frame.Pass(), base::Closure());
}
+TEST_F(SurfaceFactoryTest, DestroySequence) {
+ SurfaceId id2(5);
+ factory_.Create(id2, gfx::Size(5, 5));
+
+ // Check that waiting before the sequence is satisfied works.
+ std::set<SurfaceSequence> sequence;
+ sequence.insert(SurfaceSequence(0, 4));
+ factory_.DestroyOnSequence(id2, sequence);
+
+ scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
+ scoped_ptr<CompositorFrame> frame(new CompositorFrame);
+ frame->metadata.satisfies_sequences.push_back(6);
+ frame->metadata.satisfies_sequences.push_back(4);
+ frame->delegated_frame_data = frame_data.Pass();
+ DCHECK(manager_.GetSurfaceForId(id2));
+ factory_.SubmitFrame(surface_id_, frame.Pass(), base::Closure());
+ DCHECK(!manager_.GetSurfaceForId(id2));
+
+ // Check that waiting after the sequence is satisfied works.
+ factory_.Create(id2, gfx::Size(5, 5));
+ sequence.clear();
+ sequence.insert(SurfaceSequence(0, 6));
+ DCHECK(manager_.GetSurfaceForId(id2));
+ factory_.DestroyOnSequence(id2, sequence);
+ DCHECK(!manager_.GetSurfaceForId(id2));
+}
+
} // namespace
} // namespace cc
diff --git a/cc/surfaces/surface_id_allocator.h b/cc/surfaces/surface_id_allocator.h
index d410f06..96a241f 100644
--- a/cc/surfaces/surface_id_allocator.h
+++ b/cc/surfaces/surface_id_allocator.h
@@ -21,6 +21,8 @@
static uint32_t NamespaceForId(SurfaceId id);
+ uint32_t id_namespace() const { return id_namespace_; }
+
private:
const uint32_t id_namespace_;
uint32_t next_id_;
diff --git a/cc/surfaces/surface_manager.cc b/cc/surfaces/surface_manager.cc
index 1e3699d..920f464 100644
--- a/cc/surfaces/surface_manager.cc
+++ b/cc/surfaces/surface_manager.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "cc/surfaces/surface.h"
+#include "cc/surfaces/surface_id_allocator.h"
namespace cc {
@@ -15,6 +16,12 @@
SurfaceManager::~SurfaceManager() {
DCHECK(thread_checker_.CalledOnValidThread());
+ for (SurfaceDestroyList::iterator it = surfaces_to_destroy_.begin();
+ it != surfaces_to_destroy_.end();
+ ++it) {
+ DeregisterSurface(it->first->surface_id());
+ delete it->first;
+ }
}
void SurfaceManager::RegisterSurface(Surface* surface) {
@@ -31,6 +38,51 @@
surface_map_.erase(it);
}
+void SurfaceManager::DestroyOnSequence(
+ scoped_ptr<Surface> surface,
+ const std::set<SurfaceSequence>& dependency_set) {
+ surfaces_to_destroy_.push_back(make_pair(surface.release(), dependency_set));
+ SearchForSatisfaction();
+}
+
+void SurfaceManager::DidSatisfySequences(SurfaceId id,
+ std::vector<uint32_t>* sequence) {
+ for (std::vector<uint32_t>::iterator it = sequence->begin();
+ it != sequence->end();
+ ++it) {
+ satisfied_sequences_.insert(
+ SurfaceSequence(SurfaceIdAllocator::NamespaceForId(id), *it));
+ }
+ sequence->clear();
+ SearchForSatisfaction();
+}
+
+void SurfaceManager::SearchForSatisfaction() {
+ for (SurfaceDestroyList::iterator dest_it = surfaces_to_destroy_.begin();
+ dest_it != surfaces_to_destroy_.end();) {
+ std::set<SurfaceSequence>& dependency_set = dest_it->second;
+
+ for (std::set<SurfaceSequence>::iterator it = dependency_set.begin();
+ it != dependency_set.end();) {
+ if (satisfied_sequences_.count(*it) > 0) {
+ satisfied_sequences_.erase(*it);
+ std::set<SurfaceSequence>::iterator old_it = it;
+ ++it;
+ dependency_set.erase(old_it);
+ } else {
+ ++it;
+ }
+ }
+ if (dependency_set.empty()) {
+ scoped_ptr<Surface> surf(dest_it->first);
+ DeregisterSurface(surf->surface_id());
+ dest_it = surfaces_to_destroy_.erase(dest_it);
+ } else {
+ ++dest_it;
+ }
+ }
+}
+
Surface* SurfaceManager::GetSurfaceForId(SurfaceId surface_id) {
DCHECK(thread_checker_.CalledOnValidThread());
SurfaceMap::iterator it = surface_map_.find(surface_id);
diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h
index 7515be5..66db9d9 100644
--- a/cc/surfaces/surface_manager.h
+++ b/cc/surfaces/surface_manager.h
@@ -5,12 +5,17 @@
#ifndef CC_SURFACES_SURFACE_MANAGER_H_
#define CC_SURFACES_SURFACE_MANAGER_H_
+#include <list>
+#include <set>
+#include <vector>
+
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/threading/thread_checker.h"
#include "cc/surfaces/surface_damage_observer.h"
#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surface_sequence.h"
#include "cc/surfaces/surfaces_export.h"
namespace cc {
@@ -25,6 +30,10 @@
void RegisterSurface(Surface* surface);
void DeregisterSurface(SurfaceId surface_id);
+ // Destroy the Surface once a set of sequence numbers has been satisfied.
+ void DestroyOnSequence(scoped_ptr<Surface> surface,
+ const std::set<SurfaceSequence>& dependency_set);
+
Surface* GetSurfaceForId(SurfaceId surface_id);
void AddObserver(SurfaceDamageObserver* obs) {
@@ -37,12 +46,27 @@
void SurfaceModified(SurfaceId surface_id);
+ // A frame for a surface satisfies a set of sequence numbers.
+ void DidSatisfySequences(SurfaceId id, std::vector<uint32_t>* sequence);
+
private:
+ void SearchForSatisfaction();
+
typedef base::hash_map<SurfaceId, Surface*> SurfaceMap;
SurfaceMap surface_map_;
ObserverList<SurfaceDamageObserver> observer_list_;
base::ThreadChecker thread_checker_;
+ // List of surfaces to be destroyed, along with what sequences they're still
+ // waiting on.
+ typedef std::list<std::pair<Surface*, std::set<SurfaceSequence>>>
+ SurfaceDestroyList;
+ SurfaceDestroyList surfaces_to_destroy_;
+
+ // Set of SurfaceSequences that have been satisfied by a frame but not yet
+ // waited on.
+ std::set<SurfaceSequence> satisfied_sequences_;
+
DISALLOW_COPY_AND_ASSIGN(SurfaceManager);
};
diff --git a/cc/surfaces/surface_sequence.h b/cc/surfaces/surface_sequence.h
new file mode 100644
index 0000000..4c99e45
--- /dev/null
+++ b/cc/surfaces/surface_sequence.h
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_SURFACES_SURFACE_SEQUENCE_H_
+#define CC_SURFACES_SURFACE_SEQUENCE_H_
+
+namespace cc {
+
+// A per-surface-namespace sequence number that's used to coordinate
+// dependencies between frames. A sequence number may be satisfied once, and
+// may be depended on once.
+struct SurfaceSequence {
+ SurfaceSequence() : id_namespace(0u), sequence(0u) {}
+ SurfaceSequence(uint32_t id_namespace, uint32_t sequence)
+ : id_namespace(id_namespace), sequence(sequence) {}
+
+ uint32_t id_namespace;
+ uint32_t sequence;
+};
+
+inline bool operator==(const SurfaceSequence& a, const SurfaceSequence& b) {
+ return a.id_namespace == b.id_namespace && a.sequence == b.sequence;
+}
+
+inline bool operator!=(const SurfaceSequence& a, const SurfaceSequence& b) {
+ return !(a == b);
+}
+
+inline bool operator<(const SurfaceSequence& a, const SurfaceSequence& b) {
+ if (a.id_namespace != b.id_namespace)
+ return a.id_namespace < b.id_namespace;
+ return a.sequence < b.sequence;
+}
+
+} // namespace cc
+
+#endif // CC_SURFACES_SURFACE_SEQUENCE_H_
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc
index 9966b34..7c1b3f6 100644
--- a/cc/test/animation_test_common.cc
+++ b/cc/test/animation_test_common.cc
@@ -169,7 +169,8 @@
bool FakeTransformTransition::IsTranslation() const { return true; }
-bool FakeTransformTransition::MaximumScale(float* max_scale) const {
+bool FakeTransformTransition::MaximumTargetScale(bool forward_direction,
+ float* max_scale) const {
*max_scale = 1.f;
return true;
}
diff --git a/cc/test/animation_test_common.h b/cc/test/animation_test_common.h
index 1ee89da..7b53c48 100644
--- a/cc/test/animation_test_common.h
+++ b/cc/test/animation_test_common.h
@@ -45,7 +45,8 @@
gfx::BoxF* bounds) const override;
virtual bool AffectsScale() const override;
virtual bool IsTranslation() const override;
- virtual bool MaximumScale(float* max_scale) const override;
+ virtual bool MaximumTargetScale(bool forward_direction,
+ float* max_scale) const override;
virtual scoped_ptr<AnimationCurve> Clone() const override;
diff --git a/cc/test/data/mask_bottom_right.png b/cc/test/data/mask_bottom_right.png
new file mode 100644
index 0000000..33722eb
--- /dev/null
+++ b/cc/test/data/mask_bottom_right.png
Binary files differ
diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc
index 32767c8..c0c6916 100644
--- a/cc/test/fake_layer_tree_host.cc
+++ b/cc/test/fake_layer_tree_host.cc
@@ -7,7 +7,7 @@
namespace cc {
FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client,
const LayerTreeSettings& settings)
- : LayerTreeHost(client, NULL, settings),
+ : LayerTreeHost(client, NULL, NULL, settings),
client_(client),
host_impl_(settings, &proxy_, &manager_),
needs_commit_(false) {
diff --git a/cc/test/fake_layer_tree_host_impl.cc b/cc/test/fake_layer_tree_host_impl.cc
index 3c4e125..ea19e14 100644
--- a/cc/test/fake_layer_tree_host_impl.cc
+++ b/cc/test/fake_layer_tree_host_impl.cc
@@ -16,6 +16,7 @@
proxy,
&stats_instrumentation_,
manager,
+ NULL,
0) {
// Explicitly clear all debug settings.
SetDebugState(LayerTreeDebugState());
@@ -34,6 +35,7 @@
proxy,
&stats_instrumentation_,
manager,
+ NULL,
0) {
// Explicitly clear all debug settings.
SetDebugState(LayerTreeDebugState());
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index 29680de..df9c0f7 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -73,13 +73,13 @@
}
++num_sent_frames_;
- PostSwapBuffersComplete();
- client_->DidSwapBuffers();
} else {
- OutputSurface::SwapBuffers(frame);
+ last_swap_rect_ = frame->gl_frame_data->sub_buffer_rect;
frame->AssignTo(&last_sent_frame_);
++num_sent_frames_;
}
+ PostSwapBuffersComplete();
+ client_->DidSwapBuffers();
}
void FakeOutputSurface::SetNeedsBeginFrame(bool enable) {
diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h
index 306879b..37c0c54 100644
--- a/cc/test/fake_output_surface.h
+++ b/cc/test/fake_output_surface.h
@@ -119,6 +119,10 @@
void SetMemoryPolicyToSetAtBind(
scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind);
+ gfx::Rect last_swap_rect() const {
+ return last_swap_rect_;
+ }
+
protected:
FakeOutputSurface(
scoped_refptr<ContextProvider> context_provider,
@@ -142,6 +146,7 @@
bool has_external_stencil_test_;
TransferableResourceArray resources_held_by_parent_;
scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_;
+ gfx::Rect last_swap_rect_;
base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_;
};
diff --git a/cc/test/fake_output_surface_client.cc b/cc/test/fake_output_surface_client.cc
index 6fabdf8..77c7f8a 100644
--- a/cc/test/fake_output_surface_client.cc
+++ b/cc/test/fake_output_surface_client.cc
@@ -20,6 +20,10 @@
begin_frame_count_++;
}
+void FakeOutputSurfaceClient::DidSwapBuffers() {
+ swap_count_++;
+}
+
void FakeOutputSurfaceClient::DidLoseOutputSurface() {
did_lose_output_surface_called_ = true;
}
diff --git a/cc/test/fake_output_surface_client.h b/cc/test/fake_output_surface_client.h
index 258ad87..16453da 100644
--- a/cc/test/fake_output_surface_client.h
+++ b/cc/test/fake_output_surface_client.h
@@ -17,6 +17,7 @@
FakeOutputSurfaceClient()
: output_surface_(NULL),
begin_frame_count_(0),
+ swap_count_(0),
deferred_initialize_called_(false),
did_lose_output_surface_called_(false),
memory_policy_(0) {}
@@ -24,6 +25,7 @@
explicit FakeOutputSurfaceClient(OutputSurface* output_surface)
: output_surface_(output_surface),
begin_frame_count_(0),
+ swap_count_(0),
deferred_initialize_called_(false),
did_lose_output_surface_called_(false),
memory_policy_(0) {}
@@ -34,7 +36,7 @@
base::TimeDelta interval) override {}
virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override {}
virtual void BeginFrame(const BeginFrameArgs& args) override;
- virtual void DidSwapBuffers() override {}
+ virtual void DidSwapBuffers() override;
virtual void DidSwapBuffersComplete() override {}
virtual void ReclaimResources(const CompositorFrameAck* ack) override {}
virtual void DidLoseOutputSurface() override;
@@ -49,6 +51,7 @@
virtual void SetTreeActivationCallback(const base::Closure&) override {}
int begin_frame_count() { return begin_frame_count_; }
+ int swap_count() { return swap_count_; }
bool deferred_initialize_called() {
return deferred_initialize_called_;
@@ -63,6 +66,7 @@
private:
OutputSurface* output_surface_;
int begin_frame_count_;
+ int swap_count_;
bool deferred_initialize_called_;
bool did_lose_output_surface_called_;
ManagedMemoryPolicy memory_policy_;
diff --git a/cc/test/fake_picture_layer_impl.h b/cc/test/fake_picture_layer_impl.h
index cbdba24..10bd290 100644
--- a/cc/test/fake_picture_layer_impl.h
+++ b/cc/test/fake_picture_layer_impl.h
@@ -55,7 +55,6 @@
using PictureLayerImpl::AddTiling;
using PictureLayerImpl::CleanUpTilingsOnActiveLayer;
using PictureLayerImpl::CanHaveTilings;
- using PictureLayerImpl::MarkVisibleResourcesAsRequired;
using PictureLayerImpl::DoPostCommitInitializationIfNeeded;
using PictureLayerImpl::MinimumContentsScale;
using PictureLayerImpl::GetViewportForTilePriorityInContentSpace;
@@ -111,6 +110,10 @@
virtual void ReleaseResources() override;
+ bool only_used_low_res_last_append_quads() const {
+ return only_used_low_res_last_append_quads_;
+ }
+
protected:
FakePictureLayerImpl(
LayerTreeImpl* tree_impl,
diff --git a/cc/test/fake_picture_layer_tiling_client.cc b/cc/test/fake_picture_layer_tiling_client.cc
index 68ff518..ce46c91 100644
--- a/cc/test/fake_picture_layer_tiling_client.cc
+++ b/cc/test/fake_picture_layer_tiling_client.cc
@@ -91,4 +91,8 @@
return tree_;
}
+bool FakePictureLayerTilingClient::RequiresHighResToDraw() const {
+ return false;
+}
+
} // namespace cc
diff --git a/cc/test/fake_picture_layer_tiling_client.h b/cc/test/fake_picture_layer_tiling_client.h
index e3b2659..0fcab36 100644
--- a/cc/test/fake_picture_layer_tiling_client.h
+++ b/cc/test/fake_picture_layer_tiling_client.h
@@ -29,6 +29,7 @@
virtual size_t GetMaxTilesForInterestArea() const override;
virtual float GetSkewportTargetTimeInSeconds() const override;
virtual int GetSkewportExtrapolationLimitInContentPixels() const override;
+ virtual bool RequiresHighResToDraw() const override;
void SetTileSize(const gfx::Size& tile_size);
gfx::Size TileSize() const { return tile_size_; }
diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc
index 6767c9f..d6f704f 100644
--- a/cc/test/fake_tile_manager.cc
+++ b/cc/test/fake_tile_manager.cc
@@ -84,11 +84,9 @@
void FakeTileManager::AssignMemoryToTiles(
const GlobalStateThatImpactsTilePriority& state) {
tiles_for_raster.clear();
- all_tiles.Clear();
SetGlobalStateForTesting(state);
- GetTilesWithAssignedBins(&all_tiles);
- AssignGpuMemoryToTiles(&all_tiles, &tiles_for_raster);
+ AssignGpuMemoryToTiles(&tiles_for_raster);
}
bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) {
diff --git a/cc/test/fake_tile_manager.h b/cc/test/fake_tile_manager.h
index 36a0530..ee6ccf3 100644
--- a/cc/test/fake_tile_manager.h
+++ b/cc/test/fake_tile_manager.h
@@ -25,7 +25,6 @@
virtual void Release(Tile* tile) override;
std::vector<Tile*> tiles_for_raster;
- PrioritizedTileSet all_tiles;
};
} // namespace cc
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 9b9bae6..15a1a44 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -18,6 +18,7 @@
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/test_context_provider.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/tiled_layer_test_common.h"
#include "cc/trees/layer_tree_host_client.h"
@@ -112,14 +113,16 @@
const LayerTreeSettings& settings,
LayerTreeHostImplClient* host_impl_client,
Proxy* proxy,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
RenderingStatsInstrumentation* stats_instrumentation) {
return make_scoped_ptr(
new LayerTreeHostImplForTesting(test_hooks,
settings,
host_impl_client,
proxy,
- manager,
+ shared_bitmap_manager,
+ gpu_memory_buffer_manager,
stats_instrumentation));
}
@@ -129,13 +132,15 @@
const LayerTreeSettings& settings,
LayerTreeHostImplClient* host_impl_client,
Proxy* proxy,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
RenderingStatsInstrumentation* stats_instrumentation)
: LayerTreeHostImpl(settings,
host_impl_client,
proxy,
stats_instrumentation,
- manager,
+ shared_bitmap_manager,
+ gpu_memory_buffer_manager,
0),
test_hooks_(test_hooks),
block_notify_ready_to_activate_for_testing_(false),
@@ -200,6 +205,9 @@
}
virtual void BlockNotifyReadyToActivateForTesting(bool block) override {
+ CHECK(settings().impl_side_painting);
+ CHECK(proxy()->ImplThreadTaskRunner())
+ << "Not supported for single-threaded mode.";
block_notify_ready_to_activate_for_testing_ = block;
if (!block && notify_ready_to_activate_was_blocked_) {
NotifyReadyToActivate();
@@ -363,6 +371,7 @@
host_impl_client,
proxy(),
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
rendering_stats_instrumentation());
}
@@ -380,12 +389,14 @@
LayerTreeHostForTesting(TestHooks* test_hooks,
LayerTreeHostClient* client,
const LayerTreeSettings& settings)
- : LayerTreeHost(client, NULL, settings),
- shared_bitmap_manager_(new TestSharedBitmapManager()),
+ : LayerTreeHost(client, NULL, NULL, settings),
+ shared_bitmap_manager_(new TestSharedBitmapManager),
+ gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager),
test_hooks_(test_hooks),
test_started_(false) {}
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
TestHooks* test_hooks_;
bool test_started_;
};
@@ -636,11 +647,7 @@
// Spend less time waiting for BeginFrame because the output is
// mocked out.
settings_.refresh_rate = 200.0;
- if (impl_side_painting) {
- DCHECK(threaded)
- << "Don't run single thread + impl side painting, it doesn't exist.";
- settings_.impl_side_painting = true;
- }
+ settings_.impl_side_painting = impl_side_painting;
InitializeSettings(&settings_);
main_task_runner_->PostTask(
diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h
index af0c554..9350680 100644
--- a/cc/test/layer_tree_test.h
+++ b/cc/test/layer_tree_test.h
@@ -222,45 +222,67 @@
} // namespace cc
-#define SINGLE_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
- TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer) { \
- RunTest(false, false, false); \
- } \
+#define SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \
+ TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_MainThreadPaint) { \
+ RunTest(false, false, false); \
+ } \
+ class SingleThreadDirectNoImplNeedsSemicolon##TEST_FIXTURE_NAME {}
+
+#define SINGLE_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
+ SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
+ TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_ImplSidePaint) { \
+ RunTest(false, false, true); \
+ } \
class SingleThreadDirectNeedsSemicolon##TEST_FIXTURE_NAME {}
-#define SINGLE_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
- TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DelegatingRenderer) { \
- RunTest(false, true, false); \
- } \
+#define SINGLE_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \
+ TEST_F(TEST_FIXTURE_NAME, \
+ RunSingleThread_DelegatingRenderer_MainThreadPaint) { \
+ RunTest(false, true, false); \
+ } \
+ class SingleThreadDelegatingNoImplNeedsSemicolon##TEST_FIXTURE_NAME {}
+
+#define SINGLE_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
+ SINGLE_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
+ TEST_F(TEST_FIXTURE_NAME, \
+ RunSingleThread_DelegatingRenderer_ImplSidePaint) { \
+ RunTest(false, true, true); \
+ } \
class SingleThreadDelegatingNeedsSemicolon##TEST_FIXTURE_NAME {}
#define SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME) \
SINGLE_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
SINGLE_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME)
+#define SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \
+ SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
+ SINGLE_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME)
+
#define MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \
TEST_F(TEST_FIXTURE_NAME, RunMultiThread_DirectRenderer_MainThreadPaint) { \
RunTest(true, false, false); \
- }
+ } \
+ class MultiThreadDirectNoImplNeedsSemicolon##TEST_FIXTURE_NAME {}
-#define MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
- MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \
- TEST_F(TEST_FIXTURE_NAME, RunMultiThread_DirectRenderer_ImplSidePaint) { \
- RunTest(true, false, true); \
- } \
+#define MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
+ MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
+ TEST_F(TEST_FIXTURE_NAME, RunMultiThread_DirectRenderer_ImplSidePaint) { \
+ RunTest(true, false, true); \
+ } \
class MultiThreadDirectNeedsSemicolon##TEST_FIXTURE_NAME {}
#define MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \
TEST_F(TEST_FIXTURE_NAME, \
RunMultiThread_DelegatingRenderer_MainThreadPaint) { \
RunTest(true, true, false); \
- }
+ } \
+ class MultiThreadDelegatingNoImplNeedsSemicolon##TEST_FIXTURE_NAME {}
-#define MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
- MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) TEST_F( \
- TEST_FIXTURE_NAME, RunMultiThread_DelegatingRenderer_ImplSidePaint) { \
- RunTest(true, true, true); \
- } \
+#define MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
+ MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
+ TEST_F(TEST_FIXTURE_NAME, RunMultiThread_DelegatingRenderer_ImplSidePaint) { \
+ RunTest(true, true, true); \
+ } \
class MultiThreadDelegatingNeedsSemicolon##TEST_FIXTURE_NAME {}
#define MULTI_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \
@@ -271,18 +293,18 @@
MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME)
-#define SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( \
- TEST_FIXTURE_NAME) \
- SINGLE_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
+#define SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( \
+ TEST_FIXTURE_NAME) \
+ SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME)
#define SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
SINGLE_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME)
-#define SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F( \
- TEST_FIXTURE_NAME) \
- SINGLE_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
+#define SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F( \
+ TEST_FIXTURE_NAME) \
+ SINGLE_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME)
#define SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) \
@@ -297,4 +319,10 @@
SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME)
+// Some tests want to control when notify ready for activation occurs,
+// but this is not supported in the single-threaded case.
+#define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \
+ SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
+ MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME)
+
#endif // CC_TEST_LAYER_TREE_TEST_H_
diff --git a/cc/test/ordered_simple_task_runner.cc b/cc/test/ordered_simple_task_runner.cc
index 3f63ca7..48afd9b 100644
--- a/cc/test/ordered_simple_task_runner.cc
+++ b/cc/test/ordered_simple_task_runner.cc
@@ -267,16 +267,21 @@
void OrderedSimpleTaskRunner::AsValueInto(
base::debug::TracedValue* state) const {
state->SetInteger("pending_tasks", pending_tasks_.size());
+
+ state->BeginArray("tasks");
for (std::set<TestOrderablePendingTask>::const_iterator it =
pending_tasks_.begin();
it != pending_tasks_.end();
++it) {
- state->BeginDictionary(
- base::SizeTToString(std::distance(pending_tasks_.begin(), it)).c_str());
+ state->BeginDictionary();
it->AsValueInto(state);
state->EndDictionary();
}
+ state->EndArray();
+
+ state->BeginDictionary("now_src");
now_src_->AsValueInto(state);
+ state->EndDictionary();
}
base::Callback<bool(void)> OrderedSimpleTaskRunner::TaskRunCountBelow(
diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc
index 6900319..c47a083 100644
--- a/cc/test/pixel_test.cc
+++ b/cc/test/pixel_test.cc
@@ -23,6 +23,7 @@
#include "cc/test/pixel_test_output_surface.h"
#include "cc/test/pixel_test_software_output_device.h"
#include "cc/test/pixel_test_utils.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_in_process_context_provider.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/trees/blocking_task_runner.h"
@@ -114,14 +115,17 @@
new PixelTestOutputSurface(new TestInProcessContextProvider));
output_surface_->BindToClient(output_surface_client_.get());
- shared_bitmap_manager_.reset(new TestSharedBitmapManager());
- resource_provider_ = ResourceProvider::Create(output_surface_.get(),
- shared_bitmap_manager_.get(),
- main_thread_task_runner_.get(),
- 0,
- false,
- 1,
- false);
+ shared_bitmap_manager_.reset(new TestSharedBitmapManager);
+ gpu_memory_buffer_manager_.reset(new TestGpuMemoryBufferManager);
+ resource_provider_ =
+ ResourceProvider::Create(output_surface_.get(),
+ shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
+ main_thread_task_runner_.get(),
+ 0,
+ false,
+ 1,
+ false);
texture_mailbox_deleter_ = make_scoped_ptr(
new TextureMailboxDeleter(base::MessageLoopProxy::current()));
@@ -162,13 +166,15 @@
output_surface_.reset(new PixelTestOutputSurface(device.Pass()));
output_surface_->BindToClient(output_surface_client_.get());
shared_bitmap_manager_.reset(new TestSharedBitmapManager());
- resource_provider_ = ResourceProvider::Create(output_surface_.get(),
- shared_bitmap_manager_.get(),
- main_thread_task_runner_.get(),
- 0,
- false,
- 1,
- false);
+ resource_provider_ =
+ ResourceProvider::Create(output_surface_.get(),
+ shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
+ main_thread_task_runner_.get(),
+ 0,
+ false,
+ 1,
+ false);
renderer_ = SoftwareRenderer::Create(
this, &settings_, output_surface_.get(), resource_provider_.get());
}
diff --git a/cc/test/pixel_test.h b/cc/test/pixel_test.h
index 17ecffb..3396099 100644
--- a/cc/test/pixel_test.h
+++ b/cc/test/pixel_test.h
@@ -21,7 +21,8 @@
class OutputSurface;
class ResourceProvider;
class SoftwareRenderer;
-class SharedBitmapManager;
+class TestGpuMemoryBufferManager;
+class TestSharedBitmapManager;
class PixelTest : public testing::Test, RendererClient {
protected:
@@ -44,7 +45,8 @@
class PixelTestRendererClient;
scoped_ptr<FakeOutputSurfaceClient> output_surface_client_;
scoped_ptr<OutputSurface> output_surface_;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
scoped_ptr<BlockingTaskRunner> main_thread_task_runner_;
scoped_ptr<ResourceProvider> resource_provider_;
scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_;
diff --git a/cc/test/pixel_test_output_surface.cc b/cc/test/pixel_test_output_surface.cc
index c773a52..640c118 100644
--- a/cc/test/pixel_test_output_surface.cc
+++ b/cc/test/pixel_test_output_surface.cc
@@ -28,4 +28,9 @@
return external_stencil_test_;
}
+void PixelTestOutputSurface::SwapBuffers(CompositorFrame* frame) {
+ PostSwapBuffersComplete();
+ client_->DidSwapBuffers();
+}
+
} // namespace cc
diff --git a/cc/test/pixel_test_output_surface.h b/cc/test/pixel_test_output_surface.h
index ce9d79c..eaa2675 100644
--- a/cc/test/pixel_test_output_surface.h
+++ b/cc/test/pixel_test_output_surface.h
@@ -18,6 +18,7 @@
virtual void Reshape(const gfx::Size& size, float scale_factor) override;
virtual bool HasExternalStencilTest() const override;
+ virtual void SwapBuffers(CompositorFrame* frame) override;
void set_surface_expansion_size(const gfx::Size& surface_expansion_size) {
surface_expansion_size_ = surface_expansion_size;
diff --git a/cc/test/test_context_support.cc b/cc/test/test_context_support.cc
index 88127d5..f74f692 100644
--- a/cc/test/test_context_support.cc
+++ b/cc/test/test_context_support.cc
@@ -10,8 +10,7 @@
namespace cc {
TestContextSupport::TestContextSupport()
- : last_swap_type_(NO_SWAP),
- weak_ptr_factory_(this) {
+ : weak_ptr_factory_(this) {
}
TestContextSupport::~TestContextSupport() {}
@@ -59,7 +58,6 @@
}
void TestContextSupport::Swap() {
- last_swap_type_ = SWAP;
}
uint32 TestContextSupport::InsertFutureSyncPointCHROMIUM() {
@@ -72,8 +70,6 @@
}
void TestContextSupport::PartialSwapBuffers(const gfx::Rect& sub_buffer) {
- last_swap_type_ = PARTIAL_SWAP;
- last_partial_swap_rect_ = sub_buffer;
}
void TestContextSupport::ScheduleOverlayPlane(
diff --git a/cc/test/test_context_support.h b/cc/test/test_context_support.h
index c9b0d14..ceadd93 100644
--- a/cc/test/test_context_support.h
+++ b/cc/test/test_context_support.h
@@ -48,25 +48,11 @@
void SetScheduleOverlayPlaneCallback(
const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback);
- enum SwapType {
- NO_SWAP,
- SWAP,
- PARTIAL_SWAP
- };
-
- SwapType last_swap_type() const { return last_swap_type_; }
- gfx::Rect last_partial_swap_rect() const {
- return last_partial_swap_rect_;
- }
-
private:
std::vector<base::Closure> sync_point_callbacks_;
SurfaceVisibleCallback set_visible_callback_;
ScheduleOverlayPlaneCallback schedule_overlay_plane_callback_;
- SwapType last_swap_type_;
- gfx::Rect last_partial_swap_rect_;
-
base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(TestContextSupport);
diff --git a/cc/test/test_gles2_interface.cc b/cc/test/test_gles2_interface.cc
index db410d5..0a29fbe 100644
--- a/cc/test/test_gles2_interface.cc
+++ b/cc/test/test_gles2_interface.cc
@@ -306,32 +306,18 @@
test_context_->waitAsyncTexImage2DCHROMIUM(target);
}
-GLuint TestGLES2Interface::CreateImageCHROMIUM(GLsizei width,
+GLuint TestGLES2Interface::CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) {
+ GLenum internalformat) {
return test_context_->createImageCHROMIUM(
- width, height, internalformat, usage);
+ buffer, width, height, internalformat);
}
void TestGLES2Interface::DestroyImageCHROMIUM(GLuint image_id) {
test_context_->destroyImageCHROMIUM(image_id);
}
-void* TestGLES2Interface::MapImageCHROMIUM(GLuint image_id) {
- return test_context_->mapImageCHROMIUM(image_id);
-}
-
-void TestGLES2Interface::GetImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params) {
- test_context_->getImageParameterivCHROMIUM(image_id, pname, params);
-}
-
-void TestGLES2Interface::UnmapImageCHROMIUM(GLuint image_id) {
- test_context_->unmapImageCHROMIUM(image_id);
-}
-
GLuint TestGLES2Interface::CreateGpuMemoryBufferImageCHROMIUM(
GLsizei width,
GLsizei height,
diff --git a/cc/test/test_gles2_interface.h b/cc/test/test_gles2_interface.h
index e720022..70d8288 100644
--- a/cc/test/test_gles2_interface.h
+++ b/cc/test/test_gles2_interface.h
@@ -126,16 +126,11 @@
GLsizei image_size,
const void* data) override;
virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) override;
- virtual GLuint CreateImageCHROMIUM(GLsizei width,
+ virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) override;
+ GLenum internalformat) override;
virtual void DestroyImageCHROMIUM(GLuint image_id) override;
- virtual void* MapImageCHROMIUM(GLuint image_id) override;
- virtual void GetImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params) override;
- virtual void UnmapImageCHROMIUM(GLuint image_id) override;
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
diff --git a/cc/test/test_gpu_memory_buffer_manager.cc b/cc/test/test_gpu_memory_buffer_manager.cc
new file mode 100644
index 0000000..855959e
--- /dev/null
+++ b/cc/test/test_gpu_memory_buffer_manager.cc
@@ -0,0 +1,86 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/test/test_gpu_memory_buffer_manager.h"
+
+#include "base/logging.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+
+namespace cc {
+namespace {
+
+class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
+ public:
+ GpuMemoryBufferImpl(const gfx::Size& size, Format format)
+ : size_(size),
+ format_(format),
+ pixels_(new uint8[size.GetArea() * BytesPerPixel(format)]),
+ mapped_(false) {}
+
+ // Overridden from gfx::GpuMemoryBuffer:
+ virtual void* Map() override {
+ DCHECK(!mapped_);
+ mapped_ = true;
+ return pixels_.get();
+ }
+ virtual void Unmap() override {
+ DCHECK(mapped_);
+ mapped_ = false;
+ }
+ virtual bool IsMapped() const override { return mapped_; }
+ virtual Format GetFormat() const override { return format_; }
+ virtual uint32 GetStride() const override {
+ return size_.width() * BytesPerPixel(format_);
+ }
+ virtual gfx::GpuMemoryBufferHandle GetHandle() const override {
+ NOTREACHED();
+ return gfx::GpuMemoryBufferHandle();
+ }
+ virtual ClientBuffer AsClientBuffer() override {
+ return reinterpret_cast<ClientBuffer>(this);
+ }
+
+ private:
+ static size_t BytesPerPixel(Format format) {
+ switch (format) {
+ case RGBA_8888:
+ case RGBX_8888:
+ case BGRA_8888:
+ return 4;
+ }
+
+ NOTREACHED();
+ return 0;
+ }
+
+ const gfx::Size size_;
+ gfx::GpuMemoryBuffer::Format format_;
+ scoped_ptr<uint8[]> pixels_;
+ bool mapped_;
+};
+
+} // namespace
+
+TestGpuMemoryBufferManager::TestGpuMemoryBufferManager() {
+}
+
+TestGpuMemoryBufferManager::~TestGpuMemoryBufferManager() {
+}
+
+scoped_ptr<gfx::GpuMemoryBuffer>
+TestGpuMemoryBufferManager::AllocateGpuMemoryBuffer(
+ const gfx::Size& size,
+ gfx::GpuMemoryBuffer::Format format,
+ gfx::GpuMemoryBuffer::Usage usage) {
+ return make_scoped_ptr<gfx::GpuMemoryBuffer>(
+ new GpuMemoryBufferImpl(size, format));
+}
+
+gfx::GpuMemoryBuffer*
+TestGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer(
+ ClientBuffer buffer) {
+ return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
+}
+
+} // namespace cc
diff --git a/cc/test/test_gpu_memory_buffer_manager.h b/cc/test/test_gpu_memory_buffer_manager.h
new file mode 100644
index 0000000..61aaaaa
--- /dev/null
+++ b/cc/test/test_gpu_memory_buffer_manager.h
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_
+#define CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_
+
+#include "cc/resources/gpu_memory_buffer_manager.h"
+
+namespace cc {
+
+class TestGpuMemoryBufferManager : public GpuMemoryBufferManager {
+ public:
+ TestGpuMemoryBufferManager();
+ virtual ~TestGpuMemoryBufferManager();
+
+ // Overridden from GpuMemoryBufferManager:
+ virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
+ const gfx::Size& size,
+ gfx::GpuMemoryBuffer::Format format,
+ gfx::GpuMemoryBuffer::Usage usage) override;
+ virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer(
+ ClientBuffer buffer) override;
+};
+
+} // namespace cc
+
+#endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_
diff --git a/cc/test/test_tile_priorities.cc b/cc/test/test_tile_priorities.cc
index 4de76ba..2748e6c 100644
--- a/cc/test/test_tile_priorities.cc
+++ b/cc/test/test_tile_priorities.cc
@@ -15,11 +15,6 @@
TilePriorityForNowBin::TilePriorityForNowBin()
: TilePriority(HIGH_RESOLUTION, NOW, 0) {}
-TilePriorityRequiredForActivation::TilePriorityRequiredForActivation()
- : TilePriority(HIGH_RESOLUTION, NOW, 0) {
- required_for_activation = true;
-}
-
TilePriorityLowRes::TilePriorityLowRes()
: TilePriority(LOW_RESOLUTION, NOW, 0) {}
diff --git a/cc/test/test_tile_priorities.h b/cc/test/test_tile_priorities.h
index 9d2caab..60738e4 100644
--- a/cc/test/test_tile_priorities.h
+++ b/cc/test/test_tile_priorities.h
@@ -24,11 +24,6 @@
TilePriorityForNowBin();
};
-class TilePriorityRequiredForActivation : public TilePriority {
- public:
- TilePriorityRequiredForActivation();
-};
-
class TilePriorityLowRes : public TilePriority {
public:
TilePriorityLowRes();
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc
index ccca7db..9fae995 100644
--- a/cc/test/test_web_graphics_context_3d.cc
+++ b/cc/test/test_web_graphics_context_3d.cc
@@ -53,7 +53,6 @@
times_bind_texture_succeeds_(-1),
times_end_query_succeeds_(-1),
context_lost_(false),
- times_map_image_chromium_succeeds_(-1),
times_map_buffer_chromium_succeeds_(-1),
current_used_transfer_buffer_usage_bytes_(0),
max_used_transfer_buffer_usage_bytes_(0),
@@ -545,51 +544,26 @@
return true;
}
-GLuint TestWebGraphicsContext3D::createImageCHROMIUM(GLsizei width,
+GLuint TestWebGraphicsContext3D::createImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) {
- DCHECK_EQ(GL_RGBA8_OES, static_cast<int>(internalformat));
+ GLenum internalformat) {
+ DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat));
GLuint image_id = NextImageId();
base::AutoLock lock(namespace_->lock);
- base::ScopedPtrHashMap<unsigned, Image>& images = namespace_->images;
- images.set(image_id, make_scoped_ptr(new Image).Pass());
- images.get(image_id)->pixels.reset(new uint8[width * height * 4]);
+ base::hash_set<unsigned>& images = namespace_->images;
+ images.insert(image_id);
return image_id;
}
void TestWebGraphicsContext3D::destroyImageCHROMIUM(
GLuint id) {
RetireImageId(id);
-}
-
-void TestWebGraphicsContext3D::getImageParameterivCHROMIUM(
- GLuint image_id,
- GLenum pname,
- GLint* params) {
base::AutoLock lock(namespace_->lock);
- DCHECK_GT(namespace_->images.count(image_id), 0u);
- DCHECK_EQ(GL_IMAGE_ROWBYTES_CHROMIUM, static_cast<int>(pname));
- *params = 0;
-}
-
-void* TestWebGraphicsContext3D::mapImageCHROMIUM(GLuint image_id) {
- base::AutoLock lock(namespace_->lock);
- base::ScopedPtrHashMap<unsigned, Image>& images = namespace_->images;
- DCHECK_GT(images.count(image_id), 0u);
- if (times_map_image_chromium_succeeds_ >= 0) {
- if (!times_map_image_chromium_succeeds_) {
- return NULL;
- }
- --times_map_image_chromium_succeeds_;
- }
- return images.get(image_id)->pixels.get();
-}
-
-void TestWebGraphicsContext3D::unmapImageCHROMIUM(
- GLuint image_id) {
- base::AutoLock lock(namespace_->lock);
- DCHECK_GT(namespace_->images.count(image_id), 0u);
+ base::hash_set<unsigned>& images = namespace_->images;
+ if (!images.count(id))
+ ADD_FAILURE() << "destroyImageCHROMIUM called on unknown image " << id;
+ images.erase(id);
}
GLuint TestWebGraphicsContext3D::createGpuMemoryBufferImageCHROMIUM(
@@ -600,9 +574,8 @@
DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat));
GLuint image_id = NextImageId();
base::AutoLock lock(namespace_->lock);
- base::ScopedPtrHashMap<unsigned, Image>& images = namespace_->images;
- images.set(image_id, make_scoped_ptr(new Image).Pass());
- images.get(image_id)->pixels.reset(new uint8[width * height * 4]);
+ base::hash_set<unsigned>& images = namespace_->images;
+ images.insert(image_id);
return image_id;
}
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h
index 0e12aec..0dfba9d 100644
--- a/cc/test/test_web_graphics_context_3d.h
+++ b/cc/test/test_web_graphics_context_3d.h
@@ -22,6 +22,8 @@
#include "third_party/khronos/GLES2/gl2.h"
#include "ui/gfx/rect.h"
+extern "C" typedef struct _ClientBuffer* ClientBuffer;
+
namespace cc {
class TestContextSupport;
@@ -250,20 +252,16 @@
GLenum access);
virtual GLboolean unmapBufferCHROMIUM(GLenum target);
- virtual GLuint createImageCHROMIUM(GLsizei width,
+ virtual GLuint createImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage);
+ GLenum internalformat);
virtual void destroyImageCHROMIUM(GLuint image_id);
- virtual void getImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params);
- virtual void* mapImageCHROMIUM(GLuint image_id);
- virtual void unmapImageCHROMIUM(GLuint image_id);
virtual GLuint createGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
GLenum usage);
+
virtual void texImageIOSurface2DCHROMIUM(GLenum target,
GLsizei width,
GLsizei height,
@@ -287,11 +285,7 @@
times_end_query_succeeds_ = times;
}
- // When set, mapImageCHROMIUM and mapBufferCHROMIUM will return NULL after
- // this many times.
- void set_times_map_image_chromium_succeeds(int times) {
- times_map_image_chromium_succeeds_ = times;
- }
+ // When set, mapBufferCHROMIUM will return NULL after this many times.
void set_times_map_buffer_chromium_succeeds(int times) {
times_map_buffer_chromium_succeeds_ = times;
}
@@ -422,7 +416,7 @@
unsigned next_image_id;
unsigned next_texture_id;
base::ScopedPtrHashMap<unsigned, Buffer> buffers;
- base::ScopedPtrHashMap<unsigned, Image> images;
+ base::hash_set<unsigned> images;
OrderedTextureMap textures;
private:
@@ -443,7 +437,6 @@
int times_bind_texture_succeeds_;
int times_end_query_succeeds_;
bool context_lost_;
- int times_map_image_chromium_succeeds_;
int times_map_buffer_chromium_succeeds_;
int current_used_transfer_buffer_usage_bytes_;
int max_used_transfer_buffer_usage_bytes_;
diff --git a/cc/test/tiled_layer_test_common.cc b/cc/test/tiled_layer_test_common.cc
index 324feb9..ca86499 100644
--- a/cc/test/tiled_layer_test_common.cc
+++ b/cc/test/tiled_layer_test_common.cc
@@ -87,7 +87,7 @@
FakeTiledLayer::~FakeTiledLayer() {}
-void FakeTiledLayer::SetNeedsDisplayRect(const gfx::RectF& rect) {
+void FakeTiledLayer::SetNeedsDisplayRect(const gfx::Rect& rect) {
last_needs_display_rect_ = rect;
TiledLayer::SetNeedsDisplayRect(rect);
}
diff --git a/cc/test/tiled_layer_test_common.h b/cc/test/tiled_layer_test_common.h
index 29f06a7..a54cb37 100644
--- a/cc/test/tiled_layer_test_common.h
+++ b/cc/test/tiled_layer_test_common.h
@@ -102,8 +102,8 @@
using TiledLayer::NumPaintedTiles;
using TiledLayer::IdlePaintRect;
- virtual void SetNeedsDisplayRect(const gfx::RectF& rect) override;
- const gfx::RectF& last_needs_display_rect() const {
+ virtual void SetNeedsDisplayRect(const gfx::Rect& rect) override;
+ const gfx::Rect& last_needs_display_rect() const {
return last_needs_display_rect_;
}
@@ -127,7 +127,7 @@
private:
scoped_refptr<FakeLayerUpdater> fake_updater_;
PrioritizedResourceManager* resource_manager_;
- gfx::RectF last_needs_display_rect_;
+ gfx::Rect last_needs_display_rect_;
DISALLOW_COPY_AND_ASSIGN(FakeTiledLayer);
};
diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc
index b6a4409..dffe90a 100644
--- a/cc/trees/damage_tracker_unittest.cc
+++ b/cc/trees/damage_tracker_unittest.cc
@@ -229,7 +229,7 @@
// CASE 1: Setting the update rect should cause the corresponding damage to
// the surface.
ClearDamageForAllSurfaces(root.get());
- child->SetUpdateRect(gfx::RectF(10.f, 11.f, 12.f, 13.f));
+ child->SetUpdateRect(gfx::Rect(10, 11, 12, 13));
EmulateDrawingOneFrame(root.get());
// Damage position on the surface should be: position of update_rect (10, 11)
@@ -242,7 +242,7 @@
// CASE 2: The same update rect twice in a row still produces the same
// damage.
ClearDamageForAllSurfaces(root.get());
- child->SetUpdateRect(gfx::RectF(10.f, 11.f, 12.f, 13.f));
+ child->SetUpdateRect(gfx::Rect(10, 11, 12, 13));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
root->render_surface()->damage_tracker()->current_damage_rect();
@@ -252,7 +252,7 @@
// CASE 3: Setting a different update rect should cause damage on the new
// update region, but no additional exposed old region.
ClearDamageForAllSurfaces(root.get());
- child->SetUpdateRect(gfx::RectF(20.f, 25.f, 1.f, 2.f));
+ child->SetUpdateRect(gfx::Rect(20, 25, 1, 2));
EmulateDrawingOneFrame(root.get());
// Damage position on the surface should be: position of update_rect (20, 25)
@@ -322,7 +322,7 @@
// corresponding damage to the surface.
ClearDamageForAllSurfaces(root.get());
child->AddDamageRect(gfx::RectF(5.f, 6.f, 12.f, 13.f));
- child->SetUpdateRect(gfx::RectF(15.f, 16.f, 14.f, 10.f));
+ child->SetUpdateRect(gfx::Rect(15, 16, 14, 10));
EmulateDrawingOneFrame(root.get());
// Damage position on the surface should be: position of unified layer
@@ -336,7 +336,7 @@
// produces the same damage.
ClearDamageForAllSurfaces(root.get());
child->AddDamageRect(gfx::RectF(10.f, 11.f, 12.f, 13.f));
- child->SetUpdateRect(gfx::RectF(10.f, 11.f, 14.f, 15.f));
+ child->SetUpdateRect(gfx::Rect(10, 11, 14, 15));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
root->render_surface()->damage_tracker()->current_damage_rect();
@@ -346,7 +346,7 @@
// damage on the new damaged region, but no additional exposed old region.
ClearDamageForAllSurfaces(root.get());
child->AddDamageRect(gfx::RectF(20.f, 25.f, 2.f, 3.f));
- child->SetUpdateRect(gfx::RectF(5.f, 10.f, 7.f, 8.f));
+ child->SetUpdateRect(gfx::Rect(5, 10, 7, 8));
EmulateDrawingOneFrame(root.get());
// Damage position on the surface should be: position of unified layer damage
@@ -363,7 +363,7 @@
// CASE 1: The layer's property changed flag takes priority over update rect.
//
ClearDamageForAllSurfaces(root.get());
- child->SetUpdateRect(gfx::RectF(10.f, 11.f, 12.f, 13.f));
+ child->SetUpdateRect(gfx::Rect(10, 11, 12, 13));
child->SetOpacity(0.5f);
EmulateDrawingOneFrame(root.get());
@@ -511,7 +511,7 @@
// Setting the update rect should cause the corresponding damage to the
// surface, blurred based on the size of the blur filter.
ClearDamageForAllSurfaces(root.get());
- child->SetUpdateRect(gfx::RectF(1.f, 2.f, 3.f, 4.f));
+ child->SetUpdateRect(gfx::Rect(1, 2, 3, 4));
EmulateDrawingOneFrame(root.get());
// Damage position on the surface should be: position of update_rect (1, 2)
@@ -554,7 +554,7 @@
// CASE 1: Setting the update rect should damage the whole surface (for now)
ClearDamageForAllSurfaces(root.get());
- child->SetUpdateRect(gfx::RectF(1.f, 1.f));
+ child->SetUpdateRect(gfx::Rect(1, 1));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
@@ -588,7 +588,7 @@
// the surface, blurred based on the size of the child's background
// blur filter.
ClearDamageForAllSurfaces(root.get());
- root->SetUpdateRect(gfx::RectF(297.f, 297.f, 2.f, 2.f));
+ root->SetUpdateRect(gfx::Rect(297, 297, 2, 2));
EmulateDrawingOneFrame(root.get());
gfx::Rect root_damage_rect =
@@ -609,7 +609,7 @@
// blur filter. Since the damage extends to the right/bottom outside
// of the blurred layer, only the left/top should end up expanded.
ClearDamageForAllSurfaces(root.get());
- root->SetUpdateRect(gfx::RectF(297.f, 297.f, 30.f, 30.f));
+ root->SetUpdateRect(gfx::Rect(297, 297, 30, 30));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
@@ -628,7 +628,7 @@
// CASE 3: Setting this update rect outside the blurred content_bounds of the
// blurred child1 will not cause it to be expanded.
ClearDamageForAllSurfaces(root.get());
- root->SetUpdateRect(gfx::RectF(30.f, 30.f, 2.f, 2.f));
+ root->SetUpdateRect(gfx::Rect(30, 30, 2, 2));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
@@ -643,7 +643,7 @@
// outside the original content_bounds of the blurred child1 will
// cause it to be expanded.
ClearDamageForAllSurfaces(root.get());
- root->SetUpdateRect(gfx::RectF(99.f, 99.f, 1.f, 1.f));
+ root->SetUpdateRect(gfx::Rect(99, 99, 1, 1));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
@@ -662,7 +662,7 @@
// CASE 5: Setting the update rect on child2, which is above child1, will
// not get blurred by child1, so it does not need to get expanded.
ClearDamageForAllSurfaces(root.get());
- child2->SetUpdateRect(gfx::RectF(0.f, 0.f, 1.f, 1.f));
+ child2->SetUpdateRect(gfx::Rect(1, 1));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
@@ -677,7 +677,7 @@
// that any pixels needed for the blur are redrawn in the current
// frame.
ClearDamageForAllSurfaces(root.get());
- child1->SetUpdateRect(gfx::RectF(0.f, 0.f, 1.f, 1.f));
+ child1->SetUpdateRect(gfx::Rect(1, 1));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
@@ -798,8 +798,8 @@
// - child1 update rect in surface space: gfx::Rect(100, 100, 1, 2);
// - child2 update rect in surface space: gfx::Rect(400, 380, 3, 4);
ClearDamageForAllSurfaces(root.get());
- child1->SetUpdateRect(gfx::RectF(0.f, 0.f, 1.f, 2.f));
- child2->SetUpdateRect(gfx::RectF(0.f, 0.f, 3.f, 4.f));
+ child1->SetUpdateRect(gfx::Rect(1, 2));
+ child2->SetUpdateRect(gfx::Rect(3, 4));
EmulateDrawingOneFrame(root.get());
gfx::Rect root_damage_rect =
root->render_surface()->damage_tracker()->current_damage_rect();
@@ -1010,7 +1010,7 @@
// In our specific tree, the update rect of child1 should not cause any
// damage to any surface because it does not actually draw content.
ClearDamageForAllSurfaces(root.get());
- child1->SetUpdateRect(gfx::RectF(0.f, 0.f, 1.f, 2.f));
+ child1->SetUpdateRect(gfx::Rect(1, 2));
EmulateDrawingOneFrame(root.get());
child_damage_rect =
child1->render_surface()->damage_tracker()->current_damage_rect();
@@ -1163,7 +1163,7 @@
// CASE 1: the update_rect on a mask layer should damage the entire target
// surface.
ClearDamageForAllSurfaces(root.get());
- mask_layer->SetUpdateRect(gfx::RectF(1.f, 2.f, 3.f, 4.f));
+ mask_layer->SetUpdateRect(gfx::Rect(1, 2, 3, 4));
EmulateDrawingOneFrame(root.get());
gfx::Rect child_damage_rect =
child->render_surface()->damage_tracker()->current_damage_rect();
@@ -1350,7 +1350,7 @@
// it is included with any other partial damage.
//
ClearDamageForAllSurfaces(root.get());
- child->SetUpdateRect(gfx::RectF(10, 11, 12, 13));
+ child->SetUpdateRect(gfx::Rect(10, 11, 12, 13));
root->render_surface()->damage_tracker()->AddDamageNextUpdate(
gfx::Rect(15, 16, 32, 33));
EmulateDrawingOneFrame(root.get());
@@ -1413,7 +1413,7 @@
// New damage, without having cleared the previous damage, should be unioned
// to the previous one.
- child->SetUpdateRect(gfx::RectF(20.f, 25.f, 1.f, 2.f));
+ child->SetUpdateRect(gfx::Rect(20, 25, 1, 2));
EmulateDrawingOneFrame(root.get());
root_damage_rect =
root->render_surface()->damage_tracker()->current_damage_rect();
diff --git a/cc/trees/layer_sorter.h b/cc/trees/layer_sorter.h
index c5aab7c..7dd980c 100644
--- a/cc/trees/layer_sorter.h
+++ b/cc/trees/layer_sorter.h
@@ -16,19 +16,6 @@
#include "ui/gfx/rect_f.h"
#include "ui/gfx/vector3d_f.h"
-#if defined(COMPILER_GCC)
-namespace cc { struct GraphEdge; }
-
-namespace BASE_HASH_NAMESPACE {
-template <>
-struct hash<cc::GraphEdge*> {
- size_t operator()(cc::GraphEdge* ptr) const {
- return hash<size_t>()(reinterpret_cast<size_t>(ptr));
- }
-};
-} // namespace BASE_HASH_NAMESPACE
-#endif // COMPILER
-
namespace gfx {
class Transform;
}
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 3e5c74c..08fb810 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -67,14 +67,15 @@
scoped_ptr<LayerTreeHost> LayerTreeHost::CreateThreaded(
LayerTreeHostClient* client,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) {
DCHECK(main_task_runner.get());
DCHECK(impl_task_runner.get());
- scoped_ptr<LayerTreeHost> layer_tree_host(
- new LayerTreeHost(client, manager, settings));
+ scoped_ptr<LayerTreeHost> layer_tree_host(new LayerTreeHost(
+ client, shared_bitmap_manager, gpu_memory_buffer_manager, settings));
layer_tree_host->InitializeThreaded(main_task_runner, impl_task_runner);
return layer_tree_host.Pass();
}
@@ -82,18 +83,20 @@
scoped_ptr<LayerTreeHost> LayerTreeHost::CreateSingleThreaded(
LayerTreeHostClient* client,
LayerTreeHostSingleThreadClient* single_thread_client,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) {
- scoped_ptr<LayerTreeHost> layer_tree_host(
- new LayerTreeHost(client, manager, settings));
+ scoped_ptr<LayerTreeHost> layer_tree_host(new LayerTreeHost(
+ client, shared_bitmap_manager, gpu_memory_buffer_manager, settings));
layer_tree_host->InitializeSingleThreaded(single_thread_client,
main_task_runner);
return layer_tree_host.Pass();
}
LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
const LayerTreeSettings& settings)
: micro_benchmark_controller_(this),
next_ui_resource_id_(1),
@@ -123,7 +126,8 @@
total_frames_used_for_lcd_text_metrics_(0),
id_(s_layer_tree_host_sequence_number.GetNext() + 1),
next_commit_forces_redraw_(false),
- shared_bitmap_manager_(manager) {
+ shared_bitmap_manager_(shared_bitmap_manager),
+ gpu_memory_buffer_manager_(gpu_memory_buffer_manager) {
if (settings_.accelerated_animation_enabled)
animation_registrar_ = AnimationRegistrar::Create();
rendering_stats_instrumentation_->set_record_rendering_stats(
@@ -430,9 +434,11 @@
proxy_.get(),
rendering_stats_instrumentation_.get(),
shared_bitmap_manager_,
+ gpu_memory_buffer_manager_,
id_);
host_impl->SetUseGpuRasterization(UseGpuRasterization());
shared_bitmap_manager_ = NULL;
+ gpu_memory_buffer_manager_ = NULL;
if (settings_.calculate_top_controls_position &&
host_impl->top_controls_manager()) {
top_controls_manager_weak_ptr_ =
@@ -723,7 +729,7 @@
SetLayerTreeHostClientReady();
if (output_surface_lost_) {
- RequestNewOutputSurface();
+ proxy->RequestNewOutputSurface();
// RequestNewOutputSurface could have synchronously created an output
// surface, so check again before returning.
if (output_surface_lost_)
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index a4af339..aede050 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -42,8 +42,8 @@
#include "ui/gfx/rect.h"
namespace cc {
-
class AnimationRegistrar;
+class GpuMemoryBufferManager;
class HeadsUpDisplayLayer;
class Layer;
class LayerTreeHostImpl;
@@ -84,7 +84,8 @@
// The SharedBitmapManager will be used on the compositor thread.
static scoped_ptr<LayerTreeHost> CreateThreaded(
LayerTreeHostClient* client,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
@@ -92,7 +93,8 @@
static scoped_ptr<LayerTreeHost> CreateSingleThreaded(
LayerTreeHostClient* client,
LayerTreeHostSingleThreadClient* single_thread_client,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner);
virtual ~LayerTreeHost();
@@ -300,9 +302,12 @@
void BreakSwapPromises(SwapPromise::DidNotSwapReason reason);
+ size_t num_queued_swap_promises() const { return swap_promise_list_.size(); }
+
protected:
LayerTreeHost(LayerTreeHostClient* client,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
const LayerTreeSettings& settings);
void InitializeThreaded(
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
@@ -451,6 +456,7 @@
LayerSelectionBound selection_end_;
SharedBitmapManager* shared_bitmap_manager_;
+ GpuMemoryBufferManager* gpu_memory_buffer_manager_;
ScopedPtrVector<SwapPromise> swap_promise_list_;
std::set<SwapPromiseMonitor*> swap_promise_monitor_;
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 3bd1e79..c7381b3 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -21,7 +21,9 @@
namespace cc {
-ScrollAndScaleSet::ScrollAndScaleSet() {}
+ScrollAndScaleSet::ScrollAndScaleSet()
+ : page_scale_delta(1.f), top_controls_delta(0.f) {
+}
ScrollAndScaleSet::~ScrollAndScaleSet() {}
@@ -1094,7 +1096,7 @@
}
float layer_maximum_animated_scale = 0.f;
- if (!layer->layer_animation_controller()->MaximumScale(
+ if (!layer->layer_animation_controller()->MaximumTargetScale(
&layer_maximum_animated_scale)) {
*combined_maximum_animation_contents_scale = 0.f;
return;
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 9efcaea..17dd4a8 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -23,6 +23,8 @@
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_impl.h"
+#include "cc/test/fake_picture_layer.h"
+#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_tree_host_common_test.h"
#include "cc/trees/layer_tree_impl.h"
@@ -60,6 +62,14 @@
virtual bool FillsBoundsCompletely() const override { return false; }
};
+scoped_refptr<FakePictureLayer> CreateDrawablePictureLayer(
+ ContentLayerClient* delegate) {
+ scoped_refptr<FakePictureLayer> to_return =
+ FakePictureLayer::Create(delegate);
+ to_return->SetIsDrawable(true);
+ return to_return;
+}
+
scoped_refptr<ContentLayer> CreateDrawableContentLayer(
ContentLayerClient* delegate) {
scoped_refptr<ContentLayer> to_return = ContentLayer::Create(delegate);
@@ -73,6 +83,11 @@
EXPECT_FLOAT_EQ(expected, layer->contents_scale_y()); \
} while (false)
+#define EXPECT_IDEAL_SCALE_EQ(expected, layer) \
+ do { \
+ EXPECT_FLOAT_EQ(expected, layer->draw_properties().ideal_contents_scale); \
+ } while (false)
+
TEST_F(LayerTreeHostCommonTest, TransformsForNoOpLayer) {
// Sanity check: For layers positioned at zero, with zero size,
// and with identity transforms, then the draw transform,
@@ -3261,13 +3276,13 @@
MockContentLayerClient client;
scoped_refptr<Layer> root = Layer::Create();
- scoped_refptr<ContentLayer> render_surface1 =
- CreateDrawableContentLayer(&client);
- scoped_refptr<ContentLayer> render_surface2 =
- CreateDrawableContentLayer(&client);
- scoped_refptr<ContentLayer> child1 = CreateDrawableContentLayer(&client);
- scoped_refptr<ContentLayer> child2 = CreateDrawableContentLayer(&client);
- scoped_refptr<ContentLayer> child3 = CreateDrawableContentLayer(&client);
+ scoped_refptr<FakePictureLayer> render_surface1 =
+ CreateDrawablePictureLayer(&client);
+ scoped_refptr<FakePictureLayer> render_surface2 =
+ CreateDrawablePictureLayer(&client);
+ scoped_refptr<FakePictureLayer> child1 = CreateDrawablePictureLayer(&client);
+ scoped_refptr<FakePictureLayer> child2 = CreateDrawablePictureLayer(&client);
+ scoped_refptr<FakePictureLayer> child3 = CreateDrawablePictureLayer(&client);
root->AddChild(render_surface1);
render_surface1->AddChild(render_surface2);
render_surface2->AddChild(child1);
@@ -3353,15 +3368,15 @@
// The root layer does not actually draw content of its own.
EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect());
- // All layer visible content rects are expressed in content space of each
- // layer, so they are also scaled by the device_scale_factor.
- EXPECT_RECT_EQ(gfx::Rect(0, 0, 6, 8),
+ // All layer visible content rects are not expressed in content space of each
+ // layer, so they are not scaled by the device_scale_factor.
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 3, 4),
render_surface1->visible_content_rect());
- EXPECT_RECT_EQ(gfx::Rect(0, 0, 14, 26),
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 7, 13),
render_surface2->visible_content_rect());
- EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), child1->visible_content_rect());
- EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), child2->visible_content_rect());
- EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), child3->visible_content_rect());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visible_content_rect());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visible_content_rect());
}
TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithoutPreserves3d) {
@@ -4045,7 +4060,8 @@
MockContentLayerClient delegate;
gfx::Transform identity_matrix;
- scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> parent =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
gfx::Point3F(),
@@ -4054,7 +4070,7 @@
false,
true);
- scoped_refptr<ContentLayer> child = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> child = CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
gfx::Point3F(),
@@ -4063,8 +4079,8 @@
false,
true);
- scoped_refptr<ContentLayer> child_empty =
- CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> child_empty =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(child_empty.get(),
identity_matrix,
gfx::Point3F(),
@@ -4073,19 +4089,8 @@
false,
true);
- scoped_refptr<NoScaleContentLayer> child_no_scale =
- CreateNoScaleDrawableContentLayer(&delegate);
- SetLayerPropertiesForTesting(child_no_scale.get(),
- identity_matrix,
- gfx::Point3F(),
- gfx::PointF(2.f, 2.f),
- gfx::Size(10, 10),
- false,
- true);
-
parent->AddChild(child);
parent->AddChild(child_empty);
- parent->AddChild(child_no_scale);
scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost());
host->SetRootLayer(parent);
@@ -4101,16 +4106,16 @@
inputs.can_adjust_raster_scales = true;
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor, parent);
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor, child);
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor,
- child_empty);
- EXPECT_CONTENTS_SCALE_EQ(1, child_no_scale);
+ EXPECT_IDEAL_SCALE_EQ(device_scale_factor * page_scale_factor, parent);
+ EXPECT_IDEAL_SCALE_EQ(device_scale_factor * page_scale_factor, child);
+ EXPECT_IDEAL_SCALE_EQ(device_scale_factor * page_scale_factor, child_empty);
EXPECT_EQ(1u, render_surface_layer_list.size());
// Verify parent transforms
gfx::Transform expected_parent_transform;
+ expected_parent_transform.Scale(device_scale_factor * page_scale_factor,
+ device_scale_factor * page_scale_factor);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_parent_transform,
parent->screen_space_transform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_parent_transform,
@@ -4131,9 +4136,9 @@
// Verify child and child_empty transforms. They should match.
gfx::Transform expected_child_transform;
- expected_child_transform.Translate(
- device_scale_factor * child->position().x(),
- device_scale_factor * child->position().y());
+ expected_child_transform.Scale(device_scale_factor, device_scale_factor);
+ expected_child_transform.Translate(child->position().x(),
+ child->position().y());
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_child_transform,
child->draw_transform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_child_transform,
@@ -4163,17 +4168,6 @@
EXPECT_FLOAT_RECT_EQ(expected_child_draw_rect, child_screen_space_rect);
EXPECT_FLOAT_RECT_EQ(expected_child_draw_rect, child_empty_draw_rect);
EXPECT_FLOAT_RECT_EQ(expected_child_draw_rect, child_empty_screen_space_rect);
-
- // Verify child_no_scale transforms
- gfx::Transform expected_child_no_scale_transform = child->draw_transform();
- // All transforms operate on content rects. The child's content rect
- // incorporates device scale, but the child_no_scale does not; add it here.
- expected_child_no_scale_transform.Scale(device_scale_factor,
- device_scale_factor);
- EXPECT_TRANSFORMATION_MATRIX_EQ(expected_child_no_scale_transform,
- child_no_scale->draw_transform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expected_child_no_scale_transform,
- child_no_scale->screen_space_transform());
}
TEST_F(LayerTreeHostCommonTest, SurfaceLayerTransformsInHighDPI) {
@@ -4189,7 +4183,8 @@
scoped_refptr<Layer> root = Layer::Create();
- scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> parent =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
gfx::Point3F(),
@@ -4198,8 +4193,8 @@
false,
true);
- scoped_refptr<ContentLayer> perspective_surface =
- CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> perspective_surface =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(perspective_surface.get(),
perspective_matrix * scale_small_matrix,
gfx::Point3F(),
@@ -4208,8 +4203,8 @@
false,
true);
- scoped_refptr<ContentLayer> scale_surface =
- CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> scale_surface =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(scale_surface.get(),
scale_small_matrix,
gfx::Point3F(),
@@ -4240,32 +4235,37 @@
inputs.can_adjust_raster_scales = true;
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor, parent);
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor,
- perspective_surface);
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor,
- scale_surface);
+ EXPECT_IDEAL_SCALE_EQ(device_scale_factor * page_scale_factor, parent);
+ EXPECT_IDEAL_SCALE_EQ(device_scale_factor * page_scale_factor,
+ perspective_surface);
+ // Ideal scale is the max 2d scale component of the combined transform up to
+ // the nearest render target. Here this includes the layer transform as well
+ // as the device and page scale factors.
+ gfx::Transform transform = scale_small_matrix;
+ transform.Scale(device_scale_factor * page_scale_factor,
+ device_scale_factor * page_scale_factor);
+ gfx::Vector2dF scales =
+ MathUtil::ComputeTransform2dScaleComponents(transform, 0.f);
+ float max_2d_scale = std::max(scales.x(), scales.y());
+ EXPECT_IDEAL_SCALE_EQ(max_2d_scale, scale_surface);
+
+ // The ideal scale will draw 1:1 with its render target space along
+ // the larger-scale axis.
+ gfx::Vector2dF target_space_transform_scales =
+ MathUtil::ComputeTransform2dScaleComponents(
+ scale_surface->draw_properties().target_space_transform, 0.f);
+ EXPECT_FLOAT_EQ(max_2d_scale,
+ std::max(target_space_transform_scales.x(),
+ target_space_transform_scales.y()));
EXPECT_EQ(3u, render_surface_layer_list.size());
gfx::Transform expected_parent_draw_transform;
+ expected_parent_draw_transform.Scale(device_scale_factor * page_scale_factor,
+ device_scale_factor * page_scale_factor);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_parent_draw_transform,
parent->draw_transform());
- // The scaled surface is rendered at its appropriate scale, and drawn 1:1
- // into its target.
- gfx::Transform expected_scale_surface_draw_transform;
- expected_scale_surface_draw_transform.Translate(
- device_scale_factor * page_scale_factor * scale_surface->position().x(),
- device_scale_factor * page_scale_factor * scale_surface->position().y());
- EXPECT_TRANSFORMATION_MATRIX_EQ(
- expected_scale_surface_draw_transform,
- scale_surface->render_surface()->draw_transform());
- gfx::Transform expected_scale_surface_layer_draw_transform =
- scale_small_matrix;
- EXPECT_TRANSFORMATION_MATRIX_EQ(expected_scale_surface_layer_draw_transform,
- scale_surface->draw_transform());
-
// The scale for the perspective surface is not known, so it is rendered 1:1
// with the screen, and then scaled during drawing.
gfx::Transform expected_perspective_surface_draw_transform;
@@ -4279,6 +4279,9 @@
expected_perspective_surface_draw_transform.PreconcatTransform(
scale_small_matrix);
gfx::Transform expected_perspective_surface_layer_draw_transform;
+ expected_perspective_surface_layer_draw_transform.Scale(
+ device_scale_factor * page_scale_factor,
+ device_scale_factor * page_scale_factor);
EXPECT_TRANSFORMATION_MATRIX_EQ(
expected_perspective_surface_draw_transform,
perspective_surface->render_surface()->draw_transform());
@@ -4287,6 +4290,7 @@
perspective_surface->draw_transform());
}
+// TODO(sohanjg): Remove this test when ContentLayer is removed.
TEST_F(LayerTreeHostCommonTest,
LayerTransformsInHighDPIAccurateScaleZeroChildPosition) {
// Verify draw and screen space transforms of layers not in a surface.
@@ -4402,6 +4406,7 @@
child_no_scale->screen_space_transform());
}
+// TODO(sohanjg): Remove this test when ContentLayer is removed.
TEST_F(LayerTreeHostCommonTest, ContentsScale) {
MockContentLayerClient delegate;
gfx::Transform identity_matrix;
@@ -4585,8 +4590,9 @@
}
}
+// TODO(sohanjg): Remove this test when ContentLayer is removed.
TEST_F(LayerTreeHostCommonTest,
- ContentsScale_LayerTransformsDontAffectContentsScale) {
+ ContentsScale_LayerTransformsDontAffectContentsScale) {
MockContentLayerClient delegate;
gfx::Transform identity_matrix;
@@ -4690,7 +4696,7 @@
child_no_scale->draw_transform().matrix().get(1, 1));
}
-TEST_F(LayerTreeHostCommonTest, SmallContentsScale) {
+TEST_F(LayerTreeHostCommonTest, SmallIdealScale) {
MockContentLayerClient delegate;
gfx::Transform identity_matrix;
@@ -4705,7 +4711,8 @@
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
- scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> parent =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
parent_scale_matrix,
gfx::Point3F(),
@@ -4714,8 +4721,8 @@
false,
true);
- scoped_refptr<ContentLayer> child_scale =
- CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> child_scale =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(child_scale.get(),
child_scale_matrix,
gfx::Point3F(),
@@ -4744,38 +4751,16 @@
inputs.can_adjust_raster_scales = true;
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor *
- initial_parent_scale,
- parent);
- // The child's scale is < 1, so we should not save and use that scale
- // factor.
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor * 1,
- child_scale);
- }
+ // The ideal scale is able to go below 1.
+ float expected_ideal_scale =
+ device_scale_factor * page_scale_factor * initial_parent_scale;
+ EXPECT_LT(expected_ideal_scale, 1.f);
+ EXPECT_IDEAL_SCALE_EQ(expected_ideal_scale, parent);
- // When chilld's total scale becomes >= 1, we should save and use that scale
- // factor.
- child_scale_matrix.MakeIdentity();
- SkMScalar final_child_scale = 0.75;
- child_scale_matrix.Scale(final_child_scale, final_child_scale);
- child_scale->SetTransform(child_scale_matrix);
-
- {
- RenderSurfaceLayerList render_surface_layer_list;
- LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs(
- root.get(), root->bounds(), &render_surface_layer_list);
- inputs.device_scale_factor = device_scale_factor;
- inputs.page_scale_factor = page_scale_factor;
- inputs.page_scale_application_layer = root.get();
- inputs.can_adjust_raster_scales = true;
- LayerTreeHostCommon::CalculateDrawProperties(&inputs);
-
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor *
- initial_parent_scale,
- parent);
- EXPECT_CONTENTS_SCALE_EQ(device_scale_factor * page_scale_factor *
- initial_parent_scale * final_child_scale,
- child_scale);
+ expected_ideal_scale = device_scale_factor * page_scale_factor *
+ initial_parent_scale * initial_child_scale;
+ EXPECT_LT(expected_ideal_scale, 1.f);
+ EXPECT_IDEAL_SCALE_EQ(expected_ideal_scale, child_scale);
}
}
@@ -4979,8 +4964,9 @@
surface_no_scale_child_no_scale->draw_transform().matrix().get(1, 1));
}
+// TODO(sohanjg): Remove this test when ContentLayer is removed.
TEST_F(LayerTreeHostCommonTest,
- ContentsScaleForSurfaces_LayerTransformsDontAffectContentsScale) {
+ ContentsScaleForSurfaces_LayerTransformsDontAffectContentsScale) {
MockContentLayerClient delegate;
gfx::Transform identity_matrix;
@@ -5182,7 +5168,7 @@
surface_no_scale_child_no_scale->draw_transform().matrix().get(1, 1));
}
-TEST_F(LayerTreeHostCommonTest, ContentsScaleForAnimatingLayer) {
+TEST_F(LayerTreeHostCommonTest, IdealScaleForAnimatingLayer) {
MockContentLayerClient delegate;
gfx::Transform identity_matrix;
@@ -5197,7 +5183,8 @@
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
- scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> parent =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
parent_scale_matrix,
gfx::Point3F(),
@@ -5206,8 +5193,8 @@
false,
true);
- scoped_refptr<ContentLayer> child_scale =
- CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> child_scale =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(child_scale.get(),
child_scale_matrix,
gfx::Point3F(),
@@ -5223,10 +5210,6 @@
scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost());
host->SetRootLayer(root);
- // Now put an animating transform on child.
- int animation_id = AddAnimatedTransformToController(
- child_scale->layer_animation_controller(), 10.0, 30, 0);
-
{
RenderSurfaceLayerList render_surface_layer_list;
LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs(
@@ -5234,30 +5217,15 @@
inputs.can_adjust_raster_scales = true;
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
- EXPECT_CONTENTS_SCALE_EQ(initial_parent_scale, parent);
- // The layers with animating transforms should not compute a contents scale
- // other than 1 until they finish animating.
- EXPECT_CONTENTS_SCALE_EQ(1, child_scale);
- }
-
- // Remove the animation, now it can save a raster scale.
- child_scale->layer_animation_controller()->RemoveAnimation(animation_id);
-
- {
- RenderSurfaceLayerList render_surface_layer_list;
- LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs(
- root.get(), root->bounds(), &render_surface_layer_list);
- inputs.can_adjust_raster_scales = true;
- LayerTreeHostCommon::CalculateDrawProperties(&inputs);
-
- EXPECT_CONTENTS_SCALE_EQ(initial_parent_scale, parent);
- // The layers with animating transforms should not compute a contents scale
- // other than 1 until they finish animating.
- EXPECT_CONTENTS_SCALE_EQ(initial_parent_scale * initial_child_scale,
- child_scale);
+ EXPECT_IDEAL_SCALE_EQ(initial_parent_scale, parent);
+ // Animating layers compute ideal scale in the same way as when
+ // they are static.
+ EXPECT_IDEAL_SCALE_EQ(initial_child_scale * initial_parent_scale,
+ child_scale);
}
}
+// TODO(sohanjg): Remove this test when ContentLayer is removed.
TEST_F(LayerTreeHostCommonTest,
ChangeInContentBoundsOrScaleTriggersPushProperties) {
MockContentLayerClient delegate;
@@ -5314,7 +5282,8 @@
MockContentLayerClient delegate;
gfx::Transform identity_matrix;
- scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> parent =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
gfx::Point3F(),
@@ -5323,7 +5292,7 @@
false,
true);
- scoped_refptr<ContentLayer> child = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> child = CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
gfx::Point3F(),
@@ -5334,7 +5303,8 @@
gfx::Transform replica_transform;
replica_transform.Scale(1.0, -1.0);
- scoped_refptr<ContentLayer> replica = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> replica =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(replica.get(),
replica_transform,
gfx::Point3F(),
@@ -5345,8 +5315,8 @@
// This layer should end up in the same surface as child, with the same draw
// and screen space transforms.
- scoped_refptr<ContentLayer> duplicate_child_non_owner =
- CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> duplicate_child_non_owner =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(duplicate_child_non_owner.get(),
identity_matrix,
gfx::Point3F(),
@@ -5376,19 +5346,22 @@
EXPECT_EQ(2u, render_surface_layer_list.size());
gfx::Transform expected_parent_transform;
+ expected_parent_transform.Scale(device_scale_factor, device_scale_factor);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_parent_transform,
parent->screen_space_transform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_parent_transform,
parent->draw_transform());
gfx::Transform expected_draw_transform;
+ expected_draw_transform.Scale(device_scale_factor, device_scale_factor);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_draw_transform,
child->draw_transform());
gfx::Transform expected_screen_space_transform;
- expected_screen_space_transform.Translate(
- device_scale_factor * child->position().x(),
- device_scale_factor * child->position().y());
+ expected_screen_space_transform.Scale(device_scale_factor,
+ device_scale_factor);
+ expected_screen_space_transform.Translate(child->position().x(),
+ child->position().y());
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_screen_space_transform,
child->screen_space_transform());
@@ -5449,7 +5422,8 @@
MockContentLayerClient delegate;
gfx::Transform identity_matrix;
- scoped_refptr<ContentLayer> parent = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> parent =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(parent.get(),
identity_matrix,
gfx::Point3F(),
@@ -5458,7 +5432,7 @@
false,
true);
- scoped_refptr<ContentLayer> child = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> child = CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(child.get(),
identity_matrix,
gfx::Point3F(),
@@ -5469,7 +5443,8 @@
gfx::Transform replica_transform;
replica_transform.Scale(1.0, -1.0);
- scoped_refptr<ContentLayer> replica = CreateDrawableContentLayer(&delegate);
+ scoped_refptr<FakePictureLayer> replica =
+ CreateDrawablePictureLayer(&delegate);
SetLayerPropertiesForTesting(replica.get(),
replica_transform,
gfx::Point3F(),
@@ -5478,20 +5453,7 @@
false,
true);
- // This layer should end up in the same surface as child, with the same draw
- // and screen space transforms.
- scoped_refptr<ContentLayer> duplicate_child_non_owner =
- CreateDrawableContentLayer(&delegate);
- SetLayerPropertiesForTesting(duplicate_child_non_owner.get(),
- identity_matrix,
- gfx::Point3F(),
- gfx::PointF(),
- gfx::Size(13, 11),
- false,
- true);
-
parent->AddChild(child);
- child->AddChild(duplicate_child_non_owner);
child->SetReplicaLayer(replica.get());
scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost());
@@ -5511,22 +5473,6 @@
EXPECT_EQ(2u, render_surface_layer_list.size());
gfx::Transform identity_transform;
-
- EXPECT_TRANSFORMATION_MATRIX_EQ(identity_transform,
- parent->screen_space_transform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(identity_transform, parent->draw_transform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(identity_transform, child->draw_transform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(identity_transform,
- child->screen_space_transform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(identity_transform,
- duplicate_child_non_owner->draw_transform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(
- identity_transform, duplicate_child_non_owner->screen_space_transform());
- EXPECT_RECT_EQ(child->drawable_content_rect(),
- duplicate_child_non_owner->drawable_content_rect());
- EXPECT_EQ(child->content_bounds(),
- duplicate_child_non_owner->content_bounds());
-
EXPECT_TRANSFORMATION_MATRIX_EQ(identity_transform,
child->render_surface()->draw_transform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identity_transform,
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 4d2f5a7..c5b9566 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -78,6 +78,42 @@
namespace cc {
namespace {
+// Small helper class that saves the current viewport location as the user sees
+// it and resets to the same location.
+class ViewportAnchor {
+ public:
+ ViewportAnchor(LayerImpl* inner_scroll, LayerImpl* outer_scroll)
+ : inner_(inner_scroll),
+ outer_(outer_scroll) {
+ viewport_in_content_coordinates_ = inner_->TotalScrollOffset();
+
+ if (outer_)
+ viewport_in_content_coordinates_ += outer_->TotalScrollOffset();
+ }
+
+ void ResetViewportToAnchoredPosition() {
+ DCHECK(outer_);
+
+ inner_->ClampScrollToMaxScrollOffset();
+ outer_->ClampScrollToMaxScrollOffset();
+
+ gfx::ScrollOffset viewport_location = inner_->TotalScrollOffset() +
+ outer_->TotalScrollOffset();
+
+ gfx::Vector2dF delta =
+ viewport_in_content_coordinates_.DeltaFrom(viewport_location);
+
+ delta = outer_->ScrollBy(delta);
+ inner_->ScrollBy(delta);
+ }
+
+ private:
+ LayerImpl* inner_;
+ LayerImpl* outer_;
+ gfx::ScrollOffset viewport_in_content_coordinates_;
+};
+
+
void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) {
if (visible) {
TRACE_EVENT_ASYNC_BEGIN1("webkit",
@@ -212,10 +248,16 @@
LayerTreeHostImplClient* client,
Proxy* proxy,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
int id) {
- return make_scoped_ptr(new LayerTreeHostImpl(
- settings, client, proxy, rendering_stats_instrumentation, manager, id));
+ return make_scoped_ptr(new LayerTreeHostImpl(settings,
+ client,
+ proxy,
+ rendering_stats_instrumentation,
+ shared_bitmap_manager,
+ gpu_memory_buffer_manager,
+ id));
}
LayerTreeHostImpl::LayerTreeHostImpl(
@@ -223,7 +265,8 @@
LayerTreeHostImplClient* client,
Proxy* proxy,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
int id)
: BeginFrameSourceMixIn(),
client_(client),
@@ -262,8 +305,10 @@
rendering_stats_instrumentation_(rendering_stats_instrumentation),
micro_benchmark_controller_(this),
need_to_update_visible_tiles_before_draw_(false),
- shared_bitmap_manager_(manager),
- id_(id) {
+ shared_bitmap_manager_(shared_bitmap_manager),
+ gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
+ id_(id),
+ requires_high_res_to_draw_(false) {
DCHECK(proxy_->IsImplThread());
DidVisibilityChange(this, visible_);
animation_registrar_->set_supports_scroll_animations(
@@ -336,10 +381,6 @@
void LayerTreeHostImpl::CommitComplete() {
TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete");
- // Ask to be animated if there are animations
- if (needs_animate_layers())
- SetNeedsAnimate();
-
if (pending_tree_)
pending_tree_->ApplyScrollDeltasSinceBeginMainFrame();
sync_tree()->set_needs_update_draw_properties();
@@ -856,7 +897,7 @@
if (append_quads_data.num_incomplete_tiles ||
append_quads_data.num_missing_tiles) {
frame->contains_incomplete_tile = true;
- if (active_tree()->RequiresHighResToDraw())
+ if (RequiresHighResToDraw())
draw_result = DRAW_ABORTED_MISSING_HIGH_RES_CONTENT;
}
@@ -1611,7 +1652,7 @@
// We have released tilings for both active and pending tree.
// We would not have any content to draw until the pending tree is activated.
// Prevent the active tree from drawing until activation.
- active_tree_->SetRequiresHighResToDraw();
+ SetRequiresHighResToDraw();
}
const RendererCapabilitiesImpl&
@@ -1620,7 +1661,7 @@
}
bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
- active_tree()->ResetRequiresHighResToDraw();
+ ResetRequiresHighResToDraw();
if (frame.has_no_damage) {
active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS);
return false;
@@ -1653,16 +1694,41 @@
begin_impl_frame_interval_ = args.interval;
}
-void LayerTreeHostImpl::UpdateInnerViewportContainerSize() {
- LayerImpl* container_layer = active_tree_->InnerViewportContainerLayer();
- if (!container_layer)
+void LayerTreeHostImpl::UpdateViewportContainerSizes() {
+ LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer();
+ LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer();
+
+ if (!inner_container || !top_controls_manager_)
return;
- if (top_controls_manager_) {
- container_layer->SetBoundsDelta(
- gfx::Vector2dF(0, active_tree_->top_controls_layout_height() -
- active_tree_->total_top_controls_content_offset()));
- }
+ ViewportAnchor anchor(InnerViewportScrollLayer(),
+ OuterViewportScrollLayer());
+
+ // Adjust the inner viewport by shrinking/expanding the container to account
+ // for the change in top controls height since the last Resize from Blink.
+ inner_container->SetBoundsDelta(
+ gfx::Vector2dF(0, active_tree_->top_controls_layout_height() -
+ active_tree_->total_top_controls_content_offset()));
+
+ if (!outer_container || outer_container->BoundsForScrolling().IsEmpty())
+ return;
+
+ // Adjust the outer viewport container as well, since adjusting only the
+ // inner may cause its bounds to exceed those of the outer, causing scroll
+ // clamping. We adjust it so it maintains the same aspect ratio as the
+ // inner viewport.
+ float aspect_ratio = inner_container->BoundsForScrolling().width() /
+ inner_container->BoundsForScrolling().height();
+ float target_height = outer_container->BoundsForScrolling().width() /
+ aspect_ratio;
+ float current_outer_height = outer_container->BoundsForScrolling().height() -
+ outer_container->bounds_delta().y();
+ gfx::Vector2dF delta(0, target_height - current_outer_height);
+
+ outer_container->SetBoundsDelta(delta);
+ active_tree_->InnerViewportScrollLayer()->SetBoundsDelta(delta);
+
+ anchor.ResetViewportToAnchoredPosition();
}
void LayerTreeHostImpl::SetTopControlsLayoutHeight(float height) {
@@ -1670,7 +1736,7 @@
return;
active_tree_->set_top_controls_layout_height(height);
- UpdateInnerViewportContainerSize();
+ UpdateViewportContainerSizes();
SetFullRootLayerDamage();
}
@@ -1791,7 +1857,7 @@
top_controls_manager_->top_controls_height());
}
- UpdateInnerViewportContainerSize();
+ UpdateViewportContainerSizes();
} else {
active_tree_->ProcessUIResourceRequestQueue();
}
@@ -1817,8 +1883,10 @@
if (time_source_client_adapter_ && time_source_client_adapter_->Active())
DCHECK(active_tree_->root_layer());
- page_scale_animation_ = active_tree_->TakePageScaleAnimation();
- if (page_scale_animation_) {
+ scoped_ptr<PageScaleAnimation> page_scale_animation =
+ active_tree_->TakePageScaleAnimation();
+ if (page_scale_animation) {
+ page_scale_animation_ = page_scale_animation.Pass();
SetNeedsAnimate();
client_->SetNeedsCommitOnImplThread();
client_->RenewTreePriority();
@@ -1837,7 +1905,7 @@
// If we just became visible, we have to ensure that we draw high res tiles,
// to prevent checkerboard/low res flashes.
if (visible_)
- active_tree()->SetRequiresHighResToDraw();
+ SetRequiresHighResToDraw();
else
EvictAllUIResources();
@@ -1936,7 +2004,10 @@
DCHECK(settings_.impl_side_painting);
DCHECK(output_surface_);
DCHECK(resource_provider_);
- DCHECK(proxy_->ImplThreadTaskRunner());
+ base::SingleThreadTaskRunner* task_runner =
+ proxy_->HasImplThread() ? proxy_->ImplThreadTaskRunner()
+ : proxy_->MainThreadTaskRunner();
+ DCHECK(task_runner);
ContextProvider* context_provider = output_surface_->context_provider();
if (!context_provider) {
@@ -1955,10 +2026,8 @@
GL_TEXTURE_2D,
resource_provider_->best_texture_format());
- raster_worker_pool_ =
- GpuRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(),
- context_provider,
- resource_provider_.get());
+ raster_worker_pool_ = GpuRasterWorkerPool::Create(
+ task_runner, context_provider, resource_provider_.get());
} else if (UseZeroCopyRasterizer()) {
resource_pool_ = ResourcePool::Create(
resource_provider_.get(),
@@ -1981,7 +2050,7 @@
resource_provider_->best_texture_format());
raster_worker_pool_ =
- OneCopyRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(),
+ OneCopyRasterWorkerPool::Create(task_runner,
RasterWorkerPool::GetTaskGraphRunner(),
context_provider,
resource_provider_.get(),
@@ -1993,7 +2062,7 @@
resource_provider_->memory_efficient_texture_format());
raster_worker_pool_ = PixelBufferRasterWorkerPool::Create(
- proxy_->ImplThreadTaskRunner(),
+ task_runner,
RasterWorkerPool::GetTaskGraphRunner(),
context_provider,
resource_provider_.get(),
@@ -2001,12 +2070,11 @@
settings_.refresh_rate));
}
- tile_manager_ =
- TileManager::Create(this,
- proxy_->ImplThreadTaskRunner(),
- resource_pool_.get(),
- raster_worker_pool_->AsRasterizer(),
- rendering_stats_instrumentation_);
+ tile_manager_ = TileManager::Create(this,
+ task_runner,
+ resource_pool_.get(),
+ raster_worker_pool_->AsRasterizer(),
+ rendering_stats_instrumentation_);
UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy());
need_to_update_visible_tiles_before_draw_ = false;
@@ -2061,6 +2129,7 @@
resource_provider_ =
ResourceProvider::Create(output_surface_.get(),
shared_bitmap_manager_,
+ gpu_memory_buffer_manager_,
proxy_->blocking_main_thread_task_runner(),
settings_.highp_threshold_min,
settings_.use_rgba_4444_textures,
@@ -2098,7 +2167,7 @@
// There will not be anything to draw here, so set high res
// to avoid checkerboards, typically when we are recovering
// from lost context.
- active_tree_->SetRequiresHighResToDraw();
+ SetRequiresHighResToDraw();
return true;
}
@@ -2154,7 +2223,7 @@
device_viewport_size_ = device_viewport_size;
- UpdateInnerViewportContainerSize();
+ UpdateViewportContainerSizes();
client_->OnCanDrawStateChanged(CanDraw());
SetFullRootLayerDamage();
active_tree_->set_needs_update_draw_properties();
@@ -2205,7 +2274,7 @@
}
void LayerTreeHostImpl::DidChangeTopControlsPosition() {
- UpdateInnerViewportContainerSize();
+ UpdateViewportContainerSizes();
SetNeedsRedraw();
SetNeedsAnimate();
active_tree_->set_needs_update_draw_properties();
@@ -2501,6 +2570,31 @@
return layer_impl->ScrollDelta() - previous_delta;
}
+bool LayerTreeHostImpl::ShouldTopControlsConsumeScroll(
+ const gfx::Vector2dF& scroll_delta) const {
+ DCHECK(CurrentlyScrollingLayer());
+
+ if (!top_controls_manager_)
+ return false;
+
+ // Always consume if it's in the direction to show the top controls.
+ if (scroll_delta.y() < 0)
+ return true;
+
+ if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() &&
+ CurrentlyScrollingLayer() != OuterViewportScrollLayer())
+ return false;
+
+ if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0)
+ return true;
+
+ if (OuterViewportScrollLayer() &&
+ OuterViewportScrollLayer()->MaxScrollOffset().y() > 0)
+ return true;
+
+ return false;
+}
+
bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point,
const gfx::Vector2dF& scroll_delta) {
TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy");
@@ -2512,14 +2606,8 @@
bool did_scroll_x = false;
bool did_scroll_y = false;
bool did_scroll_top_controls = false;
- // TODO(wjmaclean) Should we guard against CurrentlyScrollingLayer() == 0
- // here?
- bool consume_by_top_controls =
- top_controls_manager_ &&
- (((CurrentlyScrollingLayer() == InnerViewportScrollLayer() ||
- CurrentlyScrollingLayer() == OuterViewportScrollLayer()) &&
- InnerViewportScrollLayer()->MaxScrollOffset().y() > 0) ||
- scroll_delta.y() < 0);
+
+ bool consume_by_top_controls = ShouldTopControlsConsumeScroll(scroll_delta);
for (LayerImpl* layer_impl = CurrentlyScrollingLayer();
layer_impl;
@@ -2527,23 +2615,20 @@
if (!layer_impl->scrollable())
continue;
- if (layer_impl == InnerViewportScrollLayer()) {
- // Only allow bubble scrolling when the scroll is in the direction to make
- // the top controls visible.
- gfx::Vector2dF applied_delta;
- gfx::Vector2dF excess_delta;
+ if (layer_impl == InnerViewportScrollLayer() ||
+ layer_impl == OuterViewportScrollLayer()) {
if (consume_by_top_controls) {
- excess_delta = top_controls_manager_->ScrollBy(pending_delta);
- applied_delta = pending_delta - excess_delta;
+ gfx::Vector2dF excess_delta =
+ top_controls_manager_->ScrollBy(pending_delta);
+ gfx::Vector2dF applied_delta = pending_delta - excess_delta;
pending_delta = excess_delta;
// Force updating of vertical adjust values if needed.
- if (applied_delta.y() != 0) {
+ if (applied_delta.y() != 0)
did_scroll_top_controls = true;
- layer_impl->ScrollbarParametersDidChange(false);
- }
}
// Track root layer deltas for reporting overscroll.
- unused_root_delta = pending_delta;
+ if (layer_impl == InnerViewportScrollLayer())
+ unused_root_delta = pending_delta;
}
gfx::Vector2dF applied_delta;
@@ -2570,9 +2655,11 @@
unused_root_delta.set_y(0.0f);
// Disable overscroll on axes which is impossible to scroll.
if (settings_.report_overscroll_only_for_scrollable_axes) {
- if (std::abs(active_tree_->TotalMaxScrollOffset().x()) <= kEpsilon)
+ if (std::abs(active_tree_->TotalMaxScrollOffset().x()) <= kEpsilon ||
+ !layer_impl->user_scrollable_horizontal())
unused_root_delta.set_x(0.0f);
- if (std::abs(active_tree_->TotalMaxScrollOffset().y()) <= kEpsilon)
+ if (std::abs(active_tree_->TotalMaxScrollOffset().y()) <= kEpsilon ||
+ !layer_impl->user_scrollable_vertical())
unused_root_delta.set_y(0.0f);
}
}
@@ -2693,8 +2780,10 @@
}
void LayerTreeHostImpl::OnRootLayerDelegatedScrollOffsetChanged() {
- DCHECK(root_layer_scroll_offset_delegate_ != NULL);
+ DCHECK(root_layer_scroll_offset_delegate_);
client_->SetNeedsCommitOnImplThread();
+ SetNeedsRedraw();
+ active_tree_->OnRootLayerDelegatedScrollOffsetChanged();
active_tree_->set_needs_update_draw_properties();
}
@@ -2901,8 +2990,7 @@
static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
LayerImpl* layer_impl) {
- if (!layer_impl)
- return;
+ DCHECK(layer_impl);
gfx::Vector2d scroll_delta =
gfx::ToFlooredVector2d(layer_impl->ScrollDelta());
@@ -2921,12 +3009,15 @@
scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
- CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer());
- scroll_info->page_scale_delta = active_tree_->page_scale_delta();
- active_tree_->set_sent_page_scale_delta(scroll_info->page_scale_delta);
- scroll_info->swap_promises.swap(swap_promises_for_main_thread_scroll_update_);
- scroll_info->top_controls_delta = active_tree()->top_controls_delta();
- active_tree_->set_sent_top_controls_delta(scroll_info->top_controls_delta);
+ if (active_tree_->root_layer()) {
+ CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer());
+ scroll_info->page_scale_delta = active_tree_->page_scale_delta();
+ active_tree_->set_sent_page_scale_delta(scroll_info->page_scale_delta);
+ scroll_info->swap_promises.swap(
+ swap_promises_for_main_thread_scroll_update_);
+ scroll_info->top_controls_delta = active_tree()->top_controls_delta();
+ active_tree_->set_sent_top_controls_delta(scroll_info->top_controls_delta);
+ }
return scroll_info.Pass();
}
@@ -3119,6 +3210,10 @@
DidModifyTilePriorities();
}
+TreePriority LayerTreeHostImpl::GetTreePriority() const {
+ return global_tile_state_.tree_priority;
+}
+
void LayerTreeHostImpl::UpdateCurrentBeginFrameArgs(
const BeginFrameArgs& args) {
DCHECK(!current_begin_frame_args_.IsValid());
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index a987d46..51ef8b0 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -120,7 +120,8 @@
LayerTreeHostImplClient* client,
Proxy* proxy,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
int id);
virtual ~LayerTreeHostImpl();
@@ -417,6 +418,7 @@
bool pinch_gesture_active() const { return pinch_gesture_active_; }
void SetTreePriority(TreePriority priority);
+ TreePriority GetTreePriority() const;
void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args);
void ResetCurrentBeginFrameArgsForNextFrame();
@@ -481,16 +483,21 @@
void SetTopControlsLayoutHeight(float height);
+ void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; }
+ void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; }
+ bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; }
+
protected:
LayerTreeHostImpl(
const LayerTreeSettings& settings,
LayerTreeHostImplClient* client,
Proxy* proxy,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
- SharedBitmapManager* manager,
+ SharedBitmapManager* shared_bitmap_manager,
+ GpuMemoryBufferManager* gpu_memory_buffer_manager,
int id);
- void UpdateInnerViewportContainerSize();
+ void UpdateViewportContainerSizes();
// Virtual for testing.
virtual void AnimateLayers(base::TimeTicks monotonic_time);
@@ -529,6 +536,8 @@
void AnimateScrollbars(base::TimeTicks monotonic_time);
void AnimateTopControls(base::TimeTicks monotonic_time);
+ bool ShouldTopControlsConsumeScroll(const gfx::Vector2dF& scroll_delta) const;
+
gfx::Vector2dF ScrollLayerWithViewportSpaceDelta(
LayerImpl* layer_impl,
float scale_from_viewport_to_screen_space,
@@ -696,6 +705,7 @@
base::Closure tree_activation_callback_;
SharedBitmapManager* shared_bitmap_manager_;
+ GpuMemoryBufferManager* gpu_memory_buffer_manager_;
int id_;
std::set<SwapPromiseMonitor*> swap_promise_monitor_;
@@ -703,6 +713,8 @@
std::vector<PictureLayerImpl*> picture_layers_;
std::vector<PictureLayerImpl::Pair> picture_layer_pairs_;
+ bool requires_high_res_to_draw_;
+
DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
};
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index c536733..5694c01 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -26,6 +26,7 @@
#include "cc/layers/solid_color_scrollbar_layer_impl.h"
#include "cc/layers/texture_layer_impl.h"
#include "cc/layers/tiled_layer_impl.h"
+#include "cc/layers/video_layer_impl.h"
#include "cc/output/begin_frame_args.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/compositor_frame_metadata.h"
@@ -46,13 +47,16 @@
#include "cc/test/fake_picture_pile_impl.h"
#include "cc/test/fake_proxy.h"
#include "cc/test/fake_rendering_stats_instrumentation.h"
+#include "cc/test/fake_video_frame_provider.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/render_pass_test_common.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
+#include "media/base/media.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkMallocPixelRef.h"
@@ -66,6 +70,7 @@
using ::testing::AnyNumber;
using ::testing::AtLeast;
using ::testing::_;
+using media::VideoFrame;
namespace cc {
namespace {
@@ -78,7 +83,8 @@
base::MessageLoopProxy::current()),
always_impl_thread_(&proxy_),
always_main_thread_blocked_(&proxy_),
- shared_bitmap_manager_(new TestSharedBitmapManager()),
+ shared_bitmap_manager_(new TestSharedBitmapManager),
+ gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager),
on_can_draw_state_changed_called_(false),
did_notify_ready_to_activate_(false),
did_request_commit_(false),
@@ -89,6 +95,7 @@
reduce_memory_result_(true),
current_limit_bytes_(0),
current_priority_cutoff_value_(0) {
+ media::InitializeMediaLibraryForTesting();
}
LayerTreeSettings DefaultSettings() {
@@ -97,6 +104,7 @@
settings.impl_side_painting = true;
settings.texture_id_allocation_chunk_size = 1;
settings.report_overscroll_only_for_scrollable_axes = true;
+ settings.use_pinch_virtual_viewport = true;
return settings;
}
@@ -170,6 +178,7 @@
&proxy_,
&stats_instrumentation_,
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
0);
bool init = host_impl_->InitializeRenderer(output_surface.Pass());
host_impl_->SetViewportSize(gfx::Size(10, 10));
@@ -387,7 +396,8 @@
DebugScopedSetImplThread always_impl_thread_;
DebugScopedSetMainThreadBlocked always_main_thread_blocked_;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
scoped_ptr<LayerTreeHostImpl> host_impl_;
FakeRenderingStatsInstrumentation stats_instrumentation_;
bool on_can_draw_state_changed_called_;
@@ -818,9 +828,7 @@
gfx::Point(), SCROLL_BACKWARD));
}
-// The user-scrollability breaks for zoomed-in pages. So disable this.
-// http://crbug.com/322223
-TEST_F(LayerTreeHostImplTest, DISABLED_ScrollWithUserUnscrollableLayers) {
+TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) {
LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(200, 200));
host_impl_->SetViewportSize(gfx::Size(100, 100));
@@ -1284,6 +1292,7 @@
base::TimeTicks start_time = base::TimeTicks() +
base::TimeDelta::FromSeconds(1);
base::TimeDelta duration = base::TimeDelta::FromMilliseconds(100);
+ base::TimeTicks third_through_animation = start_time + duration / 3;
base::TimeTicks halfway_through_animation = start_time + duration / 2;
base::TimeTicks end_time = start_time + duration;
float target_scale = 2.f;
@@ -1331,6 +1340,15 @@
did_request_redraw_ = false;
did_request_animate_ = false;
+ host_impl_->Animate(third_through_animation);
+ EXPECT_TRUE(did_request_redraw_);
+ EXPECT_TRUE(did_request_animate_);
+
+ // Another activation shouldn't have any effect on the animation.
+ host_impl_->ActivateSyncTree();
+
+ did_request_redraw_ = false;
+ did_request_animate_ = false;
host_impl_->Animate(halfway_through_animation);
EXPECT_TRUE(did_request_redraw_);
EXPECT_TRUE(did_request_animate_);
@@ -1361,6 +1379,7 @@
proxy,
rendering_stats_instrumentation,
manager,
+ NULL,
0) {}
virtual BeginFrameArgs CurrentBeginFrameArgs() const override {
@@ -2147,7 +2166,7 @@
had_incomplete_tile,
is_animating,
host_impl_->resource_provider()));
- host_impl_->active_tree()->SetRequiresHighResToDraw();
+ host_impl_->SetRequiresHighResToDraw();
LayerTreeHostImpl::FrameData frame2;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame2));
host_impl_->DrawLayers(&frame2, gfx::FrameTime::Now());
@@ -2177,7 +2196,7 @@
had_incomplete_tile,
is_animating,
host_impl_->resource_provider()));
- host_impl_->active_tree()->SetRequiresHighResToDraw();
+ host_impl_->SetRequiresHighResToDraw();
LayerTreeHostImpl::FrameData frame2;
EXPECT_EQ(DRAW_ABORTED_MISSING_HIGH_RES_CONTENT,
host_impl_->PrepareToDraw(&frame2));
@@ -2208,7 +2227,7 @@
had_incomplete_tile,
is_animating,
host_impl_->resource_provider()));
- host_impl_->active_tree()->SetRequiresHighResToDraw();
+ host_impl_->SetRequiresHighResToDraw();
LayerTreeHostImpl::FrameData frame2;
EXPECT_EQ(DRAW_ABORTED_MISSING_HIGH_RES_CONTENT,
host_impl_->PrepareToDraw(&frame2));
@@ -2229,6 +2248,7 @@
EXPECT_FALSE(did_request_commit_);
}
+// TODO(bokan): Convert these tests to create inner and outer viewports.
class LayerTreeHostImplTopControlsTest : public LayerTreeHostImplTest {
public:
LayerTreeHostImplTopControlsTest()
@@ -2245,8 +2265,6 @@
}
void SetupTopControlsAndScrollLayer() {
- CreateHostImpl(settings_, CreateOutputSurface());
-
scoped_ptr<LayerImpl> root =
LayerImpl::Create(host_impl_->active_tree(), 1);
scoped_ptr<LayerImpl> root_clip =
@@ -2269,8 +2287,6 @@
host_impl_->SetViewportSize(viewport_size_);
host_impl_->SetTopControlsLayoutHeight(
settings_.top_controls_height);
- LayerImpl* root_clip_ptr = host_impl_->active_tree()->root_layer();
- EXPECT_EQ(clip_size_, root_clip_ptr->bounds());
host_impl_->CreatePendingTree();
root =
@@ -2295,8 +2311,62 @@
host_impl_->SetViewportSize(viewport_size_);
host_impl_->sync_tree()->set_top_controls_layout_height(
settings_.top_controls_height);
- root_clip_ptr = host_impl_->sync_tree()->root_layer();
- EXPECT_EQ(clip_size_, root_clip_ptr->bounds());
+ }
+
+ void SetupTopControlsAndScrollLayerWithVirtualViewport(
+ const gfx::Size& inner_viewport_size,
+ const gfx::Size& outer_viewport_size,
+ const gfx::Size& scroll_layer_size) {
+ CreateHostImpl(settings_, CreateOutputSurface());
+
+ scoped_ptr<LayerImpl> root =
+ LayerImpl::Create(host_impl_->active_tree(), 1);
+ scoped_ptr<LayerImpl> root_clip =
+ LayerImpl::Create(host_impl_->active_tree(), 2);
+ scoped_ptr<LayerImpl> page_scale =
+ LayerImpl::Create(host_impl_->active_tree(), 3);
+
+ scoped_ptr<LayerImpl> outer_scroll =
+ LayerImpl::Create(host_impl_->active_tree(), 4);
+ scoped_ptr<LayerImpl> outer_clip =
+ LayerImpl::Create(host_impl_->active_tree(), 5);
+
+ root_clip->SetBounds(inner_viewport_size);
+ root->SetScrollClipLayer(root_clip->id());
+ root->SetBounds(outer_viewport_size);
+ root->SetContentBounds(outer_viewport_size);
+ root->SetPosition(gfx::PointF());
+ root->SetDrawsContent(false);
+ root->SetIsContainerForFixedPositionLayers(true);
+
+ outer_clip->SetBounds(outer_viewport_size);
+ outer_scroll->SetScrollClipLayer(outer_clip->id());
+ outer_scroll->SetBounds(scroll_layer_size);
+ outer_scroll->SetContentBounds(scroll_layer_size);
+ outer_scroll->SetPosition(gfx::PointF());
+ outer_scroll->SetDrawsContent(false);
+ outer_scroll->SetIsContainerForFixedPositionLayers(true);
+
+ int inner_viewport_scroll_layer_id = root->id();
+ int outer_viewport_scroll_layer_id = outer_scroll->id();
+ int page_scale_layer_id = page_scale->id();
+
+ outer_clip->AddChild(outer_scroll.Pass());
+ root->AddChild(outer_clip.Pass());
+ page_scale->AddChild(root.Pass());
+ root_clip->AddChild(page_scale.Pass());
+
+ host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
+ host_impl_->active_tree()->SetViewportLayersFromIds(
+ page_scale_layer_id,
+ inner_viewport_scroll_layer_id,
+ outer_viewport_scroll_layer_id);
+
+ host_impl_->SetViewportSize(inner_viewport_size);
+ host_impl_->SetTopControlsLayoutHeight(
+ settings_.top_controls_height);
+ LayerImpl* root_clip_ptr = host_impl_->active_tree()->root_layer();
+ EXPECT_EQ(inner_viewport_size, root_clip_ptr->bounds());
}
protected:
@@ -2307,7 +2377,30 @@
LayerTreeSettings settings_;
}; // class LayerTreeHostImplTopControlsTest
+TEST_F(LayerTreeHostImplTopControlsTest,
+ TopControlsDeltaOnlySentWithRootLayer) {
+ CreateHostImpl(settings_, CreateOutputSurface());
+
+ host_impl_->active_tree()->set_top_controls_delta(-20.f);
+
+ // Because LTH::ApplyScrollAndScale doesn't know what to do with a scroll
+ // delta packet when the root layer doesn't exist yet, make sure not to set
+ // sent_top_controls_delta either to avoid the delta getting clobbered on the
+ // next commit.
+ scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas();
+ EXPECT_EQ(scroll_info->top_controls_delta, 0.f);
+ EXPECT_EQ(host_impl_->active_tree()->sent_top_controls_delta(), 0.f);
+
+ SetupTopControlsAndScrollLayer();
+
+ // After the root layer exists, it should be set normally.
+ scroll_info = host_impl_->ProcessScrollDeltas();
+ EXPECT_EQ(scroll_info->top_controls_delta, -20.f);
+ EXPECT_EQ(host_impl_->active_tree()->sent_top_controls_delta(), -20.f);
+}
+
TEST_F(LayerTreeHostImplTopControlsTest, ScrollTopControlsByFractionalAmount) {
+ CreateHostImpl(settings_, CreateOutputSurface());
SetupTopControlsAndScrollLayer();
DrawFrame();
@@ -2331,6 +2424,7 @@
}
TEST_F(LayerTreeHostImplTopControlsTest, ScrollTopControlsWithPageScale) {
+ CreateHostImpl(settings_, CreateOutputSurface());
SetupTopControlsAndScrollLayer();
DrawFrame();
@@ -2364,6 +2458,7 @@
// Ensure setting the top controls position explicitly using the setters on the
// TreeImpl correctly affects the top controls manager and viewport bounds.
TEST_F(LayerTreeHostImplTopControlsTest, PositionTopControlsExplicitly) {
+ CreateHostImpl(settings_, CreateOutputSurface());
SetupTopControlsAndScrollLayer();
DrawFrame();
@@ -2387,6 +2482,7 @@
// applied on sync tree activation. The total top controls offset shouldn't
// change after the activation.
TEST_F(LayerTreeHostImplTopControlsTest, ApplyDeltaOnTreeActivation) {
+ CreateHostImpl(settings_, CreateOutputSurface());
SetupTopControlsAndScrollLayer();
DrawFrame();
@@ -2421,6 +2517,7 @@
// height is the amount that the inner viewport container was shrunk outside
// the compositor to accommodate the top controls.
TEST_F(LayerTreeHostImplTopControlsTest, TopControlsLayoutHeightChanged) {
+ CreateHostImpl(settings_, CreateOutputSurface());
SetupTopControlsAndScrollLayer();
DrawFrame();
@@ -2460,8 +2557,159 @@
root_clip_ptr->bounds());
}
+// Test that showing/hiding the top controls when the viewport is fully scrolled
+// doesn't incorrectly change the viewport offset due to clamping from changing
+// viewport bounds.
+TEST_F(LayerTreeHostImplTopControlsTest, TopControlsViewportOffsetClamping) {
+ SetupTopControlsAndScrollLayerWithVirtualViewport(
+ gfx::Size(100, 100), gfx::Size(200, 200), gfx::Size(200, 400));
+ DrawFrame();
+
+ EXPECT_EQ(settings_.top_controls_height,
+ host_impl_->active_tree()->total_top_controls_content_offset());
+
+ LayerImpl* outer_scroll = host_impl_->OuterViewportScrollLayer();
+ LayerImpl* inner_scroll = host_impl_->InnerViewportScrollLayer();
+
+ // Scroll the viewports to max scroll offset.
+ outer_scroll->SetScrollDelta(gfx::Vector2dF(0, 200.f));
+ inner_scroll->SetScrollDelta(gfx::Vector2dF(100, 100.f));
+
+ gfx::ScrollOffset viewport_offset =
+ host_impl_->active_tree()->TotalScrollOffset();
+ EXPECT_EQ(host_impl_->active_tree()->TotalMaxScrollOffset(), viewport_offset);
+
+ // Hide the top controls by 25px.
+ gfx::Vector2dF scroll_delta(0.f, 25.f);
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ host_impl_->ScrollBy(gfx::Point(), scroll_delta);
+ host_impl_->ScrollEnd();
+
+ EXPECT_EQ(scroll_delta.y(),
+ settings_.top_controls_height -
+ host_impl_->active_tree()->total_top_controls_content_offset());
+
+ inner_scroll->ClampScrollToMaxScrollOffset();
+ outer_scroll->ClampScrollToMaxScrollOffset();
+
+ // We should still be fully scrolled.
+ EXPECT_EQ(host_impl_->active_tree()->TotalMaxScrollOffset(),
+ host_impl_->active_tree()->TotalScrollOffset());
+
+ viewport_offset = host_impl_->active_tree()->TotalScrollOffset();
+
+ // Bring the top controls down by 25px.
+ scroll_delta = gfx::Vector2dF(0.f, -25.f);
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ host_impl_->ScrollBy(gfx::Point(), scroll_delta);
+ host_impl_->ScrollEnd();
+
+ // The viewport offset shouldn't have changed.
+ EXPECT_EQ(viewport_offset,
+ host_impl_->active_tree()->TotalScrollOffset());
+
+ // Scroll the viewports to max scroll offset.
+ outer_scroll->SetScrollDelta(gfx::Vector2dF(0, 200.f));
+ inner_scroll->SetScrollDelta(gfx::Vector2dF(100, 100.f));
+ EXPECT_EQ(host_impl_->active_tree()->TotalMaxScrollOffset(),
+ host_impl_->active_tree()->TotalScrollOffset());
+}
+
+// Test that the top controls coming in and out maintains the same aspect ratio
+// between the inner and outer viewports.
+TEST_F(LayerTreeHostImplTopControlsTest, TopControlsAspectRatio) {
+ SetupTopControlsAndScrollLayerWithVirtualViewport(
+ gfx::Size(100, 100), gfx::Size(200, 200), gfx::Size(200, 400));
+ DrawFrame();
+
+ EXPECT_EQ(settings_.top_controls_height,
+ host_impl_->active_tree()->total_top_controls_content_offset());
+
+ gfx::Vector2dF scroll_delta(0.f, 25.f);
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ host_impl_->ScrollBy(gfx::Point(), scroll_delta);
+ host_impl_->ScrollEnd();
+
+ EXPECT_EQ(scroll_delta.y(),
+ settings_.top_controls_height -
+ host_impl_->active_tree()->total_top_controls_content_offset());
+
+ // Top controls were hidden by 25px so the inner viewport should have expanded
+ // by that much.
+ LayerImpl* outer_container =
+ host_impl_->active_tree()->OuterViewportContainerLayer();
+ LayerImpl* inner_container =
+ host_impl_->active_tree()->InnerViewportContainerLayer();
+ EXPECT_EQ(gfx::Size(100, 100+25), inner_container->BoundsForScrolling());
+
+ // Outer viewport should match inner's aspect ratio. The bounds are ceiled.
+ float aspect_ratio = inner_container->BoundsForScrolling().width() /
+ inner_container->BoundsForScrolling().height();
+ gfx::Size expected = gfx::ToCeiledSize(gfx::SizeF(200, 200 / aspect_ratio));
+ EXPECT_EQ(expected, outer_container->BoundsForScrolling());
+ EXPECT_EQ(expected,
+ host_impl_->InnerViewportScrollLayer()->BoundsForScrolling());
+}
+
+// Test that scrolling the outer viewport affects the top controls.
+TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollOuterViewport) {
+ SetupTopControlsAndScrollLayerWithVirtualViewport(
+ gfx::Size(100, 100), gfx::Size(200, 200), gfx::Size(200, 400));
+ DrawFrame();
+
+ EXPECT_EQ(settings_.top_controls_height,
+ host_impl_->active_tree()->total_top_controls_content_offset());
+
+ // Send a gesture scroll that will scroll the outer viewport, make sure the
+ // top controls get scrolled.
+ gfx::Vector2dF scroll_delta(0.f, 15.f);
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ host_impl_->ScrollBy(gfx::Point(), scroll_delta);
+ EXPECT_EQ(host_impl_->OuterViewportScrollLayer(),
+ host_impl_->CurrentlyScrollingLayer());
+ host_impl_->ScrollEnd();
+
+ EXPECT_EQ(scroll_delta.y(),
+ settings_.top_controls_height -
+ host_impl_->active_tree()->total_top_controls_content_offset());
+
+ scroll_delta = gfx::Vector2dF(0.f, 50.f);
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ host_impl_->ScrollBy(gfx::Point(), scroll_delta);
+
+ EXPECT_EQ(0, host_impl_->active_tree()->total_top_controls_content_offset());
+ EXPECT_EQ(host_impl_->OuterViewportScrollLayer(),
+ host_impl_->CurrentlyScrollingLayer());
+
+ host_impl_->ScrollEnd();
+
+ // Position the viewports such that the inner viewport will be scrolled.
+ gfx::Vector2dF inner_viewport_offset(0.f, 25.f);
+ host_impl_->OuterViewportScrollLayer()->SetScrollDelta(gfx::Vector2dF());
+ host_impl_->InnerViewportScrollLayer()->SetScrollDelta(inner_viewport_offset);
+
+ scroll_delta = gfx::Vector2dF(0.f, -65.f);
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ host_impl_->ScrollBy(gfx::Point(), scroll_delta);
+
+ EXPECT_EQ(settings_.top_controls_height,
+ host_impl_->active_tree()->total_top_controls_content_offset());
+ EXPECT_EQ(inner_viewport_offset.y() +
+ (scroll_delta.y() + settings_.top_controls_height),
+ host_impl_->InnerViewportScrollLayer()->ScrollDelta().y());
+
+ host_impl_->ScrollEnd();
+}
+
TEST_F(LayerTreeHostImplTopControlsTest,
ScrollNonScrollableRootWithTopControls) {
+ CreateHostImpl(settings_, CreateOutputSurface());
SetupTopControlsAndScrollLayer();
DrawFrame();
@@ -3457,7 +3705,11 @@
host_impl_->OnRootLayerDelegatedScrollOffsetChanged();
// Check scroll delta reflected in layer.
- DrawFrame();
+ LayerTreeHostImpl::FrameData frame;
+ EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
+ host_impl_->DidDrawAllLayers(frame);
+ EXPECT_FALSE(frame.has_no_damage);
CheckLayerScrollDelta(scroll_layer, ScrollOffsetToVector2dF(scroll_offset));
host_impl_->SetRootLayerScrollOffsetDelegate(NULL);
@@ -3833,7 +4085,7 @@
// Opaque layer, drawn without blending.
layer1->SetContentsOpaque(true);
layer1->SetExpectation(false, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3842,7 +4094,7 @@
// Layer with translucent content and painting, so drawn with blending.
layer1->SetContentsOpaque(false);
layer1->SetExpectation(true, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3852,7 +4104,7 @@
layer1->SetContentsOpaque(true);
layer1->SetOpacity(0.5f);
layer1->SetExpectation(true, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3862,7 +4114,7 @@
layer1->SetContentsOpaque(true);
layer1->SetOpacity(0.5f);
layer1->SetExpectation(true, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3880,11 +4132,11 @@
layer1->SetContentsOpaque(true);
layer1->SetOpacity(1.f);
layer1->SetExpectation(false, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
layer2->SetContentsOpaque(true);
layer2->SetOpacity(1.f);
layer2->SetExpectation(false, false);
- layer2->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer2->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3895,9 +4147,9 @@
// Child layer with opaque content, drawn without blending.
layer1->SetContentsOpaque(false);
layer1->SetExpectation(true, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
layer2->SetExpectation(false, false);
- layer2->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer2->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3909,9 +4161,9 @@
// Child layer with opaque content, drawn without blending.
layer1->SetContentsOpaque(true);
layer1->SetExpectation(false, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
layer2->SetExpectation(false, false);
- layer2->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer2->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3926,9 +4178,9 @@
layer1->SetContentsOpaque(true);
layer1->SetOpacity(0.5f);
layer1->SetExpectation(false, true);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
layer2->SetExpectation(false, false);
- layer2->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer2->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
FakeLayerTreeHostImpl::RecursiveUpdateNumChildren(
host_impl_->active_tree()->root_layer());
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
@@ -3942,11 +4194,11 @@
layer1->SetContentsOpaque(true);
layer1->SetOpacity(1.f);
layer1->SetExpectation(false, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
layer2->SetContentsOpaque(true);
layer2->SetOpacity(0.5f);
layer2->SetExpectation(true, false);
- layer2->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer2->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3957,11 +4209,11 @@
layer1->SetContentsOpaque(true);
layer1->SetOpacity(1.f);
layer1->SetExpectation(false, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
layer2->SetContentsOpaque(false);
layer2->SetOpacity(1.f);
layer2->SetExpectation(true, false);
- layer2->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer2->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3973,11 +4225,11 @@
layer1->SetContentsOpaque(true);
layer1->SetOpacity(1.f);
layer1->SetExpectation(false, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
layer2->SetContentsOpaque(true);
layer2->SetOpacity(1.f);
layer2->SetExpectation(false, false);
- layer2->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer2->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -3990,7 +4242,7 @@
layer1->SetQuadVisibleRect(gfx::Rect(5, 5, 5, 5));
layer1->SetOpaqueContentRect(gfx::Rect(5, 5, 2, 5));
layer1->SetExpectation(true, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -4002,7 +4254,7 @@
layer1->SetQuadVisibleRect(gfx::Rect(5, 5, 5, 2));
layer1->SetOpaqueContentRect(gfx::Rect(5, 5, 2, 5));
layer1->SetExpectation(true, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -4014,7 +4266,7 @@
layer1->SetQuadVisibleRect(gfx::Rect(7, 5, 3, 5));
layer1->SetOpaqueContentRect(gfx::Rect(5, 5, 2, 5));
layer1->SetExpectation(true, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -4027,7 +4279,7 @@
layer1->SetQuadVisibleRect(gfx::Rect(5, 5, 2, 5));
layer1->SetOpaqueContentRect(gfx::Rect(5, 5, 2, 5));
layer1->SetExpectation(false, false);
- layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
+ layer1->SetUpdateRect(gfx::Rect(layer1->content_bounds()));
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
EXPECT_TRUE(layer1->quads_appended());
@@ -4390,8 +4642,9 @@
context_provider->BindToCurrentThread();
context_provider->TestContext3d()->set_have_post_sub_buffer(true);
- scoped_ptr<OutputSurface> output_surface(
+ scoped_ptr<FakeOutputSurface> output_surface(
FakeOutputSurface::Create3d(context_provider));
+ FakeOutputSurface* fake_output_surface = output_surface.get();
// This test creates its own LayerTreeHostImpl, so
// that we can force partial swap enabled.
@@ -4405,6 +4658,7 @@
&proxy_,
&stats_instrumentation_,
shared_bitmap_manager.get(),
+ NULL,
0);
layer_tree_host_impl->InitializeRenderer(output_surface.Pass());
layer_tree_host_impl->SetViewportSize(gfx::Size(500, 500));
@@ -4430,8 +4684,9 @@
layer_tree_host_impl->DrawLayers(&frame, gfx::FrameTime::Now());
layer_tree_host_impl->DidDrawAllLayers(frame);
layer_tree_host_impl->SwapBuffers(frame);
- EXPECT_EQ(TestContextSupport::SWAP,
- context_provider->support()->last_swap_type());
+ gfx::Rect expected_swap_rect(0, 0, 500, 500);
+ EXPECT_EQ(expected_swap_rect.ToString(),
+ fake_output_surface->last_swap_rect().ToString());
// Second frame, only the damaged area should get swapped. Damage should be
// the union of old and new child rects.
@@ -4447,12 +4702,9 @@
// Make sure that partial swap is constrained to the viewport dimensions
// expected damage rect: gfx::Rect(500, 500);
// expected swap rect: flipped damage rect, but also clamped to viewport
- EXPECT_EQ(TestContextSupport::PARTIAL_SWAP,
- context_provider->support()->last_swap_type());
- gfx::Rect expected_swap_rect(0, 500-28, 26, 28);
+ expected_swap_rect = gfx::Rect(0, 500-28, 26, 28);
EXPECT_EQ(expected_swap_rect.ToString(),
- context_provider->support()->
- last_partial_swap_rect().ToString());
+ fake_output_surface->last_swap_rect().ToString());
layer_tree_host_impl->SetViewportSize(gfx::Size(10, 10));
// This will damage everything.
@@ -4463,8 +4715,9 @@
host_impl_->DidDrawAllLayers(frame);
layer_tree_host_impl->SwapBuffers(frame);
- EXPECT_EQ(TestContextSupport::SWAP,
- context_provider->support()->last_swap_type());
+ expected_swap_rect = gfx::Rect(0, 0, 10, 10);
+ EXPECT_EQ(expected_swap_rect.ToString(),
+ fake_output_surface->last_swap_rect().ToString());
}
TEST_F(LayerTreeHostImplTest, RootLayerDoesntCreateExtraSurface) {
@@ -4694,7 +4947,7 @@
LayerTreeSettings settings;
settings.partial_swap_enabled = partial_swap;
scoped_ptr<LayerTreeHostImpl> my_host_impl = LayerTreeHostImpl::Create(
- settings, client, proxy, stats_instrumentation, manager, 0);
+ settings, client, proxy, stats_instrumentation, manager, NULL, 0);
my_host_impl->InitializeRenderer(output_surface.Pass());
my_host_impl->SetViewportSize(gfx::Size(100, 100));
@@ -4822,6 +5075,18 @@
LayerImpl::Create(host_impl_->active_tree(), 1);
root_layer->SetBounds(gfx::Size(10, 10));
+ scoped_refptr<VideoFrame> softwareFrame =
+ media::VideoFrame::CreateColorFrame(
+ gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
+ FakeVideoFrameProvider provider;
+ provider.set_frame(softwareFrame);
+ scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create(
+ host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0);
+ video_layer->SetBounds(gfx::Size(10, 10));
+ video_layer->SetContentBounds(gfx::Size(10, 10));
+ video_layer->SetDrawsContent(true);
+ root_layer->AddChild(video_layer.Pass());
+
scoped_ptr<IOSurfaceLayerImpl> io_surface_layer =
IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5);
io_surface_layer->SetBounds(gfx::Size(10, 10));
@@ -5857,6 +6122,16 @@
scoped_ptr<SolidColorLayerImpl> root_layer =
SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
+ // VideoLayerImpl will not be drawn.
+ FakeVideoFrameProvider provider;
+ scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create(
+ host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0);
+ video_layer->SetBounds(gfx::Size(10, 10));
+ video_layer->SetContentBounds(gfx::Size(10, 10));
+ video_layer->SetDrawsContent(true);
+ root_layer->AddChild(video_layer.Pass());
+ SetupRootLayerImpl(root_layer.Pass());
+
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
@@ -5956,6 +6231,7 @@
&proxy_,
&stats_instrumentation_,
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
0);
scoped_ptr<OutputSurface> output_surface(
@@ -5997,7 +6273,7 @@
LayerTreeSettings settings;
settings.gpu_rasterization_enabled = true;
host_impl_ = LayerTreeHostImpl::Create(
- settings, this, &proxy_, &stats_instrumentation_, NULL, 0);
+ settings, this, &proxy_, &stats_instrumentation_, NULL, NULL, 0);
host_impl_->SetUseGpuRasterization(true);
host_impl_->SetVisible(true);
host_impl_->SetMemoryPolicy(policy1);
@@ -6013,22 +6289,22 @@
ASSERT_TRUE(host_impl_->active_tree());
// RequiresHighResToDraw is set when new output surface is used.
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
- host_impl_->active_tree()->ResetRequiresHighResToDraw();
+ host_impl_->ResetRequiresHighResToDraw();
host_impl_->SetVisible(false);
- EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_FALSE(host_impl_->RequiresHighResToDraw());
host_impl_->SetVisible(true);
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
host_impl_->SetVisible(false);
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
- host_impl_->active_tree()->ResetRequiresHighResToDraw();
+ host_impl_->ResetRequiresHighResToDraw();
- EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_FALSE(host_impl_->RequiresHighResToDraw());
host_impl_->SetVisible(true);
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
}
TEST_F(LayerTreeHostImplTest, RequireHighResAfterGpuRasterizationToggles) {
@@ -6036,22 +6312,22 @@
EXPECT_FALSE(host_impl_->use_gpu_rasterization());
// RequiresHighResToDraw is set when new output surface is used.
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
- host_impl_->active_tree()->ResetRequiresHighResToDraw();
+ host_impl_->ResetRequiresHighResToDraw();
host_impl_->SetUseGpuRasterization(false);
- EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_FALSE(host_impl_->RequiresHighResToDraw());
host_impl_->SetUseGpuRasterization(true);
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
host_impl_->SetUseGpuRasterization(false);
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
- host_impl_->active_tree()->ResetRequiresHighResToDraw();
+ host_impl_->ResetRequiresHighResToDraw();
- EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_FALSE(host_impl_->RequiresHighResToDraw());
host_impl_->SetUseGpuRasterization(true);
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
}
class LayerTreeHostImplTestManageTiles : public LayerTreeHostImplTest {
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index bd32119..e1ab00e 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -3,9 +3,9 @@
// found in the LICENSE file.
#include "build/build_config.h"
-#include "cc/layers/content_layer.h"
#include "cc/layers/content_layer_client.h"
-#include "cc/layers/image_layer.h"
+#include "cc/layers/picture_image_layer.h"
+#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/test/layer_tree_pixel_test.h"
#include "cc/test/pixel_comparator.h"
@@ -19,7 +19,7 @@
class MaskContentLayerClient : public ContentLayerClient {
public:
- MaskContentLayerClient() {}
+ explicit MaskContentLayerClient(const gfx::Size& bounds) : bounds_(bounds) {}
virtual ~MaskContentLayerClient() {}
virtual void DidChangeLayerCanUseLCDText() override {}
@@ -36,7 +36,7 @@
paint.setColor(SK_ColorWHITE);
canvas->clear(SK_ColorTRANSPARENT);
- gfx::Rect inset_rect(rect);
+ gfx::Rect inset_rect(bounds_);
while (!inset_rect.IsEmpty()) {
inset_rect.Inset(3, 3, 2, 2);
canvas->drawRect(
@@ -46,6 +46,9 @@
inset_rect.Inset(3, 3, 2, 2);
}
}
+
+ private:
+ gfx::Size bounds_;
};
TEST_F(LayerTreeHostMasksPixelTest, MaskOfLayer) {
@@ -56,14 +59,14 @@
gfx::Rect(50, 50, 100, 100), kCSSGreen, 1, SK_ColorBLACK);
background->AddChild(green);
- MaskContentLayerClient client;
- scoped_refptr<ContentLayer> mask = ContentLayer::Create(&client);
- mask->SetBounds(gfx::Size(100, 100));
+ gfx::Size mask_bounds(100, 100);
+ MaskContentLayerClient client(mask_bounds);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
+ mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
green->SetMaskLayer(mask.get());
- this->impl_side_painting_ = false;
RunPixelTest(GL_WITH_BITMAP,
background,
base::FilePath(FILE_PATH_LITERAL("mask_of_layer.png")));
@@ -73,18 +76,20 @@
scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
gfx::Rect(200, 200), SK_ColorWHITE);
- scoped_refptr<ImageLayer> mask = ImageLayer::Create();
+ gfx::Size mask_bounds(100, 100);
+
+ scoped_refptr<PictureImageLayer> mask = PictureImageLayer::Create();
mask->SetIsDrawable(true);
mask->SetIsMask(true);
- mask->SetBounds(gfx::Size(100, 100));
+ mask->SetBounds(mask_bounds);
SkBitmap bitmap;
bitmap.allocN32Pixels(400, 400);
SkCanvas canvas(bitmap);
canvas.scale(SkIntToScalar(4), SkIntToScalar(4));
- MaskContentLayerClient client;
+ MaskContentLayerClient client(mask_bounds);
client.PaintContents(&canvas,
- gfx::Rect(100, 100),
+ gfx::Rect(mask_bounds),
ContentLayerClient::GRAPHICS_CONTEXT_ENABLED);
mask->SetBitmap(bitmap);
@@ -93,7 +98,6 @@
green->SetMaskLayer(mask.get());
background->AddChild(green);
- this->impl_side_painting_ = false;
RunPixelTest(GL_WITH_BITMAP,
background,
base::FilePath(FILE_PATH_LITERAL("image_mask_of_layer.png")));
@@ -114,14 +118,14 @@
gfx::Rect(50, 50, 100, 100), kCSSGreen, 1, SK_ColorBLACK);
clip->AddChild(green);
- MaskContentLayerClient client;
- scoped_refptr<ContentLayer> mask = ContentLayer::Create(&client);
- mask->SetBounds(gfx::Size(100, 100));
+ gfx::Size mask_bounds(100, 100);
+ MaskContentLayerClient client(mask_bounds);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
+ mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
green->SetMaskLayer(mask.get());
- this->impl_side_painting_ = false;
RunPixelTest(GL_WITH_BITMAP,
background,
base::FilePath(FILE_PATH_LITERAL("mask_of_clipped_layer.png")));
@@ -131,9 +135,10 @@
scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
gfx::Rect(200, 200), SK_ColorWHITE);
- MaskContentLayerClient client;
- scoped_refptr<ContentLayer> mask = ContentLayer::Create(&client);
- mask->SetBounds(gfx::Size(100, 100));
+ gfx::Size mask_bounds(100, 100);
+ MaskContentLayerClient client(mask_bounds);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
+ mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -151,7 +156,6 @@
replica->SetTransform(replica_transform);
green->SetReplicaLayer(replica.get());
- this->impl_side_painting_ = false;
RunPixelTest(GL_WITH_BITMAP,
background,
base::FilePath(FILE_PATH_LITERAL("mask_with_replica.png")));
@@ -161,9 +165,10 @@
scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
gfx::Rect(200, 200), SK_ColorWHITE);
- MaskContentLayerClient client;
- scoped_refptr<ContentLayer> mask = ContentLayer::Create(&client);
- mask->SetBounds(gfx::Size(100, 100));
+ gfx::Size mask_bounds(100, 100);
+ MaskContentLayerClient client(mask_bounds);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
+ mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -189,7 +194,6 @@
replica->SetTransform(replica_transform);
green->SetReplicaLayer(replica.get());
- this->impl_side_painting_ = false;
RunPixelTest(GL_WITH_BITMAP,
background,
base::FilePath(FILE_PATH_LITERAL(
@@ -200,9 +204,10 @@
scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
gfx::Rect(200, 200), SK_ColorWHITE);
- MaskContentLayerClient client;
- scoped_refptr<ContentLayer> mask = ContentLayer::Create(&client);
- mask->SetBounds(gfx::Size(100, 100));
+ gfx::Size mask_bounds(100, 100);
+ MaskContentLayerClient client(mask_bounds);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
+ mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -225,7 +230,6 @@
replica->SetMaskLayer(mask.get());
green->SetReplicaLayer(replica.get());
- this->impl_side_painting_ = false;
RunPixelTest(GL_WITH_BITMAP,
background,
base::FilePath(FILE_PATH_LITERAL("mask_of_replica.png")));
@@ -235,9 +239,10 @@
scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
gfx::Rect(200, 200), SK_ColorWHITE);
- MaskContentLayerClient client;
- scoped_refptr<ContentLayer> mask = ContentLayer::Create(&client);
- mask->SetBounds(gfx::Size(100, 100));
+ gfx::Size mask_bounds(100, 100);
+ MaskContentLayerClient client(mask_bounds);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
+ mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -267,7 +272,6 @@
replica->SetMaskLayer(mask.get());
green->SetReplicaLayer(replica.get());
- this->impl_side_painting_ = false;
RunPixelTest(GL_WITH_BITMAP,
background,
base::FilePath(FILE_PATH_LITERAL(
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 62a3786..2881f62 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -18,6 +18,7 @@
#include "cc/layers/painted_scrollbar_layer.h"
#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_layer.h"
+#include "cc/layers/video_layer.h"
#include "cc/output/begin_frame_args.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/copy_output_request.h"
@@ -38,6 +39,7 @@
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_proxy.h"
#include "cc/test/fake_scoped_ui_resource.h"
+#include "cc/test/fake_video_frame_provider.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/test_shared_bitmap_manager.h"
@@ -527,7 +529,8 @@
scoped_refptr<ContentLayer> root_layer_;
};
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw);
+SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
+ LayerTreeHostTestSetNextCommitForcesRedraw);
// Tests that if a layer is not drawn because of some reason in the parent then
// its damage is preserved until the next time it is drawn.
@@ -735,7 +738,8 @@
virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
EXPECT_EQ(frame_count_with_pending_tree_, 0);
- impl->BlockNotifyReadyToActivateForTesting(true);
+ if (impl->settings().impl_side_painting)
+ impl->BlockNotifyReadyToActivateForTesting(true);
}
virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl,
@@ -746,7 +750,8 @@
if (frame_count_with_pending_tree_ == 1) {
EXPECT_EQ(first_frame_time_.ToInternalValue(), 0);
first_frame_time_ = impl->CurrentBeginFrameArgs().frame_time;
- } else if (frame_count_with_pending_tree_ == 2) {
+ } else if (frame_count_with_pending_tree_ == 2 &&
+ impl->settings().impl_side_painting) {
impl->BlockNotifyReadyToActivateForTesting(false);
}
}
@@ -775,7 +780,7 @@
base::TimeTicks first_frame_time_;
};
-SINGLE_AND_MULTI_THREAD_TEST_F(
+SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
// This test verifies that LayerTreeHostImpl's current frame time gets
@@ -1352,8 +1357,8 @@
break;
case 2:
// Damage part of layers.
- parent_->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f));
- child_->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f));
+ parent_->SetNeedsDisplayRect(gfx::Rect(5, 5));
+ child_->SetNeedsDisplayRect(gfx::Rect(5, 5));
break;
case 3:
child_->SetNeedsDisplay();
@@ -1898,7 +1903,7 @@
LayerTreeHostWithProxy(FakeLayerTreeHostClient* client,
const LayerTreeSettings& settings,
scoped_ptr<FakeProxy> proxy)
- : LayerTreeHost(client, NULL, settings) {
+ : LayerTreeHost(client, NULL, NULL, settings) {
proxy->SetLayerTreeHost(this);
client->SetLayerTreeHost(this);
InitializeForTesting(proxy.Pass());
@@ -1973,6 +1978,7 @@
LayerTreeHost::CreateSingleThreaded(&client,
&client,
shared_bitmap_manager.get(),
+ NULL,
settings,
base::MessageLoopProxy::current());
client.SetLayerTreeHost(host.get());
@@ -1994,6 +2000,7 @@
LayerTreeHost::CreateSingleThreaded(&client,
&client,
shared_bitmap_manager.get(),
+ NULL,
settings,
base::MessageLoopProxy::current());
client.SetLayerTreeHost(host.get());
@@ -2015,6 +2022,7 @@
LayerTreeHost::CreateSingleThreaded(&client,
&client,
shared_bitmap_manager.get(),
+ NULL,
settings,
base::MessageLoopProxy::current());
client.SetLayerTreeHost(host.get());
@@ -2037,6 +2045,7 @@
LayerTreeHost::CreateSingleThreaded(&client,
&client,
shared_bitmap_manager.get(),
+ NULL,
settings,
base::MessageLoopProxy::current());
client.SetLayerTreeHost(host.get());
@@ -2404,12 +2413,18 @@
LayerTreeHostTestChangeLayerPropertiesInPaintContents() : num_commits_(0) {}
virtual void SetupTree() override {
- scoped_refptr<ContentLayer> root_layer = ContentLayer::Create(&client_);
+ if (layer_tree_host()->settings().impl_side_painting) {
+ scoped_refptr<PictureLayer> root_layer = PictureLayer::Create(&client_);
+ layer_tree_host()->SetRootLayer(root_layer);
+ } else {
+ scoped_refptr<ContentLayer> root_layer = ContentLayer::Create(&client_);
+ layer_tree_host()->SetRootLayer(root_layer);
+ }
+ Layer* root_layer = layer_tree_host()->root_layer();
root_layer->SetIsDrawable(true);
root_layer->SetBounds(gfx::Size(1, 1));
- layer_tree_host()->SetRootLayer(root_layer);
- client_.set_layer(root_layer.get());
+ client_.set_layer(root_layer);
LayerTreeHostTest::SetupTree();
}
@@ -2417,7 +2432,7 @@
virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
virtual void AfterTest() override {}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
num_commits_++;
if (num_commits_ == 1) {
LayerImpl* root_layer = host_impl->active_tree()->root_layer();
@@ -2434,7 +2449,8 @@
int num_commits_;
};
-SINGLE_THREAD_TEST_F(LayerTreeHostTestChangeLayerPropertiesInPaintContents);
+SINGLE_AND_MULTI_THREAD_TEST_F(
+ LayerTreeHostTestChangeLayerPropertiesInPaintContents);
class MockIOSurfaceWebGraphicsContext3D : public TestWebGraphicsContext3D {
public:
@@ -3971,6 +3987,28 @@
int num_draws_;
};
+// VideoLayer must support being invalidated and then passing that along
+// to the compositor thread, even though no resources are updated in
+// response to that invalidation.
+class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw {
+ public:
+ virtual void SetupTree() override {
+ LayerTreeHostTest::SetupTree();
+ scoped_refptr<VideoLayer> video_layer =
+ VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0);
+ video_layer->SetBounds(gfx::Size(10, 10));
+ video_layer->SetIsDrawable(true);
+ layer_tree_host()->root_layer()->AddChild(video_layer);
+
+ invalidate_layer_ = video_layer;
+ }
+
+ private:
+ FakeVideoFrameProvider provider_;
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate);
+
// IOSurfaceLayer must support being invalidated and then passing that along
// to the compositor thread, even though no resources are updated in
// response to that invalidation.
@@ -4695,7 +4733,7 @@
// mode. Active tree should require high-res to draw after entering this
// mode to ensure that high-res tiles are also required for a pending tree
// to be activated.
- EXPECT_TRUE(host_impl->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl->RequiresHighResToDraw());
}
virtual void DidCommit() override {
@@ -5028,7 +5066,7 @@
if (!visible) {
PostSetVisibleToMainThread(true);
} else {
- EXPECT_TRUE(host_impl->active_tree()->RequiresHighResToDraw());
+ EXPECT_TRUE(host_impl->RequiresHighResToDraw());
EndTest();
}
}
@@ -5055,4 +5093,81 @@
// TODO(vmpstr): Enable with single thread impl-side painting.
MULTI_THREAD_TEST_F(LayerTreeHostTestActivateOnInvisible);
+// Do a synchronous composite and assert that the swap promise succeeds.
+class LayerTreeHostTestSynchronousCompositeSwapPromise
+ : public LayerTreeHostTest {
+ public:
+ LayerTreeHostTestSynchronousCompositeSwapPromise() : commit_count_(0) {}
+
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
+ settings->single_thread_proxy_scheduler = false;
+ }
+
+ virtual void BeginTest() override {
+ // Successful composite.
+ scoped_ptr<SwapPromise> swap_promise0(
+ new TestSwapPromise(&swap_promise_result_[0]));
+ layer_tree_host()->QueueSwapPromise(swap_promise0.Pass());
+ layer_tree_host()->Composite(gfx::FrameTime::Now());
+
+ // Fail to swap (no damage).
+ scoped_ptr<SwapPromise> swap_promise1(
+ new TestSwapPromise(&swap_promise_result_[1]));
+ layer_tree_host()->QueueSwapPromise(swap_promise1.Pass());
+ layer_tree_host()->SetNeedsCommit();
+ layer_tree_host()->Composite(gfx::FrameTime::Now());
+
+ // Fail to draw (not visible).
+ scoped_ptr<SwapPromise> swap_promise2(
+ new TestSwapPromise(&swap_promise_result_[2]));
+ layer_tree_host()->QueueSwapPromise(swap_promise2.Pass());
+ layer_tree_host()->SetNeedsDisplayOnAllLayers();
+ layer_tree_host()->SetVisible(false);
+ layer_tree_host()->Composite(gfx::FrameTime::Now());
+
+ EndTest();
+ }
+
+ virtual void DidCommit() override {
+ commit_count_++;
+ ASSERT_LE(commit_count_, 3);
+ }
+
+ virtual void AfterTest() override {
+ EXPECT_EQ(3, commit_count_);
+
+ // Initial swap promise should have succeded.
+ {
+ base::AutoLock lock(swap_promise_result_[0].lock);
+ EXPECT_TRUE(swap_promise_result_[0].did_swap_called);
+ EXPECT_FALSE(swap_promise_result_[0].did_not_swap_called);
+ EXPECT_TRUE(swap_promise_result_[0].dtor_called);
+ }
+
+ // Second swap promise fails to swap.
+ {
+ base::AutoLock lock(swap_promise_result_[1].lock);
+ EXPECT_FALSE(swap_promise_result_[1].did_swap_called);
+ EXPECT_TRUE(swap_promise_result_[1].did_not_swap_called);
+ EXPECT_EQ(SwapPromise::SWAP_FAILS, swap_promise_result_[1].reason);
+ EXPECT_TRUE(swap_promise_result_[1].dtor_called);
+ }
+
+ // Third swap promises also fails to swap (and draw).
+ {
+ base::AutoLock lock(swap_promise_result_[2].lock);
+ EXPECT_FALSE(swap_promise_result_[2].did_swap_called);
+ EXPECT_TRUE(swap_promise_result_[2].did_not_swap_called);
+ EXPECT_EQ(SwapPromise::SWAP_FAILS, swap_promise_result_[2].reason);
+ EXPECT_TRUE(swap_promise_result_[2].dtor_called);
+ }
+ }
+
+ int commit_count_;
+ TestSwapPromiseResult swap_promise_result_[3];
+};
+
+// Impl-side painting is not supported for synchronous compositing.
+SINGLE_THREAD_NOIMPL_TEST_F(LayerTreeHostTestSynchronousCompositeSwapPromise);
+
} // namespace cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 593c5c7..3bd55e5 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -397,7 +397,8 @@
virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override {
// At the start of every commit, block activations and make sure
// we are backgrounded.
- host_impl->BlockNotifyReadyToActivateForTesting(true);
+ if (host_impl->settings().impl_side_painting)
+ host_impl->BlockNotifyReadyToActivateForTesting(true);
PostSetVisibleToMainThread(false);
}
@@ -426,7 +427,8 @@
}
virtual void UnblockActivations(LayerTreeHostImpl* host_impl) {
- host_impl->BlockNotifyReadyToActivateForTesting(false);
+ if (host_impl->settings().impl_side_painting)
+ host_impl->BlockNotifyReadyToActivateForTesting(false);
}
virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
@@ -482,7 +484,7 @@
bool active_tree_was_animated_;
};
-SINGLE_AND_MULTI_THREAD_TEST_F(
+SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree);
// Ensure that an animation's timing function is respected.
@@ -1169,7 +1171,8 @@
}
virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override {
- host_impl->BlockNotifyReadyToActivateForTesting(true);
+ if (host_impl->settings().impl_side_painting)
+ host_impl->BlockNotifyReadyToActivateForTesting(true);
}
virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
@@ -1177,9 +1180,10 @@
// blocking activation. We want to verify that even with activation blocked,
// the animation on the layer that's already in the active tree won't get a
// head start.
- if (!host_impl->settings().impl_side_painting ||
- host_impl->pending_tree()->source_frame_number() != 2)
+ if (host_impl->settings().impl_side_painting &&
+ host_impl->pending_tree()->source_frame_number() != 2) {
host_impl->BlockNotifyReadyToActivateForTesting(false);
+ }
}
virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl,
@@ -1189,8 +1193,10 @@
return;
frame_count_with_pending_tree_++;
- if (frame_count_with_pending_tree_ == 2)
+ if (frame_count_with_pending_tree_ == 2 &&
+ host_impl->settings().impl_side_painting) {
host_impl->BlockNotifyReadyToActivateForTesting(false);
+ }
}
virtual void UpdateAnimationState(LayerTreeHostImpl* host_impl,
@@ -1221,7 +1227,7 @@
int frame_count_with_pending_tree_;
};
-SINGLE_AND_MULTI_THREAD_TEST_F(
+SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers);
class LayerTreeHostAnimationTestAddAnimationAfterAnimating
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 7a9ea29..a72b12e 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -15,6 +15,8 @@
#include "cc/layers/picture_layer.h"
#include "cc/layers/texture_layer.h"
#include "cc/layers/texture_layer_impl.h"
+#include "cc/layers/video_layer.h"
+#include "cc/layers/video_layer_impl.h"
#include "cc/output/filter_operations.h"
#include "cc/resources/single_release_callback.h"
#include "cc/test/fake_content_layer.h"
@@ -30,6 +32,7 @@
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_scoped_ui_resource.h"
#include "cc/test/fake_scrollbar.h"
+#include "cc/test/fake_video_frame_provider.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/render_pass_test_common.h"
#include "cc/test/test_context_provider.h"
@@ -39,6 +42,9 @@
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
#include "gpu/GLES2/gl2extchromium.h"
+#include "media/base/media.h"
+
+using media::VideoFrame;
namespace cc {
namespace {
@@ -59,6 +65,7 @@
context_should_support_io_surface_(false),
fallback_context_works_(false),
async_output_surface_creation_(false) {
+ media::InitializeMediaLibraryForTesting();
}
void LoseContext() {
@@ -100,6 +107,13 @@
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
DrawResult draw_result) override {
+ if (draw_result == DRAW_ABORTED_MISSING_HIGH_RES_CONTENT) {
+ // Only valid for single-threaded impl-side painting, which activates
+ // immediately and will try to draw again when content has finished.
+ DCHECK(!host_impl->proxy()->HasImplThread());
+ DCHECK(layer_tree_host()->settings().impl_side_painting);
+ return draw_result;
+ }
EXPECT_EQ(DRAW_SUCCESS, draw_result);
if (!times_to_lose_during_draw_)
return draw_result;
@@ -368,6 +382,80 @@
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostClientNotReadyDoesNotCreateOutputSurface);
+class MultipleCompositeDoesNotCreateOutputSurface
+ : public LayerTreeHostContextTest {
+ public:
+ MultipleCompositeDoesNotCreateOutputSurface()
+ : LayerTreeHostContextTest(), request_count_(0) {}
+
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
+ settings->single_thread_proxy_scheduler = false;
+ }
+
+ virtual void RequestNewOutputSurface(bool fallback) override {
+ EXPECT_GE(1, ++request_count_);
+ EndTest();
+ }
+
+ virtual void BeginTest() override {
+ layer_tree_host()->Composite(base::TimeTicks());
+ layer_tree_host()->Composite(base::TimeTicks());
+ }
+
+ virtual scoped_ptr<OutputSurface> CreateOutputSurface(
+ bool fallback) override {
+ EXPECT_TRUE(false);
+ return nullptr;
+ }
+
+ virtual void DidInitializeOutputSurface() override { EXPECT_TRUE(false); }
+
+ virtual void AfterTest() override {}
+
+ int request_count_;
+};
+
+SINGLE_THREAD_TEST_F(MultipleCompositeDoesNotCreateOutputSurface);
+
+class FailedCreateDoesNotCreateExtraOutputSurface
+ : public LayerTreeHostContextTest {
+ public:
+ FailedCreateDoesNotCreateExtraOutputSurface()
+ : LayerTreeHostContextTest(), request_count_(0) {}
+
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
+ settings->single_thread_proxy_scheduler = false;
+ }
+
+ virtual void RequestNewOutputSurface(bool fallback) override {
+ if (request_count_ == 0) {
+ ExpectCreateToFail();
+ layer_tree_host()->SetOutputSurface(nullptr);
+ }
+ EXPECT_GE(2, ++request_count_);
+ EndTest();
+ }
+
+ virtual void BeginTest() override {
+ layer_tree_host()->Composite(base::TimeTicks());
+ layer_tree_host()->Composite(base::TimeTicks());
+ }
+
+ virtual scoped_ptr<OutputSurface> CreateOutputSurface(
+ bool fallback) override {
+ EXPECT_TRUE(false);
+ return nullptr;
+ }
+
+ virtual void DidInitializeOutputSurface() override { EXPECT_TRUE(false); }
+
+ virtual void AfterTest() override {}
+
+ int request_count_;
+};
+
+SINGLE_THREAD_TEST_F(FailedCreateDoesNotCreateExtraOutputSurface);
+
class LayerTreeHostContextTestLostContextSucceedsWithContent
: public LayerTreeHostContextTestLostContextSucceeds {
public:
@@ -841,6 +929,7 @@
ResourceProvider::Create(child_output_surface_.get(),
shared_bitmap_manager_.get(),
NULL,
+ NULL,
0,
false,
1,
@@ -937,6 +1026,49 @@
layer_with_mask->SetMaskLayer(mask.get());
root->AddChild(layer_with_mask);
+ scoped_refptr<VideoLayer> video_color =
+ VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0);
+ video_color->SetBounds(gfx::Size(10, 10));
+ video_color->SetIsDrawable(true);
+ root->AddChild(video_color);
+
+ scoped_refptr<VideoLayer> video_hw =
+ VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0);
+ video_hw->SetBounds(gfx::Size(10, 10));
+ video_hw->SetIsDrawable(true);
+ root->AddChild(video_hw);
+
+ scoped_refptr<VideoLayer> video_scaled_hw =
+ VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0);
+ video_scaled_hw->SetBounds(gfx::Size(10, 10));
+ video_scaled_hw->SetIsDrawable(true);
+ root->AddChild(video_scaled_hw);
+
+ color_video_frame_ = VideoFrame::CreateColorFrame(
+ gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
+ hw_video_frame_ =
+ VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder(
+ mailbox, GL_TEXTURE_2D, sync_point)),
+ media::VideoFrame::ReleaseMailboxCB(),
+ gfx::Size(4, 4),
+ gfx::Rect(0, 0, 4, 4),
+ gfx::Size(4, 4),
+ base::TimeDelta(),
+ VideoFrame::ReadPixelsCB());
+ scaled_hw_video_frame_ =
+ VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder(
+ mailbox, GL_TEXTURE_2D, sync_point)),
+ media::VideoFrame::ReleaseMailboxCB(),
+ gfx::Size(4, 4),
+ gfx::Rect(0, 0, 3, 2),
+ gfx::Size(4, 4),
+ base::TimeDelta(),
+ VideoFrame::ReadPixelsCB());
+
+ color_frame_provider_.set_frame(color_video_frame_);
+ hw_frame_provider_.set_frame(hw_video_frame_);
+ scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_);
+
if (!delegating_renderer()) {
// TODO(danakj): IOSurface layer can not be transported. crbug.com/239335
scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create();
@@ -966,6 +1098,14 @@
virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(host_impl);
+
+ if (host_impl->active_tree()->source_frame_number() == 3) {
+ // On the third commit we're recovering from context loss. Hardware
+ // video frames should not be reused by the VideoFrameProvider, but
+ // software frames can be.
+ hw_frame_provider_.set_frame(NULL);
+ scaled_hw_frame_provider_.set_frame(NULL);
+ }
}
virtual DrawResult PrepareToDrawOnThread(
@@ -1016,6 +1156,14 @@
scoped_refptr<DelegatedFrameResourceCollection>
delegated_resource_collection_;
scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_;
+
+ scoped_refptr<VideoFrame> color_video_frame_;
+ scoped_refptr<VideoFrame> hw_video_frame_;
+ scoped_refptr<VideoFrame> scaled_hw_video_frame_;
+
+ FakeVideoFrameProvider color_frame_provider_;
+ FakeVideoFrameProvider hw_frame_provider_;
+ FakeVideoFrameProvider scaled_hw_frame_provider_;
};
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources);
diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc
index f8e44d5..d231553 100644
--- a/cc/trees/layer_tree_host_unittest_damage.cc
+++ b/cc/trees/layer_tree_host_unittest_damage.cc
@@ -293,7 +293,7 @@
EXPECT_FALSE(frame_data->has_no_damage);
// Just a part of the next frame should be damaged.
- child_damage_rect_ = gfx::RectF(10, 11, 12, 13);
+ child_damage_rect_ = gfx::Rect(10, 11, 12, 13);
break;
case 3:
// The update rect in the child should be damaged and the damaged area
@@ -319,7 +319,7 @@
// If we damage part of the frame, but also damage the full
// frame, then the whole frame should be damaged.
- child_damage_rect_ = gfx::RectF(10, 11, 12, 13);
+ child_damage_rect_ = gfx::Rect(10, 11, 12, 13);
host_impl->SetFullRootLayerDamage();
break;
case 4:
@@ -340,7 +340,7 @@
if (!child_damage_rect_.IsEmpty()) {
child_->SetNeedsDisplayRect(child_damage_rect_);
- child_damage_rect_ = gfx::RectF();
+ child_damage_rect_ = gfx::Rect();
}
}
@@ -349,7 +349,7 @@
FakeContentLayerClient client_;
scoped_refptr<FakeContentLayer> root_;
scoped_refptr<FakeContentLayer> child_;
- gfx::RectF child_damage_rect_;
+ gfx::Rect child_damage_rect_;
};
SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(LayerTreeHostDamageTestForcedFullDamage);
diff --git a/cc/trees/layer_tree_host_unittest_no_message_loop.cc b/cc/trees/layer_tree_host_unittest_no_message_loop.cc
index fb0e2be..4930e86 100644
--- a/cc/trees/layer_tree_host_unittest_no_message_loop.cc
+++ b/cc/trees/layer_tree_host_unittest_no_message_loop.cc
@@ -100,8 +100,8 @@
void SetupLayerTreeHost() {
LayerTreeSettings settings;
settings.single_thread_proxy_scheduler = false;
- layer_tree_host_ =
- LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings, NULL);
+ layer_tree_host_ = LayerTreeHost::CreateSingleThreaded(
+ this, this, NULL, NULL, settings, NULL);
layer_tree_host_->SetViewportSize(size_);
layer_tree_host_->SetRootLayer(root_layer_);
}
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 82cee89..82f3d55 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -1133,6 +1133,7 @@
scoped_ptr<LayerTreeHost> layer_tree_host =
LayerTreeHost::CreateThreaded(&client,
shared_bitmap_manager.get(),
+ NULL,
settings,
base::MessageLoopProxy::current(),
impl_thread.message_loop_proxy());
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index f5dda6e..3316855 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -88,7 +88,6 @@
max_page_scale_factor_(0),
scrolling_layer_id_from_previous_tree_(0),
contents_textures_purged_(false),
- requires_high_res_to_draw_(false),
viewport_size_invalid_(false),
needs_update_draw_properties_(true),
needs_full_tree_sync_(true),
@@ -266,6 +265,12 @@
: NULL;
}
+LayerImpl* LayerTreeImpl::OuterViewportContainerLayer() const {
+ return outer_viewport_scroll_layer_
+ ? outer_viewport_scroll_layer_->scroll_clip_layer()
+ : NULL;
+}
+
LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const {
DCHECK(IsActiveTree());
return currently_scrolling_layer_;
@@ -367,7 +372,7 @@
if (!InnerViewportContainerLayer())
return gfx::SizeF();
- return gfx::ScaleSize(InnerViewportContainerLayer()->bounds(),
+ return gfx::ScaleSize(InnerViewportContainerLayer()->BoundsForScrolling(),
1.0f / total_page_scale_factor());
}
@@ -628,7 +633,7 @@
// Always reset this flag on activation, as we would only have activated
// if we were in a good state.
- ResetRequiresHighResToDraw();
+ layer_tree_host_impl_->ResetRequiresHighResToDraw();
if (root_layer())
DidBecomeActiveRecursive(root_layer());
@@ -655,16 +660,8 @@
layer_tree_host_impl_->OnCanDrawStateChangedForTree();
}
-void LayerTreeImpl::SetRequiresHighResToDraw() {
- requires_high_res_to_draw_ = true;
-}
-
-void LayerTreeImpl::ResetRequiresHighResToDraw() {
- requires_high_res_to_draw_ = false;
-}
-
bool LayerTreeImpl::RequiresHighResToDraw() const {
- return requires_high_res_to_draw_;
+ return layer_tree_host_impl_->RequiresHighResToDraw();
}
bool LayerTreeImpl::ViewportSizeInvalid() const {
@@ -937,6 +934,16 @@
}
}
+void LayerTreeImpl::OnRootLayerDelegatedScrollOffsetChanged() {
+ DCHECK(root_layer_scroll_offset_delegate_);
+ if (inner_viewport_scroll_layer_) {
+ inner_viewport_scroll_layer_->DidScroll();
+ }
+ if (outer_viewport_scroll_layer_) {
+ outer_viewport_scroll_layer_->DidScroll();
+ }
+}
+
void LayerTreeImpl::UpdateScrollOffsetDelegate() {
DCHECK(InnerViewportScrollLayer());
DCHECK(root_layer_scroll_offset_delegate_);
@@ -1466,6 +1473,10 @@
layer_tree_host_impl_->ScrollEnd();
}
+bool LayerTreeImpl::SmoothnessTakesPriority() const {
+ return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY;
+}
+
BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const {
return proxy()->blocking_main_thread_task_runner();
}
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index 95a9bac..260b90b 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -18,17 +18,6 @@
#include "cc/output/renderer.h"
#include "cc/resources/ui_resource_client.h"
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-template<>
-struct hash<cc::LayerImpl*> {
- size_t operator()(cc::LayerImpl* ptr) const {
- return hash<size_t>()(reinterpret_cast<size_t>(ptr));
- }
-};
-} // namespace BASE_HASH_NAMESPACE
-#endif // COMPILER
-
namespace base {
namespace debug {
class TracedValue;
@@ -103,6 +92,8 @@
bool use_gpu_rasterization() const;
bool create_low_res_tiling() const;
BlockingTaskRunner* BlockingMainThreadTaskRunner() const;
+ bool RequiresHighResToDraw() const;
+ bool SmoothnessTakesPriority() const;
// Tree specific methods exposed to layer-impl tree.
// ---------------------------------------------------------------------------
@@ -142,6 +133,7 @@
gfx::Vector2dF TotalScrollDelta() const;
LayerImpl* InnerViewportContainerLayer() const;
+ LayerImpl* OuterViewportContainerLayer() const;
LayerImpl* CurrentlyScrollingLayer() const;
void SetCurrentlyScrollingLayer(LayerImpl* layer);
void ClearCurrentlyScrollingLayer();
@@ -232,10 +224,6 @@
void SetContentsTexturesPurged();
void ResetContentsTexturesPurged();
- void SetRequiresHighResToDraw();
- void ResetRequiresHighResToDraw();
- bool RequiresHighResToDraw() const;
-
// Set on the active tree when the viewport size recently changed
// and the active tree's size is now out of date.
bool ViewportSizeInvalid() const;
@@ -247,6 +235,7 @@
void SetRootLayerScrollOffsetDelegate(
LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate);
+ void OnRootLayerDelegatedScrollOffsetChanged();
void UpdateScrollOffsetDelegate();
gfx::ScrollOffset GetDelegatedScrollOffset(LayerImpl* layer);
@@ -371,7 +360,6 @@
LayerImplList render_surface_layer_list_;
bool contents_textures_purged_;
- bool requires_high_res_to_draw_;
bool viewport_size_invalid_;
bool needs_update_draw_properties_;
diff --git a/cc/trees/occlusion_tracker_perftest.cc b/cc/trees/occlusion_tracker_perftest.cc
index 37cd8a6..7346f25 100644
--- a/cc/trees/occlusion_tracker_perftest.cc
+++ b/cc/trees/occlusion_tracker_perftest.cc
@@ -36,8 +36,13 @@
void CreateHost() {
LayerTreeSettings settings;
shared_bitmap_manager_.reset(new TestSharedBitmapManager());
- host_impl_ = LayerTreeHostImpl::Create(
- settings, &client_, &proxy_, &stats_, shared_bitmap_manager_.get(), 1);
+ host_impl_ = LayerTreeHostImpl::Create(settings,
+ &client_,
+ &proxy_,
+ &stats_,
+ shared_bitmap_manager_.get(),
+ NULL,
+ 1);
host_impl_->InitializeRenderer(FakeOutputSurface::Create3d());
scoped_ptr<LayerImpl> root_layer = LayerImpl::Create(active_tree(), 1);
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 64e2ab3..1b57b35 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -12,7 +12,6 @@
#include "cc/quads/draw_quad.h"
#include "cc/resources/prioritized_resource_manager.h"
#include "cc/resources/resource_update_controller.h"
-#include "cc/trees/blocking_task_runner.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
#include "cc/trees/layer_tree_impl.h"
@@ -42,14 +41,11 @@
defer_commits_(false),
commit_was_deferred_(false),
commit_requested_(false),
+ output_surface_creation_requested_(false),
weak_factory_(this) {
TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
DCHECK(Proxy::IsMainThread());
DCHECK(layer_tree_host);
-
- // Impl-side painting not supported without threaded compositing.
- CHECK(!layer_tree_host->settings().impl_side_painting)
- << "Threaded compositing must be enabled to use impl-side painting.";
}
void SingleThreadProxy::Start() {
@@ -109,6 +105,10 @@
void SingleThreadProxy::RequestNewOutputSurface() {
DCHECK(Proxy::IsMainThread());
DCHECK(layer_tree_host_->output_surface_lost());
+ output_surface_creation_callback_.Cancel();
+ if (output_surface_creation_requested_)
+ return;
+ output_surface_creation_requested_ = true;
layer_tree_host_->RequestNewOutputSurface();
}
@@ -116,6 +116,7 @@
scoped_ptr<OutputSurface> output_surface) {
DCHECK(Proxy::IsMainThread());
DCHECK(layer_tree_host_->output_surface_lost());
+ output_surface_creation_requested_ = false;
renderer_capabilities_for_main_thread_ = RendererCapabilities();
bool success = !!output_surface;
@@ -133,10 +134,7 @@
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface();
} else if (Proxy::MainThreadTaskRunner()) {
- MainThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&SingleThreadProxy::RequestNewOutputSurface,
- weak_factory_.GetWeakPtr()));
+ ScheduleRequestNewOutputSurface();
}
}
@@ -159,29 +157,11 @@
SetNeedsCommit();
}
-void SingleThreadProxy::DoCommit(const BeginFrameArgs& begin_frame_args) {
+void SingleThreadProxy::DoCommit() {
TRACE_EVENT0("cc", "SingleThreadProxy::DoCommit");
DCHECK(Proxy::IsMainThread());
- layer_tree_host_->WillBeginMainFrame();
- layer_tree_host_->BeginMainFrame(begin_frame_args);
- layer_tree_host_->AnimateLayers(begin_frame_args.frame_time);
- layer_tree_host_->Layout();
+
commit_requested_ = false;
-
- if (PrioritizedResourceManager* contents_texture_manager =
- layer_tree_host_->contents_texture_manager()) {
- contents_texture_manager->UnlinkAndClearEvictedBackings();
- contents_texture_manager->SetMaxMemoryLimitBytes(
- layer_tree_host_impl_->memory_allocation_limit_bytes());
- contents_texture_manager->SetExternalPriorityCutoff(
- layer_tree_host_impl_->memory_allocation_priority_cutoff());
- }
-
- scoped_ptr<ResourceUpdateQueue> queue =
- make_scoped_ptr(new ResourceUpdateQueue);
-
- layer_tree_host_->UpdateLayers(queue.get());
-
layer_tree_host_->WillCommit();
// Commit immediately.
@@ -192,8 +172,8 @@
// This CapturePostTasks should be destroyed before CommitComplete() is
// called since that goes out to the embedder, and we want the embedder
// to receive its callbacks before that.
- BlockingTaskRunner::CapturePostTasks blocked(
- blocking_main_thread_task_runner());
+ commit_blocking_task_runner_.reset(new BlockingTaskRunner::CapturePostTasks(
+ blocking_main_thread_task_runner()));
layer_tree_host_impl_->BeginCommit();
@@ -207,7 +187,7 @@
ResourceUpdateController::Create(
NULL,
MainThreadTaskRunner(),
- queue.Pass(),
+ queue_for_commit_.Pass(),
layer_tree_host_impl_->resource_provider());
update_controller->Finalize();
@@ -235,6 +215,27 @@
stats_instrumentation->main_thread_rendering_stats());
stats_instrumentation->AccumulateAndClearMainThreadStats();
}
+
+ if (layer_tree_host_->settings().impl_side_painting) {
+ // TODO(enne): just commit directly to the active tree.
+ //
+ // Synchronously activate during commit to satisfy any potential
+ // SetNextCommitWaitsForActivation calls. Unfortunately, the tree
+ // might not be ready to draw, so DidActivateSyncTree must set
+ // the flag to force the tree to not draw until textures are ready.
+ NotifyReadyToActivate();
+ } else {
+ CommitComplete();
+ }
+}
+
+void SingleThreadProxy::CommitComplete() {
+ DCHECK(!layer_tree_host_impl_->pending_tree())
+ << "Activation is expected to have synchronously occurred by now.";
+ DCHECK(commit_blocking_task_runner_);
+
+ DebugScopedSetMainThread main(this);
+ commit_blocking_task_runner_.reset();
layer_tree_host_->CommitComplete();
layer_tree_host_->DidBeginMainFrame();
timing_history_.DidCommit();
@@ -260,7 +261,7 @@
}
void SingleThreadProxy::SetNextCommitWaitsForActivation() {
- // There is no activation here other than commit. So do nothing.
+ // Activation always forced in commit, so nothing to do.
DCHECK(Proxy::IsMainThread());
}
@@ -329,8 +330,10 @@
}
void SingleThreadProxy::NotifyReadyToActivate() {
- // Impl-side painting only.
- NOTREACHED();
+ TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate");
+ DebugScopedSetImplThread impl(this);
+ if (scheduler_on_impl_thread_)
+ scheduler_on_impl_thread_->NotifyReadyToActivate();
}
void SingleThreadProxy::SetNeedsRedrawOnImplThread() {
@@ -344,8 +347,9 @@
}
void SingleThreadProxy::SetNeedsManageTilesOnImplThread() {
- // Impl-side painting only.
- NOTREACHED();
+ TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsManageTilesOnImplThread");
+ if (scheduler_on_impl_thread_)
+ scheduler_on_impl_thread_->SetNeedsManageTiles();
}
void SingleThreadProxy::SetNeedsRedrawRectOnImplThread(
@@ -355,8 +359,9 @@
}
void SingleThreadProxy::DidInitializeVisibleTileOnImplThread() {
- // Impl-side painting only.
- NOTREACHED();
+ TRACE_EVENT0("cc", "SingleThreadProxy::DidInitializeVisibleTileOnImplThread");
+ if (scheduler_on_impl_thread_)
+ scheduler_on_impl_thread_->SetNeedsRedraw();
}
void SingleThreadProxy::SetNeedsCommitOnImplThread() {
@@ -393,17 +398,41 @@
bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; }
+void SingleThreadProxy::DidActivateSyncTree() {
+ // Non-impl-side painting finishes commit in DoCommit. Impl-side painting
+ // defers until here to simulate SetNextCommitWaitsForActivation.
+ if (layer_tree_host_impl_->settings().impl_side_painting) {
+ // This is required because NotifyReadyToActivate gets called when
+ // the pending tree is not actually ready in the SingleThreadProxy.
+ layer_tree_host_impl_->SetRequiresHighResToDraw();
+
+ // Since activation could cause tasks to run, post CommitComplete
+ // separately so that it runs after these tasks. This is the loose
+ // equivalent of blocking commit until activation and also running
+ // all tasks posted during commit/activation before CommitComplete.
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&SingleThreadProxy::CommitComplete,
+ weak_factory_.GetWeakPtr()));
+ }
+
+ UpdateBackgroundAnimateTicking();
+ timing_history_.DidActivateSyncTree();
+}
+
+void SingleThreadProxy::DidManageTiles() {
+ DCHECK(layer_tree_host_impl_->settings().impl_side_painting);
+ DCHECK(Proxy::IsImplThread());
+ if (scheduler_on_impl_thread_)
+ scheduler_on_impl_thread_->DidManageTiles();
+}
+
void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() {
DCHECK(IsImplThread());
renderer_capabilities_for_main_thread_ =
layer_tree_host_impl_->GetRendererCapabilities().MainThreadCapabilities();
}
-void SingleThreadProxy::DidManageTiles() {
- // Impl-side painting only.
- NOTREACHED();
-}
-
void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() {
TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread");
{
@@ -435,13 +464,31 @@
TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately");
DCHECK(Proxy::IsMainThread());
DCHECK(!layer_tree_host_->output_surface_lost());
+ DCHECK(!layer_tree_host_impl_->settings().impl_side_painting)
+ << "Impl-side painting and synchronous compositing are not supported.";
- BeginFrameArgs begin_frame_args = BeginFrameArgs::Create(
- frame_begin_time, base::TimeTicks(), BeginFrameArgs::DefaultInterval());
- DoCommit(begin_frame_args);
+ {
+ BeginFrameArgs begin_frame_args(
+ BeginFrameArgs::Create(frame_begin_time,
+ base::TimeTicks(),
+ BeginFrameArgs::DefaultInterval()));
+ DoBeginMainFrame(begin_frame_args);
+ DoCommit();
- LayerTreeHostImpl::FrameData frame;
- DoComposite(frame_begin_time, &frame);
+ DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises())
+ << "Commit should always succeed and transfer promises.";
+ }
+
+ {
+ DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this));
+ LayerTreeHostImpl::FrameData frame;
+ DoComposite(frame_begin_time, &frame);
+
+ // DoComposite could abort, but because this is a synchronous composite
+ // another draw will never be scheduled, so break remaining promises.
+ layer_tree_host_impl_->active_tree()->BreakSwapPromises(
+ SwapPromise::SWAP_FAILS);
+ }
}
void SingleThreadProxy::AsValueInto(base::debug::TracedValue* state) const {
@@ -481,11 +528,24 @@
!ShouldComposite() && layer_tree_host_impl_->active_tree()->root_layer());
}
+void SingleThreadProxy::ScheduleRequestNewOutputSurface() {
+ if (output_surface_creation_callback_.IsCancelled() &&
+ !output_surface_creation_requested_) {
+ output_surface_creation_callback_.Reset(
+ base::Bind(&SingleThreadProxy::RequestNewOutputSurface,
+ weak_factory_.GetWeakPtr()));
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE, output_surface_creation_callback_.callback());
+ }
+}
+
DrawResult SingleThreadProxy::DoComposite(base::TimeTicks frame_begin_time,
LayerTreeHostImpl::FrameData* frame) {
TRACE_EVENT0("cc", "SingleThreadProxy::DoComposite");
DCHECK(!layer_tree_host_->output_surface_lost());
+ DrawResult draw_result;
+ bool draw_frame;
{
DebugScopedSetImplThread impl(this);
base::AutoReset<bool> mark_inside(&inside_draw_, true);
@@ -505,19 +565,20 @@
layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time);
UpdateBackgroundAnimateTicking();
- layer_tree_host_impl_->PrepareToDraw(frame);
- layer_tree_host_impl_->DrawLayers(frame, frame_begin_time);
+ draw_result = layer_tree_host_impl_->PrepareToDraw(frame);
+ draw_frame = draw_result == DRAW_SUCCESS;
+ if (draw_frame)
+ layer_tree_host_impl_->DrawLayers(frame, frame_begin_time);
layer_tree_host_impl_->DidDrawAllLayers(*frame);
- bool start_ready_animations = true;
+ bool start_ready_animations = draw_frame;
layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
-
layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
timing_history_.DidFinishDrawing();
}
- {
+ if (draw_frame) {
DebugScopedSetImplThread impl(this);
// This CapturePostTasks should be destroyed before
@@ -536,7 +597,7 @@
}
DidCommitAndDrawFrame();
- return DRAW_SUCCESS;
+ return draw_result;
}
void SingleThreadProxy::DidCommitAndDrawFrame() {
@@ -582,7 +643,8 @@
return;
}
- // This checker assumes NotifyReadyToCommit below causes a synchronous commit.
+ // This checker assumes NotifyReadyToCommit in this stack causes a synchronous
+ // commit.
ScopedAbortRemainingSwapPromises swap_promise_checker(layer_tree_host_);
if (!layer_tree_host_->visible()) {
@@ -598,11 +660,38 @@
return;
}
+ const BeginFrameArgs& begin_frame_args =
+ layer_tree_host_impl_->CurrentBeginFrameArgs();
+ DoBeginMainFrame(begin_frame_args);
+}
+
+void SingleThreadProxy::DoBeginMainFrame(
+ const BeginFrameArgs& begin_frame_args) {
+ layer_tree_host_->WillBeginMainFrame();
+ layer_tree_host_->BeginMainFrame(begin_frame_args);
+ layer_tree_host_->AnimateLayers(begin_frame_args.frame_time);
+ layer_tree_host_->Layout();
+
+ if (PrioritizedResourceManager* contents_texture_manager =
+ layer_tree_host_->contents_texture_manager()) {
+ contents_texture_manager->UnlinkAndClearEvictedBackings();
+ contents_texture_manager->SetMaxMemoryLimitBytes(
+ layer_tree_host_impl_->memory_allocation_limit_bytes());
+ contents_texture_manager->SetExternalPriorityCutoff(
+ layer_tree_host_impl_->memory_allocation_priority_cutoff());
+ }
+
+ DCHECK(!queue_for_commit_);
+ queue_for_commit_ = make_scoped_ptr(new ResourceUpdateQueue);
+
+ layer_tree_host_->UpdateLayers(queue_for_commit_.get());
+
timing_history_.DidBeginMainFrame();
- DCHECK(scheduler_on_impl_thread_);
- scheduler_on_impl_thread_->NotifyBeginMainFrameStarted();
- scheduler_on_impl_thread_->NotifyReadyToCommit();
+ if (scheduler_on_impl_thread_) {
+ scheduler_on_impl_thread_->NotifyBeginMainFrameStarted();
+ scheduler_on_impl_thread_->NotifyReadyToCommit();
+ }
}
void SingleThreadProxy::BeginMainFrameAbortedOnImplThread() {
@@ -631,7 +720,7 @@
void SingleThreadProxy::ScheduledActionCommit() {
DebugScopedSetMainThread main(this);
- DoCommit(layer_tree_host_impl_->CurrentBeginFrameArgs());
+ DoCommit();
}
void SingleThreadProxy::ScheduledActionAnimate() {
@@ -641,11 +730,13 @@
}
void SingleThreadProxy::ScheduledActionUpdateVisibleTiles() {
- // Impl-side painting only.
- NOTREACHED();
+ DebugScopedSetImplThread impl(this);
+ layer_tree_host_impl_->UpdateVisibleTiles();
}
void SingleThreadProxy::ScheduledActionActivateSyncTree() {
+ DebugScopedSetImplThread impl(this);
+ layer_tree_host_impl_->ActivateSyncTree();
}
void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() {
@@ -656,18 +747,17 @@
// from the ThreadProxy behavior. However, sometimes there is no
// task runner.
if (Proxy::MainThreadTaskRunner()) {
- MainThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&SingleThreadProxy::RequestNewOutputSurface,
- weak_factory_.GetWeakPtr()));
+ ScheduleRequestNewOutputSurface();
} else {
RequestNewOutputSurface();
}
}
void SingleThreadProxy::ScheduledActionManageTiles() {
- // Impl-side painting only.
- NOTREACHED();
+ TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionManageTiles");
+ DCHECK(layer_tree_host_impl_->settings().impl_side_painting);
+ DebugScopedSetImplThread impl(this);
+ layer_tree_host_impl_->ManageTiles();
}
void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) {
diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h
index 21b9f88..ed7b101 100644
--- a/cc/trees/single_thread_proxy.h
+++ b/cc/trees/single_thread_proxy.h
@@ -7,10 +7,12 @@
#include <limits>
+#include "base/cancelable_callback.h"
#include "base/time/time.h"
#include "cc/animation/animation_events.h"
#include "cc/output/begin_frame_args.h"
#include "cc/scheduler/scheduler.h"
+#include "cc/trees/blocking_task_runner.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/proxy.h"
#include "cc/trees/proxy_timing_history.h"
@@ -102,7 +104,7 @@
virtual void PostDelayedScrollbarFadeOnImplThread(
const base::Closure& start_fade,
base::TimeDelta delay) override {}
- virtual void DidActivateSyncTree() override {}
+ virtual void DidActivateSyncTree() override;
virtual void DidManageTiles() override;
virtual void SetDebugState(const LayerTreeDebugState& debug_state) override {}
@@ -119,14 +121,17 @@
void BeginMainFrame();
void BeginMainFrameAbortedOnImplThread();
- void DoCommit(const BeginFrameArgs& begin_frame_args);
+ void DoBeginMainFrame(const BeginFrameArgs& begin_frame_args);
+ void DoCommit();
DrawResult DoComposite(base::TimeTicks frame_begin_time,
LayerTreeHostImpl::FrameData* frame);
void DoSwap();
void DidCommitAndDrawFrame();
+ void CommitComplete();
bool ShouldComposite() const;
void UpdateBackgroundAnimateTicking();
+ void ScheduleRequestNewOutputSurface();
// Accessed on main thread only.
LayerTreeHost* layer_tree_host_;
@@ -141,6 +146,8 @@
scoped_ptr<Scheduler> scheduler_on_impl_thread_;
ProxyTimingHistory timing_history_;
+ scoped_ptr<BlockingTaskRunner::CapturePostTasks> commit_blocking_task_runner_;
+ scoped_ptr<ResourceUpdateQueue> queue_for_commit_;
bool next_frame_is_newly_committed_frame_;
bool inside_draw_;
@@ -148,6 +155,13 @@
bool commit_was_deferred_;
bool commit_requested_;
+ // True if a request to the LayerTreeHostClient to create an output surface
+ // is still outstanding.
+ bool output_surface_creation_requested_;
+
+ // This is the callback for the scheduled RequestNewOutputSurface.
+ base::CancelableClosure output_surface_creation_callback_;
+
base::WeakPtrFactory<SingleThreadProxy> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy);
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 93b4c65..34283c9 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -108,6 +108,7 @@
inside_draw(false),
input_throttled_until_commit(false),
animations_frozen_until_next_draw(false),
+ did_commit_after_animating(false),
smoothness_priority_expiration_notifier(
proxy->ImplThreadTaskRunner(),
base::Bind(&ThreadProxy::RenewTreePriority, base::Unretained(proxy)),
@@ -943,6 +944,7 @@
impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time;
}
impl().layer_tree_host_impl->Animate(impl().animation_time);
+ impl().did_commit_after_animating = false;
}
void ThreadProxy::ScheduledActionCommit() {
@@ -960,6 +962,7 @@
impl().animation_time = std::max(
impl().animation_time, blocked_main().last_monotonic_frame_begin_time);
}
+ impl().did_commit_after_animating = true;
blocked_main().main_thread_inside_commit = true;
impl().layer_tree_host_impl->BeginCommit();
@@ -1028,6 +1031,11 @@
impl().timing_history.DidStartDrawing();
base::AutoReset<bool> mark_inside(&impl().inside_draw, true);
+ if (impl().did_commit_after_animating) {
+ impl().layer_tree_host_impl->Animate(impl().animation_time);
+ impl().did_commit_after_animating = false;
+ }
+
if (impl().layer_tree_host_impl->pending_tree())
impl().layer_tree_host_impl->pending_tree()->UpdateDrawProperties();
@@ -1340,7 +1348,7 @@
// Once we enter NEW_CONTENTS_TAKES_PRIORITY mode, visible tiles on active
// tree might be freed. We need to set RequiresHighResToDraw to ensure that
// high res tiles will be required to activate pending tree.
- impl().layer_tree_host_impl->active_tree()->SetRequiresHighResToDraw();
+ impl().layer_tree_host_impl->SetRequiresHighResToDraw();
priority = NEW_CONTENT_TAKES_PRIORITY;
}
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
index faa86ce..fbb19be 100644
--- a/cc/trees/tree_synchronizer_unittest.cc
+++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -569,6 +569,7 @@
&proxy,
&stats_instrumentation,
shared_bitmap_manager.get(),
+ NULL,
0);
scoped_refptr<Layer> layer_tree_root = Layer::Create();
@@ -608,6 +609,7 @@
&proxy,
&stats_instrumentation,
shared_bitmap_manager.get(),
+ NULL,
0);
scoped_refptr<Layer> layer_tree_root = Layer::Create();
@@ -681,6 +683,7 @@
&proxy,
&stats_instrumentation,
shared_bitmap_manager.get(),
+ NULL,
0);
scoped_refptr<Layer> layer_tree_root = Layer::Create();
diff --git a/crypto/scoped_nss_types.h b/crypto/scoped_nss_types.h
index 8e96e8d..fdfb83c 100644
--- a/crypto/scoped_nss_types.h
+++ b/crypto/scoped_nss_types.h
@@ -16,6 +16,7 @@
template <typename Type, void (*Destroyer)(Type*)>
struct NSSDestroyer {
+ typedef void AllowSelfReset;
void operator()(Type* ptr) const {
Destroyer(ptr);
}
@@ -23,6 +24,7 @@
template <typename Type, void (*Destroyer)(Type*, PRBool), PRBool freeit>
struct NSSDestroyer1 {
+ typedef void AllowSelfReset;
void operator()(Type* ptr) const {
Destroyer(ptr, freeit);
}
diff --git a/crypto/scoped_openssl_types.h b/crypto/scoped_openssl_types.h
index d0428fb..cc056e4 100644
--- a/crypto/scoped_openssl_types.h
+++ b/crypto/scoped_openssl_types.h
@@ -22,6 +22,7 @@
// base::internal::RunnableAdapter<>, but that's far too heavy weight.
template <typename Type, void (*Destroyer)(Type*)>
struct OpenSSLDestroyer {
+ typedef void AllowSelfReset;
void operator()(Type* ptr) const { Destroyer(ptr); }
};
diff --git a/gin/modules/module_registry_unittest.cc b/gin/modules/module_registry_unittest.cc
index 77bf9f1..57bc02d 100644
--- a/gin/modules/module_registry_unittest.cc
+++ b/gin/modules/module_registry_unittest.cc
@@ -37,7 +37,7 @@
virtual void OnDidAddPendingModule(
const std::string& id,
- const std::vector<std::string>& dependencies) OVERRIDE {
+ const std::vector<std::string>& dependencies) override {
did_add_count_++;
id_ = id;
dependencies_ = dependencies;
diff --git a/gin/modules/module_runner_delegate.h b/gin/modules/module_runner_delegate.h
index df91f63..421e23a 100644
--- a/gin/modules/module_runner_delegate.h
+++ b/gin/modules/module_runner_delegate.h
@@ -41,9 +41,9 @@
// From ShellRunnerDelegate:
virtual v8::Handle<v8::ObjectTemplate> GetGlobalTemplate(
ShellRunner* runner,
- v8::Isolate* isolate) OVERRIDE;
- virtual void DidCreateContext(ShellRunner* runner) OVERRIDE;
- virtual void DidRunScript(ShellRunner* runner) OVERRIDE;
+ v8::Isolate* isolate) override;
+ virtual void DidCreateContext(ShellRunner* runner) override;
+ virtual void DidRunScript(ShellRunner* runner) override;
BuiltinModuleMap builtin_modules_;
FileModuleProvider module_provider_;
diff --git a/gin/modules/timer.h b/gin/modules/timer.h
index 1ec0b93..6284668 100644
--- a/gin/modules/timer.h
+++ b/gin/modules/timer.h
@@ -30,7 +30,7 @@
int delay_ms, v8::Handle<v8::Function> function);
virtual ObjectTemplateBuilder GetObjectTemplateBuilder(
- v8::Isolate* isolate) OVERRIDE;
+ v8::Isolate* isolate) override;
private:
Timer(v8::Isolate* isolate, bool repeating, int delay_ms,
@@ -58,7 +58,7 @@
virtual ~TimerModule();
virtual ObjectTemplateBuilder GetObjectTemplateBuilder(
- v8::Isolate* isolate) OVERRIDE;
+ v8::Isolate* isolate) override;
};
} // namespace gin
diff --git a/gin/modules/timer_unittest.cc b/gin/modules/timer_unittest.cc
index f7fd8f2..42d7050 100644
--- a/gin/modules/timer_unittest.cc
+++ b/gin/modules/timer_unittest.cc
@@ -41,7 +41,7 @@
}
virtual ObjectTemplateBuilder GetObjectTemplateBuilder(
- v8::Isolate* isolate) OVERRIDE {
+ v8::Isolate* isolate) override {
return Wrappable<Result>::GetObjectTemplateBuilder(isolate)
.SetProperty("count", &Result::count, &Result::set_count)
.SetMethod("quit", &Result::Quit);
diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h
index f085b58..59e2147 100644
--- a/gin/public/v8_platform.h
+++ b/gin/public/v8_platform.h
@@ -21,10 +21,10 @@
// v8::Platform implementation.
virtual void CallOnBackgroundThread(
v8::Task* task,
- v8::Platform::ExpectedRuntime expected_runtime) OVERRIDE;
+ v8::Platform::ExpectedRuntime expected_runtime) override;
virtual void CallOnForegroundThread(v8::Isolate* isolate,
- v8::Task* task) OVERRIDE;
- virtual double MonotonicallyIncreasingTime() OVERRIDE;
+ v8::Task* task) override;
+ virtual double MonotonicallyIncreasingTime() override;
private:
friend struct base::DefaultLazyInstanceTraits<V8Platform>;
diff --git a/gin/shell/gin_main.cc b/gin/shell/gin_main.cc
index aa9f2b5..77b167a 100644
--- a/gin/shell/gin_main.cc
+++ b/gin/shell/gin_main.cc
@@ -45,7 +45,7 @@
}
virtual void UnhandledException(ShellRunner* runner,
- TryCatch& try_catch) OVERRIDE {
+ TryCatch& try_catch) override {
ModuleRunnerDelegate::UnhandledException(runner, try_catch);
LOG(ERROR) << try_catch.GetStackTrace();
}
diff --git a/gin/test/file_runner.h b/gin/test/file_runner.h
index f248fb5..5082cd5 100644
--- a/gin/test/file_runner.h
+++ b/gin/test/file_runner.h
@@ -25,7 +25,7 @@
private:
// From ModuleRunnerDelegate:
virtual void UnhandledException(ShellRunner* runner,
- TryCatch& try_catch) OVERRIDE;
+ TryCatch& try_catch) override;
DISALLOW_COPY_AND_ASSIGN(FileRunnerDelegate);
};
diff --git a/gin/test/v8_test.h b/gin/test/v8_test.h
index e62aa57..39ed4e9 100644
--- a/gin/test/v8_test.h
+++ b/gin/test/v8_test.h
@@ -22,8 +22,8 @@
V8Test();
virtual ~V8Test();
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
protected:
scoped_ptr<IsolateHolder> instance_;
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn
index b77dfca..8239940 100644
--- a/gpu/BUILD.gn
+++ b/gpu/BUILD.gn
@@ -43,6 +43,7 @@
"//gpu/command_buffer/common",
"//gpu/command_buffer/service",
"//gpu/config",
+ "//gpu/ipc",
]
}
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt
index 154f91e..2974e43 100644
--- a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt
+++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt
@@ -8,7 +8,7 @@
Version
- Last Modifed Date: Apr 30, 2014
+ Last Modifed Date: Oct 7, 2014
Dependencies
@@ -16,19 +16,8 @@
Overview
- This extension allows for more efficient uploading of texture data through
- Chromium's OpenGL ES 2.0 implementation as well as enable hardware overlay
- support by providing ability to create buffers capable of being scanned out
- directly by the display controller.
-
- For security reasons Chromium accesses the GPU from a separate process. User
- processes are not allowed to access the GPU directly. This multi-process
- architechure has the advantage that GPU operations can be secured and
- pipelined but it has the disadvantage that all data that is going to be
- passed to GPU must first be made available to the separate GPU process.
-
- This extension helps the application directly allocate and access texture
- memory.
+ This extension defines a new resource type that is suitable for
+ sharing 2D arrays of image data between client APIs.
Issues
@@ -36,73 +25,32 @@
New Tokens
- Accepted by the <pname> parameter of GetImageParameterivCHROMIUM:
-
- IMAGE_ROWBYTES_CHROMIUM 0x78F0
-
- Accepted by the <usage> parameter of CreateImageCHROMIUM:
-
- IMAGE_MAP_CHROMIUM 0x78F1
- IMAGE_SCANOUT_CHROMIUM 0x78F2
+ None
New Procedures and Functions
- GLuint CreateImageCHROMIUM(GLsizei width, GLsizei height,
- GLenum internalformat, GLenum usage)
+ GLuint CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
+ GLsizei height,
+ GLenum internalformat)
- Allocate an image with width equal to <width> and height equal
- to <height> stored in format <internalformat>.
+ Create an image from <buffer> with width equal to <width> and
+ height equal to <height> and format equal to <internalformat>.
- Returns a unique identifier for the allocated image that could be used
- in subsequent operations.
+ Returns a unique identifier for the image that could be used in
+ subsequent operations.
INVALID_VALUE is generated if <width> or <height> is nonpositive.
- INVALID_ENUM is generated if <usage> is not one of
- IMAGE_MAP_CHROMIUM and IMAGE_SCANOUT_CHROMIUM.
+ INVALID_ENUM is generated if <internalformat> is not one of
+ RGB or RGBA.
void DestroyImageCHROMIUM(GLuint image_id)
- Frees the image previously allocated by a call to CreateImageCHROMIUM.
+ Frees the image previously created by a call to CreateImageCHROMIUM.
INVALID_OPERATION is generated if <image_id> is not a valid image id.
- void* MapImageCHROMIUM(GLuint image_id)
-
- Returns a pointer to in the user memory for the application to modify
- the image. It is illegal to call this function on an image not created
- with IMAGE_MAP_CHROMIUM usage.
-
- INVALID_OPERATION is generated if <image_id> is not a valid image id.
-
- INVALID_OPERATION is generated if the image was already mapped by a previous
- call to this method.
-
- void UnmapImageCHROMIUM(GLuint image_id)
-
- Removes the mapping created by a call to MapImageCHROMIUM.
-
- Note that after calling UnmapImageCHROMIUM the application should assume
- that the memory returned by MapImageCHROMIUM is off limits and is no longer
- accessible by the application. Accessing it after calling
- UnmapImageCHROMIUM will produce undefined results.
-
- INVALID_OPERATION is generated if <image_id> is not a valid image id.
-
- INVALID_OPERATION is generated if the image was not already mapped by a
- previous call to MapImageCHROMIUM.
-
- void GetImageParameterivCHROMIUM(GLuint image_id, GLenum pname,
- GLint* params)
-
- Sets <params> to the integer value of the parameter specified by <pname>
- for the image specified by <image_id>. <params> is expected to be
- properly allocated before calling this method.
-
- INVALID_OPERATION is generated if <image_id> is not a valid image id.
-
- INVALID_ENUM is generated if <pname> is not IMAGE_ROWBYTES_CHROMIUM.
-
Errors
None.
@@ -115,3 +63,4 @@
5/9/2013 Documented the extension
4/30/2014 Moved usage flag to creation function.
+ 10/7/2014 Remove map/unmap API.
diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h
index ddc5730..843cb31 100644
--- a/gpu/GLES2/gl2chromium_autogen.h
+++ b/gpu/GLES2/gl2chromium_autogen.h
@@ -185,8 +185,6 @@
#define glEnableFeatureCHROMIUM GLES2_GET_FUN(EnableFeatureCHROMIUM)
#define glMapBufferCHROMIUM GLES2_GET_FUN(MapBufferCHROMIUM)
#define glUnmapBufferCHROMIUM GLES2_GET_FUN(UnmapBufferCHROMIUM)
-#define glMapImageCHROMIUM GLES2_GET_FUN(MapImageCHROMIUM)
-#define glUnmapImageCHROMIUM GLES2_GET_FUN(UnmapImageCHROMIUM)
#define glMapBufferSubDataCHROMIUM GLES2_GET_FUN(MapBufferSubDataCHROMIUM)
#define glUnmapBufferSubDataCHROMIUM GLES2_GET_FUN(UnmapBufferSubDataCHROMIUM)
#define glMapTexSubImage2DCHROMIUM GLES2_GET_FUN(MapTexSubImage2DCHROMIUM)
@@ -202,7 +200,6 @@
#define glCreateStreamTextureCHROMIUM GLES2_GET_FUN(CreateStreamTextureCHROMIUM)
#define glCreateImageCHROMIUM GLES2_GET_FUN(CreateImageCHROMIUM)
#define glDestroyImageCHROMIUM GLES2_GET_FUN(DestroyImageCHROMIUM)
-#define glGetImageParameterivCHROMIUM GLES2_GET_FUN(GetImageParameterivCHROMIUM)
#define glCreateGpuMemoryBufferImageCHROMIUM \
GLES2_GET_FUN(CreateGpuMemoryBufferImageCHROMIUM)
#define glGetTranslatedShaderSourceANGLE \
diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h
index 5199864..b524112 100644
--- a/gpu/GLES2/gl2extchromium.h
+++ b/gpu/GLES2/gl2extchromium.h
@@ -106,38 +106,22 @@
#ifndef GL_CHROMIUM_image
#define GL_CHROMIUM_image 1
-#ifndef GL_IMAGE_ROWBYTES_CHROMIUM
-#define GL_IMAGE_ROWBYTES_CHROMIUM 0x78F0
-#endif
-
-#ifndef GL_IMAGE_MAP_CHROMIUM
-#define GL_IMAGE_MAP_CHROMIUM 0x78F1
-#endif
-
-#ifndef GL_IMAGE_SCANOUT_CHROMIUM
-#define GL_IMAGE_SCANOUT_CHROMIUM 0x78F2
-#endif
+typedef struct _ClientBuffer* ClientBuffer;
#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL GLuint GL_APIENTRY glCreateImageCHROMIUM(GLsizei width,
+GL_APICALL GLuint GL_APIENTRY glCreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage);
+ GLenum internalformat);
GL_APICALL void GL_APIENTRY glDestroyImageCHROMIUM(GLuint image_id);
-GL_APICALL void GL_APIENTRY glGetImageParameterivCHROMIUM(
- GLuint image_id, GLenum pname, GLint* params);
-GL_APICALL void* GL_APIENTRY glMapImageCHROMIUM(GLuint image_id);
-GL_APICALL void GL_APIENTRY glUnmapImageCHROMIUM(GLuint image_id);
#endif
typedef GLuint(GL_APIENTRYP PFNGLCREATEIMAGECHROMIUMPROC)(
+ ClientBuffer buffer,
GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage);
+ GLenum internalformat);
typedef void (
GL_APIENTRYP PFNGLDESTROYIMAGECHROMIUMPROC)(GLuint image_id);
-typedef void* (GL_APIENTRYP PFNGLMAPIMAGECHROMIUMPROC)(GLuint image_id);
-typedef void (GL_APIENTRYP PFNGLUNMAPIMAGECHROMIUMPROC)(GLuint image_id);
#endif /* GL_CHROMIUM_image */
/* GL_CHROMIUM_gpu_memory_buffer_image */
@@ -159,7 +143,7 @@
GLenum internalformat,
GLenum usage);
#endif
-typedef GLuint(GL_APIENTRYP PFNGLCREATEGPUMEMORYBUFFERIMAGECHROMIUMPROC) (
+typedef GLuint(GL_APIENTRYP PFNGLCREATEGPUMEMORYBUFFERIMAGECHROMIUMPROC)(
GLsizei width,
GLsizei height,
GLenum internalformat,
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index a6a6323..14191f2 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -1485,7 +1485,8 @@
'CreateImageCHROMIUM': {
'type': 'Manual',
'cmd_args':
- 'GLsizei width, GLsizei height, GLenum internalformat, GLenum usage',
+ 'ClientBuffer buffer, GLsizei width, GLsizei height, '
+ 'GLenum internalformat',
'result': ['GLuint'],
'client_test': False,
'gen_cmd': False,
@@ -1500,14 +1501,6 @@
'extension': True,
'chromium': True,
},
- 'GetImageParameterivCHROMIUM': {
- 'type': 'Manual',
- 'client_test': False,
- 'gen_cmd': False,
- 'expectation': False,
- 'extension': True,
- 'chromium': True,
- },
'CreateGpuMemoryBufferImageCHROMIUM': {
'type': 'Manual',
'cmd_args':
@@ -1992,12 +1985,6 @@
'client_test': False,
'pepper_interface': 'ChromiumMapSub',
},
- 'MapImageCHROMIUM': {
- 'gen_cmd': False,
- 'extension': True,
- 'chromium': True,
- 'client_test': False,
- },
'MapTexSubImage2DCHROMIUM': {
'gen_cmd': False,
'extension': True,
@@ -2237,12 +2224,6 @@
'client_test': False,
'pepper_interface': 'ChromiumMapSub',
},
- 'UnmapImageCHROMIUM': {
- 'gen_cmd': False,
- 'extension': True,
- 'chromium': True,
- 'client_test': False,
- },
'UnmapTexSubImage2DCHROMIUM': {
'gen_cmd': False,
'extension': True,
@@ -5867,8 +5848,10 @@
" helper_->%s(%s%sGetResultShmId(), GetResultShmOffset());\n" %
(func.name, arg_string, comma))
file.Write(" WaitForCmd();\n")
- file.Write(" %s result_value = *result;\n" % func.return_type)
- file.Write(' GPU_CLIENT_LOG("returned " << result_value);\n')
+ file.Write(" %s result_value = *result" % func.return_type)
+ if func.return_type == "GLboolean":
+ file.Write(" != 0")
+ file.Write(';\n GPU_CLIENT_LOG("returned " << result_value);\n')
file.Write(" CheckGLError();\n")
file.Write(" return result_value;\n")
file.Write("}\n")
diff --git a/gpu/command_buffer/client/BUILD.gn b/gpu/command_buffer/client/BUILD.gn
index afd03a4..9b4749f 100644
--- a/gpu/command_buffer/client/BUILD.gn
+++ b/gpu/command_buffer/client/BUILD.gn
@@ -81,9 +81,6 @@
"gles2_trace_implementation.cc",
"gles2_trace_implementation.h",
"gles2_trace_implementation_impl_autogen.h",
- "gpu_memory_buffer_factory.h",
- "gpu_memory_buffer_tracker.cc",
- "gpu_memory_buffer_tracker.h",
"gpu_switches.cc",
"gpu_switches.h",
"program_info_manager.cc",
diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h
index d545045..51c6b6d 100644
--- a/gpu/command_buffer/client/client_test_helper.h
+++ b/gpu/command_buffer/client/client_test_helper.h
@@ -88,13 +88,17 @@
virtual ~MockClientGpuControl();
MOCK_METHOD0(GetCapabilities, Capabilities());
- MOCK_METHOD5(CreateGpuMemoryBuffer,
- gfx::GpuMemoryBuffer*(size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32* id));
- MOCK_METHOD1(DestroyGpuMemoryBuffer, void(int32 id));
+ MOCK_METHOD4(CreateImage,
+ int32(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat));
+ MOCK_METHOD1(DestroyImage, void(int32 id));
+ MOCK_METHOD4(CreateGpuMemoryBufferImage,
+ int32(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage));
MOCK_METHOD0(InsertSyncPoint, uint32());
MOCK_METHOD0(InsertFutureSyncPoint, uint32());
MOCK_METHOD1(RetireSyncPoint, void(uint32 id));
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h
index e11cf63..71e3c82 100644
--- a/gpu/command_buffer/client/gles2_c_lib_autogen.h
+++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -721,12 +721,6 @@
GLboolean GLES2UnmapBufferCHROMIUM(GLuint target) {
return gles2::GetGLContext()->UnmapBufferCHROMIUM(target);
}
-void* GLES2MapImageCHROMIUM(GLuint image_id) {
- return gles2::GetGLContext()->MapImageCHROMIUM(image_id);
-}
-void GLES2UnmapImageCHROMIUM(GLuint image_id) {
- gles2::GetGLContext()->UnmapImageCHROMIUM(image_id);
-}
void* GLES2MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
@@ -780,21 +774,16 @@
GLuint GLES2CreateStreamTextureCHROMIUM(GLuint texture) {
return gles2::GetGLContext()->CreateStreamTextureCHROMIUM(texture);
}
-GLuint GLES2CreateImageCHROMIUM(GLsizei width,
+GLuint GLES2CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) {
+ GLenum internalformat) {
return gles2::GetGLContext()->CreateImageCHROMIUM(
- width, height, internalformat, usage);
+ buffer, width, height, internalformat);
}
void GLES2DestroyImageCHROMIUM(GLuint image_id) {
gles2::GetGLContext()->DestroyImageCHROMIUM(image_id);
}
-void GLES2GetImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params) {
- gles2::GetGLContext()->GetImageParameterivCHROMIUM(image_id, pname, params);
-}
GLuint GLES2CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
@@ -1650,14 +1639,6 @@
reinterpret_cast<GLES2FunctionPointer>(glUnmapBufferCHROMIUM),
},
{
- "glMapImageCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glMapImageCHROMIUM),
- },
- {
- "glUnmapImageCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glUnmapImageCHROMIUM),
- },
- {
"glMapBufferSubDataCHROMIUM",
reinterpret_cast<GLES2FunctionPointer>(glMapBufferSubDataCHROMIUM),
},
@@ -1711,10 +1692,6 @@
reinterpret_cast<GLES2FunctionPointer>(glDestroyImageCHROMIUM),
},
{
- "glGetImageParameterivCHROMIUM",
- reinterpret_cast<GLES2FunctionPointer>(glGetImageParameterivCHROMIUM),
- },
- {
"glCreateGpuMemoryBufferImageCHROMIUM",
reinterpret_cast<GLES2FunctionPointer>(
glCreateGpuMemoryBufferImageCHROMIUM),
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index aabfa45..96a71fc 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -18,14 +18,12 @@
#include "base/bind.h"
#include "gpu/command_buffer/client/buffer_tracker.h"
#include "gpu/command_buffer/client/gpu_control.h"
-#include "gpu/command_buffer/client/gpu_memory_buffer_tracker.h"
#include "gpu/command_buffer/client/program_info_manager.h"
#include "gpu/command_buffer/client/query_tracker.h"
#include "gpu/command_buffer/client/transfer_buffer.h"
#include "gpu/command_buffer/client/vertex_array_object_manager.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/common/trace_event.h"
-#include "ui/gfx/gpu_memory_buffer.h"
#if defined(__native_client__) && !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS)
#define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS
@@ -191,7 +189,6 @@
query_tracker_.reset(new QueryTracker(mapped_memory_.get()));
buffer_tracker_.reset(new BufferTracker(mapped_memory_.get()));
- gpu_memory_buffer_tracker_.reset(new GpuMemoryBufferTracker(gpu_control_));
query_id_allocator_.reset(new IdAllocator());
#if defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS)
@@ -2831,7 +2828,7 @@
WaitForCmd();
helper_->SetBucketSize(kResultBucketId, 0);
GPU_CLIENT_LOG(" returned " << GLES2Util::GetStringBool(*result));
- return *result;
+ return *result != 0;
}
void* GLES2Implementation::MapBufferSubDataCHROMIUM(
@@ -3937,10 +3934,10 @@
} // namespace
-GLuint GLES2Implementation::CreateImageCHROMIUMHelper(GLsizei width,
+GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) {
+ GLenum internalformat) {
if (width <= 0) {
SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "width <= 0");
return 0;
@@ -3950,48 +3947,44 @@
SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "height <= 0");
return 0;
}
+
+ if (!ValidImageFormat(internalformat)) {
+ SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "invalid format");
+ return 0;
+ }
+
// Flush the command stream to ensure ordering in case the newly
// returned image_id has recently been in use with a different buffer.
helper_->CommandBufferHelper::Flush();
-
- // Create new buffer.
- GLuint buffer_id = gpu_memory_buffer_tracker_->CreateBuffer(
- width, height, internalformat, usage);
- if (buffer_id == 0) {
- SetGLError(GL_OUT_OF_MEMORY, "glCreateImageCHROMIUM", "out of GPU memory.");
+ int32_t image_id =
+ gpu_control_->CreateImage(buffer, width, height, internalformat);
+ if (image_id < 0) {
+ SetGLError(GL_OUT_OF_MEMORY, "glCreateImageCHROMIUM", "image_id < 0");
return 0;
}
- return buffer_id;
+ return image_id;
}
-GLuint GLES2Implementation::CreateImageCHROMIUM(GLsizei width,
+GLuint GLES2Implementation::CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) {
+ GLenum internalformat) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG(
- "[" << GetLogPrefix() << "] glCreateImageCHROMIUM(" << width << ", "
- << height << ", "
- << GLES2Util::GetStringTextureInternalFormat(internalformat) << ", "
- << GLES2Util::GetStringTextureInternalFormat(usage) << ")");
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateImageCHROMIUM(" << width
+ << ", " << height << ", "
+ << GLES2Util::GetStringImageInternalFormat(internalformat)
+ << ")");
GLuint image_id =
- CreateImageCHROMIUMHelper(width, height, internalformat, usage);
+ CreateImageCHROMIUMHelper(buffer, width, height, internalformat);
CheckGLError();
return image_id;
}
void GLES2Implementation::DestroyImageCHROMIUMHelper(GLuint image_id) {
- gfx::GpuMemoryBuffer* gpu_buffer = gpu_memory_buffer_tracker_->GetBuffer(
- image_id);
- if (!gpu_buffer) {
- SetGLError(GL_INVALID_OPERATION, "glDestroyImageCHROMIUM", "invalid image");
- return;
- }
-
// Flush the command stream to make sure all pending commands
// that may refer to the image_id are executed on the service side.
helper_->CommandBufferHelper::Flush();
- gpu_memory_buffer_tracker_->RemoveBuffer(image_id);
+ gpu_control_->DestroyImage(image_id);
}
void GLES2Implementation::DestroyImageCHROMIUM(GLuint image_id) {
@@ -4002,93 +3995,6 @@
CheckGLError();
}
-void GLES2Implementation::UnmapImageCHROMIUMHelper(GLuint image_id) {
- gfx::GpuMemoryBuffer* gpu_buffer = gpu_memory_buffer_tracker_->GetBuffer(
- image_id);
- if (!gpu_buffer) {
- SetGLError(GL_INVALID_OPERATION, "glUnmapImageCHROMIUM", "invalid image");
- return;
- }
-
- if (!gpu_buffer->IsMapped()) {
- SetGLError(GL_INVALID_OPERATION, "glUnmapImageCHROMIUM", "not mapped");
- return;
- }
- gpu_buffer->Unmap();
-}
-
-void GLES2Implementation::UnmapImageCHROMIUM(GLuint image_id) {
- GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUnmapImageCHROMIUM("
- << image_id << ")");
-
- UnmapImageCHROMIUMHelper(image_id);
- CheckGLError();
-}
-
-void* GLES2Implementation::MapImageCHROMIUMHelper(GLuint image_id) {
- gfx::GpuMemoryBuffer* gpu_buffer = gpu_memory_buffer_tracker_->GetBuffer(
- image_id);
- if (!gpu_buffer) {
- SetGLError(GL_INVALID_OPERATION, "glMapImageCHROMIUM", "invalid image");
- return NULL;
- }
-
- if (gpu_buffer->IsMapped()) {
- SetGLError(GL_INVALID_OPERATION, "glMapImageCHROMIUM", "already mapped");
- return NULL;
- }
-
- return gpu_buffer->Map();
-}
-
-void* GLES2Implementation::MapImageCHROMIUM(GLuint image_id) {
- GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMapImageCHROMIUM(" << image_id
- << ")");
-
- void* mapped = MapImageCHROMIUMHelper(image_id);
- CheckGLError();
- return mapped;
-}
-
-void GLES2Implementation::GetImageParameterivCHROMIUMHelper(
- GLuint image_id, GLenum pname, GLint* params) {
- if (pname != GL_IMAGE_ROWBYTES_CHROMIUM) {
- SetGLError(GL_INVALID_ENUM, "glGetImageParameterivCHROMIUM",
- "invalid parameter");
- return;
- }
-
- gfx::GpuMemoryBuffer* gpu_buffer = gpu_memory_buffer_tracker_->GetBuffer(
- image_id);
- if (!gpu_buffer) {
- SetGLError(GL_INVALID_OPERATION, "glGetImageParameterivCHROMIUM",
- "invalid image");
- return;
- }
-
- if (!gpu_buffer->IsMapped()) {
- SetGLError(
- GL_INVALID_OPERATION, "glGetImageParameterivCHROMIUM", "not mapped");
- return;
- }
-
- *params = gpu_buffer->GetStride();
-}
-
-void GLES2Implementation::GetImageParameterivCHROMIUM(
- GLuint image_id, GLenum pname, GLint* params) {
- GPU_CLIENT_SINGLE_THREAD_CHECK();
- GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
- GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glImageParameterivCHROMIUM("
- << image_id << ", "
- << GLES2Util::GetStringBufferParameter(pname) << ", "
- << static_cast<const void*>(params) << ")");
- GetImageParameterivCHROMIUMHelper(image_id, pname, params);
- CheckGLError();
-}
-
GLuint GLES2Implementation::CreateGpuMemoryBufferImageCHROMIUMHelper(
GLsizei width,
GLsizei height,
@@ -4124,20 +4030,15 @@
// Flush the command stream to ensure ordering in case the newly
// returned image_id has recently been in use with a different buffer.
helper_->CommandBufferHelper::Flush();
-
- // Create new buffer.
- GLuint buffer_id = gpu_memory_buffer_tracker_->CreateBuffer(
- width,
- height,
- internalformat == GL_RGBA ? GL_RGBA8_OES : GL_RGB8_OES,
- usage);
- if (buffer_id == 0) {
+ int32_t image_id = gpu_control_->CreateGpuMemoryBufferImage(
+ width, height, internalformat, usage);
+ if (image_id < 0) {
SetGLError(GL_OUT_OF_MEMORY,
"glCreateGpuMemoryBufferImageCHROMIUM",
- "out of GPU memory");
+ "image_id < 0");
return 0;
}
- return buffer_id;
+ return image_id;
}
GLuint GLES2Implementation::CreateGpuMemoryBufferImageCHROMIUM(
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index e3d8fd9..1025a3e 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -24,7 +24,6 @@
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gles2_impl_export.h"
#include "gpu/command_buffer/client/gles2_interface.h"
-#include "gpu/command_buffer/client/gpu_memory_buffer_tracker.h"
#include "gpu/command_buffer/client/mapped_memory.h"
#include "gpu/command_buffer/client/query_tracker.h"
#include "gpu/command_buffer/client/ref_counted.h"
@@ -543,15 +542,11 @@
GLenum target, GLintptr offset, GLsizeiptr size, const void* data,
ScopedTransferBufferPtr* buffer);
- GLuint CreateImageCHROMIUMHelper(GLsizei width,
+ GLuint CreateImageCHROMIUMHelper(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage);
+ GLenum internalformat);
void DestroyImageCHROMIUMHelper(GLuint image_id);
- void* MapImageCHROMIUMHelper(GLuint image_id);
- void UnmapImageCHROMIUMHelper(GLuint image_id);
- void GetImageParameterivCHROMIUMHelper(
- GLuint image_id, GLenum pname, GLint* params);
GLuint CreateGpuMemoryBufferImageCHROMIUMHelper(GLsizei width,
GLsizei height,
GLenum internalformat,
@@ -774,8 +769,6 @@
scoped_ptr<BufferTracker> buffer_tracker_;
- scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_;
-
GLES2ImplementationErrorMessageCallback* error_message_callback_;
scoped_ptr<std::string> current_trace_name_;
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index 1a36943..5465fc7 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -559,10 +559,6 @@
virtual GLboolean UnmapBufferCHROMIUM(GLuint target) override;
-virtual void* MapImageCHROMIUM(GLuint image_id) override;
-
-virtual void UnmapImageCHROMIUM(GLuint image_id) override;
-
virtual void* MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
@@ -604,17 +600,13 @@
virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) override;
-virtual GLuint CreateImageCHROMIUM(GLsizei width,
+virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) override;
+ GLenum internalformat) override;
virtual void DestroyImageCHROMIUM(GLuint image_id) override;
-virtual void GetImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params) override;
-
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index e63ba63..50d7f82 100644
--- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -964,7 +964,7 @@
*result = 0;
helper_->IsBuffer(buffer, GetResultShmId(), GetResultShmOffset());
WaitForCmd();
- GLboolean result_value = *result;
+ GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
return result_value;
@@ -983,7 +983,7 @@
*result = 0;
helper_->IsFramebuffer(framebuffer, GetResultShmId(), GetResultShmOffset());
WaitForCmd();
- GLboolean result_value = *result;
+ GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
return result_value;
@@ -1001,7 +1001,7 @@
*result = 0;
helper_->IsProgram(program, GetResultShmId(), GetResultShmOffset());
WaitForCmd();
- GLboolean result_value = *result;
+ GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
return result_value;
@@ -1020,7 +1020,7 @@
*result = 0;
helper_->IsRenderbuffer(renderbuffer, GetResultShmId(), GetResultShmOffset());
WaitForCmd();
- GLboolean result_value = *result;
+ GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
return result_value;
@@ -1038,7 +1038,7 @@
*result = 0;
helper_->IsShader(shader, GetResultShmId(), GetResultShmOffset());
WaitForCmd();
- GLboolean result_value = *result;
+ GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
return result_value;
@@ -1056,7 +1056,7 @@
*result = 0;
helper_->IsTexture(texture, GetResultShmId(), GetResultShmOffset());
WaitForCmd();
- GLboolean result_value = *result;
+ GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
return result_value;
@@ -1936,7 +1936,7 @@
*result = 0;
helper_->IsVertexArrayOES(array, GetResultShmId(), GetResultShmOffset());
WaitForCmd();
- GLboolean result_value = *result;
+ GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
return result_value;
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 658b7e2..b4e2667 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -3369,9 +3369,9 @@
};
GLsizei max = std::numeric_limits<GLsizei>::max();
- EXPECT_CALL(*gpu_control_, CreateGpuMemoryBuffer(max, max, _, _, _))
- .WillOnce(Return(static_cast<gfx::GpuMemoryBuffer*>(NULL)));
- gl_->CreateImageCHROMIUM(max, max, 0, GL_IMAGE_MAP_CHROMIUM);
+ EXPECT_CALL(*gpu_control_, CreateGpuMemoryBufferImage(max, max, _, _))
+ .WillOnce(Return(-1));
+ gl_->CreateGpuMemoryBufferImageCHROMIUM(max, max, GL_RGBA, GL_MAP_CHROMIUM);
// The context should be lost.
Cmds expected;
expected.cmd.Init(GL_GUILTY_CONTEXT_RESET_ARB, GL_UNKNOWN_CONTEXT_RESET_ARB);
@@ -3387,9 +3387,9 @@
};
GLsizei max = std::numeric_limits<GLsizei>::max();
- EXPECT_CALL(*gpu_control_, CreateGpuMemoryBuffer(max, max, _, _, _))
- .WillOnce(Return(static_cast<gfx::GpuMemoryBuffer*>(NULL)));
- gl_->CreateImageCHROMIUM(max, max, 0, GL_IMAGE_MAP_CHROMIUM);
+ EXPECT_CALL(*gpu_control_, CreateGpuMemoryBufferImage(max, max, _, _))
+ .WillOnce(Return(-1));
+ gl_->CreateGpuMemoryBufferImageCHROMIUM(max, max, GL_RGBA, GL_MAP_CHROMIUM);
// The context should not be lost.
EXPECT_TRUE(NoCommandsWritten());
}
diff --git a/gpu/command_buffer/client/gles2_interface.h b/gpu/command_buffer/client/gles2_interface.h
index ca05308..0b0bc51 100644
--- a/gpu/command_buffer/client/gles2_interface.h
+++ b/gpu/command_buffer/client/gles2_interface.h
@@ -9,6 +9,8 @@
#include "base/compiler_specific.h"
+extern "C" typedef struct _ClientBuffer* ClientBuffer;
+
namespace gpu {
namespace gles2 {
diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h
index abfc598..595bde1 100644
--- a/gpu/command_buffer/client/gles2_interface_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -371,8 +371,6 @@
virtual GLboolean EnableFeatureCHROMIUM(const char* feature) = 0;
virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) = 0;
virtual GLboolean UnmapBufferCHROMIUM(GLuint target) = 0;
-virtual void* MapImageCHROMIUM(GLuint image_id) = 0;
-virtual void UnmapImageCHROMIUM(GLuint image_id) = 0;
virtual void* MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
@@ -403,14 +401,11 @@
GLsizei* size,
void* info) = 0;
virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) = 0;
-virtual GLuint CreateImageCHROMIUM(GLsizei width,
+virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) = 0;
+ GLenum internalformat) = 0;
virtual void DestroyImageCHROMIUM(GLuint image_id) = 0;
-virtual void GetImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params) = 0;
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
index f059cad..b021b56 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -402,8 +402,6 @@
virtual GLboolean EnableFeatureCHROMIUM(const char* feature) override;
virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) override;
virtual GLboolean UnmapBufferCHROMIUM(GLuint target) override;
-virtual void* MapImageCHROMIUM(GLuint image_id) override;
-virtual void UnmapImageCHROMIUM(GLuint image_id) override;
virtual void* MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
@@ -434,14 +432,11 @@
GLsizei* size,
void* info) override;
virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) override;
-virtual GLuint CreateImageCHROMIUM(GLsizei width,
+virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) override;
+ GLenum internalformat) override;
virtual void DestroyImageCHROMIUM(GLuint image_id) override;
-virtual void GetImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params) override;
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
index cde303f..0936086 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -662,11 +662,6 @@
GLboolean GLES2InterfaceStub::UnmapBufferCHROMIUM(GLuint /* target */) {
return 0;
}
-void* GLES2InterfaceStub::MapImageCHROMIUM(GLuint /* image_id */) {
- return 0;
-}
-void GLES2InterfaceStub::UnmapImageCHROMIUM(GLuint /* image_id */) {
-}
void* GLES2InterfaceStub::MapBufferSubDataCHROMIUM(GLuint /* target */,
GLintptr /* offset */,
GLsizeiptr /* size */,
@@ -712,18 +707,14 @@
GLuint GLES2InterfaceStub::CreateStreamTextureCHROMIUM(GLuint /* texture */) {
return 0;
}
-GLuint GLES2InterfaceStub::CreateImageCHROMIUM(GLsizei /* width */,
+GLuint GLES2InterfaceStub::CreateImageCHROMIUM(ClientBuffer /* buffer */,
+ GLsizei /* width */,
GLsizei /* height */,
- GLenum /* internalformat */,
- GLenum /* usage */) {
+ GLenum /* internalformat */) {
return 0;
}
void GLES2InterfaceStub::DestroyImageCHROMIUM(GLuint /* image_id */) {
}
-void GLES2InterfaceStub::GetImageParameterivCHROMIUM(GLuint /* image_id */,
- GLenum /* pname */,
- GLint* /* params */) {
-}
GLuint GLES2InterfaceStub::CreateGpuMemoryBufferImageCHROMIUM(
GLsizei /* width */,
GLsizei /* height */,
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
index 1e7bc8f..aa0c96f 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -402,8 +402,6 @@
virtual GLboolean EnableFeatureCHROMIUM(const char* feature) override;
virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) override;
virtual GLboolean UnmapBufferCHROMIUM(GLuint target) override;
-virtual void* MapImageCHROMIUM(GLuint image_id) override;
-virtual void UnmapImageCHROMIUM(GLuint image_id) override;
virtual void* MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
@@ -434,14 +432,11 @@
GLsizei* size,
void* info) override;
virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) override;
-virtual GLuint CreateImageCHROMIUM(GLsizei width,
+virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) override;
+ GLenum internalformat) override;
virtual void DestroyImageCHROMIUM(GLuint image_id) override;
-virtual void GetImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params) override;
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
index 4495967..d1b5fce 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -1156,16 +1156,6 @@
return gl_->UnmapBufferCHROMIUM(target);
}
-void* GLES2TraceImplementation::MapImageCHROMIUM(GLuint image_id) {
- TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::MapImageCHROMIUM");
- return gl_->MapImageCHROMIUM(image_id);
-}
-
-void GLES2TraceImplementation::UnmapImageCHROMIUM(GLuint image_id) {
- TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::UnmapImageCHROMIUM");
- gl_->UnmapImageCHROMIUM(image_id);
-}
-
void* GLES2TraceImplementation::MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
@@ -1247,12 +1237,12 @@
return gl_->CreateStreamTextureCHROMIUM(texture);
}
-GLuint GLES2TraceImplementation::CreateImageCHROMIUM(GLsizei width,
+GLuint GLES2TraceImplementation::CreateImageCHROMIUM(ClientBuffer buffer,
+ GLsizei width,
GLsizei height,
- GLenum internalformat,
- GLenum usage) {
+ GLenum internalformat) {
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CreateImageCHROMIUM");
- return gl_->CreateImageCHROMIUM(width, height, internalformat, usage);
+ return gl_->CreateImageCHROMIUM(buffer, width, height, internalformat);
}
void GLES2TraceImplementation::DestroyImageCHROMIUM(GLuint image_id) {
@@ -1260,14 +1250,6 @@
gl_->DestroyImageCHROMIUM(image_id);
}
-void GLES2TraceImplementation::GetImageParameterivCHROMIUM(GLuint image_id,
- GLenum pname,
- GLint* params) {
- TRACE_EVENT_BINARY_EFFICIENT0("gpu",
- "GLES2Trace::GetImageParameterivCHROMIUM");
- gl_->GetImageParameterivCHROMIUM(image_id, pname, params);
-}
-
GLuint GLES2TraceImplementation::CreateGpuMemoryBufferImageCHROMIUM(
GLsizei width,
GLsizei height,
diff --git a/gpu/command_buffer/client/gpu_control.h b/gpu/command_buffer/client/gpu_control.h
index b28757c..a56bd51 100644
--- a/gpu/command_buffer/client/gpu_control.h
+++ b/gpu/command_buffer/client/gpu_control.h
@@ -15,6 +15,8 @@
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/gpu_export.h"
+extern "C" typedef struct _ClientBuffer* ClientBuffer;
+
namespace gfx {
class GpuMemoryBuffer;
}
@@ -29,17 +31,22 @@
virtual Capabilities GetCapabilities() = 0;
- // Create a gpu memory buffer of the given dimensions and format. Returns
- // its ID or -1 on error.
- virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(
- size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32_t* id) = 0;
+ // Create an image for a client buffer with the given dimensions and
+ // format. Returns its ID or -1 on error.
+ virtual int32_t CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) = 0;
- // Destroy a gpu memory buffer. The ID must be positive.
- virtual void DestroyGpuMemoryBuffer(int32_t id) = 0;
+ // Destroy an image. The ID must be positive.
+ virtual void DestroyImage(int32_t id) = 0;
+
+ // Create a gpu memory buffer backed image with the given dimensions and
+ // format for |usage|. Returns its ID or -1 on error.
+ virtual int32_t CreateGpuMemoryBufferImage(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage) = 0;
// Inserts a sync point, returning its ID. Sync point IDs are global and can
// be used for cross-context synchronization.
diff --git a/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc b/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc
deleted file mode 100644
index 9ffe0e3..0000000
--- a/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gpu/command_buffer/client/gpu_memory_buffer_tracker.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
-#include "gpu/command_buffer/client/gpu_control.h"
-
-namespace gpu {
-namespace gles2 {
-
-GpuMemoryBufferTracker::GpuMemoryBufferTracker(GpuControl* gpu_control)
- : gpu_control_(gpu_control) {
-}
-
-GpuMemoryBufferTracker::~GpuMemoryBufferTracker() {
- while (!buffers_.empty()) {
- RemoveBuffer(buffers_.begin()->first);
- }
-}
-
-int32 GpuMemoryBufferTracker::CreateBuffer(size_t width,
- size_t height,
- int32 internalformat,
- int32 usage) {
- int32 image_id = 0;
- DCHECK(gpu_control_);
- gfx::GpuMemoryBuffer* buffer = gpu_control_->CreateGpuMemoryBuffer(
- width, height, internalformat, usage, &image_id);
- if (!buffer)
- return 0;
-
- std::pair<BufferMap::iterator, bool> result =
- buffers_.insert(std::make_pair(image_id, buffer));
- DCHECK(result.second);
-
- return image_id;
-}
-
-gfx::GpuMemoryBuffer* GpuMemoryBufferTracker::GetBuffer(int32 image_id) {
- BufferMap::iterator it = buffers_.find(image_id);
- return (it != buffers_.end()) ? it->second : NULL;
-}
-
-void GpuMemoryBufferTracker::RemoveBuffer(int32 image_id) {
- BufferMap::iterator buffer_it = buffers_.find(image_id);
- if (buffer_it != buffers_.end())
- buffers_.erase(buffer_it);
- DCHECK(gpu_control_);
- gpu_control_->DestroyGpuMemoryBuffer(image_id);
-}
-
-} // namespace gles2
-} // namespace gpu
diff --git a/gpu/command_buffer/client/gpu_memory_buffer_tracker.h b/gpu/command_buffer/client/gpu_memory_buffer_tracker.h
deleted file mode 100644
index 25ec949..0000000
--- a/gpu/command_buffer/client/gpu_memory_buffer_tracker.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_
-#define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_
-
-#include "base/basictypes.h"
-#include "base/containers/hash_tables.h"
-#include "gles2_impl_export.h"
-
-namespace gfx {
-class GpuMemoryBuffer;
-}
-
-namespace gpu {
-class GpuControl;
-
-namespace gles2 {
-
-// Tracks GPU memory buffer objects on the client side.
-class GLES2_IMPL_EXPORT GpuMemoryBufferTracker {
- public:
- explicit GpuMemoryBufferTracker(GpuControl* gpu_control);
- virtual ~GpuMemoryBufferTracker();
-
- int32 CreateBuffer(size_t width,
- size_t height,
- int32 internalformat,
- int32 usage);
- gfx::GpuMemoryBuffer* GetBuffer(int32 image_id);
- void RemoveBuffer(int32 image_id);
-
- private:
- typedef base::hash_map<int32, gfx::GpuMemoryBuffer*> BufferMap;
- BufferMap buffers_;
- GpuControl* gpu_control_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferTracker);
-};
-
-} // namespace gles2
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_
diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt
index 5964cd8..49cb433 100644
--- a/gpu/command_buffer/cmd_buffer_functions.txt
+++ b/gpu/command_buffer/cmd_buffer_functions.txt
@@ -175,9 +175,6 @@
GL_APICALL GLboolean GL_APIENTRY glEnableFeatureCHROMIUM (const char* feature);
GL_APICALL void* GL_APIENTRY glMapBufferCHROMIUM (GLuint target, GLenum access);
GL_APICALL GLboolean GL_APIENTRY glUnmapBufferCHROMIUM (GLuint target);
-GL_APICALL void* GL_APIENTRY glMapImageCHROMIUM (GLuint image_id);
-GL_APICALL void GL_APIENTRY glUnmapImageCHROMIUM (GLuint image_id);
-
GL_APICALL void* GL_APIENTRY glMapBufferSubDataCHROMIUM (GLuint target, GLintptrNotNegative offset, GLsizeiptr size, GLenum access);
GL_APICALL void GL_APIENTRY glUnmapBufferSubDataCHROMIUM (const void* mem);
GL_APICALL void* GL_APIENTRY glMapTexSubImage2DCHROMIUM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLenum access);
@@ -189,9 +186,8 @@
GL_APICALL void GL_APIENTRY glGetMultipleIntegervCHROMIUM (const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size);
GL_APICALL void GL_APIENTRY glGetProgramInfoCHROMIUM (GLidProgram program, GLsizeiNotNegative bufsize, GLsizei* size, void* info);
GL_APICALL GLuint GL_APIENTRY glCreateStreamTextureCHROMIUM (GLuint texture);
-GL_APICALL GLuint GL_APIENTRY glCreateImageCHROMIUM (GLsizei width, GLsizei height, GLenum internalformat, GLenum usage);
+GL_APICALL GLuint GL_APIENTRY glCreateImageCHROMIUM (ClientBuffer buffer, GLsizei width, GLsizei height, GLenum internalformat);
GL_APICALL void GL_APIENTRY glDestroyImageCHROMIUM (GLuint image_id);
-GL_APICALL void GL_APIENTRY glGetImageParameterivCHROMIUM (GLuint image_id, GLenum pname, GLint* params);
GL_APICALL GLuint GL_APIENTRY glCreateGpuMemoryBufferImageCHROMIUM (GLsizei width, GLsizei height, GLenum internalformat, GLenum usage);
GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLidShader shader, GLsizeiNotNegative bufsize, GLsizeiOptional* length, char* source);
GL_APICALL void GL_APIENTRY glPostSubBufferCHROMIUM (GLint x, GLint y, GLint width, GLint height);
diff --git a/gpu/command_buffer/common/capabilities.cc b/gpu/command_buffer/common/capabilities.cc
index 74b2423..f51071a 100644
--- a/gpu/command_buffer/common/capabilities.cc
+++ b/gpu/command_buffer/common/capabilities.cc
@@ -19,7 +19,8 @@
discard_framebuffer(false),
sync_query(false),
image(false),
- future_sync_points(false) {
+ future_sync_points(false),
+ blend_minmax(false) {
}
} // namespace gpu
diff --git a/gpu/command_buffer/common/capabilities.h b/gpu/command_buffer/common/capabilities.h
index cb0246f..df97d1f 100644
--- a/gpu/command_buffer/common/capabilities.h
+++ b/gpu/command_buffer/common/capabilities.h
@@ -23,6 +23,7 @@
bool sync_query;
bool image;
bool future_sync_points;
+ bool blend_minmax;
Capabilities();
};
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc
index 3b5097c..41db0b8 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -232,6 +232,10 @@
// GL_EXT_multisampled_render_to_texture
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT:
return 1;
+ // -- glGetFramebufferAttachmentParameteriv with
+ // GL_EXT_sRGB
+ case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:
+ return 1;
// -- glGetProgramiv
case GL_DELETE_STATUS:
@@ -352,11 +356,13 @@
switch (format) {
case GL_RGB:
+ case GL_SRGB_EXT:
return 3;
case GL_LUMINANCE_ALPHA:
return 2;
case GL_RGBA:
case GL_BGRA_EXT:
+ case GL_SRGB_ALPHA_EXT:
return 4;
case GL_ALPHA:
case GL_LUMINANCE:
@@ -670,6 +676,7 @@
case GL_RGB565:
case GL_RGB16F_EXT:
case GL_RGB32F_EXT:
+ case GL_SRGB_EXT:
return kRGB;
case GL_BGRA_EXT:
case GL_BGRA8_EXT:
@@ -679,6 +686,8 @@
case GL_RGBA8_OES:
case GL_RGBA4:
case GL_RGB5_A1:
+ case GL_SRGB_ALPHA_EXT:
+ case GL_SRGB8_ALPHA8_EXT:
return kRGBA;
case GL_DEPTH_COMPONENT32_OES:
case GL_DEPTH_COMPONENT24_OES:
diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
index c5bbc54..20b4493 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
@@ -129,10 +129,6 @@
"GL_LINES",
},
{
- 0x78F0,
- "GL_IMAGE_ROWBYTES_CHROMIUM",
- },
- {
0x88B8,
"GL_READ_ONLY",
},
@@ -1314,7 +1310,7 @@
},
{
0x78F1,
- "GL_IMAGE_MAP_CHROMIUM",
+ "GL_MAP_CHROMIUM",
},
{
0x00080000,
@@ -1334,7 +1330,7 @@
},
{
0x78F2,
- "GL_IMAGE_SCANOUT_CHROMIUM",
+ "GL_SCANOUT_CHROMIUM",
},
{
0x93C7,
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager.h b/gpu/command_buffer/service/async_pixel_transfer_manager.h
index 63b30c6..66b8bf7 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager.h
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager.h
@@ -15,17 +15,6 @@
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/gpu_export.h"
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-template <>
- struct hash<gpu::gles2::TextureRef*> {
- size_t operator()(gpu::gles2::TextureRef* ptr) const {
- return hash<size_t>()(reinterpret_cast<size_t>(ptr));
- }
-};
-} // namespace BASE_HASH_NAMESPACE
-#endif // COMPILER
-
namespace gfx {
class GLContext;
}
diff --git a/gpu/command_buffer/service/disk_cache_proto.proto b/gpu/command_buffer/service/disk_cache_proto.proto
index 5a55943..ab3bb57 100644
--- a/gpu/command_buffer/service/disk_cache_proto.proto
+++ b/gpu/command_buffer/service/disk_cache_proto.proto
@@ -1,24 +1,41 @@
option optimize_for = LITE_RUNTIME;
-message ShaderInfoProto {
- optional int32 type = 1;
- optional int32 size = 2;
+message ShaderVariableProto {
+ optional uint32 type = 1;
+ optional uint32 precision = 2;
optional string name = 3;
- optional string key = 4;
- optional int32 precision = 5;
- optional int32 static_use = 6;
+ optional string mapped_name = 4;
+ optional uint32 array_size = 5;
+ optional bool static_use = 6;
+ repeated ShaderVariableProto fields = 7;
+ optional string struct_name = 8;
+}
+
+message ShaderAttributeProto {
+ optional ShaderVariableProto basic = 1;
+ optional int32 location = 2;
+}
+
+message ShaderUniformProto {
+ optional ShaderVariableProto basic = 1;
+}
+
+message ShaderVaryingProto {
+ optional ShaderVariableProto basic = 1;
+ optional int32 interpolation = 2;
+ optional bool is_invariant = 3;
}
message ShaderProto {
optional bytes sha = 1;
- repeated ShaderInfoProto attribs = 2;
- repeated ShaderInfoProto uniforms = 3;
- repeated ShaderInfoProto varyings = 4;
+ repeated ShaderAttributeProto attribs = 2;
+ repeated ShaderUniformProto uniforms = 3;
+ repeated ShaderVaryingProto varyings = 4;
}
message GpuProgramProto {
optional bytes sha = 1;
- optional int32 format = 2;
+ optional uint32 format = 2;
optional bytes program = 3;
optional ShaderProto vertex_shader = 4;
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index e853d9b..bda7a82 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -132,6 +132,7 @@
enable_shader_name_hashing(false),
enable_samplers(false),
ext_draw_buffers(false),
+ nv_draw_buffers(false),
ext_frag_depth(false),
ext_shader_texture_lod(false),
use_async_readpixels(false),
@@ -142,7 +143,8 @@
is_swiftshader(false),
angle_texture_usage(false),
ext_texture_storage(false),
- chromium_path_rendering(false) {
+ chromium_path_rendering(false),
+ ext_blend_minmax(false) {
}
FeatureInfo::Workarounds::Workarounds() :
@@ -391,6 +393,20 @@
validators_.index_type.AddValue(GL_UNSIGNED_INT);
}
+ if (is_es3 || extensions.Contains("GL_EXT_sRGB") ||
+ gfx::HasDesktopGLFeatures()) {
+ AddExtensionString("GL_EXT_sRGB");
+ texture_format_validators_[GL_SRGB_EXT].AddValue(GL_UNSIGNED_BYTE);
+ texture_format_validators_[GL_SRGB_ALPHA_EXT].AddValue(GL_UNSIGNED_BYTE);
+ validators_.texture_internal_format.AddValue(GL_SRGB_EXT);
+ validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
+ validators_.texture_format.AddValue(GL_SRGB_EXT);
+ validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT);
+ validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT);
+ validators_.frame_buffer_parameter.AddValue(
+ GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT);
+ }
+
bool enable_texture_format_bgra8888 = false;
bool enable_read_format_bgra = false;
bool enable_render_buffer_bgra = false;
@@ -760,12 +776,25 @@
validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
}
+ bool vendor_agnostic_draw_buffers =
+ extensions.Contains("GL_ARB_draw_buffers") ||
+ extensions.Contains("GL_EXT_draw_buffers");
if (!workarounds_.disable_ext_draw_buffers &&
- (extensions.Contains("GL_ARB_draw_buffers") ||
- extensions.Contains("GL_EXT_draw_buffers"))) {
+ (vendor_agnostic_draw_buffers ||
+ (extensions.Contains("GL_NV_draw_buffers") && is_es3))) {
AddExtensionString("GL_EXT_draw_buffers");
feature_flags_.ext_draw_buffers = true;
+ // This flag is set to enable emulation of EXT_draw_buffers when we're
+ // running on GLES 3.0+, NV_draw_buffers extension is supported and
+ // glDrawBuffers from GLES 3.0 core has been bound. It toggles using the
+ // NV_draw_buffers extension directive instead of EXT_draw_buffers extension
+ // directive in ESSL 100 shaders translated by ANGLE, enabling them to write
+ // into multiple gl_FragData values, which is not by default possible in
+ // ESSL 100 with core GLES 3.0. For more information, see the
+ // NV_draw_buffers specification.
+ feature_flags_.nv_draw_buffers = !vendor_agnostic_draw_buffers;
+
GLint max_color_attachments = 0;
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments);
for (GLenum i = GL_COLOR_ATTACHMENT1_EXT;
@@ -789,6 +818,7 @@
if (is_es3 || extensions.Contains("GL_EXT_blend_minmax") ||
gfx::HasDesktopGLFeatures()) {
+ feature_flags_.ext_blend_minmax = true;
AddExtensionString("GL_EXT_blend_minmax");
validators_.equation.AddValue(GL_MIN_EXT);
validators_.equation.AddValue(GL_MAX_EXT);
diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h
index 740b833..a30581a 100644
--- a/gpu/command_buffer/service/feature_info.h
+++ b/gpu/command_buffer/service/feature_info.h
@@ -59,6 +59,7 @@
bool enable_shader_name_hashing;
bool enable_samplers;
bool ext_draw_buffers;
+ bool nv_draw_buffers;
bool ext_frag_depth;
bool ext_shader_texture_lod;
bool use_async_readpixels;
@@ -70,6 +71,7 @@
bool angle_texture_usage;
bool ext_texture_storage;
bool chromium_path_rendering;
+ bool ext_blend_minmax;
};
struct Workarounds {
diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc
index 106e183..004eeee 100644
--- a/gpu/command_buffer/service/feature_info_unittest.cc
+++ b/gpu/command_buffer/service/feature_info_unittest.cc
@@ -123,6 +123,8 @@
EXPECT_FALSE(info_->feature_flags().native_vertex_array_object);
EXPECT_FALSE(info_->feature_flags().map_buffer_range);
EXPECT_FALSE(info_->feature_flags().use_async_readpixels);
+ EXPECT_FALSE(info_->feature_flags().ext_draw_buffers);
+ EXPECT_FALSE(info_->feature_flags().nv_draw_buffers);
EXPECT_FALSE(info_->feature_flags().ext_discard_framebuffer);
EXPECT_FALSE(info_->feature_flags().angle_depth_texture);
EXPECT_FALSE(info_->feature_flags().is_angle);
@@ -251,6 +253,8 @@
Not(HasSubstr("GL_AMD_compressed_ATC_texture")));
EXPECT_THAT(info_->extensions(),
Not(HasSubstr("GL_IMG_texture_compression_pvrtc")));
+ EXPECT_THAT(info_->extensions(),
+ Not(HasSubstr("GL_EXT_sRGB")));
EXPECT_FALSE(info_->feature_flags().npot_ok);
EXPECT_FALSE(info_->validators()->compressed_texture_format.IsValid(
GL_COMPRESSED_RGB_S3TC_DXT1_EXT));
@@ -320,6 +324,22 @@
EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MIN_EXT));
EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MAX_EXT));
EXPECT_FALSE(info_->feature_flags().chromium_sync_query);
+ EXPECT_FALSE(info_->GetTextureFormatValidator(GL_SRGB_EXT).IsValid(
+ GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(info_->GetTextureFormatValidator(GL_SRGB_ALPHA_EXT).IsValid(
+ GL_UNSIGNED_BYTE));
+ EXPECT_FALSE(info_->validators()->texture_format.IsValid(
+ GL_SRGB_EXT));
+ EXPECT_FALSE(info_->validators()->texture_format.IsValid(
+ GL_SRGB_ALPHA_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(
+ GL_SRGB_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format.IsValid(
+ GL_SRGB_ALPHA_EXT));
+ EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(
+ GL_SRGB8_ALPHA8_EXT));
+ EXPECT_FALSE(info_->validators()->frame_buffer_parameter.IsValid(
+ GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));
}
TEST_F(FeatureInfoTest, InitializeWithANGLE) {
@@ -433,6 +453,28 @@
GL_BGRA8_EXT));
}
+TEST_F(FeatureInfoTest, InitializeEXT_sRGB) {
+ SetupInitExpectations("GL_EXT_sRGB");
+ EXPECT_THAT(info_->extensions(),
+ HasSubstr("GL_EXT_sRGB"));
+ EXPECT_TRUE(info_->GetTextureFormatValidator(GL_SRGB_EXT).IsValid(
+ GL_UNSIGNED_BYTE));
+ EXPECT_TRUE(info_->GetTextureFormatValidator(GL_SRGB_ALPHA_EXT).IsValid(
+ GL_UNSIGNED_BYTE));
+ EXPECT_TRUE(info_->validators()->texture_format.IsValid(
+ GL_SRGB_EXT));
+ EXPECT_TRUE(info_->validators()->texture_format.IsValid(
+ GL_SRGB_ALPHA_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(
+ GL_SRGB_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid(
+ GL_SRGB_ALPHA_EXT));
+ EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(
+ GL_SRGB8_ALPHA8_EXT));
+ EXPECT_TRUE(info_->validators()->frame_buffer_parameter.IsValid(
+ GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));
+}
+
TEST_F(FeatureInfoTest, InitializeEXT_texture_storage) {
SetupInitExpectations("GL_EXT_texture_storage");
EXPECT_TRUE(info_->feature_flags().ext_texture_storage);
@@ -1254,6 +1296,19 @@
EXPECT_TRUE(gfx::GLFence::IsSupported());
}
+TEST_F(FeatureInfoTest, InitializeWithNVDrawBuffers) {
+ SetupInitExpectationsWithGLVersion("GL_NV_draw_buffers", "", "OpenGL ES 3.0");
+ EXPECT_TRUE(info_->feature_flags().nv_draw_buffers);
+ EXPECT_TRUE(info_->feature_flags().ext_draw_buffers);
+}
+
+TEST_F(FeatureInfoTest, InitializeWithPreferredEXTDrawBuffers) {
+ SetupInitExpectationsWithGLVersion(
+ "GL_NV_draw_buffers GL_EXT_draw_buffers", "", "OpenGL ES 3.0");
+ EXPECT_FALSE(info_->feature_flags().nv_draw_buffers);
+ EXPECT_TRUE(info_->feature_flags().ext_draw_buffers);
+}
+
TEST_F(FeatureInfoTest, ARBSyncDisabled) {
CommandLine command_line(0, NULL);
command_line.AppendSwitchASCII(
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
index 4448ac8..60f3ac9 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -126,6 +126,10 @@
virtual void OnWillRenderTo() const override {}
virtual void OnDidRenderTo() const override {}
+ virtual bool FormsFeedbackLoop(
+ TextureRef* /* texture */, GLint /*level */) const override {
+ return false;
+ }
protected:
virtual ~RenderbufferAttachment() { }
@@ -264,6 +268,11 @@
texture_ref_->texture()->OnDidModifyPixels();
}
+ virtual bool FormsFeedbackLoop(
+ TextureRef* texture, GLint level) const override {
+ return texture == texture_ref_.get() && level == level_;
+ }
+
protected:
virtual ~TextureAttachment() {}
diff --git a/gpu/command_buffer/service/framebuffer_manager.h b/gpu/command_buffer/service/framebuffer_manager.h
index 96bf7fe..78c11ad 100644
--- a/gpu/command_buffer/service/framebuffer_manager.h
+++ b/gpu/command_buffer/service/framebuffer_manager.h
@@ -52,6 +52,7 @@
TextureManager* texture_manager, std::string* signature) const = 0;
virtual void OnWillRenderTo() const = 0;
virtual void OnDidRenderTo() const = 0;
+ virtual bool FormsFeedbackLoop(TextureRef* texture, GLint level) const = 0;
protected:
friend class base::RefCounted<Attachment>;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 65587ec..20c4da8 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1181,6 +1181,10 @@
// attached. Generates GL error if not.
bool CheckBoundReadFramebufferColorAttachment(const char* func_name);
+ // Check that the currently bound read framebuffer's color image
+ // isn't the target texture of the glCopyTex{Sub}Image2D.
+ bool FormsTextureCopyingFeedbackLoop(TextureRef* texture, GLint level);
+
// Check if a framebuffer meets our requirements.
bool CheckFramebufferValid(
Framebuffer* framebuffer,
@@ -2746,6 +2750,7 @@
caps.post_sub_buffer = supports_post_sub_buffer_;
caps.image = true;
+ caps.blend_minmax = feature_info_->feature_flags().ext_blend_minmax;
return caps;
}
@@ -2792,6 +2797,8 @@
if (!draw_buffers_explicitly_enabled_)
resources.MaxDrawBuffers = 1;
resources.EXT_shader_texture_lod = shader_texture_lod_explicitly_enabled_;
+ resources.NV_draw_buffers =
+ draw_buffers_explicitly_enabled_ && features().nv_draw_buffers;
} else {
resources.OES_standard_derivatives =
features().oes_standard_derivatives ? 1 : 0;
@@ -2805,6 +2812,8 @@
features().ext_frag_depth ? 1 : 0;
resources.EXT_shader_texture_lod =
features().ext_shader_texture_lod ? 1 : 0;
+ resources.NV_draw_buffers =
+ features().nv_draw_buffers ? 1 : 0;
}
ShShaderSpec shader_spec = force_webgl_glsl_validation_ ? SH_WEBGL_SPEC
@@ -3227,6 +3236,20 @@
return true;
}
+bool GLES2DecoderImpl::FormsTextureCopyingFeedbackLoop(
+ TextureRef* texture, GLint level) {
+ Framebuffer* framebuffer = features().chromium_framebuffer_multisample ?
+ framebuffer_state_.bound_read_framebuffer.get() :
+ framebuffer_state_.bound_draw_framebuffer.get();
+ if (!framebuffer)
+ return false;
+ const Framebuffer::Attachment* attachment = framebuffer->GetAttachment(
+ GL_COLOR_ATTACHMENT0);
+ if (!attachment)
+ return false;
+ return attachment->FormsFeedbackLoop(texture, level);
+}
+
gfx::Size GLES2DecoderImpl::GetBoundReadFrameBufferSize() {
Framebuffer* framebuffer =
GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER_EXT);
@@ -4859,7 +4882,13 @@
if (!program) {
return;
}
+ // At this point, the program's shaders may not be translated yet,
+ // therefore, we may not find the hashed attribute name.
+ // glBindAttribLocation call with original name is useless.
+ // So instead, we should simply cache the binding, and then call
+ // Program::ExecuteBindAttribLocationCalls() right before link.
program->SetAttribLocationBinding(name, static_cast<GLint>(index));
+ // TODO(zmo): Get rid of the following glBindAttribLocation call.
glBindAttribLocation(program->service_id(), index, name);
}
@@ -8590,6 +8619,13 @@
return;
}
+ if (FormsTextureCopyingFeedbackLoop(texture_ref, level)) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_OPERATION,
+ "glCopyTexImage2D", "source and destination textures are the same");
+ return;
+ }
+
if (!CheckBoundFramebuffersValid("glCopyTexImage2D")) {
return;
}
@@ -8708,6 +8744,13 @@
return;
}
+ if (FormsTextureCopyingFeedbackLoop(texture_ref, level)) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_OPERATION,
+ "glCopyTexSubImage2D", "source and destination textures are the same");
+ return;
+ }
+
if (!CheckBoundFramebuffersValid("glCopyTexSubImage2D")) {
return;
}
@@ -10084,6 +10127,8 @@
return GL_LUMINANCE_ALPHA;
case GL_BGRA8_EXT:
return GL_BGRA_EXT;
+ case GL_SRGB8_ALPHA8_EXT:
+ return GL_SRGB_ALPHA_EXT;
default:
return GL_NONE;
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
index 32ba98d..ce8f307 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
@@ -2022,7 +2022,15 @@
.RetiresOnSaturation();
CopyTexImage2D cmd;
cmd.Init(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 1, 1);
+ // Unbind fbo and bind again after CopyTexImage2D tp avoid feedback loops.
+ if (bound_fbo) {
+ DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0);
+ }
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ if (bound_fbo) {
+ DoBindFramebuffer(
+ GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
+ }
EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer));
// Test deleting texture marks fbo as not complete.
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 707b9ef..1d0ce6a 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -609,18 +609,25 @@
return capabilities_;
}
-gfx::GpuMemoryBuffer* InProcessCommandBuffer::CreateGpuMemoryBuffer(
+int32 InProcessCommandBuffer::CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) {
+ NOTREACHED();
+ return -1;
+}
+
+void InProcessCommandBuffer::DestroyImage(int32 id) {
+ NOTREACHED();
+}
+
+int32 InProcessCommandBuffer::CreateGpuMemoryBufferImage(
size_t width,
size_t height,
unsigned internalformat,
- unsigned usage,
- int32* id) {
+ unsigned usage) {
NOTREACHED();
- return NULL;
-}
-
-void InProcessCommandBuffer::DestroyGpuMemoryBuffer(int32 id) {
- NOTREACHED();
+ return -1;
}
uint32 InProcessCommandBuffer::InsertSyncPoint() {
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h
index e91d6f6..65cf1ec 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.h
+++ b/gpu/command_buffer/service/in_process_command_buffer.h
@@ -94,12 +94,15 @@
// GpuControl implementation:
virtual gpu::Capabilities GetCapabilities() override;
- virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32* id) override;
- virtual void DestroyGpuMemoryBuffer(int32 id) override;
+ virtual int32 CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) override;
+ virtual void DestroyImage(int32 id) override;
+ virtual int32 CreateGpuMemoryBufferImage(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage) override;
virtual uint32 InsertSyncPoint() override;
virtual uint32 InsertFutureSyncPoint() override;
virtual void RetireSyncPoint(uint32 sync_point) override;
diff --git a/gpu/command_buffer/service/memory_program_cache.cc b/gpu/command_buffer/service/memory_program_cache.cc
index 87378aa..86fffd3 100644
--- a/gpu/command_buffer/service/memory_program_cache.cc
+++ b/gpu/command_buffer/service/memory_program_cache.cc
@@ -45,47 +45,96 @@
VARYING_MAP
};
-void StoreShaderInfo(ShaderMapType type, ShaderProto *proto,
- const ShaderTranslator::VariableMap& map) {
- ShaderTranslator::VariableMap::const_iterator iter;
- for (iter = map.begin(); iter != map.end(); ++iter) {
- ShaderInfoProto* info = NULL;
- switch (type) {
- case UNIFORM_MAP:
- info = proto->add_uniforms();
- break;
- case ATTRIB_MAP:
- info = proto->add_attribs();
- break;
- case VARYING_MAP:
- info = proto->add_varyings();
- break;
- default: NOTREACHED();
- }
-
- info->set_key(iter->first);
- info->set_type(iter->second.type);
- info->set_size(iter->second.size);
- info->set_precision(iter->second.precision);
- info->set_static_use(iter->second.static_use);
- info->set_name(iter->second.name);
+void FillShaderVariableProto(
+ ShaderVariableProto* proto, const sh::ShaderVariable& variable) {
+ proto->set_type(variable.type);
+ proto->set_precision(variable.precision);
+ proto->set_name(variable.name);
+ proto->set_mapped_name(variable.mappedName);
+ proto->set_array_size(variable.arraySize);
+ proto->set_static_use(variable.staticUse);
+ for (size_t ii = 0; ii < variable.fields.size(); ++ii) {
+ ShaderVariableProto* field = proto->add_fields();
+ FillShaderVariableProto(field, variable.fields[ii]);
}
+ proto->set_struct_name(variable.structName);
}
-void RetrieveShaderInfo(const ShaderInfoProto& proto,
- ShaderTranslator::VariableMap* map) {
- ShaderTranslator::VariableInfo info(
- proto.type(), proto.size(), proto.precision(),
- proto.static_use(), proto.name());
- (*map)[proto.key()] = info;
+void FillShaderAttributeProto(
+ ShaderAttributeProto* proto, const sh::Attribute& attrib) {
+ FillShaderVariableProto(proto->mutable_basic(), attrib);
+ proto->set_location(attrib.location);
+}
+
+void FillShaderUniformProto(
+ ShaderUniformProto* proto, const sh::Uniform& uniform) {
+ FillShaderVariableProto(proto->mutable_basic(), uniform);
+}
+
+void FillShaderVaryingProto(
+ ShaderVaryingProto* proto, const sh::Varying& varying) {
+ FillShaderVariableProto(proto->mutable_basic(), varying);
+ proto->set_interpolation(varying.interpolation);
+ proto->set_is_invariant(varying.isInvariant);
}
void FillShaderProto(ShaderProto* proto, const char* sha,
const Shader* shader) {
proto->set_sha(sha, gpu::gles2::ProgramCache::kHashLength);
- StoreShaderInfo(ATTRIB_MAP, proto, shader->attrib_map());
- StoreShaderInfo(UNIFORM_MAP, proto, shader->uniform_map());
- StoreShaderInfo(VARYING_MAP, proto, shader->varying_map());
+ for (AttributeMap::const_iterator iter = shader->attrib_map().begin();
+ iter != shader->attrib_map().end(); ++iter) {
+ ShaderAttributeProto* info = proto->add_attribs();
+ FillShaderAttributeProto(info, iter->second);
+ }
+ for (UniformMap::const_iterator iter = shader->uniform_map().begin();
+ iter != shader->uniform_map().end(); ++iter) {
+ ShaderUniformProto* info = proto->add_uniforms();
+ FillShaderUniformProto(info, iter->second);
+ }
+ for (VaryingMap::const_iterator iter = shader->varying_map().begin();
+ iter != shader->varying_map().end(); ++iter) {
+ ShaderVaryingProto* info = proto->add_varyings();
+ FillShaderVaryingProto(info, iter->second);
+ }
+}
+
+void RetrieveShaderVariableInfo(
+ const ShaderVariableProto& proto, sh::ShaderVariable* variable) {
+ variable->type = proto.type();
+ variable->precision = proto.precision();
+ variable->name = proto.name();
+ variable->mappedName = proto.mapped_name();
+ variable->arraySize = proto.array_size();
+ variable->staticUse = proto.static_use();
+ variable->fields.resize(proto.fields_size());
+ for (int ii = 0; ii < proto.fields_size(); ++ii)
+ RetrieveShaderVariableInfo(proto.fields(ii), &(variable->fields[ii]));
+ variable->structName = proto.struct_name();
+}
+
+void RetrieveShaderAttributeInfo(
+ const ShaderAttributeProto& proto, AttributeMap* map) {
+ sh::Attribute attrib;
+ RetrieveShaderVariableInfo(proto.basic(), &attrib);
+ attrib.location = proto.location();
+ (*map)[proto.basic().mapped_name()] = attrib;
+}
+
+void RetrieveShaderUniformInfo(
+ const ShaderUniformProto& proto, UniformMap* map) {
+ sh::Uniform uniform;
+ RetrieveShaderVariableInfo(proto.basic(), &uniform);
+ (*map)[proto.basic().mapped_name()] = uniform;
+}
+
+void RetrieveShaderVaryingInfo(
+ const ShaderVaryingProto& proto, VaryingMap* map) {
+ sh::Varying varying;
+ RetrieveShaderVariableInfo(proto.basic(), &varying);
+ varying.interpolation = static_cast<sh::InterpolationType>(
+ proto.interpolation());
+ varying.isInvariant = proto.is_invariant();
+ (*map)[proto.basic().mapped_name()] = varying;
}
void RunShaderCallback(const ShaderCacheCallback& callback,
@@ -270,39 +319,36 @@
void MemoryProgramCache::LoadProgram(const std::string& program) {
scoped_ptr<GpuProgramProto> proto(GpuProgramProto::default_instance().New());
if (proto->ParseFromString(program)) {
- ShaderTranslator::VariableMap vertex_attribs;
- ShaderTranslator::VariableMap vertex_uniforms;
- ShaderTranslator::VariableMap vertex_varyings;
-
+ AttributeMap vertex_attribs;
+ UniformMap vertex_uniforms;
+ VaryingMap vertex_varyings;
for (int i = 0; i < proto->vertex_shader().attribs_size(); i++) {
- RetrieveShaderInfo(proto->vertex_shader().attribs(i), &vertex_attribs);
+ RetrieveShaderAttributeInfo(proto->vertex_shader().attribs(i),
+ &vertex_attribs);
}
-
for (int i = 0; i < proto->vertex_shader().uniforms_size(); i++) {
- RetrieveShaderInfo(proto->vertex_shader().uniforms(i), &vertex_uniforms);
+ RetrieveShaderUniformInfo(proto->vertex_shader().uniforms(i),
+ &vertex_uniforms);
}
-
for (int i = 0; i < proto->vertex_shader().varyings_size(); i++) {
- RetrieveShaderInfo(proto->vertex_shader().varyings(i), &vertex_varyings);
+ RetrieveShaderVaryingInfo(proto->vertex_shader().varyings(i),
+ &vertex_varyings);
}
- ShaderTranslator::VariableMap fragment_attribs;
- ShaderTranslator::VariableMap fragment_uniforms;
- ShaderTranslator::VariableMap fragment_varyings;
-
+ AttributeMap fragment_attribs;
+ UniformMap fragment_uniforms;
+ VaryingMap fragment_varyings;
for (int i = 0; i < proto->fragment_shader().attribs_size(); i++) {
- RetrieveShaderInfo(proto->fragment_shader().attribs(i),
- &fragment_attribs);
+ RetrieveShaderAttributeInfo(proto->fragment_shader().attribs(i),
+ &fragment_attribs);
}
-
for (int i = 0; i < proto->fragment_shader().uniforms_size(); i++) {
- RetrieveShaderInfo(proto->fragment_shader().uniforms(i),
- &fragment_uniforms);
+ RetrieveShaderUniformInfo(proto->fragment_shader().uniforms(i),
+ &fragment_uniforms);
}
-
for (int i = 0; i < proto->fragment_shader().varyings_size(); i++) {
- RetrieveShaderInfo(proto->fragment_shader().varyings(i),
- &fragment_varyings);
+ RetrieveShaderVaryingInfo(proto->fragment_shader().varyings(i),
+ &fragment_varyings);
}
scoped_ptr<char[]> binary(new char[proto->program().length()]);
@@ -336,13 +382,13 @@
const char* data,
const std::string& program_hash,
const char* shader_0_hash,
- const ShaderTranslator::VariableMap& attrib_map_0,
- const ShaderTranslator::VariableMap& uniform_map_0,
- const ShaderTranslator::VariableMap& varying_map_0,
+ const AttributeMap& attrib_map_0,
+ const UniformMap& uniform_map_0,
+ const VaryingMap& varying_map_0,
const char* shader_1_hash,
- const ShaderTranslator::VariableMap& attrib_map_1,
- const ShaderTranslator::VariableMap& uniform_map_1,
- const ShaderTranslator::VariableMap& varying_map_1,
+ const AttributeMap& attrib_map_1,
+ const UniformMap& uniform_map_1,
+ const VaryingMap& varying_map_1,
MemoryProgramCache* program_cache)
: length_(length),
format_(format),
diff --git a/gpu/command_buffer/service/memory_program_cache.h b/gpu/command_buffer/service/memory_program_cache.h
index 56e5979..804547e 100644
--- a/gpu/command_buffer/service/memory_program_cache.h
+++ b/gpu/command_buffer/service/memory_program_cache.h
@@ -55,13 +55,13 @@
const char* data,
const std::string& program_hash,
const char* shader_0_hash,
- const ShaderTranslator::VariableMap& attrib_map_0,
- const ShaderTranslator::VariableMap& uniform_map_0,
- const ShaderTranslator::VariableMap& varying_map_0,
+ const AttributeMap& attrib_map_0,
+ const UniformMap& uniform_map_0,
+ const VaryingMap& varying_map_0,
const char* shader_1_hash,
- const ShaderTranslator::VariableMap& attrib_map_1,
- const ShaderTranslator::VariableMap& uniform_map_1,
- const ShaderTranslator::VariableMap& varying_map_1,
+ const AttributeMap& attrib_map_1,
+ const UniformMap& uniform_map_1,
+ const VaryingMap& varying_map_1,
MemoryProgramCache* program_cache);
GLsizei length() const {
@@ -80,15 +80,15 @@
return shader_0_hash_;
}
- const ShaderTranslator::VariableMap& attrib_map_0() const {
+ const AttributeMap& attrib_map_0() const {
return attrib_map_0_;
}
- const ShaderTranslator::VariableMap& uniform_map_0() const {
+ const UniformMap& uniform_map_0() const {
return uniform_map_0_;
}
- const ShaderTranslator::VariableMap& varying_map_0() const {
+ const VaryingMap& varying_map_0() const {
return varying_map_0_;
}
@@ -96,15 +96,15 @@
return shader_1_hash_;
}
- const ShaderTranslator::VariableMap& attrib_map_1() const {
+ const AttributeMap& attrib_map_1() const {
return attrib_map_1_;
}
- const ShaderTranslator::VariableMap& uniform_map_1() const {
+ const UniformMap& uniform_map_1() const {
return uniform_map_1_;
}
- const ShaderTranslator::VariableMap& varying_map_1() const {
+ const VaryingMap& varying_map_1() const {
return varying_map_1_;
}
@@ -118,13 +118,13 @@
const scoped_ptr<const char[]> data_;
const std::string program_hash_;
const std::string shader_0_hash_;
- const ShaderTranslator::VariableMap attrib_map_0_;
- const ShaderTranslator::VariableMap uniform_map_0_;
- const ShaderTranslator::VariableMap varying_map_0_;
+ const AttributeMap attrib_map_0_;
+ const UniformMap uniform_map_0_;
+ const VaryingMap varying_map_0_;
const std::string shader_1_hash_;
- const ShaderTranslator::VariableMap attrib_map_1_;
- const ShaderTranslator::VariableMap uniform_map_1_;
- const ShaderTranslator::VariableMap varying_map_1_;
+ const AttributeMap attrib_map_1_;
+ const UniformMap uniform_map_1_;
+ const VaryingMap varying_map_1_;
MemoryProgramCache* const program_cache_;
DISALLOW_COPY_AND_ASSIGN(ProgramCacheValue);
diff --git a/gpu/command_buffer/service/memory_program_cache_unittest.cc b/gpu/command_buffer/service/memory_program_cache_unittest.cc
index ba18ff4..4ff3fe3 100644
--- a/gpu/command_buffer/service/memory_program_cache_unittest.cc
+++ b/gpu/command_buffer/service/memory_program_cache_unittest.cc
@@ -21,10 +21,6 @@
using ::testing::SetArgPointee;
using ::testing::SetArrayArgument;
-namespace {
-typedef gpu::gles2::ShaderTranslator::VariableMap VariableMap;
-} // anonymous namespace
-
namespace gpu {
namespace gles2 {
@@ -105,24 +101,27 @@
GL_FRAGMENT_SHADER);
ASSERT_TRUE(vertex_shader_ != NULL);
ASSERT_TRUE(fragment_shader_ != NULL);
- typedef ShaderTranslatorInterface::VariableInfo VariableInfo;
- typedef ShaderTranslator::VariableMap VariableMap;
- VariableMap vertex_attrib_map;
- VariableMap vertex_uniform_map;
- VariableMap vertex_varying_map;
- VariableMap fragment_attrib_map;
- VariableMap fragment_uniform_map;
- VariableMap fragment_varying_map;
+ AttributeMap vertex_attrib_map;
+ UniformMap vertex_uniform_map;
+ VaryingMap vertex_varying_map;
+ AttributeMap fragment_attrib_map;
+ UniformMap fragment_uniform_map;
+ VaryingMap fragment_varying_map;
- vertex_attrib_map["a"] = VariableInfo(1, 34, SH_PRECISION_LOWP, 0, "a");
- vertex_uniform_map["a"] = VariableInfo(0, 10, SH_PRECISION_MEDIUMP, 1, "a");
- vertex_uniform_map["b"] = VariableInfo(2, 3114, SH_PRECISION_HIGHP, 1, "b");
- vertex_varying_map["c"] = VariableInfo(3, 2, SH_PRECISION_HIGHP, 1, "c");
- fragment_attrib_map["jjjbb"] =
- VariableInfo(463, 1114, SH_PRECISION_MEDIUMP, 0, "jjjbb");
- fragment_uniform_map["k"] =
- VariableInfo(10, 34413, SH_PRECISION_MEDIUMP, 1, "k");
- fragment_varying_map["c"] = VariableInfo(3, 2, SH_PRECISION_HIGHP, 1, "c");
+ vertex_attrib_map["a"] = TestHelper::ConstructAttribute(
+ GL_FLOAT_VEC2, 34, GL_LOW_FLOAT, false, "a");
+ vertex_uniform_map["a"] = TestHelper::ConstructUniform(
+ GL_FLOAT, 10, GL_MEDIUM_FLOAT, true, "a");
+ vertex_uniform_map["b"] = TestHelper::ConstructUniform(
+ GL_FLOAT_VEC3, 3114, GL_HIGH_FLOAT, true, "b");
+ vertex_varying_map["c"] = TestHelper::ConstructVarying(
+ GL_FLOAT_VEC4, 2, GL_HIGH_FLOAT, true, "c");
+ fragment_attrib_map["jjjbb"] = TestHelper::ConstructAttribute(
+ GL_FLOAT_MAT4, 1114, GL_MEDIUM_FLOAT, false, "jjjbb");
+ fragment_uniform_map["k"] = TestHelper::ConstructUniform(
+ GL_FLOAT_MAT2, 34413, GL_MEDIUM_FLOAT, true, "k");
+ fragment_varying_map["c"] = TestHelper::ConstructVarying(
+ GL_FLOAT_VEC4, 2, GL_HIGH_FLOAT, true, "c");
vertex_shader_->set_source("bbbalsldkdkdkd");
fragment_shader_->set_source("bbbal sldkdkdkas 134 ad");
@@ -261,19 +260,19 @@
base::Unretained(this)));
EXPECT_EQ(1, shader_cache_count());
- VariableMap vertex_attrib_map = vertex_shader_->attrib_map();
- VariableMap vertex_uniform_map = vertex_shader_->uniform_map();
- VariableMap vertex_varying_map = vertex_shader_->varying_map();
- VariableMap fragment_attrib_map = fragment_shader_->attrib_map();
- VariableMap fragment_uniform_map = fragment_shader_->uniform_map();
- VariableMap fragment_varying_map = fragment_shader_->varying_map();
+ AttributeMap vertex_attrib_map = vertex_shader_->attrib_map();
+ UniformMap vertex_uniform_map = vertex_shader_->uniform_map();
+ VaryingMap vertex_varying_map = vertex_shader_->varying_map();
+ AttributeMap fragment_attrib_map = fragment_shader_->attrib_map();
+ UniformMap fragment_uniform_map = fragment_shader_->uniform_map();
+ VaryingMap fragment_varying_map = fragment_shader_->varying_map();
- vertex_shader_->set_attrib_map(VariableMap());
- vertex_shader_->set_uniform_map(VariableMap());
- vertex_shader_->set_varying_map(VariableMap());
- fragment_shader_->set_attrib_map(VariableMap());
- fragment_shader_->set_uniform_map(VariableMap());
- fragment_shader_->set_varying_map(VariableMap());
+ vertex_shader_->set_attrib_map(AttributeMap());
+ vertex_shader_->set_uniform_map(UniformMap());
+ vertex_shader_->set_varying_map(VaryingMap());
+ fragment_shader_->set_attrib_map(AttributeMap());
+ fragment_shader_->set_uniform_map(UniformMap());
+ fragment_shader_->set_varying_map(VaryingMap());
SetExpectationsForLoadLinkedProgram(kProgramId, &emulator);
@@ -316,19 +315,19 @@
base::Unretained(this)));
EXPECT_EQ(1, shader_cache_count());
- VariableMap vertex_attrib_map = vertex_shader_->attrib_map();
- VariableMap vertex_uniform_map = vertex_shader_->uniform_map();
- VariableMap vertex_varying_map = vertex_shader_->varying_map();
- VariableMap fragment_attrib_map = fragment_shader_->attrib_map();
- VariableMap fragment_uniform_map = fragment_shader_->uniform_map();
- VariableMap fragment_varying_map = fragment_shader_->varying_map();
+ AttributeMap vertex_attrib_map = vertex_shader_->attrib_map();
+ UniformMap vertex_uniform_map = vertex_shader_->uniform_map();
+ VaryingMap vertex_varying_map = vertex_shader_->varying_map();
+ AttributeMap fragment_attrib_map = fragment_shader_->attrib_map();
+ UniformMap fragment_uniform_map = fragment_shader_->uniform_map();
+ VaryingMap fragment_varying_map = fragment_shader_->varying_map();
- vertex_shader_->set_attrib_map(VariableMap());
- vertex_shader_->set_uniform_map(VariableMap());
- vertex_shader_->set_varying_map(VariableMap());
- fragment_shader_->set_attrib_map(VariableMap());
- fragment_shader_->set_uniform_map(VariableMap());
- fragment_shader_->set_varying_map(VariableMap());
+ vertex_shader_->set_attrib_map(AttributeMap());
+ vertex_shader_->set_uniform_map(UniformMap());
+ vertex_shader_->set_varying_map(VaryingMap());
+ fragment_shader_->set_attrib_map(AttributeMap());
+ fragment_shader_->set_uniform_map(UniformMap());
+ fragment_shader_->set_varying_map(VaryingMap());
SetExpectationsForLoadLinkedProgram(kProgramId, &emulator);
diff --git a/gpu/command_buffer/service/mocks.h b/gpu/command_buffer/service/mocks.h
index 17c8401..87b3136 100644
--- a/gpu/command_buffer/service/mocks.h
+++ b/gpu/command_buffer/service/mocks.h
@@ -100,9 +100,9 @@
const std::string& shader_source,
std::string* info_log,
std::string* translated_source,
- VariableMap* attrib_map,
- VariableMap* uniform_map,
- VariableMap* varying_map,
+ AttributeMap* attrib_map,
+ UniformMap* uniform_map,
+ VaryingMap* varying_map,
NameMap* name_map));
MOCK_CONST_METHOD0(
GetStringForOptionsThatWouldAffectCompilation, std::string());
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index 4dd4bc4..e8196f6 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -15,6 +15,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
@@ -33,28 +34,6 @@
namespace {
-struct UniformType {
- explicit UniformType(const ShaderTranslator::VariableInfo uniform)
- : type(uniform.type),
- size(uniform.size),
- precision(uniform.precision) { }
-
- UniformType()
- : type(0),
- size(0),
- precision(SH_PRECISION_MEDIUMP) { }
-
- bool operator==(const UniformType& other) const {
- return type == other.type &&
- size == other.size &&
- precision == other.precision;
- }
-
- int type;
- int size;
- int precision;
-};
-
int ShaderTypeToIndex(GLenum shader_type) {
switch (shader_type) {
case GL_VERTEX_SHADER:
@@ -389,17 +368,15 @@
DCHECK(max_len == 0 || length < max_len);
DCHECK(length == 0 || name_buffer[length] == '\0');
if (!ProgramManager::IsInvalidPrefix(name_buffer.get(), length)) {
- std::string name;
std::string original_name;
- GetCorrectedVariableInfo(
- false, name_buffer.get(), &name, &original_name, &size, &type);
+ GetVertexAttribData(name_buffer.get(), &original_name, &type);
// TODO(gman): Should we check for error?
GLint location = glGetAttribLocation(service_id_, name_buffer.get());
if (location > max_location) {
max_location = location;
}
attrib_infos_.push_back(
- VertexAttrib(size, type, original_name, location));
+ VertexAttrib(1, type, original_name, location));
max_attrib_name_length_ = std::max(
max_attrib_name_length_, static_cast<GLsizei>(original_name.size()));
}
@@ -447,9 +424,9 @@
DCHECK(length == 0 || name_buffer[length] == '\0');
if (!ProgramManager::IsInvalidPrefix(name_buffer.get(), length)) {
data.queried_name = std::string(name_buffer.get());
- GetCorrectedVariableInfo(
- true, name_buffer.get(), &data.corrected_name, &data.original_name,
- &data.size, &data.type);
+ GetCorrectedUniformData(
+ data.queried_name,
+ &data.corrected_name, &data.original_name, &data.size, &data.type);
uniform_data.push_back(data);
}
}
@@ -471,8 +448,8 @@
// remove "[0]"
std::string short_name;
int element_index = 0;
- bool good ALLOW_UNUSED = GetUniformNameSansElement(
- data.queried_name, &element_index, &short_name);\
+ bool good = GetUniformNameSansElement(data.queried_name, &element_index,
+ &short_name);
DCHECK(good);
LocationMap::const_iterator it = bind_uniform_location_map_.find(
short_name);
@@ -516,7 +493,7 @@
for (LocationMap::const_iterator it = bind_attrib_location_map_.begin();
it != bind_attrib_location_map_.end(); ++it) {
const std::string* mapped_name = GetAttribMappedName(it->first);
- if (mapped_name && *mapped_name != it->first)
+ if (mapped_name)
glBindAttribLocation(service_id_, it->second, mapped_name->c_str());
}
}
@@ -678,10 +655,10 @@
}
GLint Program::GetAttribLocation(
- const std::string& name) const {
+ const std::string& original_name) const {
for (GLuint ii = 0; ii < attrib_infos_.size(); ++ii) {
const VertexAttrib& info = attrib_infos_[ii];
- if (info.name == name) {
+ if (info.name == original_name) {
return info.location;
}
}
@@ -757,41 +734,60 @@
// Note: This is only valid to call right after a program has been linked
// successfully.
-void Program::GetCorrectedVariableInfo(
- bool use_uniforms,
- const std::string& name, std::string* corrected_name,
- std::string* original_name,
+void Program::GetCorrectedUniformData(
+ const std::string& name,
+ std::string* corrected_name, std::string* original_name,
GLsizei* size, GLenum* type) const {
- DCHECK(corrected_name);
- DCHECK(original_name);
- DCHECK(size);
- DCHECK(type);
- const char* kArraySpec = "[0]";
- for (int jj = 0; jj < 2; ++jj) {
- std::string test_name(name + ((jj == 1) ? kArraySpec : ""));
- for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- Shader* shader = attached_shaders_[ii].get();
- if (shader) {
- const Shader::VariableInfo* variable_info =
- use_uniforms ? shader->GetUniformInfo(test_name) :
- shader->GetAttribInfo(test_name);
- // Note: There is an assuption here that if an attrib is defined in more
- // than 1 attached shader their types and sizes match. Should we check
- // for that case?
- if (variable_info) {
- *corrected_name = test_name;
- *original_name = variable_info->name;
- *type = variable_info->type;
- *size = variable_info->size;
- return;
- }
+ DCHECK(corrected_name && original_name && size && type);
+ for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
+ Shader* shader = attached_shaders_[ii].get();
+ if (!shader)
+ continue;
+ const sh::ShaderVariable* info = NULL;
+ const sh::Uniform* uniform = shader->GetUniformInfo(name);
+ bool found = false;
+ if (uniform)
+ found = uniform->findInfoByMappedName(name, &info, original_name);
+ if (found) {
+ const std::string kArraySpec("[0]");
+ if (info->arraySize > 0 && !EndsWith(name, kArraySpec, true)) {
+ *corrected_name = name + kArraySpec;
+ *original_name += kArraySpec;
+ } else {
+ *corrected_name = name;
}
+ *type = info->type;
+ *size = std::max(1u, info->arraySize);
+ return;
}
}
+ // TODO(zmo): this path should never be reached unless there is a serious
+ // bug in the driver or in ANGLE translator.
*corrected_name = name;
*original_name = name;
}
+void Program::GetVertexAttribData(
+ const std::string& name, std::string* original_name, GLenum* type) const {
+ DCHECK(original_name);
+ DCHECK(type);
+ Shader* shader = attached_shaders_[ShaderTypeToIndex(GL_VERTEX_SHADER)].get();
+ if (shader) {
+ // Vertex attributes can not be arrays or structs (GLSL ES 3.00.4, section
+ // 4.3.4, "Input Variables"), so the top level sh::Attribute returns the
+ // information we need.
+ const sh::Attribute* info = shader->GetAttribInfo(name);
+ if (info) {
+ *original_name = info->name;
+ *type = info->type;
+ return;
+ }
+ }
+ // TODO(zmo): this path should never be reached unless there is a serious
+ // bug in the driver or in ANGLE translator.
+ *original_name = name;
+}
+
bool Program::AddUniformInfo(
GLsizei size, GLenum type, GLint location, GLint fake_base_location,
const std::string& name, const std::string& original_name,
@@ -993,44 +989,64 @@
std::set<GLint> location_binding_used;
for (LocationMap::const_iterator it = bind_attrib_location_map_.begin();
it != bind_attrib_location_map_.end(); ++it) {
- // Find out if an attribute is declared in this program's shaders.
- bool active = false;
+ // Find out if an attribute is statically used in this program's shaders.
+ const sh::Attribute* attrib = NULL;
+ const std::string* mapped_name = GetAttribMappedName(it->first);
+ if (!mapped_name)
+ continue;
for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
if (!attached_shaders_[ii].get() || !attached_shaders_[ii]->valid())
continue;
- if (attached_shaders_[ii]->GetAttribInfo(it->first)) {
- active = true;
- break;
+ attrib = attached_shaders_[ii]->GetAttribInfo(*mapped_name);
+ if (attrib) {
+ if (attrib->staticUse)
+ break;
+ else
+ attrib = NULL;
}
}
- if (active) {
- std::pair<std::set<GLint>::iterator, bool> result =
- location_binding_used.insert(it->second);
- if (!result.second)
- return true;
+ if (attrib) {
+ size_t num_of_locations = 1;
+ switch (attrib->type) {
+ case GL_FLOAT_MAT2:
+ num_of_locations = 2;
+ break;
+ case GL_FLOAT_MAT3:
+ num_of_locations = 3;
+ break;
+ case GL_FLOAT_MAT4:
+ num_of_locations = 4;
+ break;
+ default:
+ break;
+ }
+ for (size_t ii = 0; ii < num_of_locations; ++ii) {
+ GLint loc = it->second + ii;
+ std::pair<std::set<GLint>::iterator, bool> result =
+ location_binding_used.insert(loc);
+ if (!result.second)
+ return true;
+ }
}
}
return false;
}
bool Program::DetectUniformsMismatch(std::string* conflicting_name) const {
- typedef std::map<std::string, UniformType> UniformMap;
- UniformMap uniform_map;
+ typedef std::map<std::string, const sh::Uniform*> UniformPointerMap;
+ UniformPointerMap uniform_pointer_map;
for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
- const ShaderTranslator::VariableMap& shader_uniforms =
- attached_shaders_[ii]->uniform_map();
- for (ShaderTranslator::VariableMap::const_iterator iter =
- shader_uniforms.begin();
+ const UniformMap& shader_uniforms = attached_shaders_[ii]->uniform_map();
+ for (UniformMap::const_iterator iter = shader_uniforms.begin();
iter != shader_uniforms.end(); ++iter) {
const std::string& name = iter->first;
- UniformType type(iter->second);
- UniformMap::iterator map_entry = uniform_map.find(name);
- if (map_entry == uniform_map.end()) {
- uniform_map[name] = type;
+ UniformPointerMap::iterator hit = uniform_pointer_map.find(name);
+ if (hit == uniform_pointer_map.end()) {
+ uniform_pointer_map[name] = &(iter->second);
} else {
- // If a uniform is already in the map, i.e., it has already been
- // declared by other shader, then the type and precision must match.
- if (map_entry->second == type)
+ // If a uniform is in the map, i.e., it has already been declared by
+ // another shader, then the type, precision, etc. must match.
+ if (hit->second->isSameUniformAtLinkTime(iter->second))
continue;
*conflicting_name = name;
return true;
@@ -1045,30 +1061,25 @@
attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER &&
attached_shaders_[1].get() &&
attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER);
- const ShaderTranslator::VariableMap* vertex_varyings =
- &(attached_shaders_[0]->varying_map());
- const ShaderTranslator::VariableMap* fragment_varyings =
- &(attached_shaders_[1]->varying_map());
+ const VaryingMap* vertex_varyings = &(attached_shaders_[0]->varying_map());
+ const VaryingMap* fragment_varyings = &(attached_shaders_[1]->varying_map());
- for (ShaderTranslator::VariableMap::const_iterator iter =
- fragment_varyings->begin();
+ for (VaryingMap::const_iterator iter = fragment_varyings->begin();
iter != fragment_varyings->end(); ++iter) {
const std::string& name = iter->first;
if (IsBuiltInVarying(name))
continue;
- ShaderTranslator::VariableMap::const_iterator hit =
- vertex_varyings->find(name);
+ VaryingMap::const_iterator hit = vertex_varyings->find(name);
if (hit == vertex_varyings->end()) {
- if (iter->second.static_use) {
+ if (iter->second.staticUse) {
*conflicting_name = name;
return true;
}
continue;
}
- if (hit->second.type != iter->second.type ||
- hit->second.size != iter->second.size) {
+ if (!hit->second.isSameVaryingAtLinkTime(iter->second)) {
*conflicting_name = name;
return true;
}
@@ -1082,14 +1093,14 @@
attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER &&
attached_shaders_[1].get() &&
attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER);
- const ShaderTranslator::VariableMap* uniforms[2];
+ const UniformMap* uniforms[2];
uniforms[0] = &(attached_shaders_[0]->uniform_map());
uniforms[1] = &(attached_shaders_[1]->uniform_map());
- const ShaderTranslator::VariableMap* attribs =
+ const AttributeMap* attribs =
&(attached_shaders_[0]->attrib_map());
- for (ShaderTranslator::VariableMap::const_iterator iter =
- attribs->begin(); iter != attribs->end(); ++iter) {
+ for (AttributeMap::const_iterator iter = attribs->begin();
+ iter != attribs->end(); ++iter) {
for (int ii = 0; ii < 2; ++ii) {
if (uniforms[ii]->find(iter->first) != uniforms[ii]->end()) {
*conflicting_name = iter->first;
@@ -1106,30 +1117,27 @@
attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER &&
attached_shaders_[1].get() &&
attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER);
- const ShaderTranslator::VariableMap* vertex_varyings =
- &(attached_shaders_[0]->varying_map());
- const ShaderTranslator::VariableMap* fragment_varyings =
- &(attached_shaders_[1]->varying_map());
+ const VaryingMap* vertex_varyings = &(attached_shaders_[0]->varying_map());
+ const VaryingMap* fragment_varyings = &(attached_shaders_[1]->varying_map());
std::map<std::string, ShVariableInfo> combined_map;
- for (ShaderTranslator::VariableMap::const_iterator iter =
- fragment_varyings->begin();
+ for (VaryingMap::const_iterator iter = fragment_varyings->begin();
iter != fragment_varyings->end(); ++iter) {
- if (!iter->second.static_use && option == kCountOnlyStaticallyUsed)
+ if (!iter->second.staticUse && option == kCountOnlyStaticallyUsed)
continue;
if (!IsBuiltInVarying(iter->first)) {
- ShaderTranslator::VariableMap::const_iterator vertex_iter =
+ VaryingMap::const_iterator vertex_iter =
vertex_varyings->find(iter->first);
if (vertex_iter == vertex_varyings->end() ||
- (!vertex_iter->second.static_use &&
+ (!vertex_iter->second.staticUse &&
option == kCountOnlyStaticallyUsed))
continue;
}
ShVariableInfo var;
var.type = static_cast<sh::GLenum>(iter->second.type);
- var.size = iter->second.size;
+ var.size = std::max(1u, iter->second.arraySize);
combined_map[iter->first] = var;
}
diff --git a/gpu/command_buffer/service/program_manager.h b/gpu/command_buffer/service/program_manager.h
index bcc3630..9698fc1 100644
--- a/gpu/command_buffer/service/program_manager.h
+++ b/gpu/command_buffer/service/program_manager.h
@@ -79,7 +79,7 @@
};
struct VertexAttrib {
VertexAttrib(GLsizei _size, GLenum _type, const std::string& _name,
- GLint _location)
+ GLint _location)
: size(_size),
type(_type),
location(_location),
@@ -115,7 +115,7 @@
&attrib_infos_[index] : NULL;
}
- GLint GetAttribLocation(const std::string& name) const;
+ GLint GetAttribLocation(const std::string& original_name) const;
const VertexAttrib* GetAttribInfoByLocation(GLuint location) const {
if (location < attrib_location_to_index_map_.size()) {
@@ -281,9 +281,17 @@
const std::string& name, const std::string& original_name,
size_t* next_available_index);
- void GetCorrectedVariableInfo(
- bool use_uniforms, const std::string& name, std::string* corrected_name,
- std::string* original_name, GLsizei* size, GLenum* type) const;
+ // Query uniform data returned by ANGLE translator by the mapped name.
+ // Some drivers incorrectly return an uniform name of size-1 array without
+ // "[0]". In this case, we correct the name by appending "[0]" to it.
+ void GetCorrectedUniformData(
+ const std::string& name,
+ std::string* corrected_name, std::string* original_name,
+ GLsizei* size, GLenum* type) const;
+
+ // Query VertexAttrib data returned by ANGLE translator by the mapped name.
+ void GetVertexAttribData(
+ const std::string& name, std::string* original_name, GLenum* type) const;
void DetachShaders(ShaderManager* manager);
diff --git a/gpu/command_buffer/service/program_manager_unittest.cc b/gpu/command_buffer/service/program_manager_unittest.cc
index 3cca263..5d80694 100644
--- a/gpu/command_buffer/service/program_manager_unittest.cc
+++ b/gpu/command_buffer/service/program_manager_unittest.cc
@@ -151,10 +151,10 @@
static const GLint kAttrib1Size = 1;
static const GLint kAttrib2Size = 1;
static const GLint kAttrib3Size = 1;
- static const int kAttrib1Precision = SH_PRECISION_MEDIUMP;
- static const int kAttrib2Precision = SH_PRECISION_HIGHP;
- static const int kAttrib3Precision = SH_PRECISION_LOWP;
- static const int kAttribStaticUse = 0;
+ static const GLenum kAttrib1Precision = GL_MEDIUM_FLOAT;
+ static const GLenum kAttrib2Precision = GL_HIGH_FLOAT;
+ static const GLenum kAttrib3Precision = GL_LOW_FLOAT;
+ static const bool kAttribStaticUse = true;
static const GLint kAttrib1Location = 0;
static const GLint kAttrib2Location = 1;
static const GLint kAttrib3Location = 2;
@@ -166,8 +166,9 @@
static const char* kUniform1Name;
static const char* kUniform2Name;
- static const char* kUniform3BadName;
- static const char* kUniform3GoodName;
+ static const char* kUniform2NameWithArrayIndex;
+ static const char* kUniform3Name;
+ static const char* kUniform3NameWithArrayIndex;
static const GLint kUniform1Size = 1;
static const GLint kUniform2Size = 3;
static const GLint kUniform3Size = 2;
@@ -206,10 +207,10 @@
} VarCategory;
typedef struct {
- int type;
- int size;
- int precision;
- int static_use;
+ GLenum type;
+ GLint size;
+ GLenum precision;
+ bool static_use;
std::string name;
VarCategory category;
} VarInfo;
@@ -283,56 +284,78 @@
const GLuint kFShaderClientId = 2;
const GLuint kFShaderServiceId = 12;
- ShaderTranslator::VariableMap vertex_attrib_map;
- ShaderTranslator::VariableMap vertex_uniform_map;
- ShaderTranslator::VariableMap vertex_varying_map;
+ AttributeMap vertex_attrib_map;
+ UniformMap vertex_uniform_map;
+ VaryingMap vertex_varying_map;
for (size_t ii = 0; ii < vertex_variable_size; ++ii) {
- ShaderTranslator::VariableMap* map = NULL;
switch (vertex_variables[ii].category) {
case kVarAttribute:
- map = &vertex_attrib_map;
+ vertex_attrib_map[vertex_variables[ii].name] =
+ TestHelper::ConstructAttribute(
+ vertex_variables[ii].type,
+ vertex_variables[ii].size,
+ vertex_variables[ii].precision,
+ vertex_variables[ii].static_use,
+ vertex_variables[ii].name);
break;
case kVarUniform:
- map = &vertex_uniform_map;
+ vertex_uniform_map[vertex_variables[ii].name] =
+ TestHelper::ConstructUniform(
+ vertex_variables[ii].type,
+ vertex_variables[ii].size,
+ vertex_variables[ii].precision,
+ vertex_variables[ii].static_use,
+ vertex_variables[ii].name);
break;
case kVarVarying:
- map = &vertex_varying_map;
+ vertex_varying_map[vertex_variables[ii].name] =
+ TestHelper::ConstructVarying(
+ vertex_variables[ii].type,
+ vertex_variables[ii].size,
+ vertex_variables[ii].precision,
+ vertex_variables[ii].static_use,
+ vertex_variables[ii].name);
break;
default:
NOTREACHED();
}
- (*map)[vertex_variables[ii].name] =
- ShaderTranslator::VariableInfo(vertex_variables[ii].type,
- vertex_variables[ii].size,
- vertex_variables[ii].precision,
- vertex_variables[ii].static_use,
- vertex_variables[ii].name);
}
- ShaderTranslator::VariableMap frag_attrib_map;
- ShaderTranslator::VariableMap frag_uniform_map;
- ShaderTranslator::VariableMap frag_varying_map;
+ AttributeMap frag_attrib_map;
+ UniformMap frag_uniform_map;
+ VaryingMap frag_varying_map;
for (size_t ii = 0; ii < fragment_variable_size; ++ii) {
- ShaderTranslator::VariableMap* map = NULL;
switch (fragment_variables[ii].category) {
case kVarAttribute:
- map = &frag_attrib_map;
+ frag_attrib_map[fragment_variables[ii].name] =
+ TestHelper::ConstructAttribute(
+ fragment_variables[ii].type,
+ fragment_variables[ii].size,
+ fragment_variables[ii].precision,
+ fragment_variables[ii].static_use,
+ fragment_variables[ii].name);
break;
case kVarUniform:
- map = &frag_uniform_map;
+ frag_uniform_map[fragment_variables[ii].name] =
+ TestHelper::ConstructUniform(
+ fragment_variables[ii].type,
+ fragment_variables[ii].size,
+ fragment_variables[ii].precision,
+ fragment_variables[ii].static_use,
+ fragment_variables[ii].name);
break;
case kVarVarying:
- map = &frag_varying_map;
+ frag_varying_map[fragment_variables[ii].name] =
+ TestHelper::ConstructVarying(
+ fragment_variables[ii].type,
+ fragment_variables[ii].size,
+ fragment_variables[ii].precision,
+ fragment_variables[ii].static_use,
+ fragment_variables[ii].name);
break;
default:
NOTREACHED();
}
- (*map)[fragment_variables[ii].name] =
- ShaderTranslator::VariableInfo(fragment_variables[ii].type,
- fragment_variables[ii].size,
- fragment_variables[ii].precision,
- fragment_variables[ii].static_use,
- fragment_variables[ii].name);
}
// Check we can create shader.
@@ -434,15 +457,15 @@
kUniform2FakeLocation,
kUniform2RealLocation,
kUniform2DesiredLocation,
- kUniform2Name,
+ kUniform2NameWithArrayIndex,
},
- { kUniform3BadName,
+ { kUniform3Name,
kUniform3Size,
kUniform3Type,
kUniform3FakeLocation,
kUniform3RealLocation,
kUniform3DesiredLocation,
- kUniform3GoodName,
+ kUniform3NameWithArrayIndex,
},
};
@@ -453,11 +476,12 @@
const char* ProgramManagerWithShaderTest::kAttrib2Name = "attrib2";
const char* ProgramManagerWithShaderTest::kAttrib3Name = "attrib3";
const char* ProgramManagerWithShaderTest::kUniform1Name = "uniform1";
-// Correctly has array spec.
-const char* ProgramManagerWithShaderTest::kUniform2Name = "uniform2[0]";
-// Incorrectly missing array spec.
-const char* ProgramManagerWithShaderTest::kUniform3BadName = "uniform3";
-const char* ProgramManagerWithShaderTest::kUniform3GoodName = "uniform3[0]";
+const char* ProgramManagerWithShaderTest::kUniform2Name = "uniform2";
+const char* ProgramManagerWithShaderTest::kUniform2NameWithArrayIndex =
+ "uniform2[0]";
+const char* ProgramManagerWithShaderTest::kUniform3Name = "uniform3";
+const char* ProgramManagerWithShaderTest::kUniform3NameWithArrayIndex =
+ "uniform3[0]";
TEST_F(ProgramManagerWithShaderTest, GetAttribInfos) {
const Program* program = manager_.GetProgram(kClientProgramId);
@@ -514,7 +538,7 @@
EXPECT_EQ(kUniform2Size, info->size);
EXPECT_EQ(kUniform2Type, info->type);
EXPECT_EQ(kUniform2RealLocation, info->element_locations[0]);
- EXPECT_STREQ(kUniform2Name, info->name.c_str());
+ EXPECT_STREQ(kUniform2NameWithArrayIndex, info->name.c_str());
info = program->GetUniformInfo(2);
// We emulate certain OpenGL drivers by supplying the name without
// the array spec. Our implementation should correctly add the required spec.
@@ -522,7 +546,7 @@
EXPECT_EQ(kUniform3Size, info->size);
EXPECT_EQ(kUniform3Type, info->type);
EXPECT_EQ(kUniform3RealLocation, info->element_locations[0]);
- EXPECT_STREQ(kUniform3GoodName, info->name.c_str());
+ EXPECT_STREQ(kUniform3NameWithArrayIndex, info->name.c_str());
EXPECT_TRUE(program->GetUniformInfo(kInvalidIndex) == NULL);
}
@@ -586,7 +610,7 @@
EXPECT_EQ(kUniform2FakeLocation,
program->GetUniformFakeLocation(kUniform2Name));
EXPECT_EQ(kUniform3FakeLocation,
- program->GetUniformFakeLocation(kUniform3BadName));
+ program->GetUniformFakeLocation(kUniform3Name));
// Check we can get uniform2 as "uniform2" even though the name is
// "uniform2[0]"
EXPECT_EQ(kUniform2FakeLocation,
@@ -594,7 +618,7 @@
// Check we can get uniform3 as "uniform3[0]" even though we simulated GL
// returning "uniform3"
EXPECT_EQ(kUniform3FakeLocation,
- program->GetUniformFakeLocation(kUniform3GoodName));
+ program->GetUniformFakeLocation(kUniform3NameWithArrayIndex));
// Check that we can get the locations of the array elements > 1
EXPECT_EQ(ProgramManager::MakeFakeLocation(kUniform2FakeLocation, 1),
program->GetUniformFakeLocation("uniform2[1]"));
@@ -653,15 +677,15 @@
kUniform2FakeLocation,
kUniform2RealLocation,
kUniform2DesiredLocation,
- kUniform2Name,
+ kUniform2NameWithArrayIndex,
},
- { kUniform3BadName,
+ { kUniform3Name,
kUniform3Size,
kUniform3Type,
kUniform3FakeLocation,
kUniform3RealLocation,
kUniform3DesiredLocation,
- kUniform3GoodName,
+ kUniform3NameWithArrayIndex,
},
};
const size_t kNumUniforms = arraysize(kUniforms);
@@ -698,7 +722,7 @@
// as the "gl_" uniform we skipped.
// +4u is to account for "gl_" and NULL terminator.
program->GetProgramiv(GL_ACTIVE_UNIFORM_MAX_LENGTH, &value);
- EXPECT_EQ(strlen(kUniform3BadName) + 4u, static_cast<size_t>(value));
+ EXPECT_EQ(strlen(kUniform3Name) + 4u, static_cast<size_t>(value));
}
// Test the bug comparing similar array names is fixed.
@@ -772,27 +796,27 @@
static GLenum kAttrib2GoodType = GL_FLOAT_MAT2;
static GLenum kUniform2BadType = GL_FLOAT_VEC3;
static GLenum kUniform2GoodType = GL_FLOAT_MAT3;
- ShaderTranslator::VariableMap attrib_map;
- ShaderTranslator::VariableMap uniform_map;
- ShaderTranslator::VariableMap varying_map;
- attrib_map[kAttrib1Name] = ShaderTranslatorInterface::VariableInfo(
+ AttributeMap attrib_map;
+ UniformMap uniform_map;
+ VaryingMap varying_map;
+ attrib_map[kAttrib1Name] = TestHelper::ConstructAttribute(
kAttrib1Type, kAttrib1Size, kAttrib1Precision,
kAttribStaticUse, kAttrib1Name);
- attrib_map[kAttrib2Name] = ShaderTranslatorInterface::VariableInfo(
+ attrib_map[kAttrib2Name] = TestHelper::ConstructAttribute(
kAttrib2GoodType, kAttrib2Size, kAttrib2Precision,
kAttribStaticUse, kAttrib2Name);
- attrib_map[kAttrib3Name] = ShaderTranslatorInterface::VariableInfo(
+ attrib_map[kAttrib3Name] = TestHelper::ConstructAttribute(
kAttrib3Type, kAttrib3Size, kAttrib3Precision,
kAttribStaticUse, kAttrib3Name);
- uniform_map[kUniform1Name] = ShaderTranslatorInterface::VariableInfo(
+ uniform_map[kUniform1Name] = TestHelper::ConstructUniform(
kUniform1Type, kUniform1Size, kUniform1Precision,
kUniform1StaticUse, kUniform1Name);
- uniform_map[kUniform2Name] = ShaderTranslatorInterface::VariableInfo(
+ uniform_map[kUniform2Name] = TestHelper::ConstructUniform(
kUniform2GoodType, kUniform2Size, kUniform2Precision,
kUniform2StaticUse, kUniform2Name);
- uniform_map[kUniform3GoodName] = ShaderTranslatorInterface::VariableInfo(
+ uniform_map[kUniform3Name] = TestHelper::ConstructUniform(
kUniform3Type, kUniform3Size, kUniform3Precision,
- kUniform3StaticUse, kUniform3GoodName);
+ kUniform3StaticUse, kUniform3Name);
const GLuint kVShaderClientId = 2001;
const GLuint kFShaderClientId = 2002;
const GLuint kVShaderServiceId = 3001;
@@ -829,15 +853,15 @@
kUniform2FakeLocation,
kUniform2RealLocation,
kUniform2DesiredLocation,
- kUniform2Name,
+ kUniform2NameWithArrayIndex,
},
- { kUniform3BadName,
+ { kUniform3Name,
kUniform3Size,
kUniform3Type,
kUniform3FakeLocation,
kUniform3RealLocation,
kUniform3DesiredLocation,
- kUniform3GoodName,
+ kUniform3NameWithArrayIndex,
},
};
const size_t kNumAttribs= arraysize(kAttribs);
@@ -859,26 +883,41 @@
const Program::VertexAttrib* attrib_info =
program->GetAttribInfo(index);
ASSERT_TRUE(attrib_info != NULL);
- ShaderTranslator::VariableMap::const_iterator it = attrib_map.find(
- attrib_info->name);
+ size_t pos = attrib_info->name.find_first_of("[.");
+ std::string top_name;
+ if (pos == std::string::npos)
+ top_name = attrib_info->name;
+ else
+ top_name = attrib_info->name.substr(0, pos);
+ AttributeMap::const_iterator it = attrib_map.find(top_name);
ASSERT_TRUE(it != attrib_map.end());
- EXPECT_EQ(it->first, attrib_info->name);
- EXPECT_EQ(static_cast<GLenum>(it->second.type), attrib_info->type);
- EXPECT_EQ(it->second.size, attrib_info->size);
- EXPECT_EQ(it->second.name, attrib_info->name);
+ const sh::ShaderVariable* info;
+ std::string original_name;
+ EXPECT_TRUE(it->second.findInfoByMappedName(
+ attrib_info->name, &info, &original_name));
+ EXPECT_EQ(info->type, attrib_info->type);
+ EXPECT_EQ(static_cast<GLint>(info->arraySize), attrib_info->size);
+ EXPECT_EQ(original_name, attrib_info->name);
}
// Check Uniforms
for (unsigned index = 0; index < kNumUniforms; ++index) {
- const Program::UniformInfo* uniform_info =
- program->GetUniformInfo(index);
+ const Program::UniformInfo* uniform_info = program->GetUniformInfo(index);
ASSERT_TRUE(uniform_info != NULL);
- ShaderTranslator::VariableMap::const_iterator it = uniform_map.find(
- uniform_info->name);
+ size_t pos = uniform_info->name.find_first_of("[.");
+ std::string top_name;
+ if (pos == std::string::npos)
+ top_name = uniform_info->name;
+ else
+ top_name = uniform_info->name.substr(0, pos);
+ UniformMap::const_iterator it = uniform_map.find(top_name);
ASSERT_TRUE(it != uniform_map.end());
- EXPECT_EQ(it->first, uniform_info->name);
- EXPECT_EQ(static_cast<GLenum>(it->second.type), uniform_info->type);
- EXPECT_EQ(it->second.size, uniform_info->size);
- EXPECT_EQ(it->second.name, uniform_info->name);
+ const sh::ShaderVariable* info;
+ std::string original_name;
+ EXPECT_TRUE(it->second.findInfoByMappedName(
+ uniform_info->name, &info, &original_name));
+ EXPECT_EQ(info->type, uniform_info->type);
+ EXPECT_EQ(static_cast<GLint>(info->arraySize), uniform_info->size);
+ EXPECT_EQ(original_name, uniform_info->name);
}
}
@@ -1086,15 +1125,22 @@
const GLuint kVShaderServiceId = 11;
const GLuint kFShaderClientId = 2;
const GLuint kFShaderServiceId = 12;
- ShaderTranslator::VariableMap attrib_map;
+ AttributeMap attrib_map;
for (uint32 ii = 0; ii < kNumAttribs; ++ii) {
- attrib_map[kAttribs[ii].name] = ShaderTranslatorInterface::VariableInfo(
+ attrib_map[kAttribs[ii].name] = TestHelper::ConstructAttribute(
kAttribs[ii].type,
kAttribs[ii].size,
SH_PRECISION_MEDIUMP,
kAttribStaticUse,
kAttribs[ii].name);
}
+ const char kAttribMatName[] = "matAttrib";
+ attrib_map[kAttribMatName] = TestHelper::ConstructAttribute(
+ GL_FLOAT_MAT2,
+ 1,
+ SH_PRECISION_MEDIUMP,
+ kAttribStaticUse,
+ kAttribMatName);
// Check we can create shader.
Shader* vshader = shader_manager_.CreateShader(
kVShaderClientId, kVShaderServiceId, GL_VERTEX_SHADER);
@@ -1106,15 +1152,15 @@
TestHelper::SetShaderStates(
gl_.get(), vshader, true, NULL, NULL, &attrib_map, NULL, NULL, NULL);
// Check attrib infos got copied.
- for (ShaderTranslator::VariableMap::const_iterator it = attrib_map.begin();
+ for (AttributeMap::const_iterator it = attrib_map.begin();
it != attrib_map.end(); ++it) {
- const Shader::VariableInfo* variable_info =
+ const sh::Attribute* variable_info =
vshader->GetAttribInfo(it->first);
ASSERT_TRUE(variable_info != NULL);
EXPECT_EQ(it->second.type, variable_info->type);
- EXPECT_EQ(it->second.size, variable_info->size);
+ EXPECT_EQ(it->second.arraySize, variable_info->arraySize);
EXPECT_EQ(it->second.precision, variable_info->precision);
- EXPECT_EQ(it->second.static_use, variable_info->static_use);
+ EXPECT_EQ(it->second.staticUse, variable_info->staticUse);
EXPECT_EQ(it->second.name, variable_info->name);
}
TestHelper::SetShaderStates(
@@ -1134,19 +1180,40 @@
program->SetAttribLocationBinding(kAttrib1Name, 0);
EXPECT_FALSE(program->DetectAttribLocationBindingConflicts());
+ EXPECT_CALL(*(gl_.get()), BindAttribLocation(_, 0, _))
+ .Times(1)
+ .RetiresOnSaturation();
EXPECT_TRUE(LinkAsExpected(program, true));
program->SetAttribLocationBinding("xxx", 0);
EXPECT_FALSE(program->DetectAttribLocationBindingConflicts());
+ EXPECT_CALL(*(gl_.get()), BindAttribLocation(_, 0, _))
+ .Times(1)
+ .RetiresOnSaturation();
EXPECT_TRUE(LinkAsExpected(program, true));
program->SetAttribLocationBinding(kAttrib2Name, 1);
EXPECT_FALSE(program->DetectAttribLocationBindingConflicts());
+ EXPECT_CALL(*(gl_.get()), BindAttribLocation(_, _, _))
+ .Times(2)
+ .RetiresOnSaturation();
EXPECT_TRUE(LinkAsExpected(program, true));
program->SetAttribLocationBinding(kAttrib2Name, 0);
EXPECT_TRUE(program->DetectAttribLocationBindingConflicts());
EXPECT_TRUE(LinkAsExpected(program, false));
+
+ program->SetAttribLocationBinding(kAttribMatName, 1);
+ program->SetAttribLocationBinding(kAttrib2Name, 3);
+ EXPECT_CALL(*(gl_.get()), BindAttribLocation(_, _, _))
+ .Times(3)
+ .RetiresOnSaturation();
+ EXPECT_FALSE(program->DetectAttribLocationBindingConflicts());
+ EXPECT_TRUE(LinkAsExpected(program, true));
+
+ program->SetAttribLocationBinding(kAttrib2Name, 2);
+ EXPECT_TRUE(program->DetectAttribLocationBindingConflicts());
+ EXPECT_TRUE(LinkAsExpected(program, false));
}
TEST_F(ProgramManagerWithShaderTest, UniformsPrecisionMismatch) {
@@ -1156,12 +1223,12 @@
const GLuint kFShaderClientId = 2;
const GLuint kFShaderServiceId = 12;
- ShaderTranslator::VariableMap vertex_uniform_map;
- vertex_uniform_map["a"] = ShaderTranslator::VariableInfo(
- 1, 3, SH_PRECISION_MEDIUMP, 1, "a");
- ShaderTranslator::VariableMap frag_uniform_map;
- frag_uniform_map["a"] = ShaderTranslator::VariableInfo(
- 1, 3, SH_PRECISION_LOWP, 1, "a");
+ UniformMap vertex_uniform_map;
+ vertex_uniform_map["a"] = TestHelper::ConstructUniform(
+ GL_FLOAT, 3, GL_MEDIUM_FLOAT, true, "a");
+ UniformMap frag_uniform_map;
+ frag_uniform_map["a"] = TestHelper::ConstructUniform(
+ GL_FLOAT, 3, GL_LOW_FLOAT, true, "a");
// Check we can create shader.
Shader* vshader = shader_manager_.CreateShader(
@@ -1198,9 +1265,9 @@
// shader, linking should fail.
TEST_F(ProgramManagerWithShaderTest, VaryingTypeMismatch) {
const VarInfo kVertexVarying =
- { GL_FLOAT_VEC3, 1, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying };
+ { GL_FLOAT_VEC3, 1, GL_MEDIUM_FLOAT, true, "a", kVarVarying };
const VarInfo kFragmentVarying =
- { GL_FLOAT_VEC4, 1, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying };
+ { GL_FLOAT_VEC4, 1, GL_MEDIUM_FLOAT, true, "a", kVarVarying };
Program* program = SetupShaderVariableTest(
&kVertexVarying, 1, &kFragmentVarying, 1);
@@ -1215,9 +1282,9 @@
// shader, linking should fail.
TEST_F(ProgramManagerWithShaderTest, VaryingArraySizeMismatch) {
const VarInfo kVertexVarying =
- { GL_FLOAT, 2, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying };
+ { GL_FLOAT, 2, GL_MEDIUM_FLOAT, true, "a", kVarVarying };
const VarInfo kFragmentVarying =
- { GL_FLOAT, 3, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying };
+ { GL_FLOAT, 3, GL_MEDIUM_FLOAT, true, "a", kVarVarying };
Program* program = SetupShaderVariableTest(
&kVertexVarying, 1, &kFragmentVarying, 1);
@@ -1232,9 +1299,9 @@
// shader, linking should succeed.
TEST_F(ProgramManagerWithShaderTest, VaryingPrecisionMismatch) {
const VarInfo kVertexVarying =
- { GL_FLOAT, 2, SH_PRECISION_HIGHP, 1, "a", kVarVarying };
+ { GL_FLOAT, 2, GL_HIGH_FLOAT, true, "a", kVarVarying };
const VarInfo kFragmentVarying =
- { GL_FLOAT, 2, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying };
+ { GL_FLOAT, 2, GL_MEDIUM_FLOAT, true, "a", kVarVarying };
Program* program = SetupShaderVariableTest(
&kVertexVarying, 1, &kFragmentVarying, 1);
@@ -1249,7 +1316,7 @@
// declared in vertex shader, link should fail.
TEST_F(ProgramManagerWithShaderTest, VaryingMissing) {
const VarInfo kFragmentVarying =
- { GL_FLOAT, 3, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying };
+ { GL_FLOAT, 3, GL_MEDIUM_FLOAT, true, "a", kVarVarying };
Program* program = SetupShaderVariableTest(
NULL, 0, &kFragmentVarying, 1);
@@ -1265,7 +1332,7 @@
// succeed.
TEST_F(ProgramManagerWithShaderTest, InactiveVarying) {
const VarInfo kFragmentVarying =
- { GL_FLOAT, 3, SH_PRECISION_MEDIUMP, 0, "a", kVarVarying };
+ { GL_FLOAT, 3, GL_MEDIUM_FLOAT, false, "a", kVarVarying };
Program* program = SetupShaderVariableTest(
NULL, 0, &kFragmentVarying, 1);
@@ -1281,9 +1348,9 @@
// failure.
TEST_F(ProgramManagerWithShaderTest, AttribUniformNameConflict) {
const VarInfo kVertexAttribute =
- { GL_FLOAT_VEC4, 1, SH_PRECISION_MEDIUMP, 1, "a", kVarAttribute };
+ { GL_FLOAT_VEC4, 1, GL_MEDIUM_FLOAT, true, "a", kVarAttribute };
const VarInfo kFragmentUniform =
- { GL_FLOAT_VEC4, 1, SH_PRECISION_MEDIUMP, 1, "a", kVarUniform };
+ { GL_FLOAT_VEC4, 1, GL_MEDIUM_FLOAT, true, "a", kVarUniform };
Program* program = SetupShaderVariableTest(
&kVertexAttribute, 1, &kFragmentUniform, 1);
@@ -1297,12 +1364,12 @@
// Varyings go over 8 rows.
TEST_F(ProgramManagerWithShaderTest, TooManyVaryings) {
const VarInfo kVertexVaryings[] = {
- { GL_FLOAT_VEC4, 4, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying },
- { GL_FLOAT_VEC4, 5, SH_PRECISION_MEDIUMP, 1, "b", kVarVarying }
+ { GL_FLOAT_VEC4, 4, GL_MEDIUM_FLOAT, true, "a", kVarVarying },
+ { GL_FLOAT_VEC4, 5, GL_MEDIUM_FLOAT, true, "b", kVarVarying }
};
const VarInfo kFragmentVaryings[] = {
- { GL_FLOAT_VEC4, 4, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying },
- { GL_FLOAT_VEC4, 5, SH_PRECISION_MEDIUMP, 1, "b", kVarVarying }
+ { GL_FLOAT_VEC4, 4, GL_MEDIUM_FLOAT, true, "a", kVarVarying },
+ { GL_FLOAT_VEC4, 5, GL_MEDIUM_FLOAT, true, "b", kVarVarying }
};
Program* program = SetupShaderVariableTest(
kVertexVaryings, 2, kFragmentVaryings, 2);
@@ -1315,12 +1382,12 @@
// Varyings go over 8 rows but some are inactive
TEST_F(ProgramManagerWithShaderTest, TooManyInactiveVaryings) {
const VarInfo kVertexVaryings[] = {
- { GL_FLOAT_VEC4, 4, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying },
- { GL_FLOAT_VEC4, 5, SH_PRECISION_MEDIUMP, 1, "b", kVarVarying }
+ { GL_FLOAT_VEC4, 4, GL_MEDIUM_FLOAT, true, "a", kVarVarying },
+ { GL_FLOAT_VEC4, 5, GL_MEDIUM_FLOAT, true, "b", kVarVarying }
};
const VarInfo kFragmentVaryings[] = {
- { GL_FLOAT_VEC4, 4, SH_PRECISION_MEDIUMP, 0, "a", kVarVarying },
- { GL_FLOAT_VEC4, 5, SH_PRECISION_MEDIUMP, 1, "b", kVarVarying }
+ { GL_FLOAT_VEC4, 4, GL_MEDIUM_FLOAT, false, "a", kVarVarying },
+ { GL_FLOAT_VEC4, 5, GL_MEDIUM_FLOAT, true, "b", kVarVarying }
};
Program* program = SetupShaderVariableTest(
kVertexVaryings, 2, kFragmentVaryings, 2);
@@ -1334,12 +1401,12 @@
// However, we still fail the check if kCountAll option is used.
TEST_F(ProgramManagerWithShaderTest, CountAllVaryingsInPacking) {
const VarInfo kVertexVaryings[] = {
- { GL_FLOAT_VEC4, 4, SH_PRECISION_MEDIUMP, 1, "a", kVarVarying },
- { GL_FLOAT_VEC4, 5, SH_PRECISION_MEDIUMP, 1, "b", kVarVarying }
+ { GL_FLOAT_VEC4, 4, GL_MEDIUM_FLOAT, true, "a", kVarVarying },
+ { GL_FLOAT_VEC4, 5, GL_MEDIUM_FLOAT, true, "b", kVarVarying }
};
const VarInfo kFragmentVaryings[] = {
- { GL_FLOAT_VEC4, 4, SH_PRECISION_MEDIUMP, 0, "a", kVarVarying },
- { GL_FLOAT_VEC4, 5, SH_PRECISION_MEDIUMP, 1, "b", kVarVarying }
+ { GL_FLOAT_VEC4, 4, GL_MEDIUM_FLOAT, false, "a", kVarVarying },
+ { GL_FLOAT_VEC4, 5, GL_MEDIUM_FLOAT, true, "b", kVarVarying }
};
Program* program = SetupShaderVariableTest(
kVertexVaryings, 2, kFragmentVaryings, 2);
@@ -1397,15 +1464,15 @@
kUniform2FakeLocation,
kUniform2RealLocation,
kUniform2DesiredLocation,
- kUniform2Name,
+ kUniform2NameWithArrayIndex,
},
- { kUniform3BadName,
+ { kUniform3Name,
kUniform3Size,
kUniform3Type,
kUniform3FakeLocation,
kUniform3RealLocation,
kUniform3DesiredLocation,
- kUniform3GoodName,
+ kUniform3NameWithArrayIndex,
},
};
const size_t kNumAttribs = arraysize(kAttribs);
@@ -1447,7 +1514,7 @@
EXPECT_TRUE(program->SetUniformLocationBinding(
kUniform1Name, kUniform1DesiredLocation));
EXPECT_TRUE(program->SetUniformLocationBinding(
- kUniform3BadName, kUniform3DesiredLocation));
+ kUniform3Name, kUniform3DesiredLocation));
static ProgramManagerWithShaderTest::AttribInfo kAttribs[] = {
{ kAttrib1Name, kAttrib1Size, kAttrib1Type, kAttrib1Location, },
@@ -1469,15 +1536,15 @@
kUniform2FakeLocation,
kUniform2RealLocation,
kUniform2DesiredLocation,
- kUniform2Name,
+ kUniform2NameWithArrayIndex,
},
- { kUniform3BadName,
+ { kUniform3Name,
kUniform3Size,
kUniform3Type,
kUniform3FakeLocation,
kUniform3RealLocation,
kUniform3DesiredLocation,
- kUniform3GoodName,
+ kUniform3NameWithArrayIndex,
},
};
@@ -1491,9 +1558,9 @@
EXPECT_EQ(kUniform1DesiredLocation,
program->GetUniformFakeLocation(kUniform1Name));
EXPECT_EQ(kUniform3DesiredLocation,
- program->GetUniformFakeLocation(kUniform3BadName));
+ program->GetUniformFakeLocation(kUniform3Name));
EXPECT_EQ(kUniform3DesiredLocation,
- program->GetUniformFakeLocation(kUniform3GoodName));
+ program->GetUniformFakeLocation(kUniform3NameWithArrayIndex));
}
class ProgramManagerWithCacheTest : public GpuServiceTest {
diff --git a/gpu/command_buffer/service/shader_manager.cc b/gpu/command_buffer/service/shader_manager.cc
index 189d78b..2707b90 100644
--- a/gpu/command_buffer/service/shader_manager.cc
+++ b/gpu/command_buffer/service/shader_manager.cc
@@ -12,6 +12,18 @@
namespace gpu {
namespace gles2 {
+namespace {
+
+// Given a variable name | a[0].b.c[0] |, return |a|.
+std::string GetTopVariableName(const std::string& fullname) {
+ size_t pos = fullname.find_first_of("[.");
+ if (pos == std::string::npos)
+ return fullname;
+ return fullname.substr(0, pos);
+}
+
+} // namespace anonymous
+
Shader::Shader(GLuint service_id, GLenum shader_type)
: use_count_(0),
service_id_(service_id),
@@ -96,15 +108,17 @@
service_id_ = 0;
}
-const Shader::VariableInfo* Shader::GetAttribInfo(
- const std::string& name) const {
- VariableMap::const_iterator it = attrib_map_.find(name);
+const sh::Attribute* Shader::GetAttribInfo(const std::string& name) const {
+ // Vertex attributes can't be arrays or structs (GLSL ES 3.00.4, section
+ // 4.3.4, "Input Variables"), so |name| is the top level name used as
+ // the AttributeMap key.
+ AttributeMap::const_iterator it = attrib_map_.find(name);
return it != attrib_map_.end() ? &it->second : NULL;
}
const std::string* Shader::GetAttribMappedName(
const std::string& original_name) const {
- for (VariableMap::const_iterator it = attrib_map_.begin();
+ for (AttributeMap::const_iterator it = attrib_map_.begin();
it != attrib_map_.end(); ++it) {
if (it->second.name == original_name)
return &(it->first);
@@ -120,15 +134,13 @@
return NULL;
}
-const Shader::VariableInfo* Shader::GetUniformInfo(
- const std::string& name) const {
- VariableMap::const_iterator it = uniform_map_.find(name);
+const sh::Uniform* Shader::GetUniformInfo(const std::string& name) const {
+ UniformMap::const_iterator it = uniform_map_.find(GetTopVariableName(name));
return it != uniform_map_.end() ? &it->second : NULL;
}
-const Shader::VariableInfo* Shader::GetVaryingInfo(
- const std::string& name) const {
- VariableMap::const_iterator it = varying_map_.find(name);
+const sh::Varying* Shader::GetVaryingInfo(const std::string& name) const {
+ VaryingMap::const_iterator it = varying_map_.find(GetTopVariableName(name));
return it != varying_map_.end() ? &it->second : NULL;
}
diff --git a/gpu/command_buffer/service/shader_manager.h b/gpu/command_buffer/service/shader_manager.h
index 359e574..c726767 100644
--- a/gpu/command_buffer/service/shader_manager.h
+++ b/gpu/command_buffer/service/shader_manager.h
@@ -29,8 +29,6 @@
kGL, // GL or GLES
};
- typedef ShaderTranslator::VariableInfo VariableInfo;
-
void DoCompile(ShaderTranslatorInterface* translator,
TranslatedShaderSourceType type);
@@ -58,9 +56,9 @@
return signature_source_;
}
- const VariableInfo* GetAttribInfo(const std::string& name) const;
- const VariableInfo* GetUniformInfo(const std::string& name) const;
- const VariableInfo* GetVaryingInfo(const std::string& name) const;
+ const sh::Attribute* GetAttribInfo(const std::string& name) const;
+ const sh::Uniform* GetUniformInfo(const std::string& name) const;
+ const sh::Varying* GetVaryingInfo(const std::string& name) const;
// If the original_name is not found, return NULL.
const std::string* GetAttribMappedName(
@@ -88,42 +86,39 @@
}
// Used by program cache.
- const ShaderTranslator::VariableMap& attrib_map() const {
+ const AttributeMap& attrib_map() const {
return attrib_map_;
}
// Used by program cache.
- const ShaderTranslator::VariableMap& uniform_map() const {
+ const UniformMap& uniform_map() const {
return uniform_map_;
}
// Used by program cache.
- const ShaderTranslator::VariableMap& varying_map() const {
+ const VaryingMap& varying_map() const {
return varying_map_;
}
// Used by program cache.
- void set_attrib_map(const ShaderTranslator::VariableMap& attrib_map) {
+ void set_attrib_map(const AttributeMap& attrib_map) {
// copied because cache might be cleared
- attrib_map_ = ShaderTranslator::VariableMap(attrib_map);
+ attrib_map_ = AttributeMap(attrib_map);
}
// Used by program cache.
- void set_uniform_map(const ShaderTranslator::VariableMap& uniform_map) {
+ void set_uniform_map(const UniformMap& uniform_map) {
// copied because cache might be cleared
- uniform_map_ = ShaderTranslator::VariableMap(uniform_map);
+ uniform_map_ = UniformMap(uniform_map);
}
// Used by program cache.
- void set_varying_map(const ShaderTranslator::VariableMap& varying_map) {
+ void set_varying_map(const VaryingMap& varying_map) {
// copied because cache might be cleared
- varying_map_ = ShaderTranslator::VariableMap(varying_map);
+ varying_map_ = VaryingMap(varying_map);
}
private:
- typedef ShaderTranslator::VariableMap VariableMap;
- typedef ShaderTranslator::NameMap NameMap;
-
friend class base::RefCounted<Shader>;
friend class ShaderManager;
@@ -157,9 +152,9 @@
std::string log_info_;
// The type info when the shader was last compiled.
- VariableMap attrib_map_;
- VariableMap uniform_map_;
- VariableMap varying_map_;
+ AttributeMap attrib_map_;
+ UniformMap uniform_map_;
+ VaryingMap varying_map_;
// The name hashing info when the shader was last compiled.
NameMap name_map_;
diff --git a/gpu/command_buffer/service/shader_manager_unittest.cc b/gpu/command_buffer/service/shader_manager_unittest.cc
index d6236f7..717572b 100644
--- a/gpu/command_buffer/service/shader_manager_unittest.cc
+++ b/gpu/command_buffer/service/shader_manager_unittest.cc
@@ -93,28 +93,28 @@
const GLenum kShader1Type = GL_VERTEX_SHADER;
const char* kClient1Source = "hello world";
const GLenum kAttrib1Type = GL_FLOAT_VEC2;
- const GLsizei kAttrib1Size = 2;
- const int kAttrib1Precision = SH_PRECISION_MEDIUMP;
+ const GLint kAttrib1Size = 2;
+ const GLenum kAttrib1Precision = GL_MEDIUM_FLOAT;
const char* kAttrib1Name = "attr1";
const GLenum kAttrib2Type = GL_FLOAT_VEC3;
- const GLsizei kAttrib2Size = 4;
- const int kAttrib2Precision = SH_PRECISION_HIGHP;
+ const GLint kAttrib2Size = 4;
+ const GLenum kAttrib2Precision = GL_HIGH_FLOAT;
const char* kAttrib2Name = "attr2";
- const int kAttribStaticUse = 0;
+ const bool kAttribStaticUse = false;
const GLenum kUniform1Type = GL_FLOAT_MAT2;
- const GLsizei kUniform1Size = 3;
- const int kUniform1Precision = SH_PRECISION_LOWP;
- const int kUniform1StaticUse = 1;
+ const GLint kUniform1Size = 3;
+ const GLenum kUniform1Precision = GL_LOW_FLOAT;
+ const bool kUniform1StaticUse = true;
const char* kUniform1Name = "uni1";
const GLenum kUniform2Type = GL_FLOAT_MAT3;
- const GLsizei kUniform2Size = 5;
- const int kUniform2Precision = SH_PRECISION_MEDIUMP;
- const int kUniform2StaticUse = 0;
+ const GLint kUniform2Size = 5;
+ const GLenum kUniform2Precision = GL_MEDIUM_FLOAT;
+ const bool kUniform2StaticUse = false;
const char* kUniform2Name = "uni2";
const GLenum kVarying1Type = GL_FLOAT_VEC4;
- const GLsizei kVarying1Size = 1;
- const int kVarying1Precision = SH_PRECISION_HIGHP;
- const int kVarying1StaticUse = 0;
+ const GLint kVarying1Size = 1;
+ const GLenum kVarying1Precision = GL_HIGH_FLOAT;
+ const bool kVarying1StaticUse = false;
const char* kVarying1Name = "varying1";
// Check we can create shader.
@@ -145,22 +145,22 @@
const std::string kLog = "foo";
const std::string kTranslatedSource = "poo";
- ShaderTranslator::VariableMap attrib_map;
- attrib_map[kAttrib1Name] = ShaderTranslatorInterface::VariableInfo(
+ AttributeMap attrib_map;
+ attrib_map[kAttrib1Name] = TestHelper::ConstructAttribute(
kAttrib1Type, kAttrib1Size, kAttrib1Precision,
kAttribStaticUse, kAttrib1Name);
- attrib_map[kAttrib2Name] = ShaderTranslatorInterface::VariableInfo(
+ attrib_map[kAttrib2Name] = TestHelper::ConstructAttribute(
kAttrib2Type, kAttrib2Size, kAttrib2Precision,
kAttribStaticUse, kAttrib2Name);
- ShaderTranslator::VariableMap uniform_map;
- uniform_map[kUniform1Name] = ShaderTranslatorInterface::VariableInfo(
+ UniformMap uniform_map;
+ uniform_map[kUniform1Name] = TestHelper::ConstructUniform(
kUniform1Type, kUniform1Size, kUniform1Precision,
kUniform1StaticUse, kUniform1Name);
- uniform_map[kUniform2Name] = ShaderTranslatorInterface::VariableInfo(
+ uniform_map[kUniform2Name] = TestHelper::ConstructUniform(
kUniform2Type, kUniform2Size, kUniform2Precision,
kUniform2StaticUse, kUniform2Name);
- ShaderTranslator::VariableMap varying_map;
- varying_map[kVarying1Name] = ShaderTranslatorInterface::VariableInfo(
+ VaryingMap varying_map;
+ varying_map[kVarying1Name] = TestHelper::ConstructVarying(
kVarying1Type, kVarying1Size, kVarying1Precision,
kVarying1StaticUse, kVarying1Name);
@@ -175,41 +175,38 @@
// Check varying infos got copied.
EXPECT_EQ(attrib_map.size(), shader1->attrib_map().size());
- for (ShaderTranslator::VariableMap::const_iterator it = attrib_map.begin();
+ for (AttributeMap::const_iterator it = attrib_map.begin();
it != attrib_map.end(); ++it) {
- const Shader::VariableInfo* variable_info =
- shader1->GetAttribInfo(it->first);
+ const sh::Attribute* variable_info = shader1->GetAttribInfo(it->first);
ASSERT_TRUE(variable_info != NULL);
EXPECT_EQ(it->second.type, variable_info->type);
- EXPECT_EQ(it->second.size, variable_info->size);
+ EXPECT_EQ(it->second.arraySize, variable_info->arraySize);
EXPECT_EQ(it->second.precision, variable_info->precision);
- EXPECT_EQ(it->second.static_use, variable_info->static_use);
+ EXPECT_EQ(it->second.staticUse, variable_info->staticUse);
EXPECT_STREQ(it->second.name.c_str(), variable_info->name.c_str());
}
// Check uniform infos got copied.
EXPECT_EQ(uniform_map.size(), shader1->uniform_map().size());
- for (ShaderTranslator::VariableMap::const_iterator it = uniform_map.begin();
+ for (UniformMap::const_iterator it = uniform_map.begin();
it != uniform_map.end(); ++it) {
- const Shader::VariableInfo* variable_info =
- shader1->GetUniformInfo(it->first);
+ const sh::Uniform* variable_info = shader1->GetUniformInfo(it->first);
ASSERT_TRUE(variable_info != NULL);
EXPECT_EQ(it->second.type, variable_info->type);
- EXPECT_EQ(it->second.size, variable_info->size);
+ EXPECT_EQ(it->second.arraySize, variable_info->arraySize);
EXPECT_EQ(it->second.precision, variable_info->precision);
- EXPECT_EQ(it->second.static_use, variable_info->static_use);
+ EXPECT_EQ(it->second.staticUse, variable_info->staticUse);
EXPECT_STREQ(it->second.name.c_str(), variable_info->name.c_str());
}
// Check varying infos got copied.
EXPECT_EQ(varying_map.size(), shader1->varying_map().size());
- for (ShaderTranslator::VariableMap::const_iterator it = varying_map.begin();
+ for (VaryingMap::const_iterator it = varying_map.begin();
it != varying_map.end(); ++it) {
- const Shader::VariableInfo* variable_info =
- shader1->GetVaryingInfo(it->first);
+ const sh::Varying* variable_info = shader1->GetVaryingInfo(it->first);
ASSERT_TRUE(variable_info != NULL);
EXPECT_EQ(it->second.type, variable_info->type);
- EXPECT_EQ(it->second.size, variable_info->size);
+ EXPECT_EQ(it->second.arraySize, variable_info->arraySize);
EXPECT_EQ(it->second.precision, variable_info->precision);
- EXPECT_EQ(it->second.static_use, variable_info->static_use);
+ EXPECT_EQ(it->second.staticUse, variable_info->staticUse);
EXPECT_STREQ(it->second.name.c_str(), variable_info->name.c_str());
}
diff --git a/gpu/command_buffer/service/shader_translator.cc b/gpu/command_buffer/service/shader_translator.cc
index bc06ab3..0fdb4bc 100644
--- a/gpu/command_buffer/service/shader_translator.cc
+++ b/gpu/command_buffer/service/shader_translator.cc
@@ -14,9 +14,10 @@
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
-namespace {
+namespace gpu {
+namespace gles2 {
-using gpu::gles2::ShaderTranslator;
+namespace {
class ShaderTranslatorInitializer {
public:
@@ -34,58 +35,40 @@
base::LazyInstance<ShaderTranslatorInitializer> g_translator_initializer =
LAZY_INSTANCE_INITIALIZER;
-void GetVariableInfo(ShHandle compiler, ShShaderInfo var_type,
- ShaderTranslator::VariableMap* var_map) {
+void GetAttributes(ShHandle compiler, AttributeMap* var_map) {
if (!var_map)
return;
var_map->clear();
-
- size_t name_len = 0, mapped_name_len = 0;
- switch (var_type) {
- case SH_ACTIVE_ATTRIBUTES:
- ShGetInfo(compiler, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, &name_len);
- break;
- case SH_ACTIVE_UNIFORMS:
- ShGetInfo(compiler, SH_ACTIVE_UNIFORM_MAX_LENGTH, &name_len);
- break;
- case SH_VARYINGS:
- ShGetInfo(compiler, SH_VARYING_MAX_LENGTH, &name_len);
- break;
- default: NOTREACHED();
- }
- ShGetInfo(compiler, SH_MAPPED_NAME_MAX_LENGTH, &mapped_name_len);
- if (name_len <= 1 || mapped_name_len <= 1) return;
- scoped_ptr<char[]> name(new char[name_len]);
- scoped_ptr<char[]> mapped_name(new char[mapped_name_len]);
-
- size_t num_vars = 0;
- ShGetInfo(compiler, var_type, &num_vars);
- for (size_t i = 0; i < num_vars; ++i) {
- size_t len = 0;
- int size = 0;
- sh::GLenum type = GL_NONE;
- ShPrecisionType precision = SH_PRECISION_UNDEFINED;
- int static_use = 0;
-
- ShGetVariableInfo(compiler, var_type, i,
- &len, &size, &type, &precision, &static_use,
- name.get(), mapped_name.get());
-
- // In theory we should CHECK(len <= name_len - 1) here, but ANGLE needs
- // to handle long struct field name mapping before we can do this.
- // Also, we should modify the ANGLE interface to also return a length
- // for mapped_name.
- std::string name_string(name.get(), std::min(len, name_len - 1));
- mapped_name.get()[mapped_name_len - 1] = '\0';
-
- ShaderTranslator::VariableInfo info(
- type, size, precision, static_use, name_string);
- (*var_map)[mapped_name.get()] = info;
+ const std::vector<sh::Attribute>* attribs = ShGetAttributes(compiler);
+ if (attribs) {
+ for (size_t ii = 0; ii < attribs->size(); ++ii)
+ (*var_map)[(*attribs)[ii].mappedName] = (*attribs)[ii];
}
}
-void GetNameHashingInfo(
- ShHandle compiler, ShaderTranslator::NameMap* name_map) {
+void GetUniforms(ShHandle compiler, UniformMap* var_map) {
+ if (!var_map)
+ return;
+ var_map->clear();
+ const std::vector<sh::Uniform>* uniforms = ShGetUniforms(compiler);
+ if (uniforms) {
+ for (size_t ii = 0; ii < uniforms->size(); ++ii)
+ (*var_map)[(*uniforms)[ii].mappedName] = (*uniforms)[ii];
+ }
+}
+
+void GetVaryings(ShHandle compiler, VaryingMap* var_map) {
+ if (!var_map)
+ return;
+ var_map->clear();
+ const std::vector<sh::Varying>* varyings = ShGetVaryings(compiler);
+ if (varyings) {
+ for (size_t ii = 0; ii < varyings->size(); ++ii)
+ (*var_map)[(*varyings)[ii].mappedName] = (*varyings)[ii];
+ }
+}
+
+void GetNameHashingInfo(ShHandle compiler, NameMap* name_map) {
if (!name_map)
return;
name_map->clear();
@@ -110,9 +93,6 @@
} // namespace
-namespace gpu {
-namespace gles2 {
-
ShaderTranslator::DestructionObserver::DestructionObserver() {
}
@@ -167,9 +147,9 @@
bool ShaderTranslator::Translate(const std::string& shader_source,
std::string* info_log,
std::string* translated_source,
- VariableMap* attrib_map,
- VariableMap* uniform_map,
- VariableMap* varying_map,
+ AttributeMap* attrib_map,
+ UniformMap* uniform_map,
+ VaryingMap* varying_map,
NameMap* name_map) const {
// Make sure this instance is initialized.
DCHECK(compiler_ != NULL);
@@ -194,9 +174,9 @@
}
}
// Get info for attribs, uniforms, and varyings.
- GetVariableInfo(compiler_, SH_ACTIVE_ATTRIBUTES, attrib_map);
- GetVariableInfo(compiler_, SH_ACTIVE_UNIFORMS, uniform_map);
- GetVariableInfo(compiler_, SH_VARYINGS, varying_map);
+ GetAttributes(compiler_, attrib_map);
+ GetUniforms(compiler_, uniform_map);
+ GetVaryings(compiler_, varying_map);
// Get info for name hashing.
GetNameHashingInfo(compiler_, name_map);
}
diff --git a/gpu/command_buffer/service/shader_translator.h b/gpu/command_buffer/service/shader_translator.h
index 57a198e..ff9d741 100644
--- a/gpu/command_buffer/service/shader_translator.h
+++ b/gpu/command_buffer/service/shader_translator.h
@@ -18,6 +18,13 @@
namespace gpu {
namespace gles2 {
+// Mapping between variable name and info.
+typedef base::hash_map<std::string, sh::Attribute> AttributeMap;
+typedef base::hash_map<std::string, sh::Uniform> UniformMap;
+typedef base::hash_map<std::string, sh::Varying> VaryingMap;
+// Mapping between hashed name and original name.
+typedef base::hash_map<std::string, std::string> NameMap;
+
// Translates a GLSL ES 2.0 shader to desktop GLSL shader, or just
// validates GLSL ES 2.0 shaders on a true GLSL ES implementation.
class ShaderTranslatorInterface {
@@ -27,42 +34,6 @@
kGlslES
};
- struct VariableInfo {
- VariableInfo()
- : type(0),
- size(0),
- precision(SH_PRECISION_UNDEFINED),
- static_use(0) {
- }
-
- VariableInfo(int _type, int _size, int _precision,
- int _static_use, std::string _name)
- : type(_type),
- size(_size),
- precision(_precision),
- static_use(_static_use),
- name(_name) {
- }
- bool operator==(
- const ShaderTranslatorInterface::VariableInfo& other) const {
- return type == other.type &&
- size == other.size &&
- precision == other.precision &&
- strcmp(name.c_str(), other.name.c_str()) == 0;
- }
-
- int type;
- int size;
- int precision;
- int static_use;
- std::string name; // name in the original shader source.
- };
-
- // Mapping between variable name and info.
- typedef base::hash_map<std::string, VariableInfo> VariableMap;
- // Mapping between hashed name and original name.
- typedef base::hash_map<std::string, std::string> NameMap;
-
// Initializes the translator.
// Must be called once before using the translator object.
virtual bool Init(
@@ -80,9 +51,9 @@
virtual bool Translate(const std::string& shader_source,
std::string* info_log,
std::string* translated_shader,
- VariableMap* attrib_map,
- VariableMap* uniform_map,
- VariableMap* varying_map,
+ AttributeMap* attrib_map,
+ UniformMap* uniform_map,
+ VaryingMap* varying_map,
NameMap* name_map) const = 0;
// Return a string that is unique for a specfic set of options that would
@@ -123,9 +94,9 @@
virtual bool Translate(const std::string& shader_source,
std::string* info_log,
std::string* translated_source,
- VariableMap* attrib_map,
- VariableMap* uniform_map,
- VariableMap* varying_map,
+ AttributeMap* attrib_map,
+ UniformMap* uniform_map,
+ VaryingMap* varying_map,
NameMap* name_map) const override;
virtual std::string GetStringForOptionsThatWouldAffectCompilation() const
diff --git a/gpu/command_buffer/service/shader_translator_unittest.cc b/gpu/command_buffer/service/shader_translator_unittest.cc
index f489626..198ea82 100644
--- a/gpu/command_buffer/service/shader_translator_unittest.cc
+++ b/gpu/command_buffer/service/shader_translator_unittest.cc
@@ -54,8 +54,10 @@
// A valid shader should be successfully translated.
std::string info_log, translated_source;
- ShaderTranslatorInterface::VariableMap attrib_map, uniform_map, varying_map;
- ShaderTranslatorInterface::NameMap name_map;
+ AttributeMap attrib_map;
+ UniformMap uniform_map;
+ VaryingMap varying_map;
+ NameMap name_map;
EXPECT_TRUE(vertex_translator_->Translate(shader,
&info_log,
&translated_source,
@@ -84,8 +86,10 @@
// An invalid shader should fail.
std::string info_log, translated_source;
- ShaderTranslatorInterface::VariableMap attrib_map, uniform_map, varying_map;
- ShaderTranslatorInterface::NameMap name_map;
+ AttributeMap attrib_map;
+ UniformMap uniform_map;
+ VaryingMap varying_map;
+ NameMap name_map;
EXPECT_FALSE(vertex_translator_->Translate(bad_shader,
&info_log,
&translated_source,
@@ -124,8 +128,10 @@
// A valid shader should be successfully translated.
std::string info_log, translated_source;
- ShaderTranslatorInterface::VariableMap attrib_map, uniform_map, varying_map;
- ShaderTranslatorInterface::NameMap name_map;
+ AttributeMap attrib_map;
+ UniformMap uniform_map;
+ VaryingMap varying_map;
+ NameMap name_map;
EXPECT_TRUE(fragment_translator_->Translate(shader,
&info_log,
&translated_source,
@@ -148,8 +154,10 @@
const char* shader = "foo-bar";
std::string info_log, translated_source;
- ShaderTranslatorInterface::VariableMap attrib_map, uniform_map, varying_map;
- ShaderTranslatorInterface::NameMap name_map;
+ AttributeMap attrib_map;
+ UniformMap uniform_map;
+ VaryingMap varying_map;
+ NameMap name_map;
// An invalid shader should fail.
EXPECT_FALSE(fragment_translator_->Translate(shader,
&info_log,
@@ -177,8 +185,10 @@
"}";
std::string info_log, translated_source;
- ShaderTranslatorInterface::VariableMap attrib_map, uniform_map, varying_map;
- ShaderTranslatorInterface::NameMap name_map;
+ AttributeMap attrib_map;
+ UniformMap uniform_map;
+ VaryingMap varying_map;
+ NameMap name_map;
EXPECT_TRUE(vertex_translator_->Translate(shader,
&info_log,
&translated_source,
@@ -193,13 +203,12 @@
// There should be no uniforms.
EXPECT_TRUE(uniform_map.empty());
// There should be one attribute with following characteristics:
- // name:vPosition type:GL_FLOAT_VEC4 size:1.
+ // name:vPosition type:GL_FLOAT_VEC4 size:0.
EXPECT_EQ(1u, attrib_map.size());
- ShaderTranslator::VariableMap::const_iterator iter =
- attrib_map.find("vPosition");
+ AttributeMap::const_iterator iter = attrib_map.find("vPosition");
EXPECT_TRUE(iter != attrib_map.end());
- EXPECT_EQ(GL_FLOAT_VEC4, iter->second.type);
- EXPECT_EQ(1, iter->second.size);
+ EXPECT_EQ(static_cast<GLenum>(GL_FLOAT_VEC4), iter->second.type);
+ EXPECT_EQ(0u, iter->second.arraySize);
EXPECT_EQ("vPosition", iter->second.name);
}
@@ -218,8 +227,10 @@
"}";
std::string info_log, translated_source;
- ShaderTranslatorInterface::VariableMap attrib_map, uniform_map, varying_map;
- ShaderTranslatorInterface::NameMap name_map;
+ AttributeMap attrib_map;
+ UniformMap uniform_map;
+ VaryingMap varying_map;
+ NameMap name_map;
EXPECT_TRUE(fragment_translator_->Translate(shader,
&info_log,
&translated_source,
@@ -236,20 +247,26 @@
// There should be two uniforms with following characteristics:
// 1. name:bar[0].foo.color[0] type:GL_FLOAT_VEC4 size:1
// 2. name:bar[1].foo.color[0] type:GL_FLOAT_VEC4 size:1
- EXPECT_EQ(2u, uniform_map.size());
+ // However, there will be only one entry "bar" in the map.
+ EXPECT_EQ(1u, uniform_map.size());
+ UniformMap::const_iterator iter = uniform_map.find("bar");
+ EXPECT_TRUE(iter != uniform_map.end());
// First uniform.
- ShaderTranslator::VariableMap::const_iterator iter =
- uniform_map.find("bar[0].foo.color[0]");
- EXPECT_TRUE(iter != uniform_map.end());
- EXPECT_EQ(GL_FLOAT_VEC4, iter->second.type);
- EXPECT_EQ(1, iter->second.size);
- EXPECT_EQ("bar[0].foo.color[0]", iter->second.name);
+ const sh::ShaderVariable* info;
+ std::string original_name;
+ EXPECT_TRUE(iter->second.findInfoByMappedName(
+ "bar[0].foo.color[0]", &info, &original_name));
+ EXPECT_EQ(static_cast<GLenum>(GL_FLOAT_VEC4), info->type);
+ EXPECT_EQ(1u, info->arraySize);
+ EXPECT_STREQ("color", info->name.c_str());
+ EXPECT_STREQ("bar[0].foo.color[0]", original_name.c_str());
// Second uniform.
- iter = uniform_map.find("bar[1].foo.color[0]");
- EXPECT_TRUE(iter != uniform_map.end());
- EXPECT_EQ(GL_FLOAT_VEC4, iter->second.type);
- EXPECT_EQ(1, iter->second.size);
- EXPECT_EQ("bar[1].foo.color[0]", iter->second.name);
+ EXPECT_TRUE(iter->second.findInfoByMappedName(
+ "bar[1].foo.color[0]", &info, &original_name));
+ EXPECT_EQ(static_cast<GLenum>(GL_FLOAT_VEC4), info->type);
+ EXPECT_EQ(1u, info->arraySize);
+ EXPECT_STREQ("color", info->name.c_str());
+ EXPECT_STREQ("bar[1].foo.color[0]", original_name.c_str());
}
#if defined(OS_MACOSX)
@@ -263,8 +280,10 @@
"}";
std::string info_log, translated_source;
- ShaderTranslatorInterface::VariableMap attrib_map, uniform_map, varying_map;
- ShaderTranslatorInterface::NameMap name_map;
+ AttributeMap attrib_map;
+ UniformMap uniform_map;
+ VaryingMap varying_map;
+ NameMap name_map;
EXPECT_TRUE(vertex_translator_->Translate(shader,
&info_log,
&translated_source,
diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc
index 2f0e9c9..cea7b8a 100644
--- a/gpu/command_buffer/service/test_helper.cc
+++ b/gpu/command_buffer/service/test_helper.cc
@@ -34,6 +34,24 @@
namespace gpu {
namespace gles2 {
+namespace {
+
+template<typename T>
+T ConstructShaderVariable(
+ GLenum type, GLint array_size, GLenum precision,
+ bool static_use, const std::string& name) {
+ T var;
+ var.type = type;
+ var.arraySize = array_size;
+ var.precision = precision;
+ var.staticUse = static_use;
+ var.name = name;
+ var.mappedName = name; // No name hashing.
+ return var;
+}
+
+} // namespace anonymous
+
// GCC requires these declarations, but MSVC requires they not be present
#ifndef COMPILER_MSVC
const GLuint TestHelper::kServiceBlackTexture2dId;
@@ -392,6 +410,17 @@
.RetiresOnSaturation();
#endif
}
+
+ if (strstr(extensions, "GL_EXT_draw_buffers") ||
+ strstr(extensions, "GL_ARB_draw_buffers") ||
+ (is_es3 && strstr(extensions, "GL_NV_draw_buffers"))) {
+ EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _))
+ .WillOnce(SetArgumentPointee<1>(8))
+ .RetiresOnSaturation();
+ EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _))
+ .WillOnce(SetArgumentPointee<1>(8))
+ .RetiresOnSaturation();
+ }
}
void TestHelper::SetupExpectationsForClearingUniforms(
@@ -648,10 +677,10 @@
bool expected_valid,
const std::string* const expected_log_info,
const std::string* const expected_translated_source,
- const ShaderTranslatorInterface::VariableMap* const expected_attrib_map,
- const ShaderTranslatorInterface::VariableMap* const expected_uniform_map,
- const ShaderTranslatorInterface::VariableMap* const expected_varying_map,
- const ShaderTranslatorInterface::NameMap* const expected_name_map) {
+ const AttributeMap* const expected_attrib_map,
+ const UniformMap* const expected_uniform_map,
+ const VaryingMap* const expected_varying_map,
+ const NameMap* const expected_name_map) {
const std::string empty_log_info;
const std::string* log_info = (expected_log_info && !expected_valid) ?
expected_log_info : &empty_log_info;
@@ -659,22 +688,18 @@
const std::string* translated_source =
(expected_translated_source && expected_valid) ?
expected_translated_source : &empty_translated_source;
- const ShaderTranslatorInterface::VariableMap empty_attrib_map;
- const ShaderTranslatorInterface::VariableMap* attrib_map =
- (expected_attrib_map && expected_valid) ?
- expected_attrib_map : &empty_attrib_map;
- const ShaderTranslatorInterface::VariableMap empty_uniform_map;
- const ShaderTranslatorInterface::VariableMap* uniform_map =
- (expected_uniform_map && expected_valid) ?
- expected_uniform_map : &empty_uniform_map;
- const ShaderTranslatorInterface::VariableMap empty_varying_map;
- const ShaderTranslatorInterface::VariableMap* varying_map =
- (expected_varying_map && expected_valid) ?
- expected_varying_map : &empty_varying_map;
- const ShaderTranslatorInterface::NameMap empty_name_map;
- const ShaderTranslatorInterface::NameMap* name_map =
- (expected_name_map && expected_valid) ?
- expected_name_map : &empty_name_map;
+ const AttributeMap empty_attrib_map;
+ const AttributeMap* attrib_map = (expected_attrib_map && expected_valid) ?
+ expected_attrib_map : &empty_attrib_map;
+ const UniformMap empty_uniform_map;
+ const UniformMap* uniform_map = (expected_uniform_map && expected_valid) ?
+ expected_uniform_map : &empty_uniform_map;
+ const VaryingMap empty_varying_map;
+ const VaryingMap* varying_map = (expected_varying_map && expected_valid) ?
+ expected_varying_map : &empty_varying_map;
+ const NameMap empty_name_map;
+ const NameMap* name_map = (expected_name_map && expected_valid) ?
+ expected_name_map : &empty_name_map;
MockShaderTranslator translator;
EXPECT_CALL(translator, Translate(_,
@@ -714,6 +739,30 @@
SetShaderStates(gl, shader, valid, NULL, NULL, NULL, NULL, NULL, NULL);
}
+// static
+sh::Attribute TestHelper::ConstructAttribute(
+ GLenum type, GLint array_size, GLenum precision,
+ bool static_use, const std::string& name) {
+ return ConstructShaderVariable<sh::Attribute>(
+ type, array_size, precision, static_use, name);
+}
+
+// static
+sh::Uniform TestHelper::ConstructUniform(
+ GLenum type, GLint array_size, GLenum precision,
+ bool static_use, const std::string& name) {
+ return ConstructShaderVariable<sh::Uniform>(
+ type, array_size, precision, static_use, name);
+}
+
+// static
+sh::Varying TestHelper::ConstructVarying(
+ GLenum type, GLint array_size, GLenum precision,
+ bool static_use, const std::string& name) {
+ return ConstructShaderVariable<sh::Varying>(
+ type, array_size, precision, static_use, name);
+}
+
ScopedGLImplementationSetter::ScopedGLImplementationSetter(
gfx::GLImplementation implementation)
: old_implementation_(gfx::GetGLImplementation()) {
diff --git a/gpu/command_buffer/service/test_helper.h b/gpu/command_buffer/service/test_helper.h
index 92e929e..f83ed23 100644
--- a/gpu/command_buffer/service/test_helper.h
+++ b/gpu/command_buffer/service/test_helper.h
@@ -114,14 +114,24 @@
bool expected_valid,
const std::string* const expected_log_info,
const std::string* const expected_translated_source,
- const ShaderTranslatorInterface::VariableMap* const expected_attrib_map,
- const ShaderTranslatorInterface::VariableMap* const expected_uniform_map,
- const ShaderTranslatorInterface::VariableMap* const expected_varying_map,
- const ShaderTranslatorInterface::NameMap* const expected_name_map);
+ const AttributeMap* const expected_attrib_map,
+ const UniformMap* const expected_uniform_map,
+ const VaryingMap* const expected_varying_map,
+ const NameMap* const expected_name_map);
static void SetShaderStates(
::gfx::MockGLInterface* gl, Shader* shader, bool valid);
+ static sh::Attribute ConstructAttribute(
+ GLenum type, GLint array_size, GLenum precision,
+ bool static_use, const std::string& name);
+ static sh::Uniform ConstructUniform(
+ GLenum type, GLint array_size, GLenum precision,
+ bool static_use, const std::string& name);
+ static sh::Varying ConstructVarying(
+ GLenum type, GLint array_size, GLenum precision,
+ bool static_use, const std::string& name);
+
private:
static void SetupTextureInitializationExpectations(::gfx::MockGLInterface* gl,
GLenum target,
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
index 8932ec2..6255a1c 100644
--- a/gpu/command_buffer/service/texture_definition.cc
+++ b/gpu/command_buffer/service/texture_definition.cc
@@ -374,21 +374,22 @@
usage_(texture->usage()),
immutable_(texture->IsImmutable()) {
// TODO
- DCHECK(!texture->level_infos_.empty());
- DCHECK(!texture->level_infos_[0].empty());
+ DCHECK(!texture->face_infos_.empty());
+ DCHECK(!texture->face_infos_[0].level_infos.empty());
DCHECK(!texture->NeedsMips());
- DCHECK(texture->level_infos_[0][0].width);
- DCHECK(texture->level_infos_[0][0].height);
+ DCHECK(texture->face_infos_[0].level_infos[0].width);
+ DCHECK(texture->face_infos_[0].level_infos[0].height);
+ const Texture::FaceInfo& first_face = texture->face_infos_[0];
scoped_refptr<gfx::GLImage> gl_image(
new GLImageSync(image_buffer_,
- gfx::Size(texture->level_infos_[0][0].width,
- texture->level_infos_[0][0].height)));
+ gfx::Size(first_face.level_infos[0].width,
+ first_face.level_infos[0].height)));
texture->SetLevelImage(NULL, target, 0, gl_image.get());
// TODO: all levels
level_infos_.clear();
- const Texture::LevelInfo& level = texture->level_infos_[0][0];
+ const Texture::LevelInfo& level = first_face.level_infos[0];
LevelInfo info(level.target,
level.internal_format,
level.width,
@@ -435,13 +436,13 @@
// though.
glFlush();
- texture->level_infos_.resize(1);
+ texture->face_infos_.resize(1);
for (size_t i = 0; i < level_infos_.size(); i++) {
const LevelInfo& base_info = level_infos_[i][0];
const size_t levels_needed = TextureManager::ComputeMipMapCount(
base_info.target, base_info.width, base_info.height, base_info.depth);
DCHECK(level_infos_.size() <= levels_needed);
- texture->level_infos_[0].resize(levels_needed);
+ texture->face_infos_[0].level_infos.resize(levels_needed);
for (size_t n = 0; n < level_infos_.size(); n++) {
const LevelInfo& info = level_infos_[i][n];
texture->SetLevelInfo(NULL,
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index acc63d7..45aaa65 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -17,6 +17,7 @@
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/memory_tracking.h"
+#include "ui/gl/gl_implementation.h"
namespace gpu {
namespace gles2 {
@@ -128,6 +129,7 @@
service_id_(service_id),
cleared_(true),
num_uncleared_mips_(0),
+ num_npot_faces_(0),
target_(0),
min_filter_(GL_NEAREST_MIPMAP_LINEAR),
mag_filter_(GL_LINEAR),
@@ -137,7 +139,11 @@
pool_(GL_TEXTURE_POOL_UNMANAGED_CHROMIUM),
max_level_set_(-1),
texture_complete_(false),
+ texture_mips_dirty_(false),
+ texture_mips_complete_(false),
cube_complete_(false),
+ texture_level0_dirty_(false),
+ texture_level0_complete_(false),
npot_(false),
has_been_bound_(false),
framebuffer_attachment_count_(0),
@@ -220,16 +226,23 @@
Texture::LevelInfo::~LevelInfo() {
}
+Texture::FaceInfo::FaceInfo()
+ : num_mip_levels(0) {
+}
+
+Texture::FaceInfo::~FaceInfo() {
+}
+
Texture::CanRenderCondition Texture::GetCanRenderCondition() const {
if (target_ == 0)
return CAN_RENDER_ALWAYS;
if (target_ != GL_TEXTURE_EXTERNAL_OES) {
- if (level_infos_.empty()) {
+ if (face_infos_.empty()) {
return CAN_RENDER_NEVER;
}
- const Texture::LevelInfo& first_face = level_infos_[0][0];
+ const Texture::LevelInfo& first_face = face_infos_[0].level_infos[0];
if (first_face.width == 0 ||
first_face.height == 0 ||
first_face.depth == 0) {
@@ -281,12 +294,12 @@
DCHECK_GE(level, 0);
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
DCHECK_LT(static_cast<size_t>(face_index),
- level_infos_.size());
+ face_infos_.size());
DCHECK_LT(static_cast<size_t>(level),
- level_infos_[face_index].size());
+ face_infos_[face_index].level_infos.size());
const Texture::LevelInfo& info =
- level_infos_[face_index][level];
+ face_infos_[face_index].level_infos[level];
TextureSignature signature_data(target,
level,
@@ -322,29 +335,30 @@
if (!CanGenerateMipmaps(feature_info)) {
return false;
}
- for (size_t ii = 0; ii < level_infos_.size(); ++ii) {
- const Texture::LevelInfo& info1 = level_infos_[ii][0];
- GLsizei width = info1.width;
- GLsizei height = info1.height;
- GLsizei depth = info1.depth;
+ for (size_t ii = 0; ii < face_infos_.size(); ++ii) {
+ const Texture::FaceInfo& face_info = face_infos_[ii];
+ const Texture::LevelInfo& level0_info = face_info.level_infos[0];
+ GLsizei width = level0_info.width;
+ GLsizei height = level0_info.height;
+ GLsizei depth = level0_info.depth;
GLenum target = target_ == GL_TEXTURE_2D ? GL_TEXTURE_2D :
GLES2Util::IndexToGLFaceTarget(ii);
- int num_mips =
- TextureManager::ComputeMipMapCount(target_, width, height, depth);
- for (int level = 1; level < num_mips; ++level) {
+
+ const GLsizei num_mips = face_info.num_mip_levels;
+ for (GLsizei level = 1; level < num_mips; ++level) {
width = std::max(1, width >> 1);
height = std::max(1, height >> 1);
depth = std::max(1, depth >> 1);
SetLevelInfo(feature_info,
target,
level,
- info1.internal_format,
+ level0_info.internal_format,
width,
height,
depth,
- info1.border,
- info1.format,
- info1.type,
+ level0_info.border,
+ level0_info.format,
+ level0_info.type,
true);
}
}
@@ -357,9 +371,9 @@
DCHECK_EQ(0u, target_); // you can only set this once.
target_ = target;
size_t num_faces = (target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
- level_infos_.resize(num_faces);
+ face_infos_.resize(num_faces);
for (size_t ii = 0; ii < num_faces; ++ii) {
- level_infos_[ii].resize(max_levels);
+ face_infos_[ii].level_infos.resize(max_levels);
}
if (target == GL_TEXTURE_EXTERNAL_OES || target == GL_TEXTURE_RECTANGLE_ARB) {
@@ -377,22 +391,22 @@
bool Texture::CanGenerateMipmaps(
const FeatureInfo* feature_info) const {
if ((npot() && !feature_info->feature_flags().npot_ok) ||
- level_infos_.empty() ||
+ face_infos_.empty() ||
target_ == GL_TEXTURE_EXTERNAL_OES ||
target_ == GL_TEXTURE_RECTANGLE_ARB) {
return false;
}
// Can't generate mips for depth or stencil textures.
- const Texture::LevelInfo& first = level_infos_[0][0];
+ const Texture::LevelInfo& first = face_infos_[0].level_infos[0];
uint32 channels = GLES2Util::GetChannelsForFormat(first.format);
if (channels & (GLES2Util::kDepth | GLES2Util::kStencil)) {
return false;
}
// TODO(gman): Check internal_format, format and type.
- for (size_t ii = 0; ii < level_infos_.size(); ++ii) {
- const LevelInfo& info = level_infos_[ii][0];
+ for (size_t ii = 0; ii < face_infos_.size(); ++ii) {
+ const LevelInfo& info = face_infos_[ii].level_infos[0];
if ((info.target == 0) || (info.width != first.width) ||
(info.height != first.height) || (info.depth != 1) ||
(info.format != first.format) ||
@@ -407,21 +421,74 @@
return true;
}
+bool Texture::TextureIsNPOT(GLsizei width,
+ GLsizei height,
+ GLsizei depth) {
+ return (GLES2Util::IsNPOT(width) ||
+ GLES2Util::IsNPOT(height) ||
+ GLES2Util::IsNPOT(depth));
+}
+
+bool Texture::TextureFaceComplete(const Texture::LevelInfo& first_face,
+ size_t face_index,
+ GLenum target,
+ GLenum internal_format,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type) {
+ bool complete = (target != 0 && depth == 1);
+ if (face_index != 0) {
+ complete &= (width == first_face.width &&
+ height == first_face.height &&
+ internal_format == first_face.internal_format &&
+ format == first_face.format &&
+ type == first_face.type);
+ }
+ return complete;
+}
+
+bool Texture::TextureMipComplete(const Texture::LevelInfo& level0_face,
+ GLenum target,
+ GLint level,
+ GLenum internal_format,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type) {
+ bool complete = (target != 0);
+ if (level != 0) {
+ const GLsizei mip_width = std::max(1, level0_face.width >> level);
+ const GLsizei mip_height = std::max(1, level0_face.height >> level);
+ const GLsizei mip_depth = std::max(1, level0_face.depth >> level);
+
+ complete &= (width == mip_width &&
+ height == mip_height &&
+ depth == mip_depth &&
+ internal_format == level0_face.internal_format &&
+ format == level0_face.format &&
+ type == level0_face.type);
+ }
+ return complete;
+}
+
void Texture::SetLevelCleared(GLenum target, GLint level, bool cleared) {
DCHECK_GE(level, 0);
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
DCHECK_LT(static_cast<size_t>(face_index),
- level_infos_.size());
+ face_infos_.size());
DCHECK_LT(static_cast<size_t>(level),
- level_infos_[face_index].size());
+ face_infos_[face_index].level_infos.size());
Texture::LevelInfo& info =
- level_infos_[face_index][level];
+ face_infos_[face_index].level_infos[level];
UpdateMipCleared(&info, cleared);
UpdateCleared();
}
void Texture::UpdateCleared() {
- if (level_infos_.empty()) {
+ if (face_infos_.empty()) {
return;
}
@@ -466,13 +533,13 @@
}
void Texture::UpdateHasImages() {
- if (level_infos_.empty())
+ if (face_infos_.empty())
return;
bool has_images = false;
- for (size_t ii = 0; ii < level_infos_.size(); ++ii) {
- for (size_t jj = 0; jj < level_infos_[ii].size(); ++jj) {
- const Texture::LevelInfo& info = level_infos_[ii][jj];
+ for (size_t ii = 0; ii < face_infos_.size(); ++ii) {
+ for (size_t jj = 0; jj < face_infos_[ii].level_infos.size(); ++jj) {
+ const Texture::LevelInfo& info = face_infos_[ii].level_infos[jj];
if (info.image.get() != NULL) {
has_images = true;
break;
@@ -508,14 +575,44 @@
DCHECK_GE(level, 0);
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
DCHECK_LT(static_cast<size_t>(face_index),
- level_infos_.size());
+ face_infos_.size());
DCHECK_LT(static_cast<size_t>(level),
- level_infos_[face_index].size());
+ face_infos_[face_index].level_infos.size());
DCHECK_GE(width, 0);
DCHECK_GE(height, 0);
DCHECK_GE(depth, 0);
Texture::LevelInfo& info =
- level_infos_[face_index][level];
+ face_infos_[face_index].level_infos[level];
+
+ // Update counters only if any attributes have changed. Counters are
+ // comparisons between the old and new values so it must be done before any
+ // assignment has been done to the LevelInfo.
+ if (info.target != target ||
+ info.internal_format != internal_format ||
+ info.width != width ||
+ info.height != height ||
+ info.depth != depth ||
+ info.format != format ||
+ info.type != type) {
+ if (level == 0) {
+ // Calculate the mip level count.
+ face_infos_[face_index].num_mip_levels =
+ TextureManager::ComputeMipMapCount(target_, width, height, depth);
+
+ // Update NPOT face count for the first level.
+ bool prev_npot = TextureIsNPOT(info.width, info.height, info.depth);
+ bool now_npot = TextureIsNPOT(width, height, depth);
+ if (prev_npot != now_npot)
+ num_npot_faces_ += now_npot ? 1 : -1;
+
+ // Signify that level 0 has been changed, so they need to be reverified.
+ texture_level0_dirty_ = true;
+ }
+
+ // Signify that at least one of the mips has changed.
+ texture_mips_dirty_ = true;
+ }
+
info.target = target;
info.level = level;
info.internal_format = internal_format;
@@ -554,9 +651,9 @@
GLsizei height,
GLenum type) const {
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
- if (level >= 0 && face_index < level_infos_.size() &&
- static_cast<size_t>(level) < level_infos_[face_index].size()) {
- const LevelInfo& info = level_infos_[face_index][level];
+ if (level >= 0 && face_index < face_infos_.size() &&
+ static_cast<size_t>(level) < face_infos_[face_index].level_infos.size()) {
+ const LevelInfo& info = face_infos_[face_index].level_infos[level];
int32 right;
int32 top;
return SafeAddInt32(xoffset, width, &right) &&
@@ -575,9 +672,9 @@
DCHECK(width);
DCHECK(height);
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
- if (level >= 0 && face_index < level_infos_.size() &&
- static_cast<size_t>(level) < level_infos_[face_index].size()) {
- const LevelInfo& info = level_infos_[face_index][level];
+ if (level >= 0 && face_index < face_infos_.size() &&
+ static_cast<size_t>(level) < face_infos_[face_index].level_infos.size()) {
+ const LevelInfo& info = face_infos_[face_index].level_infos[level];
if (info.target != 0) {
*width = info.width;
*height = info.height;
@@ -592,9 +689,9 @@
DCHECK(type);
DCHECK(internal_format);
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
- if (level >= 0 && face_index < level_infos_.size() &&
- static_cast<size_t>(level) < level_infos_[face_index].size()) {
- const LevelInfo& info = level_infos_[face_index][level];
+ if (level >= 0 && face_index < face_infos_.size() &&
+ static_cast<size_t>(level) < face_infos_[face_index].level_infos.size()) {
+ const LevelInfo& info = face_infos_[face_index].level_infos[level];
if (info.target != 0) {
*type = info.type;
*internal_format = info.internal_format;
@@ -700,83 +797,85 @@
void Texture::Update(const FeatureInfo* feature_info) {
// Update npot status.
// Assume GL_TEXTURE_EXTERNAL_OES textures are npot, all others
- npot_ = target_ == GL_TEXTURE_EXTERNAL_OES;
+ npot_ = (target_ == GL_TEXTURE_EXTERNAL_OES) || (num_npot_faces_ > 0);
- if (level_infos_.empty()) {
+ if (face_infos_.empty()) {
texture_complete_ = false;
cube_complete_ = false;
return;
}
- // checks that the first mip of any face is npot.
- for (size_t ii = 0; ii < level_infos_.size(); ++ii) {
- const Texture::LevelInfo& info = level_infos_[ii][0];
- if (GLES2Util::IsNPOT(info.width) ||
- GLES2Util::IsNPOT(info.height) ||
- GLES2Util::IsNPOT(info.depth)) {
- npot_ = true;
- break;
- }
- }
-
// Update texture_complete and cube_complete status.
- const Texture::LevelInfo& first_face = level_infos_[0][0];
- int levels_needed = TextureManager::ComputeMipMapCount(
- target_, first_face.width, first_face.height, first_face.depth);
+ const Texture::FaceInfo& first_face = face_infos_[0];
+ const Texture::LevelInfo& first_level = first_face.level_infos[0];
+ const GLsizei levels_needed = first_face.num_mip_levels;
+
texture_complete_ =
max_level_set_ >= (levels_needed - 1) && max_level_set_ >= 0;
- cube_complete_ = (level_infos_.size() == 6) &&
- (first_face.width == first_face.height);
+ cube_complete_ = (face_infos_.size() == 6) &&
+ (first_level.width == first_level.height);
- if (first_face.width == 0 || first_face.height == 0) {
+ if (first_level.width == 0 || first_level.height == 0) {
texture_complete_ = false;
- }
- if (first_face.type == GL_FLOAT &&
+ } else if (first_level.type == GL_FLOAT &&
!feature_info->feature_flags().enable_texture_float_linear &&
(min_filter_ != GL_NEAREST_MIPMAP_NEAREST ||
mag_filter_ != GL_NEAREST)) {
texture_complete_ = false;
- } else if (first_face.type == GL_HALF_FLOAT_OES &&
+ } else if (first_level.type == GL_HALF_FLOAT_OES &&
!feature_info->feature_flags().enable_texture_half_float_linear &&
(min_filter_ != GL_NEAREST_MIPMAP_NEAREST ||
mag_filter_ != GL_NEAREST)) {
texture_complete_ = false;
}
- for (size_t ii = 0;
- ii < level_infos_.size() && (cube_complete_ || texture_complete_);
- ++ii) {
- const Texture::LevelInfo& level0 = level_infos_[ii][0];
- if (level0.target == 0 ||
- level0.width != first_face.width ||
- level0.height != first_face.height ||
- level0.depth != 1 ||
- level0.internal_format != first_face.internal_format ||
- level0.format != first_face.format ||
- level0.type != first_face.type) {
- cube_complete_ = false;
- }
- // Get level0 dimensions
- GLsizei width = level0.width;
- GLsizei height = level0.height;
- GLsizei depth = level0.depth;
- for (GLint jj = 1; jj < levels_needed; ++jj) {
- // compute required size for mip.
- width = std::max(1, width >> 1);
- height = std::max(1, height >> 1);
- depth = std::max(1, depth >> 1);
- const Texture::LevelInfo& info = level_infos_[ii][jj];
- if (info.target == 0 ||
- info.width != width ||
- info.height != height ||
- info.depth != depth ||
- info.internal_format != level0.internal_format ||
- info.format != level0.format ||
- info.type != level0.type) {
- texture_complete_ = false;
+
+ if (cube_complete_ && texture_level0_dirty_) {
+ texture_level0_complete_ = true;
+ for (size_t ii = 0; ii < face_infos_.size(); ++ii) {
+ const Texture::LevelInfo& level0 = face_infos_[ii].level_infos[0];
+ if (!TextureFaceComplete(first_level,
+ ii,
+ level0.target,
+ level0.internal_format,
+ level0.width,
+ level0.height,
+ level0.depth,
+ level0.format,
+ level0.type)) {
+ texture_level0_complete_ = false;
break;
}
}
+ texture_level0_dirty_ = false;
}
+ cube_complete_ &= texture_level0_complete_;
+
+ if (texture_complete_ && texture_mips_dirty_) {
+ texture_mips_complete_ = true;
+ for (size_t ii = 0;
+ ii < face_infos_.size() && texture_mips_complete_;
+ ++ii) {
+ const Texture::FaceInfo& face_info = face_infos_[ii];
+ const Texture::LevelInfo& level0 = face_info.level_infos[0];
+ for (GLsizei jj = 1; jj < levels_needed; ++jj) {
+ const Texture::LevelInfo& level_info = face_infos_[ii].level_infos[jj];
+ if (!TextureMipComplete(level0,
+ level_info.target,
+ jj,
+ level_info.internal_format,
+ level_info.width,
+ level_info.height,
+ level_info.depth,
+ level_info.format,
+ level_info.type)) {
+ texture_mips_complete_ = false;
+ break;
+ }
+ }
+ }
+ texture_mips_dirty_ = false;
+ }
+ texture_complete_ &= texture_mips_complete_;
}
bool Texture::ClearRenderableLevels(GLES2Decoder* decoder) {
@@ -785,13 +884,10 @@
return true;
}
- const Texture::LevelInfo& first_face = level_infos_[0][0];
- int levels_needed = TextureManager::ComputeMipMapCount(
- target_, first_face.width, first_face.height, first_face.depth);
-
- for (size_t ii = 0; ii < level_infos_.size(); ++ii) {
- for (GLint jj = 0; jj < levels_needed; ++jj) {
- Texture::LevelInfo& info = level_infos_[ii][jj];
+ for (size_t ii = 0; ii < face_infos_.size(); ++ii) {
+ const Texture::FaceInfo& face_info = face_infos_[ii];
+ for (GLint jj = 0; jj < face_info.num_mip_levels; ++jj) {
+ const Texture::LevelInfo& info = face_info.level_infos[jj];
if (info.target != 0) {
if (!ClearLevel(decoder, info.target, jj)) {
return false;
@@ -805,12 +901,12 @@
bool Texture::IsLevelCleared(GLenum target, GLint level) const {
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
- if (face_index >= level_infos_.size() ||
- level >= static_cast<GLint>(level_infos_[face_index].size())) {
+ if (face_index >= face_infos_.size() ||
+ level >= static_cast<GLint>(face_infos_[face_index].level_infos.size())) {
return true;
}
- const Texture::LevelInfo& info = level_infos_[face_index][level];
+ const Texture::LevelInfo& info = face_infos_[face_index].level_infos[level];
return info.cleared;
}
@@ -827,12 +923,12 @@
GLES2Decoder* decoder, GLenum target, GLint level) {
DCHECK(decoder);
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
- if (face_index >= level_infos_.size() ||
- level >= static_cast<GLint>(level_infos_[face_index].size())) {
+ if (face_index >= face_infos_.size() ||
+ level >= static_cast<GLint>(face_infos_[face_index].level_infos.size())) {
return true;
}
- Texture::LevelInfo& info = level_infos_[face_index][level];
+ Texture::LevelInfo& info = face_infos_[face_index].level_infos[level];
DCHECK(target == info.target);
@@ -862,11 +958,11 @@
DCHECK_GE(level, 0);
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
DCHECK_LT(static_cast<size_t>(face_index),
- level_infos_.size());
+ face_infos_.size());
DCHECK_LT(static_cast<size_t>(level),
- level_infos_[face_index].size());
+ face_infos_[face_index].level_infos.size());
Texture::LevelInfo& info =
- level_infos_[face_index][level];
+ face_infos_[face_index].level_infos[level];
DCHECK_EQ(info.target, target);
DCHECK_EQ(info.level, level);
info.image = image;
@@ -881,9 +977,9 @@
}
size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
- if (level >= 0 && face_index < level_infos_.size() &&
- static_cast<size_t>(level) < level_infos_[face_index].size()) {
- const LevelInfo& info = level_infos_[face_index][level];
+ if (level >= 0 && face_index < face_infos_.size() &&
+ static_cast<size_t>(level) < face_infos_[face_index].level_infos.size()) {
+ const LevelInfo& info = face_infos_[face_index].level_infos[level];
if (info.target != 0) {
return info.image.get();
}
@@ -1545,6 +1641,18 @@
texture_ref, args);
}
+GLenum TextureManager::AdjustTexFormat(GLenum format) const {
+ // TODO: GLES 3 allows for internal format and format to differ. This logic
+ // may need to change as a result.
+ if (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) {
+ if (format == GL_SRGB_EXT)
+ return GL_RGB;
+ if (format == GL_SRGB_ALPHA_EXT)
+ return GL_RGBA;
+ }
+ return format;
+}
+
void TextureManager::DoTexImage2D(
DecoderTextureState* texture_state,
ErrorState* error_state,
@@ -1581,7 +1689,7 @@
{
ScopedTextureUploadTimer timer(texture_state);
glTexSubImage2D(args.target, args.level, 0, 0, args.width, args.height,
- args.format, args.type, args.pixels);
+ AdjustTexFormat(args.format), args.type, args.pixels);
}
SetLevelCleared(texture_ref, args.target, args.level, true);
texture_state->tex_image_2d_failed = false;
@@ -1593,7 +1701,7 @@
ScopedTextureUploadTimer timer(texture_state);
glTexImage2D(
args.target, args.level, args.internal_format, args.width, args.height,
- args.border, args.format, args.type, args.pixels);
+ args.border, AdjustTexFormat(args.format), args.type, args.pixels);
}
GLenum error = ERRORSTATE_PEEK_GL_ERROR(error_state, "glTexImage2D");
if (error == GL_NO_ERROR) {
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index df00607..25bc2ff 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -208,6 +208,14 @@
uint32 estimated_size;
};
+ struct FaceInfo {
+ FaceInfo();
+ ~FaceInfo();
+
+ GLsizei num_mip_levels;
+ std::vector<LevelInfo> level_infos;
+ };
+
// Set the info for a particular level.
void SetLevelInfo(
const FeatureInfo* feature_info,
@@ -276,6 +284,31 @@
// Returns true if mipmaps can be generated by GL.
bool CanGenerateMipmaps(const FeatureInfo* feature_info) const;
+ // Returns true if any of the texture dimensions are not a power of two.
+ static bool TextureIsNPOT(GLsizei width, GLsizei height, GLsizei depth);
+
+ // Returns true if texture face is complete relative to the first face.
+ static bool TextureFaceComplete(const Texture::LevelInfo& first_face,
+ size_t face_index,
+ GLenum target,
+ GLenum internal_format,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type);
+
+ // Returns true if texture mip level is complete relative to first level.
+ static bool TextureMipComplete(const Texture::LevelInfo& level0_face,
+ GLenum target,
+ GLint level,
+ GLenum internal_format,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type);
+
// Sets the Texture's target
// Parameters:
// target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP or
@@ -327,7 +360,7 @@
MailboxManager* mailbox_manager_;
// Info about each face and level of texture.
- std::vector<std::vector<LevelInfo> > level_infos_;
+ std::vector<FaceInfo> face_infos_;
// The texture refs that point to this Texture.
typedef std::set<TextureRef*> RefSet;
@@ -344,6 +377,7 @@
bool cleared_;
int num_uncleared_mips_;
+ int num_npot_faces_;
// The target. 0 if unset, otherwise GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP.
GLenum target_;
@@ -362,9 +396,17 @@
// Whether or not this texture is "texture complete"
bool texture_complete_;
+ // Whether mip levels have changed and should be reverified.
+ bool texture_mips_dirty_;
+ bool texture_mips_complete_;
+
// Whether or not this texture is "cube complete"
bool cube_complete_;
+ // Whether any level 0 faces have changed and should be reverified.
+ bool texture_level0_dirty_;
+ bool texture_level0_complete_;
+
// Whether or not this texture is non-power-of-two
bool npot_;
@@ -772,6 +814,8 @@
void UpdateNumImages(int delta);
void IncFramebufferStateChangeCount();
+ GLenum AdjustTexFormat(GLenum format) const;
+
MemoryTypeTracker* GetMemTracker(GLenum texture_pool);
scoped_ptr<MemoryTypeTracker> memory_tracker_managed_;
scoped_ptr<MemoryTypeTracker> memory_tracker_unmanaged_;
diff --git a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
index c73cc3d..745ceb9 100644
--- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
+++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
@@ -17,6 +17,7 @@
#include "gpu/command_buffer/tests/gl_test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gl/gl_image.h"
using testing::_;
@@ -73,14 +74,11 @@
TEST_F(GpuMemoryBufferTest, Lifecycle) {
uint8 pixels[1 * 4] = { 255u, 0u, 0u, 255u };
- // Create the image. This should add the image ID to the ImageManager.
- GLuint image_id = glCreateImageCHROMIUM(
- kImageWidth, kImageHeight, GL_RGBA8_OES, GL_IMAGE_MAP_CHROMIUM);
- EXPECT_NE(0u, image_id);
- EXPECT_TRUE(gl_.decoder()->GetImageManager()->LookupImage(image_id) != NULL);
+ scoped_ptr<gfx::GpuMemoryBuffer> buffer(gl_.CreateGpuMemoryBuffer(
+ gfx::Size(kImageWidth, kImageHeight), gfx::GpuMemoryBuffer::RGBA_8888));
- // Map image for writing.
- uint8* mapped_buffer = static_cast<uint8*>(glMapImageCHROMIUM(image_id));
+ // Map buffer for writing.
+ uint8* mapped_buffer = static_cast<uint8*>(buffer->Map());
ASSERT_TRUE(mapped_buffer != NULL);
// Assign a value to each pixel.
@@ -94,8 +92,14 @@
}
}
- // Unmap the image.
- glUnmapImageCHROMIUM(image_id);
+ // Unmap the buffer.
+ buffer->Unmap();
+
+ // Create the image. This should add the image ID to the ImageManager.
+ GLuint image_id = glCreateImageCHROMIUM(
+ buffer->AsClientBuffer(), kImageWidth, kImageHeight, GL_RGBA);
+ EXPECT_NE(0u, image_id);
+ EXPECT_TRUE(gl_.decoder()->GetImageManager()->LookupImage(image_id) != NULL);
// Bind the texture and the image.
glBindTexture(GL_TEXTURE_2D, texture_ids_[0]);
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 2a837eb..5678778 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -6,6 +6,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+#include <GLES2/gl2extchromium.h>
#include <vector>
@@ -35,25 +36,30 @@
namespace gpu {
namespace {
-int BytesPerPixel(unsigned internalformat) {
- switch (internalformat) {
- case GL_RGBA8_OES:
+size_t BytesPerPixel(gfx::GpuMemoryBuffer::Format format) {
+ switch (format) {
+ case gfx::GpuMemoryBuffer::RGBA_8888:
+ case gfx::GpuMemoryBuffer::BGRA_8888:
return 4;
- default:
+ case gfx::GpuMemoryBuffer::RGBX_8888:
NOTREACHED();
return 0;
}
+
+ NOTREACHED();
+ return 0;
}
class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
public:
GpuMemoryBufferImpl(base::RefCountedBytes* bytes,
const gfx::Size& size,
- unsigned internalformat)
- : bytes_(bytes),
- size_(size),
- internalformat_(internalformat),
- mapped_(false) {}
+ gfx::GpuMemoryBuffer::Format format)
+ : bytes_(bytes), size_(size), format_(format), mapped_(false) {}
+
+ static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer) {
+ return reinterpret_cast<GpuMemoryBufferImpl*>(buffer);
+ }
// Overridden from gfx::GpuMemoryBuffer:
virtual void* Map() override {
@@ -62,18 +68,24 @@
}
virtual void Unmap() override { mapped_ = false; }
virtual bool IsMapped() const override { return mapped_; }
+ virtual Format GetFormat() const override { return format_; }
virtual uint32 GetStride() const override {
- return size_.width() * BytesPerPixel(internalformat_);
+ return size_.width() * BytesPerPixel(format_);
}
virtual gfx::GpuMemoryBufferHandle GetHandle() const override {
NOTREACHED();
return gfx::GpuMemoryBufferHandle();
}
+ virtual ClientBuffer AsClientBuffer() override {
+ return reinterpret_cast<ClientBuffer>(this);
+ }
+
+ base::RefCountedBytes* bytes() { return bytes_.get(); }
private:
scoped_refptr<base::RefCountedBytes> bytes_;
const gfx::Size size_;
- unsigned internalformat_;
+ gfx::GpuMemoryBuffer::Format format_;
bool mapped_;
};
@@ -116,6 +128,16 @@
}
}
+// static
+scoped_ptr<gfx::GpuMemoryBuffer> GLManager::CreateGpuMemoryBuffer(
+ const gfx::Size& size,
+ gfx::GpuMemoryBuffer::Format format) {
+ std::vector<unsigned char> data(size.GetArea() * BytesPerPixel(format), 0);
+ scoped_refptr<base::RefCountedBytes> bytes(new base::RefCountedBytes(data));
+ return make_scoped_ptr<gfx::GpuMemoryBuffer>(
+ new GpuMemoryBufferImpl(bytes.get(), size, format));
+}
+
void GLManager::Initialize(const GLManager::Options& options) {
const int32 kCommandBufferSize = 1024 * 1024;
const size_t kStartTransferBufferSize = 4 * 1024 * 1024;
@@ -315,45 +337,44 @@
return decoder_->GetCapabilities();
}
-gfx::GpuMemoryBuffer* GLManager::CreateGpuMemoryBuffer(
- size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32* id) {
- gfx::Size size(width, height);
+int32 GLManager::CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) {
+ GpuMemoryBufferImpl* gpu_memory_buffer =
+ GpuMemoryBufferImpl::FromClientBuffer(buffer);
- *id = -1;
-
- std::vector<unsigned char> data(
- size.GetArea() * BytesPerPixel(internalformat), 0);
- scoped_refptr<base::RefCountedBytes> bytes(new base::RefCountedBytes(data));
- scoped_ptr<gfx::GpuMemoryBuffer> buffer(
- new GpuMemoryBufferImpl(bytes.get(), size, internalformat));
+ scoped_refptr<gfx::GLImageRefCountedMemory> image(
+ new gfx::GLImageRefCountedMemory(gfx::Size(width, height),
+ internalformat));
+ if (!image->Initialize(gpu_memory_buffer->bytes(),
+ gpu_memory_buffer->GetFormat())) {
+ return -1;
+ }
static int32 next_id = 1;
int32 new_id = next_id++;
- scoped_refptr<gfx::GLImageRefCountedMemory> image(
- new gfx::GLImageRefCountedMemory(size, internalformat));
- if (!image->Initialize(bytes.get()))
- return NULL;
-
gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
DCHECK(image_manager);
image_manager->AddImage(image.get(), new_id);
-
- *id = new_id;
- DCHECK(gpu_memory_buffers_.find(new_id) == gpu_memory_buffers_.end());
- return gpu_memory_buffers_.add(new_id, buffer.Pass()).first->second;
+ return new_id;
}
-void GLManager::DestroyGpuMemoryBuffer(int32 id) {
+int32 GLManager::CreateGpuMemoryBufferImage(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage) {
+ DCHECK_EQ(usage, static_cast<unsigned>(GL_MAP_CHROMIUM));
+ scoped_ptr<gfx::GpuMemoryBuffer> buffer = GLManager::CreateGpuMemoryBuffer(
+ gfx::Size(width, height), gfx::GpuMemoryBuffer::RGBA_8888);
+ return CreateImage(buffer->AsClientBuffer(), width, height, internalformat);
+}
+
+void GLManager::DestroyImage(int32 id) {
gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
DCHECK(image_manager);
image_manager->RemoveImage(id);
-
- gpu_memory_buffers_.erase(id);
}
uint32 GLManager::InsertSyncPoint() {
diff --git a/gpu/command_buffer/tests/gl_manager.h b/gpu/command_buffer/tests/gl_manager.h
index a4f4c71..d76ca5b 100644
--- a/gpu/command_buffer/tests/gl_manager.h
+++ b/gpu/command_buffer/tests/gl_manager.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/service/feature_info.h"
+#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/size.h"
namespace gfx {
@@ -60,6 +61,10 @@
GLManager();
virtual ~GLManager();
+ static scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
+ const gfx::Size& size,
+ gfx::GpuMemoryBuffer::Format format);
+
void Initialize(const Options& options);
void Destroy();
@@ -91,12 +96,15 @@
// GpuControl implementation.
virtual Capabilities GetCapabilities() override;
- virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32* id) override;
- virtual void DestroyGpuMemoryBuffer(int32 id) override;
+ virtual int32 CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) override;
+ virtual void DestroyImage(int32 id) override;
+ virtual int32 CreateGpuMemoryBufferImage(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage) override;
virtual uint32 InsertSyncPoint() override;
virtual uint32 InsertFutureSyncPoint() override;
virtual void RetireSyncPoint(uint32 sync_point) override;
@@ -124,9 +132,6 @@
scoped_ptr<gles2::GLES2Implementation> gles2_implementation_;
bool context_lost_allowed_;
- // Client GpuControl implementation.
- base::ScopedPtrHashMap<int32, gfx::GpuMemoryBuffer> gpu_memory_buffers_;
-
// Used on Android to virtualize GL for all contexts.
static int use_count_;
static scoped_refptr<gfx::GLShareGroup>* base_share_group_;
diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc
index d38e1eb..c9b5335 100644
--- a/gpu/config/gpu_driver_bug_list_json.cc
+++ b/gpu/config/gpu_driver_bug_list_json.cc
@@ -19,7 +19,7 @@
{
"name": "gpu driver bug list",
// Please update the version number whenever you change this file.
- "version": "7.5",
+ "version": "7.7",
"entries": [
{
"id": 1,
@@ -824,18 +824,6 @@
"use_virtualized_gl_contexts"
]
},
- {
- "id": 73,
- "description": "Using D3D11 causes browser crashes on certain Intel GPUs",
- "cr_bugs": [310808],
- "os": {
- "type": "win"
- },
- "vendor_id": "0x8086",
- "features": [
- "disable_d3d11"
- ]
- },
) // LONG_STRING_CONST macro
// Avoid C2026 (string too big) error on VisualStudio.
LONG_STRING_CONST(
@@ -1024,6 +1012,40 @@
"features": [
"etc1_power_of_two_only"
]
+ },
+ {
+ "id": 92,
+ "description": "Old Intel drivers cannot reliably support D3D11",
+ "cr_bugs": [363721],
+ "os": {
+ "type": "win"
+ },
+ "vendor_id": "0x8086",
+ "driver_version": {
+ "op": "<",
+ "value": "8.16"
+ },
+ "features": [
+ "disable_d3d11"
+ ]
+ },
+ {
+ "id": 93,
+ "description": "The GL implementation on the Android emulator has problems with PBOs.",
+ "cr_bugs": [340882],
+ "os": {
+ "type": "android"
+ },
+ "gl_vendor": "VMware.*",
+ "gl_renderer": "Gallium.*",
+ "gl_type": "gles",
+ "gl_version": {
+ "op": "=",
+ "value": "3.0"
+ },
+ "features": [
+ "disable_async_readpixels"
+ ]
}
]
}
diff --git a/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc
index f560dcb..c7951f9 100644
--- a/gpu/config/gpu_info.cc
+++ b/gpu/config/gpu_info.cc
@@ -17,6 +17,19 @@
enumerator->EndGPUDevice();
}
+void EnumerateVideoEncodeAcceleratorSupportedProfile(
+ gpu::GPUInfo::Enumerator* enumerator,
+ const media::VideoEncodeAccelerator::SupportedProfile profile) {
+ enumerator->BeginVideoEncodeAcceleratorSupportedProfile();
+ enumerator->AddInt("profile", profile.profile);
+ enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width());
+ enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height());
+ enumerator->AddInt("maxFramerateNumerator", profile.max_framerate_numerator);
+ enumerator->AddInt("maxFramerateDenominator",
+ profile.max_framerate_denominator);
+ enumerator->EndVideoEncodeAcceleratorSupportedProfile();
+}
+
} // namespace
namespace gpu {
@@ -88,6 +101,8 @@
CollectInfoResult dx_diagnostics_info_state;
DxDiagNode dx_diagnostics;
#endif
+ std::vector<media::VideoEncodeAccelerator::SupportedProfile>
+ video_encode_accelerator_supported_profiles;
};
// If this assert fails then most likely something below needs to be updated.
@@ -142,6 +157,12 @@
#if defined(OS_WIN)
enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state);
#endif
+ // TODO(kbr): add dx_diagnostics on Windows.
+ for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size();
+ ++ii) {
+ EnumerateVideoEncodeAcceleratorSupportedProfile(
+ enumerator, video_encode_accelerator_supported_profiles[ii]);
+ }
enumerator->EndAuxAttributes();
}
diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h
index 8f5479b..bdbb205 100644
--- a/gpu/config/gpu_info.h
+++ b/gpu/config/gpu_info.h
@@ -18,6 +18,7 @@
#include "gpu/config/dx_diag_node.h"
#include "gpu/config/gpu_performance_stats.h"
#include "gpu/gpu_export.h"
+#include "media/video/video_encode_accelerator.h"
namespace gpu {
@@ -177,6 +178,8 @@
DxDiagNode dx_diagnostics;
#endif
+ std::vector<media::VideoEncodeAccelerator::SupportedProfile>
+ video_encode_accelerator_supported_profiles;
// Note: when adding new members, please remember to update EnumerateFields
// in gpu_info.cc.
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc
index 78dfe22..5d25546 100644
--- a/gpu/config/gpu_info_collector.cc
+++ b/gpu/config/gpu_info_collector.cc
@@ -156,6 +156,8 @@
basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering;
basic_gpu_info->context_info_state = context_gpu_info.context_info_state;
basic_gpu_info->initialization_time = context_gpu_info.initialization_time;
+ basic_gpu_info->video_encode_accelerator_supported_profiles =
+ context_gpu_info.video_encode_accelerator_supported_profiles;
}
} // namespace gpu
diff --git a/gpu/config/gpu_info_unittest.cc b/gpu/config/gpu_info_unittest.cc
index 48d476f..71d4e5c 100644
--- a/gpu/config/gpu_info_unittest.cc
+++ b/gpu/config/gpu_info_unittest.cc
@@ -32,6 +32,7 @@
#if defined(OS_WIN)
EXPECT_EQ(gpu_info.dx_diagnostics_info_state, kCollectInfoNone);
#endif
+ EXPECT_EQ(gpu_info.video_encode_accelerator_supported_profiles.size(), 0u);
}
} // namespace gpu
diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc
index 99496ae..c7c7f03 100644
--- a/gpu/config/software_rendering_list_json.cc
+++ b/gpu/config/software_rendering_list_json.cc
@@ -18,7 +18,7 @@
{
"name": "software rendering list",
// Please update the version number whenever you change this file.
- "version": "9.10",
+ "version": "9.11",
"entries": [
{
"id": 1,
@@ -868,7 +868,11 @@
"description": "Samsung Galaxy NOTE is too buggy to use for video decoding",
"cr_bugs": [308721],
"os": {
- "type": "android"
+ "type": "android",
+ "version": {
+ "op": "<",
+ "value": "4.4"
+ }
},
"machine_model_name": ["GT-.*"],
"features": [
@@ -880,7 +884,11 @@
"description": "Samsung Galaxy S4 is too buggy to use for video decoding",
"cr_bugs": [329072],
"os": {
- "type": "android"
+ "type": "android",
+ "version": {
+ "op": "<",
+ "value": "4.4"
+ }
},
"machine_model_name": ["SCH-.*"],
"features": [
@@ -1117,7 +1125,11 @@
"description": "Samsung Galaxy Tab is too buggy to use for video decoding",
"cr_bugs": [408353],
"os": {
- "type": "android"
+ "type": "android",
+ "version": {
+ "op": "<",
+ "value": "4.4"
+ }
},
"machine_model_name": ["SM-.*"],
"features": [
@@ -1136,6 +1148,23 @@
"accelerated_2d_canvas",
"gpu_rasterization"
]
+ },
+ {
+ "id": 103,
+ "description": "Intel GM965/GL960 crash often on Mac OS 10.6",
+ "cr_bugs": [421641],
+ "os": {
+ "type": "macosx",
+ "version": {
+ "op": "=",
+ "value": "10.6"
+ }
+ },
+ "vendor_id": "0x8086",
+ "device_id": ["0x2a02"],
+ "features": [
+ "all"
+ ]
}
]
}
diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc
index a5cd9c4..afd5908 100644
--- a/gpu/gles2_conform_support/egl/display.cc
+++ b/gpu/gles2_conform_support/egl/display.cc
@@ -273,20 +273,26 @@
return decoder_->GetCapabilities();
}
-gfx::GpuMemoryBuffer* Display::CreateGpuMemoryBuffer(
- size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32* id) {
+int32_t Display::CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) {
NOTIMPLEMENTED();
- return NULL;
+ return -1;
}
-void Display::DestroyGpuMemoryBuffer(int32 id) {
+void Display::DestroyImage(int32 id) {
NOTIMPLEMENTED();
}
+int32_t Display::CreateGpuMemoryBufferImage(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage) {
+ NOTIMPLEMENTED();
+ return -1;
+}
+
uint32 Display::InsertSyncPoint() {
NOTIMPLEMENTED();
return 0u;
diff --git a/gpu/gles2_conform_support/egl/display.h b/gpu/gles2_conform_support/egl/display.h
index 2876427..a1e82fe 100644
--- a/gpu/gles2_conform_support/egl/display.h
+++ b/gpu/gles2_conform_support/egl/display.h
@@ -75,12 +75,15 @@
// GpuControl implementation.
virtual gpu::Capabilities GetCapabilities() override;
- virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32* id) override;
- virtual void DestroyGpuMemoryBuffer(int32 id) override;
+ virtual int32_t CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) override;
+ virtual void DestroyImage(int32_t id) override;
+ virtual int32_t CreateGpuMemoryBufferImage(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage) override;
virtual uint32 InsertSyncPoint() override;
virtual uint32 InsertFutureSyncPoint() override;
virtual void RetireSyncPoint(uint32 sync_point) override;
diff --git a/gpu/gpu_common.gypi b/gpu/gpu_common.gypi
index 13f3c8c..5ff16da 100644
--- a/gpu/gpu_common.gypi
+++ b/gpu/gpu_common.gypi
@@ -35,9 +35,6 @@
'command_buffer/client/gles2_trace_implementation.cc',
'command_buffer/client/gles2_trace_implementation.h',
'command_buffer/client/gles2_trace_implementation_impl_autogen.h',
- 'command_buffer/client/gpu_memory_buffer_factory.h',
- 'command_buffer/client/gpu_memory_buffer_tracker.cc',
- 'command_buffer/client/gpu_memory_buffer_tracker.h',
'command_buffer/client/gpu_switches.cc',
'command_buffer/client/gpu_switches.h',
'command_buffer/client/program_info_manager.cc',
diff --git a/gpu/khronos_glcts_support/khronos_glcts_test.cc b/gpu/khronos_glcts_support/khronos_glcts_test.cc
index b77bb8d..5491b15 100644
--- a/gpu/khronos_glcts_support/khronos_glcts_test.cc
+++ b/gpu/khronos_glcts_support/khronos_glcts_test.cc
@@ -9,8 +9,8 @@
#include "base/at_exit.h"
#include "base/base_paths.h"
#include "base/command_line.h"
-#include "base/file_util.h"
#include "base/files/file_path.h"
+#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/process/launch.h"
diff --git a/gpu/khronos_glcts_support/khronos_glcts_test_expectations.txt b/gpu/khronos_glcts_support/khronos_glcts_test_expectations.txt
index 54c2969..8a531ac 100644
--- a/gpu/khronos_glcts_support/khronos_glcts_test_expectations.txt
+++ b/gpu/khronos_glcts_support/khronos_glcts_test_expectations.txt
@@ -24,6 +24,11 @@
// 91531 MAC WIN LINUX : conformance_more_* = SKIP
// 91532 MAC NVIDIA 0x0640 : tex_image_and_sub_image_2d_with_video = PASS FAIL
+// Chromium implements GL_ARB_texture_rectangle which makes this test fail
+139729 DEBUG RELEASE : ES2_CTS_gtf_GL_build_Texture_Rectangle_Samplers_frag = FAIL
+
+// eglGetCurrentDisplay() returns EGL_NO_DISPLAY which causes this test to fail.
+421568 DEBUG RELEASE : ES2_CTS_gtf_GL2ExtensionTests_egl_create_context_egl_create_context = FAIL
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/gpu/khronos_glcts_support/native/egl_native_windowless.cc b/gpu/khronos_glcts_support/native/egl_native_windowless.cc
index ac0e908..1a575a5 100644
--- a/gpu/khronos_glcts_support/native/egl_native_windowless.cc
+++ b/gpu/khronos_glcts_support/native/egl_native_windowless.cc
@@ -14,6 +14,29 @@
namespace native {
namespace windowless {
+class Surface : public tcu::egl::WindowSurface {
+ public:
+ Surface(tcu::egl::Display& display,
+ EGLConfig config,
+ const EGLint* attribList,
+ int width,
+ int height)
+ : tcu::egl::WindowSurface(display,
+ config,
+ (EGLNativeWindowType)NULL,
+ attribList),
+ width_(width),
+ height_(height) {}
+
+ int getWidth() const { return width_; }
+
+ int getHeight() const { return height_; }
+
+ private:
+ const int width_;
+ const int height_;
+};
+
class Window : public tcu::NativeWindow {
public:
Window(tcu::egl::Display& display,
@@ -23,19 +46,19 @@
int height)
: tcu::NativeWindow::NativeWindow(),
eglDisplay_(display),
- eglSurface_(display, config, (EGLNativeWindowType)NULL, attribList) {}
+ surface_(display, config, attribList, width, height) {}
virtual ~Window() {}
tcu::egl::Display& getEglDisplay() { return eglDisplay_; }
- tcu::egl::WindowSurface& getEglSurface() { return eglSurface_; }
+ tcu::egl::WindowSurface& getEglSurface() { return surface_; }
void processEvents() { return; }
private:
tcu::egl::Display& eglDisplay_;
- tcu::egl::WindowSurface eglSurface_;
+ Surface surface_;
};
class Platform : public tcu::EglPlatform {
diff --git a/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc b/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
index 0cb5758..d92f7ef 100644
--- a/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
+++ b/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
@@ -40,7 +40,6 @@
functions->fCompileShader = glCompileShader;
functions->fCompressedTexImage2D = glCompressedTexImage2D;
functions->fCopyTexSubImage2D = glCopyTexSubImage2D;
- functions->fCopyTextureCHROMIUM = glCopyTextureCHROMIUM;
functions->fCreateProgram = glCreateProgram;
functions->fCreateShader = glCreateShader;
functions->fCullFace = glCullFace;
diff --git a/mojo/BUILD.gn b/mojo/BUILD.gn
index 2161ddc..8f58fc1 100644
--- a/mojo/BUILD.gn
+++ b/mojo/BUILD.gn
@@ -12,6 +12,8 @@
}
deps = [
":tests",
+ "//mojo/apps/js:mojo_js_content_handler",
+ "//mojo/apps/js:mojo_js_standalone",
"//mojo/common",
"//mojo/examples",
"//mojo/public",
@@ -42,7 +44,10 @@
testonly = true
deps = [
"//mojo/application_manager:mojo_application_manager_unittests",
+ "//mojo/apps/js/test:mojo_apps_js_unittests",
+ "//mojo/bindings/js/tests:mojo_js_unittests",
"//mojo/common:mojo_common_unittests",
+ "//mojo/converters/surfaces/tests:mojo_surfaces_lib_unittests",
"//mojo/edk/system:mojo_message_pipe_perftests",
"//mojo/edk/system:mojo_system_unittests",
"//mojo/public/c/system/tests:perftests",
@@ -52,7 +57,6 @@
"//mojo/public/cpp/system/tests:mojo_public_system_unittests",
"//mojo/public/cpp/utility/tests:mojo_public_utility_unittests",
"//mojo/services/clipboard:mojo_clipboard_unittests",
- "//mojo/services/public/cpp/surfaces/tests:mojo_surfaces_lib_unittests",
"//mojo/shell:mojo_external_application_tests",
"//mojo/shell:mojo_shell_tests",
"//mojo/tools:message_generator",
diff --git a/mojo/PRESUBMIT.py b/mojo/PRESUBMIT.py
index a7dc055..41a8ec6 100644
--- a/mojo/PRESUBMIT.py
+++ b/mojo/PRESUBMIT.py
@@ -19,6 +19,12 @@
# For the bindings generator:
mojo_public_bindings_pylib_path = os.path.join(
input_api.PresubmitLocalPath(), "public", "tools", "bindings", "pylib")
+ # For the python bindings:
+ mojo_python_bindings_path = os.path.join(
+ input_api.PresubmitLocalPath(), "public", "python")
+ # For the python bindings tests:
+ mojo_python_bindings_tests_path = os.path.join(
+ input_api.PresubmitLocalPath(), "python", "tests")
# TODO(vtl): Don't lint these files until the (many) problems are fixed
# (possibly by deleting/rewriting some files).
temporary_black_list = input_api.DEFAULT_BLACK_LIST + \
@@ -30,7 +36,12 @@
r".*\btools[\\\/]test_runner\.py$")
results = []
- pylint_extra_paths = [third_party_path, mojo_public_bindings_pylib_path]
+ pylint_extra_paths = [
+ third_party_path,
+ mojo_public_bindings_pylib_path,
+ mojo_python_bindings_path,
+ mojo_python_bindings_tests_path,
+ ]
results += input_api.canned_checks.RunPylint(
input_api, output_api, extra_paths_list=pylint_extra_paths,
black_list=temporary_black_list)
diff --git a/mojo/android/BUILD.gn b/mojo/android/BUILD.gn
index c2cfbfe..5eb9ded 100644
--- a/mojo/android/BUILD.gn
+++ b/mojo/android/BUILD.gn
@@ -7,12 +7,33 @@
group("android") {
testonly = true
deps = [
- ":system_impl",
+ ":system_java",
":mojo_javatests",
]
}
-android_library("system_impl") {
+generate_jni("system_java_jni_headers") {
+ sources = [
+ "system/src/org/chromium/mojo/system/impl/CoreImpl.java",
+ ]
+
+ jni_package = "mojo"
+}
+
+shared_library("libsystem_java") {
+ sources = [
+ "system/core_impl.cc",
+ "system/core_impl.h",
+ ]
+
+ deps = [
+ ":system_java_jni_headers",
+ "//mojo/edk/system",
+ "//mojo/environment:chromium",
+ ]
+}
+
+android_library("system_java") {
java_files = [
"system/src/org/chromium/mojo/system/impl/CoreImpl.java",
"system/src/org/chromium/mojo/system/impl/DataPipeConsumerHandleImpl.java",
@@ -54,7 +75,7 @@
]
deps = [
- ":system_impl",
+ ":system_java",
"//base:base_java",
"//base:base_java_test_support",
"//mojo/public/interfaces/bindings/tests:test_interfaces_java",
diff --git a/mojo/apps/js/BUILD.gn b/mojo/apps/js/BUILD.gn
index 16f1907..bc63231 100644
--- a/mojo/apps/js/BUILD.gn
+++ b/mojo/apps/js/BUILD.gn
@@ -2,8 +2,17 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+group("js") {
+ # Meta-target, don't link into production code.
+ testonly = true
+ deps = [
+ ":mojo_js_content_handler",
+ ":mojo_js_standalone"
+ ]
+}
+
# GYP version: part of mojo/mojo_apps.gypi:mojo_js_lib
-source_set("js") {
+source_set("mojo_runner") {
sources = [
"mojo_runner_delegate.cc",
"mojo_runner_delegate.h",
@@ -26,14 +35,14 @@
sources = [
"application_delegate_impl.cc",
"js_app.cc",
- "mojo_module.cc",
+ "mojo_bridge_module.cc",
]
public_deps = [
"//mojo/bindings/js",
]
deps = [
- ":js",
+ ":mojo_runner",
"//mojo/application",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/utility",
diff --git a/mojo/apps/js/application_delegate_impl.cc b/mojo/apps/js/application_delegate_impl.cc
index eb784a9..f197c3c 100644
--- a/mojo/apps/js/application_delegate_impl.cc
+++ b/mojo/apps/js/application_delegate_impl.cc
@@ -37,6 +37,8 @@
std::find(app_vector_.begin(), app_vector_.end(), app);
if (itr != app_vector_.end())
app_vector_.erase(itr);
+ if (app_vector_.empty())
+ base::MessageLoop::current()->QuitNow();
}
void ApplicationDelegateImpl::ConnectToService(
diff --git a/mojo/apps/js/bindings/monotonic_clock.cc b/mojo/apps/js/bindings/monotonic_clock.cc
index 733af8a..2d75905 100644
--- a/mojo/apps/js/bindings/monotonic_clock.cc
+++ b/mojo/apps/js/bindings/monotonic_clock.cc
@@ -4,6 +4,7 @@
#include "mojo/apps/js/bindings/monotonic_clock.h"
+#include "base/time/time.h"
#include "gin/object_template_builder.h"
#include "gin/per_isolate_data.h"
#include "gin/public/wrapper_info.h"
@@ -17,8 +18,8 @@
gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin };
double GetMonotonicSeconds() {
- const double kMicrosecondsPerSecond = 1000000;
- return static_cast<double>(mojo::GetTimeTicksNow()) / kMicrosecondsPerSecond;
+ return static_cast<double>(mojo::GetTimeTicksNow()) /
+ base::Time::kMicrosecondsPerSecond;
}
} // namespace
diff --git a/mojo/apps/js/content_handler_main.cc b/mojo/apps/js/content_handler_main.cc
index 3ea9a3e..1edf10d 100644
--- a/mojo/apps/js/content_handler_main.cc
+++ b/mojo/apps/js/content_handler_main.cc
@@ -21,6 +21,11 @@
}
private:
+ virtual void Initialize(ApplicationImpl* app) override {
+ base::i18n::InitializeICU();
+ ApplicationDelegateImpl::Initialize(app);
+ }
+
virtual bool ConfigureIncomingConnection(
ApplicationConnection* connection) override {
connection->AddService(&content_handler_factory_);
@@ -35,7 +40,6 @@
} // namespace mojo
MojoResult MojoMain(MojoHandle shell_handle) {
- base::i18n::InitializeICU();
mojo::ApplicationRunnerChromium runner(
new mojo::apps::ContentHandlerApplicationDelegateImpl());
return runner.Run(shell_handle);
diff --git a/mojo/apps/js/js_app.cc b/mojo/apps/js/js_app.cc
index 7b400b2..f3550fa 100644
--- a/mojo/apps/js/js_app.cc
+++ b/mojo/apps/js/js_app.cc
@@ -8,7 +8,7 @@
#include "gin/array_buffer.h"
#include "gin/converter.h"
#include "mojo/apps/js/application_delegate_impl.h"
-#include "mojo/apps/js/mojo_module.h"
+#include "mojo/apps/js/mojo_bridge_module.h"
namespace mojo {
namespace apps {
@@ -19,8 +19,8 @@
app_delegate_impl_task_runner_(
base::MessageLoop::current()->task_runner()) {
CHECK(on_app_delegate_impl_thread());
- runner_delegate_.AddBuiltinModule(Mojo::kModuleName,
- base::Bind(Mojo::GetModule, this));
+ runner_delegate_.AddBuiltinModule(MojoInternals::kModuleName,
+ base::Bind(MojoInternals::GetModule, this));
}
JSApp::~JSApp() {
diff --git a/mojo/apps/js/js_app.h b/mojo/apps/js/js_app.h
index 6bbaed4..8db1044 100644
--- a/mojo/apps/js/js_app.h
+++ b/mojo/apps/js/js_app.h
@@ -30,13 +30,12 @@
// This method causes Load() and then Run() to run on a new thread.
bool Start();
-
// Subclasses must return the JS source code for this app's main script and
// the filename or URL that identifies the script's origin. This method will
// be called from this app's thread.
virtual bool Load(std::string* source, std::string* file_name) = 0;
- // Called by the JS mojo module to quit this JS app. See mojo_module.cc.
+ // Called by the JS mojo module to quit this JS app. See mojo.js.
void Quit();
// Called by the JS mojo module to connect to a Mojo service.
diff --git a/mojo/apps/js/main.js b/mojo/apps/js/main.js
index e2562cf..3a44f04 100644
--- a/mojo/apps/js/main.js
+++ b/mojo/apps/js/main.js
@@ -3,36 +3,36 @@
// found in the LICENSE file.
// This trivial app just loads "cnn.com" using the Mojo Network and URLLoader
-// services and then prints a brief summary of the response. It's intended to
-// be run using the mojo_js content handler and assumes that this source file
-// is specified as a URL. For example:
+// services and then prints a brief summary of the response.
//
+// To run it using mojo_js_standalone (don't forget the quotes):
+// mojo_shell 'mojo://mojo_js_standalone THIS_DIR/main.js'
+//
+// To run it using mojo_js_content handler this file must be specified as
+// a URL. For example:
// (cd YOUR_DIR/mojo/apps/js; python -m SimpleHTTPServer ) &
-// mojo_shell --content-handlers=application/javascript,mojo://mojo_js \
-// http://localhost:8000/test.js
+// mojo_shell \
+// --content-handlers=application/javascript,mojo://mojo_js_content_handler \
+// http://localhost:8000/test.js
define("test", [
+ "mojo/apps/js/mojo",
"mojo/public/js/bindings/core",
"mojo/public/js/bindings/connection",
"mojo/public/js/bindings/support",
"mojo/services/public/interfaces/network/network_service.mojom",
"mojo/services/public/interfaces/network/url_loader.mojom",
- "mojo",
"console"
-], function(core, connection, support, net, loader, mojo, console) {
+], function(mojo, core, connection, support, net, loader, console) {
- var netServiceHandle = mojo.connectToService(
- "mojo:mojo_network_service", net.NetworkService.name);
- var netConnection = new connection.Connection(
- netServiceHandle,
- net.NetworkService.stubClass,
- net.NetworkService.proxyClass);
+ var networkService = mojo.connectToService(
+ "mojo:mojo_network_service", net.NetworkService);
var urlLoaderPipe = core.createMessagePipe();
- netConnection.remote.createURLLoader(urlLoaderPipe.handle1);
+ networkService.createURLLoader(urlLoaderPipe.handle1);
var urlLoaderConnection = new connection.Connection(
urlLoaderPipe.handle0,
- loader.URLLoader.stubClass,
+ function(){},
loader.URLLoader.proxyClass);
var urlRequest = new loader.URLRequest({
diff --git a/mojo/apps/js/mojo.js b/mojo/apps/js/mojo.js
new file mode 100644
index 0000000..23bacff
--- /dev/null
+++ b/mojo/apps/js/mojo.js
@@ -0,0 +1,26 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+define("mojo/apps/js/mojo", [
+ "mojo/public/js/bindings/connection",
+ "mojo/apps/js/bridge",
+], function(connection, mojo) {
+
+ function connectToService(url, service, client) {
+ var serviceHandle = mojo.connectToService(url, service.name);
+ var clientClass = client && service.client.delegatingStubClass;
+ var serviceConnection =
+ new connection.Connection(serviceHandle, clientClass, service.proxyClass);
+ if (serviceConnection.local)
+ serviceConnection.local.delegate$ = client;
+ serviceConnection.remote.connection$ = serviceConnection;
+ return serviceConnection.remote;
+ }
+
+ var exports = {};
+ exports.connectToService = connectToService;
+ exports.quit = mojo.quit;
+ return exports;
+});
+
diff --git a/mojo/apps/js/mojo_module.cc b/mojo/apps/js/mojo_bridge_module.cc
similarity index 82%
rename from mojo/apps/js/mojo_module.cc
rename to mojo/apps/js/mojo_bridge_module.cc
index d3c0f76..691a1e8 100644
--- a/mojo/apps/js/mojo_module.cc
+++ b/mojo/apps/js/mojo_bridge_module.cc
@@ -2,16 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/apps/js/mojo_module.h"
+#include "mojo/apps/js/mojo_bridge_module.h"
#include "gin/arguments.h"
#include "gin/converter.h"
#include "gin/object_template_builder.h"
#include "gin/per_isolate_data.h"
#include "mojo/apps/js/js_app.h"
-#include "mojo/apps/js/mojo_module.h"
#include "mojo/bindings/js/handle.h"
-#include "mojo/common/data_pipe_utils.h"
namespace mojo {
namespace apps {
@@ -22,9 +20,10 @@
} // namespace
-const char Mojo::kModuleName[] = "mojo";
+const char MojoInternals::kModuleName[] = "mojo/apps/js/bridge";
-v8::Local<v8::Value> Mojo::GetModule(JSApp* js_app, v8::Isolate* isolate) {
+v8::Local<v8::Value> MojoInternals::GetModule(JSApp* js_app,
+ v8::Isolate* isolate) {
gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
v8::Local<v8::ObjectTemplate> templ =
data->GetObjectTemplate(&g_wrapper_info);
diff --git a/mojo/apps/js/mojo_module.h b/mojo/apps/js/mojo_bridge_module.h
similarity index 76%
rename from mojo/apps/js/mojo_module.h
rename to mojo/apps/js/mojo_bridge_module.h
index cb4a73a..e3d95f3 100644
--- a/mojo/apps/js/mojo_module.h
+++ b/mojo/apps/js/mojo_bridge_module.h
@@ -13,7 +13,10 @@
class JSApp;
-class Mojo {
+// The JavaScript "mojo/apps/js/mojo" module depends on this built-in module.
+// It provides the bridge between the JSApp class and JavaScript.
+
+class MojoInternals {
public:
static const char kModuleName[];
static v8::Local<v8::Value> GetModule(JSApp* js_app, v8::Isolate* isolate);
diff --git a/mojo/apps/js/standalone_main.cc b/mojo/apps/js/standalone_main.cc
index efdfcb8..f776960 100644
--- a/mojo/apps/js/standalone_main.cc
+++ b/mojo/apps/js/standalone_main.cc
@@ -34,6 +34,7 @@
class StandaloneApplicationDelegateImpl : public ApplicationDelegateImpl {
private:
virtual void Initialize(ApplicationImpl* app) override {
+ base::i18n::InitializeICU();
ApplicationDelegateImpl::Initialize(app);
for (size_t i = 1; i < app->args().size(); i++) {
@@ -48,7 +49,6 @@
} // namespace mojo
MojoResult MojoMain(MojoHandle shell_handle) {
- base::i18n::InitializeICU();
mojo::ApplicationRunnerChromium runner(
new mojo::apps::StandaloneApplicationDelegateImpl());
return runner.Run(shell_handle);
diff --git a/mojo/apps/js/test/BUILD.gn b/mojo/apps/js/test/BUILD.gn
index 1258316..5cb5a48 100644
--- a/mojo/apps/js/test/BUILD.gn
+++ b/mojo/apps/js/test/BUILD.gn
@@ -9,10 +9,14 @@
deps = [
":js_to_cpp_bindings",
"//gin:gin_test",
- "//mojo/apps/js",
+ "//mojo/apps/js:mojo_runner",
+ "//mojo/apps/js/bindings",
+ "//mojo/bindings/js",
"//mojo/common",
"//mojo/edk/test:run_all_unittests",
"//mojo/edk/test:test_support",
+ "//mojo/public/cpp/bindings",
+ "//mojo/public/cpp/system",
"//mojo/public/interfaces/bindings/tests:test_interfaces",
]
diff --git a/mojo/apps/js/test/handle_unittest.cc b/mojo/apps/js/test/handle_unittest.cc
index ec089c9..9167197 100644
--- a/mojo/apps/js/test/handle_unittest.cc
+++ b/mojo/apps/js/test/handle_unittest.cc
@@ -12,7 +12,7 @@
namespace js {
class HandleWrapperTest : public testing::Test,
- public gin::HandleCloseObserver {
+ public HandleCloseObserver {
public:
HandleWrapperTest() : closes_observed_(0) {}
@@ -25,7 +25,7 @@
DISALLOW_COPY_AND_ASSIGN(HandleWrapperTest);
};
-class TestHandleWrapper : public gin::HandleWrapper {
+class TestHandleWrapper : public HandleWrapper {
public:
explicit TestHandleWrapper(MojoHandle handle) : HandleWrapper(handle) {}
diff --git a/mojo/aura/BUILD.gn b/mojo/aura/BUILD.gn
index 62d135f..95d662f 100644
--- a/mojo/aura/BUILD.gn
+++ b/mojo/aura/BUILD.gn
@@ -29,11 +29,11 @@
"//ui/events:events_base",
"//ui/gl",
"//mojo/cc",
+ "//mojo/converters/geometry",
+ "//mojo/converters/surfaces",
"//mojo/public/cpp/application",
"//mojo/public/gles2:for_shared_library",
"//mojo/public/interfaces/application:application",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/gpu",
"//mojo/services/public/interfaces/native_viewport",
diff --git a/mojo/aura/surface_binding.cc b/mojo/aura/surface_binding.cc
index ada166e..3c9584e 100644
--- a/mojo/aura/surface_binding.cc
+++ b/mojo/aura/surface_binding.cc
@@ -17,10 +17,10 @@
#include "mojo/aura/window_tree_host_mojo.h"
#include "mojo/cc/context_provider_mojo.h"
#include "mojo/cc/output_surface_mojo.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
#include "mojo/services/public/cpp/view_manager/view.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
diff --git a/mojo/aura/surface_context_factory.cc b/mojo/aura/surface_context_factory.cc
index 1e56029..aa96401 100644
--- a/mojo/aura/surface_context_factory.cc
+++ b/mojo/aura/surface_context_factory.cc
@@ -6,6 +6,7 @@
#include "cc/output/output_surface.h"
#include "cc/resources/shared_bitmap_manager.h"
+#include "cc/surfaces/surface_id_allocator.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/public/cpp/view_manager/view.h"
#include "ui/compositor/reflector.h"
@@ -51,8 +52,17 @@
return nullptr;
}
+cc::GpuMemoryBufferManager* SurfaceContextFactory::GetGpuMemoryBufferManager() {
+ return nullptr;
+}
+
base::MessageLoopProxy* SurfaceContextFactory::GetCompositorMessageLoop() {
return nullptr;
}
+scoped_ptr<cc::SurfaceIdAllocator>
+SurfaceContextFactory::CreateSurfaceIdAllocator() {
+ return nullptr;
+}
+
} // namespace mojo
diff --git a/mojo/aura/surface_context_factory.h b/mojo/aura/surface_context_factory.h
index dc0e8d0..8dd4721 100644
--- a/mojo/aura/surface_context_factory.h
+++ b/mojo/aura/surface_context_factory.h
@@ -31,7 +31,10 @@
virtual void RemoveCompositor(ui::Compositor* compositor) override;
virtual bool DoesCreateTestContexts() override;
virtual cc::SharedBitmapManager* GetSharedBitmapManager() override;
+ virtual cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
virtual base::MessageLoopProxy* GetCompositorMessageLoop() override;
+ virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator()
+ override;
SurfaceBinding surface_binding_;
diff --git a/mojo/bindings/js/core.cc b/mojo/bindings/js/core.cc
index e116db1..f9e4359 100644
--- a/mojo/bindings/js/core.cc
+++ b/mojo/bindings/js/core.cc
@@ -24,7 +24,7 @@
namespace {
-MojoResult CloseHandle(gin::Handle<gin::HandleWrapper> handle) {
+MojoResult CloseHandle(gin::Handle<HandleWrapper> handle) {
if (!handle->get().is_valid())
return MOJO_RESULT_INVALID_ARGUMENT;
handle->Close();
@@ -84,7 +84,7 @@
MojoResult WriteMessage(
mojo::Handle handle,
const gin::ArrayBufferView& buffer,
- const std::vector<gin::Handle<gin::HandleWrapper> >& handles,
+ const std::vector<gin::Handle<HandleWrapper> >& handles,
MojoWriteMessageFlags flags) {
std::vector<MojoHandle> raw_handles(handles.size());
for (size_t i = 0; i < handles.size(); ++i)
@@ -231,7 +231,7 @@
// The drainData data pipe handle argument is closed automatically.
v8::Handle<v8::Value> DoDrainData(gin::Arguments* args,
- gin::Handle<gin::HandleWrapper> handle) {
+ gin::Handle<HandleWrapper> handle) {
return (new DrainData(args->isolate(), handle->release()))->GetPromise();
}
diff --git a/mojo/bindings/js/handle.cc b/mojo/bindings/js/handle.cc
index a25a911..baa1bae 100644
--- a/mojo/bindings/js/handle.cc
+++ b/mojo/bindings/js/handle.cc
@@ -6,7 +6,8 @@
#include "mojo/bindings/js/handle_close_observer.h"
-namespace gin {
+namespace mojo {
+namespace js {
gin::WrapperInfo HandleWrapper::kWrapperInfo = { gin::kEmbedderNativeGin };
@@ -38,11 +39,16 @@
FOR_EACH_OBSERVER(HandleCloseObserver, close_observers_, OnWillCloseHandle());
}
+} // namespace js
+} // namespace mojo
+
+namespace gin {
+
v8::Handle<v8::Value> Converter<mojo::Handle>::ToV8(v8::Isolate* isolate,
const mojo::Handle& val) {
if (!val.is_valid())
return v8::Null(isolate);
- return HandleWrapper::Create(isolate, val.value()).ToV8();
+ return mojo::js::HandleWrapper::Create(isolate, val.value()).ToV8();
}
bool Converter<mojo::Handle>::FromV8(v8::Isolate* isolate,
@@ -53,8 +59,9 @@
return true;
}
- gin::Handle<HandleWrapper> handle;
- if (!Converter<gin::Handle<HandleWrapper> >::FromV8(isolate, val, &handle))
+ gin::Handle<mojo::js::HandleWrapper> handle;
+ if (!Converter<gin::Handle<mojo::js::HandleWrapper> >::FromV8(
+ isolate, val, &handle))
return false;
*out = handle->get();
diff --git a/mojo/bindings/js/handle.h b/mojo/bindings/js/handle.h
index e0f00dd..4f0d9b5 100644
--- a/mojo/bindings/js/handle.h
+++ b/mojo/bindings/js/handle.h
@@ -11,7 +11,8 @@
#include "gin/wrappable.h"
#include "mojo/public/cpp/system/core.h"
-namespace gin {
+namespace mojo {
+namespace js {
class HandleCloseObserver;
// Wrapper for mojo Handles exposed to JavaScript. This ensures the Handle
@@ -41,6 +42,11 @@
ObserverList<HandleCloseObserver> close_observers_;
};
+} // namespace js
+} // namespace mojo
+
+namespace gin {
+
// Note: It's important to use this converter rather than the one for
// MojoHandle, since that will do a simple int32 conversion. It's unfortunate
// there's no way to prevent against accidental use.
@@ -56,24 +62,24 @@
// We need to specialize the normal gin::Handle converter in order to handle
// converting |null| to a wrapper for an empty mojo::Handle.
template<>
-struct Converter<gin::Handle<gin::HandleWrapper> > {
+struct Converter<gin::Handle<mojo::js::HandleWrapper> > {
static v8::Handle<v8::Value> ToV8(
- v8::Isolate* isolate, const gin::Handle<gin::HandleWrapper>& val) {
+ v8::Isolate* isolate, const gin::Handle<mojo::js::HandleWrapper>& val) {
return val.ToV8();
}
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
- gin::Handle<gin::HandleWrapper>* out) {
+ gin::Handle<mojo::js::HandleWrapper>* out) {
if (val->IsNull()) {
- *out = HandleWrapper::Create(isolate, MOJO_HANDLE_INVALID);
+ *out = mojo::js::HandleWrapper::Create(isolate, MOJO_HANDLE_INVALID);
return true;
}
- gin::HandleWrapper* object = NULL;
- if (!Converter<gin::HandleWrapper*>::FromV8(isolate, val, &object)) {
+ mojo::js::HandleWrapper* object = NULL;
+ if (!Converter<mojo::js::HandleWrapper*>::FromV8(isolate, val, &object)) {
return false;
}
- *out = gin::Handle<gin::HandleWrapper>(val, object);
+ *out = gin::Handle<mojo::js::HandleWrapper>(val, object);
return true;
}
};
diff --git a/mojo/bindings/js/handle_close_observer.h b/mojo/bindings/js/handle_close_observer.h
index 854603e..8f19466 100644
--- a/mojo/bindings/js/handle_close_observer.h
+++ b/mojo/bindings/js/handle_close_observer.h
@@ -5,7 +5,8 @@
#ifndef MOJO_BINDINGS_JS_HANDLE_CLOSE_OBSERVER_H_
#define MOJO_BINDINGS_JS_HANDLE_CLOSE_OBSERVER_H_
-namespace gin {
+namespace mojo {
+namespace js {
class HandleCloseObserver {
public:
@@ -15,6 +16,7 @@
virtual ~HandleCloseObserver() {}
};
-} // namespace gin
+} // namespace js
+} // namespace mojo
#endif // MOJO_BINDINGS_JS_HANDLE_CLOSE_OBSERVER_H_
diff --git a/mojo/bindings/js/support.cc b/mojo/bindings/js/support.cc
index 1c82f17..b90953d 100644
--- a/mojo/bindings/js/support.cc
+++ b/mojo/bindings/js/support.cc
@@ -22,7 +22,7 @@
namespace {
WaitingCallback* AsyncWait(const gin::Arguments& args,
- gin::Handle<gin::HandleWrapper> handle,
+ gin::Handle<HandleWrapper> handle,
MojoHandleSignals signals,
v8::Handle<v8::Function> callback) {
return WaitingCallback::Create(args.isolate(), callback, handle, signals)
diff --git a/mojo/bindings/js/waiting_callback.cc b/mojo/bindings/js/waiting_callback.cc
index a88f956..c281248 100644
--- a/mojo/bindings/js/waiting_callback.cc
+++ b/mojo/bindings/js/waiting_callback.cc
@@ -24,7 +24,7 @@
gin::Handle<WaitingCallback> WaitingCallback::Create(
v8::Isolate* isolate,
v8::Handle<v8::Function> callback,
- gin::Handle<gin::HandleWrapper> handle_wrapper,
+ gin::Handle<HandleWrapper> handle_wrapper,
MojoHandleSignals signals) {
gin::Handle<WaitingCallback> waiting_callback = gin::CreateHandle(
isolate, new WaitingCallback(isolate, callback, handle_wrapper));
@@ -49,7 +49,7 @@
WaitingCallback::WaitingCallback(v8::Isolate* isolate,
v8::Handle<v8::Function> callback,
- gin::Handle<gin::HandleWrapper> handle_wrapper)
+ gin::Handle<HandleWrapper> handle_wrapper)
: wait_id_(0), handle_wrapper_(handle_wrapper.get()) {
handle_wrapper_->AddCloseObserver(this);
v8::Handle<v8::Context> context = isolate->GetCurrentContext();
diff --git a/mojo/bindings/js/waiting_callback.h b/mojo/bindings/js/waiting_callback.h
index b3a4fda..2a4374a 100644
--- a/mojo/bindings/js/waiting_callback.h
+++ b/mojo/bindings/js/waiting_callback.h
@@ -17,7 +17,7 @@
namespace js {
class WaitingCallback : public gin::Wrappable<WaitingCallback>,
- public gin::HandleCloseObserver {
+ public HandleCloseObserver {
public:
static gin::WrapperInfo kWrapperInfo;
@@ -25,7 +25,7 @@
static gin::Handle<WaitingCallback> Create(
v8::Isolate* isolate,
v8::Handle<v8::Function> callback,
- gin::Handle<gin::HandleWrapper> handle_wrapper,
+ gin::Handle<HandleWrapper> handle_wrapper,
MojoHandleSignals signals);
// Cancels the callback. Does nothing if a callback is not pending. This is
@@ -36,7 +36,7 @@
private:
WaitingCallback(v8::Isolate* isolate,
v8::Handle<v8::Function> callback,
- gin::Handle<gin::HandleWrapper> handle_wrapper);
+ gin::Handle<HandleWrapper> handle_wrapper);
virtual ~WaitingCallback();
// Callback from MojoAsyncWaiter. |closure| is the WaitingCallback.
@@ -52,7 +52,7 @@
base::WeakPtr<gin::Runner> runner_;
MojoAsyncWaitID wait_id_;
- gin::HandleWrapper* handle_wrapper_;
+ HandleWrapper* handle_wrapper_;
DISALLOW_COPY_AND_ASSIGN(WaitingCallback);
};
diff --git a/mojo/cc/BUILD.gn b/mojo/cc/BUILD.gn
index af2a8e5..1a78c01 100644
--- a/mojo/cc/BUILD.gn
+++ b/mojo/cc/BUILD.gn
@@ -10,14 +10,16 @@
"//cc/surfaces",
"//skia",
"//gpu/command_buffer/client:gles2_implementation",
+ "//mojo/converters/surfaces",
"//mojo/public/gles2:for_shared_library",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/surfaces",
]
sources = [
"context_provider_mojo.cc",
"context_provider_mojo.h",
+ "direct_output_surface.cc",
+ "direct_output_surface.h",
"output_surface_mojo.cc",
"output_surface_mojo.h",
]
diff --git a/mojo/cc/DEPS b/mojo/cc/DEPS
index f789994..9390f5e 100644
--- a/mojo/cc/DEPS
+++ b/mojo/cc/DEPS
@@ -1,4 +1,5 @@
include_rules = [
"+cc",
"-cc/blink",
+ "+gpu/command_buffer/client",
]
diff --git a/mojo/cc/direct_output_surface.cc b/mojo/cc/direct_output_surface.cc
new file mode 100644
index 0000000..0899c4e
--- /dev/null
+++ b/mojo/cc/direct_output_surface.cc
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/cc/direct_output_surface.h"
+
+#include "base/bind.h"
+#include "cc/output/compositor_frame.h"
+#include "cc/output/context_provider.h"
+#include "cc/output/output_surface_client.h"
+#include "gpu/command_buffer/client/context_support.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
+
+namespace mojo {
+
+DirectOutputSurface::DirectOutputSurface(
+ const scoped_refptr<cc::ContextProvider>& context_provider)
+ : cc::OutputSurface(context_provider), weak_ptr_factory_(this) {
+}
+
+DirectOutputSurface::~DirectOutputSurface() {}
+
+void DirectOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
+ DCHECK(context_provider_.get());
+ DCHECK(frame->gl_frame_data);
+ if (frame->gl_frame_data->sub_buffer_rect ==
+ gfx::Rect(frame->gl_frame_data->size)) {
+ context_provider_->ContextSupport()->Swap();
+ } else {
+ context_provider_->ContextSupport()->PartialSwapBuffers(
+ frame->gl_frame_data->sub_buffer_rect);
+ }
+ uint32_t sync_point =
+ context_provider_->ContextGL()->InsertSyncPointCHROMIUM();
+ context_provider_->ContextSupport()->SignalSyncPoint(
+ sync_point,
+ base::Bind(&OutputSurface::OnSwapBuffersComplete,
+ weak_ptr_factory_.GetWeakPtr()));
+ client_->DidSwapBuffers();
+}
+
+} // namespace mojo
diff --git a/mojo/cc/direct_output_surface.h b/mojo/cc/direct_output_surface.h
new file mode 100644
index 0000000..50e6c40
--- /dev/null
+++ b/mojo/cc/direct_output_surface.h
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_CC_DIRECT_OUTPUT_SURFACE_H_
+#define MOJO_CC_DIRECT_OUTPUT_SURFACE_H_
+
+#include "cc/output/output_surface.h"
+
+namespace mojo {
+
+// An OutputSurface implementation that directly draws and
+// swaps to an actual GL surface.
+class DirectOutputSurface : public cc::OutputSurface {
+ public:
+ explicit DirectOutputSurface(
+ const scoped_refptr<cc::ContextProvider>& context_provider);
+ virtual ~DirectOutputSurface() override;
+
+ // cc::OutputSurface implementation
+ virtual void SwapBuffers(cc::CompositorFrame* frame) override;
+
+private:
+ base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_;
+};
+
+} // namespace mojo
+
+#endif // MOJO_CC_DIRECT_OUTPUT_SURFACE_H_
diff --git a/mojo/cc/output_surface_mojo.cc b/mojo/cc/output_surface_mojo.cc
index fbd2c9e..193c7ac 100644
--- a/mojo/cc/output_surface_mojo.cc
+++ b/mojo/cc/output_surface_mojo.cc
@@ -6,8 +6,8 @@
#include "cc/output/compositor_frame.h"
#include "cc/output/output_surface_client.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
namespace mojo {
diff --git a/mojo/services/public/cpp/geometry/BUILD.gn b/mojo/converters/geometry/BUILD.gn
similarity index 85%
rename from mojo/services/public/cpp/geometry/BUILD.gn
rename to mojo/converters/geometry/BUILD.gn
index c87adf3..2d0a1e0 100644
--- a/mojo/services/public/cpp/geometry/BUILD.gn
+++ b/mojo/converters/geometry/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_services.gypi:mojo_geometry_lib
+# GYP version: mojo/mojo_converters.gypi:mojo_geometry_lib
component("geometry") {
output_name = "mojo_geometry_lib"
@@ -22,7 +22,7 @@
]
sources = [
- "lib/geometry_type_converters.cc",
+ "geometry_type_converters.cc",
"geometry_type_converters.h",
"mojo_geometry_export.h",
]
diff --git a/mojo/services/public/cpp/geometry/DEPS b/mojo/converters/geometry/DEPS
similarity index 100%
rename from mojo/services/public/cpp/geometry/DEPS
rename to mojo/converters/geometry/DEPS
diff --git a/mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc b/mojo/converters/geometry/geometry_type_converters.cc
similarity index 97%
rename from mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc
rename to mojo/converters/geometry/geometry_type_converters.cc
index 9a40c15..3830879 100644
--- a/mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc
+++ b/mojo/converters/geometry/geometry_type_converters.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
namespace mojo {
diff --git a/mojo/services/public/cpp/geometry/geometry_type_converters.h b/mojo/converters/geometry/geometry_type_converters.h
similarity index 87%
rename from mojo/services/public/cpp/geometry/geometry_type_converters.h
rename to mojo/converters/geometry/geometry_type_converters.h
index 2f2cc1b..ee9ea72 100644
--- a/mojo/services/public/cpp/geometry/geometry_type_converters.h
+++ b/mojo/converters/geometry/geometry_type_converters.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_
-#define MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_
+#ifndef MOJO_CONVERTERS_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_
+#define MOJO_CONVERTERS_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_
-#include "mojo/services/public/cpp/geometry/mojo_geometry_export.h"
+#include "mojo/converters/geometry/mojo_geometry_export.h"
#include "mojo/services/public/interfaces/geometry/geometry.mojom.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_f.h"
@@ -71,4 +71,4 @@
} // namespace mojo
-#endif // MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_
+#endif // MOJO_CONVERTERS_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_
diff --git a/mojo/services/public/cpp/geometry/mojo_geometry_export.h b/mojo/converters/geometry/mojo_geometry_export.h
similarity index 76%
rename from mojo/services/public/cpp/geometry/mojo_geometry_export.h
rename to mojo/converters/geometry/mojo_geometry_export.h
index f21aebc..f906ddf 100644
--- a/mojo/services/public/cpp/geometry/mojo_geometry_export.h
+++ b/mojo/converters/geometry/mojo_geometry_export.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_MOJO_GEOMETRY_EXPORT_H_
-#define MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_MOJO_GEOMETRY_EXPORT_H_
+#ifndef MOJO_CONVERTERS_GEOMETRY_MOJO_GEOMETRY_EXPORT_H_
+#define MOJO_CONVERTERS_GEOMETRY_MOJO_GEOMETRY_EXPORT_H_
#if defined(COMPONENT_BUILD)
@@ -29,4 +29,4 @@
#define MOJO_GEOMETRY_EXPORT
#endif
-#endif // MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_MOJO_GEOMETRY_EXPORT_H_
+#endif // MOJO_CONVERTERS_GEOMETRY_MOJO_GEOMETRY_EXPORT_H_
diff --git a/mojo/services/public/cpp/input_events/BUILD.gn b/mojo/converters/input_events/BUILD.gn
similarity index 72%
rename from mojo/services/public/cpp/input_events/BUILD.gn
rename to mojo/converters/input_events/BUILD.gn
index 2b47ece..94df786 100644
--- a/mojo/services/public/cpp/input_events/BUILD.gn
+++ b/mojo/converters/input_events/BUILD.gn
@@ -2,11 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+# GYP version: mojo/mojo_converters.gypi:mojo_input_events_lib
component("input_events") {
sources = [
- "lib/input_events_type_converters.cc",
- "lib/mojo_extended_key_event_data.cc",
- "lib/mojo_extended_key_event_data.h",
+ "input_events_type_converters.cc",
+ "mojo_extended_key_event_data.cc",
+ "mojo_extended_key_event_data.h",
"mojo_input_events_export.h",
]
@@ -18,10 +19,10 @@
"//base",
"//ui/events",
"//ui/gfx/geometry",
+ "//mojo/converters/geometry",
"//mojo/environment:chromium",
"//mojo/public/c/system:for_component",
"//mojo/services/public/interfaces/input_events",
"//mojo/services/public/interfaces/geometry",
- "//mojo/services/public/cpp/geometry",
]
}
diff --git a/mojo/services/public/cpp/input_events/DEPS b/mojo/converters/input_events/DEPS
similarity index 100%
rename from mojo/services/public/cpp/input_events/DEPS
rename to mojo/converters/input_events/DEPS
diff --git a/mojo/services/public/cpp/input_events/lib/input_event_names.h b/mojo/converters/input_events/input_event_names.h
similarity index 100%
rename from mojo/services/public/cpp/input_events/lib/input_event_names.h
rename to mojo/converters/input_events/input_event_names.h
diff --git a/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc b/mojo/converters/input_events/input_events_type_converters.cc
similarity index 95%
rename from mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
rename to mojo/converters/input_events/input_events_type_converters.cc
index 340e200..f0cd627 100644
--- a/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
+++ b/mojo/converters/input_events/input_events_type_converters.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
#if defined(USE_X11)
#include <X11/extensions/XInput2.h>
#include <X11/Xlib.h>
#endif
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/input_events/mojo_extended_key_event_data.h"
#include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/keyboard_codes.h"
@@ -63,7 +63,7 @@
#define MOJO_INPUT_EVENT_NAME(name) case ui::ET_##name: return EVENT_TYPE_##name
switch (type) {
-#include "mojo/services/public/cpp/input_events/lib/input_event_names.h"
+#include "mojo/converters/input_events/input_event_names.h"
case ui::ET_LAST:
NOTREACHED();
break;
@@ -80,7 +80,7 @@
#define MOJO_INPUT_EVENT_NAME(name) case EVENT_TYPE_##name: return ui::ET_##name
switch (type) {
-#include "mojo/services/public/cpp/input_events/lib/input_event_names.h"
+#include "mojo/converters/input_events/input_event_names.h"
}
#undef MOJO_INPUT_EVENT_NAME
diff --git a/mojo/services/public/cpp/input_events/input_events_type_converters.h b/mojo/converters/input_events/input_events_type_converters.h
similarity index 77%
rename from mojo/services/public/cpp/input_events/input_events_type_converters.h
rename to mojo/converters/input_events/input_events_type_converters.h
index bbbbe10..0577630 100644
--- a/mojo/services/public/cpp/input_events/input_events_type_converters.h
+++ b/mojo/converters/input_events/input_events_type_converters.h
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_
-#define MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_
+#ifndef MOJO_CONVERTERS_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_
+#define MOJO_CONVERTERS_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_
#include "base/memory/scoped_ptr.h"
-#include "mojo/services/public/cpp/input_events/mojo_input_events_export.h"
+#include "mojo/converters/input_events/mojo_input_events_export.h"
#include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
#include "ui/events/event.h"
@@ -39,4 +39,4 @@
} // namespace mojo
-#endif // MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_
+#endif // MOJO_CONVERTERS_INPUT_EVENTS_INPUT_EVENTS_TYPE_CONVERTERS_H_
diff --git a/mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.cc b/mojo/converters/input_events/mojo_extended_key_event_data.cc
similarity index 90%
rename from mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.cc
rename to mojo/converters/input_events/mojo_extended_key_event_data.cc
index fa93751..8a605dc 100644
--- a/mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.cc
+++ b/mojo/converters/input_events/mojo_extended_key_event_data.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h"
+#include "mojo/converters/input_events/mojo_extended_key_event_data.h"
namespace mojo {
diff --git a/mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h b/mojo/converters/input_events/mojo_extended_key_event_data.h
similarity index 75%
rename from mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h
rename to mojo/converters/input_events/mojo_extended_key_event_data.h
index 15c1c48..b8927e3 100644
--- a/mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h
+++ b/mojo/converters/input_events/mojo_extended_key_event_data.h
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_LIB_MOJO_EXTENDED_KEY_EVENT_DATA_H_
-#define MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_LIB_MOJO_EXTENDED_KEY_EVENT_DATA_H_
+#ifndef MOJO_CONVERTERS_INPUT_EVENTS_MOJO_EXTENDED_KEY_EVENT_DATA_H_
+#define MOJO_CONVERTERS_INPUT_EVENTS_MOJO_EXTENDED_KEY_EVENT_DATA_H_
+#include "mojo/converters/input_events/mojo_input_events_export.h"
#include "ui/events/event.h"
-#include "mojo/services/public/cpp/input_events/mojo_input_events_export.h"
namespace mojo {
@@ -36,4 +36,4 @@
} // namespace mojo
-#endif // MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_LIB_MOJO_EXTENDED_KEY_EVENT_DATA_H_
+#endif // MOJO_CONVERTERS_INPUT_EVENTS_MOJO_EXTENDED_KEY_EVENT_DATA_H_
diff --git a/mojo/services/public/cpp/input_events/mojo_input_events_export.h b/mojo/converters/input_events/mojo_input_events_export.h
similarity index 75%
rename from mojo/services/public/cpp/input_events/mojo_input_events_export.h
rename to mojo/converters/input_events/mojo_input_events_export.h
index d7b193e..747c20a 100644
--- a/mojo/services/public/cpp/input_events/mojo_input_events_export.h
+++ b/mojo/converters/input_events/mojo_input_events_export.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_MOJO_INPUT_EVENTS_EXPORT_H_
-#define MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_MOJO_INPUT_EVENTS_EXPORT_H_
+#ifndef MOJO_CONVERTERS_INPUT_EVENTS_MOJO_INPUT_EVENTS_EXPORT_H_
+#define MOJO_CONVERTERS_INPUT_EVENTS_MOJO_INPUT_EVENTS_EXPORT_H_
#if defined(COMPONENT_BUILD)
@@ -29,4 +29,4 @@
#define MOJO_INPUT_EVENTS_EXPORT
#endif
-#endif // MOJO_SERVICES_PUBLIC_CPP_INPUT_EVENTS_MOJO_INPUT_EVENTS_EXPORT_H_
+#endif // MOJO_CONVERTERS_INPUT_EVENTS_MOJO_INPUT_EVENTS_EXPORT_H_
diff --git a/mojo/services/public/cpp/surfaces/BUILD.gn b/mojo/converters/surfaces/BUILD.gn
similarity index 80%
rename from mojo/services/public/cpp/surfaces/BUILD.gn
rename to mojo/converters/surfaces/BUILD.gn
index 5bd6729..534ea00 100644
--- a/mojo/services/public/cpp/surfaces/BUILD.gn
+++ b/mojo/converters/surfaces/BUILD.gn
@@ -2,22 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_services.gypi:mojo_surfaces_lib
+# GYP version: mojo/mojo_converters.gypi:mojo_surfaces_lib
component("surfaces") {
output_name = "mojo_surfaces_lib"
sources = [
- "lib/surfaces_type_converters.cc",
- "lib/surfaces_utils.cc",
"mojo_surfaces_export.h",
+ "surfaces_type_converters.cc",
"surfaces_type_converters.h",
+ "surfaces_utils.cc",
"surfaces_utils.h",
]
defines = [ "MOJO_SURFACES_IMPLEMENTATION" ]
public_deps = [
- "//mojo/services/public/cpp/geometry",
+ "//mojo/converters/geometry",
"//ui/gfx",
]
diff --git a/mojo/services/public/cpp/surfaces/DEPS b/mojo/converters/surfaces/DEPS
similarity index 100%
rename from mojo/services/public/cpp/surfaces/DEPS
rename to mojo/converters/surfaces/DEPS
diff --git a/mojo/services/public/cpp/surfaces/mojo_surfaces_export.h b/mojo/converters/surfaces/mojo_surfaces_export.h
similarity index 76%
rename from mojo/services/public/cpp/surfaces/mojo_surfaces_export.h
rename to mojo/converters/surfaces/mojo_surfaces_export.h
index 31b408f..15872e6 100644
--- a/mojo/services/public/cpp/surfaces/mojo_surfaces_export.h
+++ b/mojo/converters/surfaces/mojo_surfaces_export.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_SURFACES_MOJO_SURFACES_EXPORT_H_
-#define MOJO_SERVICES_PUBLIC_CPP_SURFACES_MOJO_SURFACES_EXPORT_H_
+#ifndef MOJO_CONVERTERS_SURFACES_MOJO_SURFACES_EXPORT_H_
+#define MOJO_CONVERTERS_SURFACES_MOJO_SURFACES_EXPORT_H_
#if defined(COMPONENT_BUILD)
@@ -29,4 +29,4 @@
#define MOJO_SURFACES_EXPORT
#endif
-#endif // MOJO_SERVICES_PUBLIC_CPP_SURFACES_MOJO_SURFACES_EXPORT_H_
+#endif // MOJO_CONVERTERS_SURFACES_MOJO_SURFACES_EXPORT_H_
diff --git a/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc b/mojo/converters/surfaces/surfaces_type_converters.cc
similarity index 98%
rename from mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc
rename to mojo/converters/surfaces/surfaces_type_converters.cc
index 9d5bd0a..d034b27 100644
--- a/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc
+++ b/mojo/converters/surfaces/surfaces_type_converters.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "base/macros.h"
#include "cc/output/compositor_frame.h"
@@ -16,7 +16,7 @@
#include "cc/quads/texture_draw_quad.h"
#include "cc/quads/tile_draw_quad.h"
#include "cc/quads/yuv_video_draw_quad.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
namespace mojo {
diff --git a/mojo/services/public/cpp/surfaces/surfaces_type_converters.h b/mojo/converters/surfaces/surfaces_type_converters.h
similarity index 94%
rename from mojo/services/public/cpp/surfaces/surfaces_type_converters.h
rename to mojo/converters/surfaces/surfaces_type_converters.h
index 4ef0e2c..5caf314 100644
--- a/mojo/services/public/cpp/surfaces/surfaces_type_converters.h
+++ b/mojo/converters/surfaces/surfaces_type_converters.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_
-#define MOJO_SERVICES_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_
+#ifndef MOJO_CONVERTERS_SURFACES_SURFACES_TYPE_CONVERTERS_H_
+#define MOJO_CONVERTERS_SURFACES_SURFACES_TYPE_CONVERTERS_H_
#include "base/memory/scoped_ptr.h"
#include "cc/resources/returned_resource.h"
@@ -11,7 +11,7 @@
#include "cc/surfaces/surface_id.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/mailbox_holder.h"
-#include "mojo/services/public/cpp/surfaces/mojo_surfaces_export.h"
+#include "mojo/converters/surfaces/mojo_surfaces_export.h"
#include "mojo/services/public/interfaces/surfaces/quads.mojom.h"
#include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h"
#include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
@@ -154,4 +154,4 @@
} // namespace mojo
-#endif // MOJO_SERVICES_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_
+#endif // MOJO_CONVERTERS_SURFACES_SURFACES_TYPE_CONVERTERS_H_
diff --git a/mojo/services/public/cpp/surfaces/lib/surfaces_utils.cc b/mojo/converters/surfaces/surfaces_utils.cc
similarity index 88%
rename from mojo/services/public/cpp/surfaces/lib/surfaces_utils.cc
rename to mojo/converters/surfaces/surfaces_utils.cc
index c35a77a..05ccfe6 100644
--- a/mojo/services/public/cpp/surfaces/lib/surfaces_utils.cc
+++ b/mojo/converters/surfaces/surfaces_utils.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/services/public/cpp/surfaces/surfaces_utils.h"
+#include "mojo/converters/surfaces/surfaces_utils.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/transform.h"
diff --git a/mojo/services/public/cpp/surfaces/surfaces_utils.h b/mojo/converters/surfaces/surfaces_utils.h
similarity index 72%
rename from mojo/services/public/cpp/surfaces/surfaces_utils.h
rename to mojo/converters/surfaces/surfaces_utils.h
index e4c3c83..70de8c0 100644
--- a/mojo/services/public/cpp/surfaces/surfaces_utils.h
+++ b/mojo/converters/surfaces/surfaces_utils.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_SURFACES_SURFACES_UTILS_H_
-#define MOJO_SERVICES_PUBLIC_CPP_SURFACES_SURFACES_UTILS_H_
+#ifndef MOJO_CONVERTERS_SURFACES_SURFACES_UTILS_H_
+#define MOJO_CONVERTERS_SURFACES_SURFACES_UTILS_H_
-#include "mojo/services/public/cpp/surfaces/mojo_surfaces_export.h"
+#include "mojo/converters/surfaces/mojo_surfaces_export.h"
#include "mojo/services/public/interfaces/surfaces/quads.mojom.h"
namespace gfx {
@@ -24,4 +24,4 @@
} // namespace mojo
-#endif // MOJO_SERVICES_PUBLIC_CPP_SURFACES_SURFACES_UTILS_H_
+#endif // MOJO_CONVERTERS_SURFACES_SURFACES_UTILS_H_
diff --git a/mojo/services/public/cpp/surfaces/tests/BUILD.gn b/mojo/converters/surfaces/tests/BUILD.gn
similarity index 80%
rename from mojo/services/public/cpp/surfaces/tests/BUILD.gn
rename to mojo/converters/surfaces/tests/BUILD.gn
index 4211eff..4f09c5c 100644
--- a/mojo/services/public/cpp/surfaces/tests/BUILD.gn
+++ b/mojo/converters/surfaces/tests/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_services.gypi:mojo_surfaces_lib_unittests
+# GYP version: mojo/mojo_converters.gypi:mojo_surfaces_lib_unittests
test("mojo_surfaces_lib_unittests") {
deps = [
"//base",
@@ -10,10 +10,10 @@
"//cc",
"//cc/surfaces",
"//gpu",
+ "//mojo/converters/geometry",
+ "//mojo/converters/surfaces",
"//mojo/edk/test:run_all_unittests",
"//mojo/environment:chromium",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/surfaces",
"//skia",
diff --git a/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc b/mojo/converters/surfaces/tests/surface_unittest.cc
similarity index 98%
rename from mojo/services/public/cpp/surfaces/tests/surface_unittest.cc
rename to mojo/converters/surfaces/tests/surface_unittest.cc
index 9076e5f..4b1fd21 100644
--- a/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc
+++ b/mojo/converters/surfaces/tests/surface_unittest.cc
@@ -8,8 +8,8 @@
#include "cc/quads/texture_draw_quad.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/mailbox_holder.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkXfermode.h"
diff --git a/mojo/edk/embedder/embedder.cc b/mojo/edk/embedder/embedder.cc
index cb84f3e..888e883 100644
--- a/mojo/edk/embedder/embedder.cc
+++ b/mojo/edk/embedder/embedder.cc
@@ -11,7 +11,6 @@
#include "mojo/edk/embedder/platform_support.h"
#include "mojo/edk/system/channel.h"
#include "mojo/edk/system/channel_endpoint.h"
-#include "mojo/edk/system/channel_endpoint_id.h"
#include "mojo/edk/system/core.h"
#include "mojo/edk/system/entrypoints.h"
#include "mojo/edk/system/message_pipe_dispatcher.h"
@@ -57,20 +56,7 @@
// Once |Init()| has succeeded, we have to return |channel| (since
// |Shutdown()| will have to be called on it).
- // Attach the endpoint.
- system::ChannelEndpointId endpoint_id =
- channel->AttachEndpoint(channel_endpoint);
- if (!endpoint_id.is_valid()) {
- // This means that, e.g., the other endpoint of the message pipe was closed
- // first. But it's not necessarily an error per se.
- DVLOG(2) << "Channel::AttachEndpoint() failed";
- return channel;
- }
- CHECK_EQ(endpoint_id, system::ChannelEndpointId::GetBootstrap());
-
- channel->RunEndpoint(channel_endpoint,
- system::ChannelEndpointId::GetBootstrap());
-
+ channel->AttachAndRunEndpoint(channel_endpoint, true);
return channel;
}
diff --git a/mojo/edk/mojo_edk.gyp b/mojo/edk/mojo_edk.gyp
index ac5ba95..58dae52 100644
--- a/mojo/edk/mojo_edk.gyp
+++ b/mojo/edk/mojo_edk.gyp
@@ -84,8 +84,11 @@
'../public/cpp/bindings/tests/bounds_checker_unittest.cc',
'../public/cpp/bindings/tests/buffer_unittest.cc',
'../public/cpp/bindings/tests/connector_unittest.cc',
+ '../public/cpp/bindings/tests/container_test_util.cc',
+ '../public/cpp/bindings/tests/equals_unittest.cc',
'../public/cpp/bindings/tests/handle_passing_unittest.cc',
'../public/cpp/bindings/tests/interface_ptr_unittest.cc',
+ '../public/cpp/bindings/tests/map_unittest.cc',
'../public/cpp/bindings/tests/request_response_unittest.cc',
'../public/cpp/bindings/tests/router_unittest.cc',
'../public/cpp/bindings/tests/sample_service_unittest.cc',
@@ -229,6 +232,7 @@
'system/channel.h',
'system/channel_endpoint.cc',
'system/channel_endpoint.h',
+ 'system/channel_endpoint_id.cc',
'system/channel_endpoint_id.h',
'system/constants.h',
'system/core.cc',
@@ -308,6 +312,7 @@
'embedder/embedder_unittest.cc',
'embedder/platform_channel_pair_posix_unittest.cc',
'embedder/simple_platform_shared_buffer_unittest.cc',
+ 'system/channel_endpoint_id_unittest.cc',
'system/channel_unittest.cc',
'system/core_unittest.cc',
'system/core_test_base.cc',
diff --git a/mojo/edk/system/BUILD.gn b/mojo/edk/system/BUILD.gn
index 7baec81..250bcaf 100644
--- a/mojo/edk/system/BUILD.gn
+++ b/mojo/edk/system/BUILD.gn
@@ -30,6 +30,7 @@
"channel.h",
"channel_endpoint.cc",
"channel_endpoint.h",
+ "channel_endpoint_id.cc",
"channel_endpoint_id.h",
"constants.h",
"core.cc",
@@ -98,6 +99,7 @@
sources = [
"../test/multiprocess_test_helper_unittest.cc",
+ "channel_endpoint_id_unittest.cc",
"channel_unittest.cc",
"core_test_base.cc",
"core_test_base.h",
diff --git a/mojo/edk/system/channel.cc b/mojo/edk/system/channel.cc
index 50411b3..0582b23 100644
--- a/mojo/edk/system/channel.cc
+++ b/mojo/edk/system/channel.cc
@@ -125,6 +125,42 @@
endpoint->Run(remote_id);
}
+void Channel::AttachAndRunEndpoint(scoped_refptr<ChannelEndpoint> endpoint,
+ bool is_bootstrap) {
+ DCHECK(endpoint.get());
+
+ ChannelEndpointId local_id;
+ ChannelEndpointId remote_id;
+ {
+ base::AutoLock locker(lock_);
+
+ DLOG_IF(WARNING, is_shutting_down_)
+ << "AttachEndpoint() while shutting down";
+
+ if (is_bootstrap) {
+ local_id = ChannelEndpointId::GetBootstrap();
+ DCHECK(local_id_to_endpoint_map_.find(local_id) ==
+ local_id_to_endpoint_map_.end());
+
+ remote_id = ChannelEndpointId::GetBootstrap();
+ } else {
+ // TODO(vtl): More work needs to be done to enable the non-bootstrap case.
+ NOTREACHED() << "Non-bootstrap case not yet fully implemented";
+ do {
+ local_id = local_id_generator_.GetNext();
+ } while (local_id_to_endpoint_map_.find(local_id) !=
+ local_id_to_endpoint_map_.end());
+
+ // TODO(vtl): We also need to check for collisions of remote IDs here.
+ remote_id = remote_id_generator_.GetNext();
+ }
+
+ local_id_to_endpoint_map_[local_id] = endpoint;
+ }
+
+ endpoint->AttachAndRun(this, local_id, remote_id);
+}
+
void Channel::RunRemoteMessagePipeEndpoint(ChannelEndpointId local_id,
ChannelEndpointId remote_id) {
#if DCHECK_IS_ON
diff --git a/mojo/edk/system/channel.h b/mojo/edk/system/channel.h
index 5ece5da..57bd9ce 100644
--- a/mojo/edk/system/channel.h
+++ b/mojo/edk/system/channel.h
@@ -71,22 +71,25 @@
// may be called multiple times, or not at all.)
void WillShutdownSoon();
- // Attaches the given endpoint to this channel. This assigns it a local ID,
- // which it returns. The first endpoint attached will always have
- // |ChannelEndpointId::GetBootstrap()| as its local ID. (For bootstrapping,
- // this occurs on both sides, so one should use that same bootstrap ID for the
- // remote ID for the first message pipe across a channel.) Returns an invalid
- // |ChannelEndpointId| on failure.
- // TODO(vtl): This should be combined with "run", and it should take a
- // |ChannelEndpoint| instead.
- // TODO(vtl): Maybe limit the number of attached message pipes.
+ // TODO(vtl): Remove these once |AttachAndRunEndpoint()| is fully implemented
+ // and everything is converted to use it.
ChannelEndpointId AttachEndpoint(scoped_refptr<ChannelEndpoint> endpoint);
-
- // Runs the given endpoint (which must have been attached to this |Channel|,
- // and not detached), assigning it the specified |remote_id|.
void RunEndpoint(scoped_refptr<ChannelEndpoint> endpoint,
ChannelEndpointId remote_id);
+ // Attaches the given endpoint to this channel and runs it. |is_bootstrap|
+ // should be set if and only if it is the first endpoint on the channel. This
+ // assigns the endpoint both local and remote IDs. If |is_bootstrap| is set,
+ // both are the bootstrap ID (given by |ChannelEndpointId::GetBootstrap()|).
+ //
+ // (Bootstrapping is symmetric: Both sides attach and run endpoints with
+ // |is_bootstrap| set, which establishes the first message pipe across a
+ // channel.)
+ //
+ // TODO(vtl): Maybe limit the number of attached message pipes.
+ void AttachAndRunEndpoint(scoped_refptr<ChannelEndpoint> endpoint,
+ bool is_bootstrap);
+
// Tells the other side of the channel to run a message pipe endpoint (which
// must already be attached); |local_id| and |remote_id| are relative to this
// channel (i.e., |local_id| is the other side's remote ID and |remote_id| is
@@ -183,6 +186,10 @@
// Note: The IDs generated by this should be checked for existence before use.
LocalChannelEndpointIdGenerator local_id_generator_;
+ // TODO(vtl): We need to keep track of remote IDs (so that we don't collide
+ // if/when we wrap).
+ RemoteChannelEndpointIdGenerator remote_id_generator_;
+
DISALLOW_COPY_AND_ASSIGN(Channel);
};
diff --git a/mojo/edk/system/channel_endpoint.cc b/mojo/edk/system/channel_endpoint.cc
index 6fa44f1..0318f2f 100644
--- a/mojo/edk/system/channel_endpoint.cc
+++ b/mojo/edk/system/channel_endpoint.cc
@@ -93,6 +93,27 @@
}
}
+void ChannelEndpoint::AttachAndRun(Channel* channel,
+ ChannelEndpointId local_id,
+ ChannelEndpointId remote_id) {
+ DCHECK(channel);
+ DCHECK(local_id.is_valid());
+ DCHECK(remote_id.is_valid());
+
+ base::AutoLock locker(lock_);
+ DCHECK(!channel_);
+ DCHECK(!local_id_.is_valid());
+ DCHECK(!remote_id_.is_valid());
+ channel_ = channel;
+ local_id_ = local_id;
+ remote_id_ = remote_id;
+
+ while (!paused_message_queue_.IsEmpty()) {
+ LOG_IF(WARNING, !WriteMessageNoLock(paused_message_queue_.GetMessage()))
+ << "Failed to write enqueue message to channel";
+ }
+}
+
bool ChannelEndpoint::OnReadMessage(
const MessageInTransit::View& message_view,
embedder::ScopedPlatformHandleVectorPtr platform_handles) {
diff --git a/mojo/edk/system/channel_endpoint.h b/mojo/edk/system/channel_endpoint.h
index cc5f736..5650c2f 100644
--- a/mojo/edk/system/channel_endpoint.h
+++ b/mojo/edk/system/channel_endpoint.h
@@ -131,12 +131,17 @@
// Methods called by |Channel|:
- // Called by |Channel| when it takes a reference to this object.
+ // TODO(vtl): Remove these once we've switched over to |AttachAndRun()|.
void AttachToChannel(Channel* channel, ChannelEndpointId local_id);
-
- // TODO(vtl): Combine this with |AttachToChannel()|.
void Run(ChannelEndpointId remote_id);
+ // Called by |Channel| when it takes a reference to this object. It will send
+ // all queue messages (in |paused_message_queue_|).
+ // TODO(vtl): Maybe rename this "OnAttach"?
+ void AttachAndRun(Channel* channel,
+ ChannelEndpointId local_id,
+ ChannelEndpointId remote_id);
+
// Called by |Channel| when it receives a message for the message pipe.
bool OnReadMessage(const MessageInTransit::View& message_view,
embedder::ScopedPlatformHandleVectorPtr platform_handles);
diff --git a/mojo/edk/system/channel_endpoint_id.cc b/mojo/edk/system/channel_endpoint_id.cc
new file mode 100644
index 0000000..ed00f6a
--- /dev/null
+++ b/mojo/edk/system/channel_endpoint_id.cc
@@ -0,0 +1,30 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/edk/system/channel_endpoint_id.h"
+
+#include "base/compiler_specific.h"
+
+namespace mojo {
+namespace system {
+
+STATIC_CONST_MEMBER_DEFINITION const uint32_t ChannelEndpointId::kRemoteFlag;
+
+ChannelEndpointId LocalChannelEndpointIdGenerator::GetNext() {
+ ChannelEndpointId rv = next_;
+ next_.value_ = (next_.value_ + 1) & ~ChannelEndpointId::kRemoteFlag;
+ // Skip over the invalid value, in case we wrap.
+ if (!next_.is_valid())
+ next_.value_++;
+ return rv;
+}
+
+ChannelEndpointId RemoteChannelEndpointIdGenerator::GetNext() {
+ ChannelEndpointId rv = next_;
+ next_.value_ = (next_.value_ + 1) | ChannelEndpointId::kRemoteFlag;
+ return rv;
+}
+
+} // namespace system
+} // namespace mojo
diff --git a/mojo/edk/system/channel_endpoint_id.h b/mojo/edk/system/channel_endpoint_id.h
index fc1ad60..3643517 100644
--- a/mojo/edk/system/channel_endpoint_id.h
+++ b/mojo/edk/system/channel_endpoint_id.h
@@ -11,8 +11,10 @@
#include <ostream>
#include "base/containers/hash_tables.h"
+#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "build/build_config.h"
+#include "mojo/edk/system/system_impl_export.h"
namespace mojo {
namespace system {
@@ -20,21 +22,28 @@
// ChannelEndpointId -----------------------------------------------------------
class LocalChannelEndpointIdGenerator;
+FORWARD_DECLARE_TEST(LocalChannelEndpointIdGeneratorTest, WrapAround);
+FORWARD_DECLARE_TEST(RemoteChannelEndpointIdGeneratorTest, WrapAround);
// Represents an ID for an endpoint (i.e., one side of a message pipe) on a
// |Channel|. This class must be POD.
-class ChannelEndpointId {
+//
+// Note: The terminology "remote" for a |ChannelEndpointId| means a destination
+// ID that was actually allocated by the sender, or similarly a source ID that
+// was allocated by the receiver.
+//
+// From the standpoint of the |Channel| with such a remote ID in its endpoint
+// table, such an ID is a "remotely-allocated local ID". From the standpoint of
+// the |Channel| allocating such a remote ID (for its peer |Channel|), it's a
+// "locally-allocated remote ID".
+class MOJO_SYSTEM_IMPL_EXPORT ChannelEndpointId {
public:
ChannelEndpointId() : value_(0) {}
ChannelEndpointId(const ChannelEndpointId& other) : value_(other.value_) {}
// Returns the local ID to use for the first message pipe endpoint on a
// channel.
- static ChannelEndpointId GetBootstrap() {
- ChannelEndpointId rv;
- rv.value_ = 1;
- return rv;
- }
+ static ChannelEndpointId GetBootstrap() { return ChannelEndpointId(1); }
bool operator==(const ChannelEndpointId& other) const {
return value_ == other.value_;
@@ -48,10 +57,19 @@
}
bool is_valid() const { return !!value_; }
+ bool is_remote() const { return !!(value_ & kRemoteFlag); }
uint32_t value() const { return value_; }
+ // Flag set in |value()| if this is a remote ID.
+ static const uint32_t kRemoteFlag = 0x80000000u;
+
private:
friend class LocalChannelEndpointIdGenerator;
+ FRIEND_TEST_ALL_PREFIXES(LocalChannelEndpointIdGeneratorTest, WrapAround);
+ friend class RemoteChannelEndpointIdGenerator;
+ FRIEND_TEST_ALL_PREFIXES(RemoteChannelEndpointIdGeneratorTest, WrapAround);
+
+ explicit ChannelEndpointId(uint32_t value) : value_(value) {}
uint32_t value_;
@@ -71,29 +89,44 @@
// LocalChannelEndpointIdGenerator ---------------------------------------------
-// A simple generator for "new" local |ChannelEndpointId|s. It does not track
+// A generator for "new" local |ChannelEndpointId|s. It does not track
// used/existing IDs; that must be done separately. (This class is not
// thread-safe.)
-class LocalChannelEndpointIdGenerator {
+class MOJO_SYSTEM_IMPL_EXPORT LocalChannelEndpointIdGenerator {
public:
LocalChannelEndpointIdGenerator()
- : next_channel_endpoint_id_(ChannelEndpointId::GetBootstrap()) {}
+ : next_(ChannelEndpointId::GetBootstrap()) {}
- ChannelEndpointId GetNext() {
- ChannelEndpointId rv = next_channel_endpoint_id_;
- next_channel_endpoint_id_.value_++;
- // Skip over the invalid value, in case we wrap.
- if (!next_channel_endpoint_id_.is_valid())
- next_channel_endpoint_id_.value_++;
- return rv;
- }
+ ChannelEndpointId GetNext();
private:
- ChannelEndpointId next_channel_endpoint_id_;
+ FRIEND_TEST_ALL_PREFIXES(LocalChannelEndpointIdGeneratorTest, WrapAround);
+
+ ChannelEndpointId next_;
DISALLOW_COPY_AND_ASSIGN(LocalChannelEndpointIdGenerator);
};
+// RemoteChannelEndpointIdGenerator --------------------------------------------
+
+// A generator for "new" remote |ChannelEndpointId|s, for |Channel|s to
+// locally allocate remote IDs. (See the comment above |ChannelEndpointId| for
+// an explanatory note.) It does not track used/existing IDs; that must be done
+// separately. (This class is not thread-safe.)
+class MOJO_SYSTEM_IMPL_EXPORT RemoteChannelEndpointIdGenerator {
+ public:
+ RemoteChannelEndpointIdGenerator() : next_(ChannelEndpointId::kRemoteFlag) {}
+
+ ChannelEndpointId GetNext();
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(RemoteChannelEndpointIdGeneratorTest, WrapAround);
+
+ ChannelEndpointId next_;
+
+ DISALLOW_COPY_AND_ASSIGN(RemoteChannelEndpointIdGenerator);
+};
+
} // namespace system
} // namespace mojo
diff --git a/mojo/edk/system/channel_endpoint_id_unittest.cc b/mojo/edk/system/channel_endpoint_id_unittest.cc
new file mode 100644
index 0000000..a5bd14f
--- /dev/null
+++ b/mojo/edk/system/channel_endpoint_id_unittest.cc
@@ -0,0 +1,155 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/edk/system/channel_endpoint_id.h"
+
+#include <sstream>
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mojo {
+namespace system {
+namespace {
+
+TEST(ChannelEndpointIdTest, Basic) {
+ ChannelEndpointId invalid;
+ ChannelEndpointId bootstrap(ChannelEndpointId::GetBootstrap());
+
+ EXPECT_EQ(invalid, invalid);
+ EXPECT_EQ(bootstrap, bootstrap);
+ EXPECT_FALSE(invalid == bootstrap);
+
+ EXPECT_FALSE(invalid != invalid);
+ EXPECT_FALSE(bootstrap != bootstrap);
+ EXPECT_NE(invalid, bootstrap);
+
+ EXPECT_FALSE(invalid < invalid);
+ EXPECT_LT(invalid, bootstrap);
+
+ EXPECT_FALSE(invalid.is_valid());
+ EXPECT_TRUE(bootstrap.is_valid());
+
+ EXPECT_FALSE(invalid.is_remote());
+ EXPECT_FALSE(bootstrap.is_remote());
+
+ // Test assignment.
+ ChannelEndpointId copy;
+ copy = bootstrap;
+ EXPECT_EQ(copy, bootstrap);
+ copy = invalid;
+ EXPECT_EQ(copy, invalid);
+}
+
+// Tests values of invalid and bootstrap IDs. (This tests implementation
+// details.)
+TEST(ChannelEndpointIdTest, Value) {
+ EXPECT_EQ(0u, ChannelEndpointId().value());
+ EXPECT_EQ(1u, ChannelEndpointId::GetBootstrap().value());
+}
+
+// Tests ostream output. (This tests implementation details.)
+TEST(ChannelEndpointIdTest, Ostream) {
+ {
+ std::ostringstream stream;
+ stream << ChannelEndpointId();
+ EXPECT_EQ("0", stream.str());
+ }
+ {
+ std::ostringstream stream;
+ stream << ChannelEndpointId::GetBootstrap();
+ EXPECT_EQ("1", stream.str());
+ }
+}
+
+TEST(LocalChannelEndpointIdGeneratorTest, Basic) {
+ LocalChannelEndpointIdGenerator gen;
+
+ ChannelEndpointId id1;
+ EXPECT_FALSE(id1.is_valid()); // Check sanity.
+
+ id1 = gen.GetNext();
+ EXPECT_TRUE(id1.is_valid());
+ EXPECT_FALSE(id1.is_remote());
+
+ EXPECT_EQ(ChannelEndpointId::GetBootstrap().value(), id1.value());
+
+ ChannelEndpointId id2 = gen.GetNext();
+ EXPECT_TRUE(id2.is_valid());
+ EXPECT_FALSE(id2.is_remote());
+ // Technically, nonequality here is an implementation detail, since, e.g.,
+ // random generation of IDs would be a valid implementation.
+ EXPECT_NE(id2, id1);
+ // ... but right now we just increment to generate IDs.
+ EXPECT_EQ(2u, id2.value());
+}
+
+// Note: LocalChannelEndpointIdGeneratorTest.WrapAround is defined further
+// below, outside the anonymous namespace.
+
+TEST(RemoteChannelEndpointIdGeneratorTest, Basic) {
+ RemoteChannelEndpointIdGenerator gen;
+
+ ChannelEndpointId id1;
+ EXPECT_FALSE(id1.is_valid()); // Check sanity.
+
+ id1 = gen.GetNext();
+ EXPECT_TRUE(id1.is_valid());
+ EXPECT_TRUE(id1.is_remote());
+
+ // This tests an implementation detail.
+ EXPECT_EQ(ChannelEndpointId::kRemoteFlag, id1.value());
+
+ ChannelEndpointId id2 = gen.GetNext();
+ EXPECT_TRUE(id2.is_valid());
+ EXPECT_TRUE(id2.is_remote());
+ // Technically, nonequality here is an implementation detail, since, e.g.,
+ // random generation of IDs would be a valid implementation.
+ EXPECT_NE(id2, id1);
+ // ... but right now we just increment to generate IDs.
+ EXPECT_EQ(ChannelEndpointId::kRemoteFlag + 1, id2.value());
+}
+
+// Note: RemoteChannelEndpointIdGeneratorTest.WrapAround is defined further
+// below, outside the anonymous namespace.
+
+} // namespace
+
+// Tests that |LocalChannelEndpointIdGenerator| handles wrap-around correctly.
+// (This tests implementation details.) This test isn't in an anonymous
+// namespace, since it needs to be friended.
+TEST(LocalChannelEndpointIdGeneratorTest, WrapAround) {
+ LocalChannelEndpointIdGenerator gen;
+ gen.next_ = ChannelEndpointId(ChannelEndpointId::kRemoteFlag - 1);
+
+ ChannelEndpointId id = gen.GetNext();
+ EXPECT_TRUE(id.is_valid());
+ EXPECT_FALSE(id.is_remote());
+ EXPECT_EQ(ChannelEndpointId::kRemoteFlag - 1, id.value());
+
+ id = gen.GetNext();
+ EXPECT_TRUE(id.is_valid());
+ EXPECT_FALSE(id.is_remote());
+ EXPECT_EQ(1u, id.value());
+}
+
+// Tests that |RemoteChannelEndpointIdGenerator| handles wrap-around correctly.
+// (This tests implementation details.) This test isn't in an anonymous
+// namespace, since it needs to be friended.
+TEST(RemoteChannelEndpointIdGeneratorTest, WrapAround) {
+ RemoteChannelEndpointIdGenerator gen;
+ gen.next_ = ChannelEndpointId(~0u);
+
+ ChannelEndpointId id = gen.GetNext();
+ EXPECT_TRUE(id.is_valid());
+ EXPECT_TRUE(id.is_remote());
+ EXPECT_EQ(~0u, id.value());
+
+ id = gen.GetNext();
+ EXPECT_TRUE(id.is_valid());
+ EXPECT_TRUE(id.is_remote());
+ EXPECT_EQ(ChannelEndpointId::kRemoteFlag, id.value());
+}
+
+} // namespace system
+} // namespace mojo
diff --git a/mojo/edk/system/channel_unittest.cc b/mojo/edk/system/channel_unittest.cc
index 8ac23e1..e5a9508 100644
--- a/mojo/edk/system/channel_unittest.cc
+++ b/mojo/edk/system/channel_unittest.cc
@@ -236,15 +236,7 @@
scoped_refptr<MessagePipe> mp(
MessagePipe::CreateLocalProxy(&channel_endpoint));
- ChannelEndpointId local_id = channel()->AttachEndpoint(channel_endpoint);
- EXPECT_EQ(ChannelEndpointId::GetBootstrap(), local_id);
-
- // TODO(vtl): Currently, we always "expect" a |RunMessagePipeEndpoint()| after
- // an |AttachEndpoint()| (which is actually incorrect). We need to refactor
- // |AttachEndpoint()| to indicate whether |Run...()| will necessarily be
- // called or not. (Then, in the case that it may not be called, we should test
- // a |Shutdown()| without the |Run...()|.)
- channel()->RunEndpoint(channel_endpoint, ChannelEndpointId::GetBootstrap());
+ channel()->AttachAndRunEndpoint(channel_endpoint, true);
Waiter waiter;
waiter.Init();
@@ -287,10 +279,7 @@
scoped_refptr<MessagePipe> mp(
MessagePipe::CreateLocalProxy(&channel_endpoint));
- ChannelEndpointId local_id = channel()->AttachEndpoint(channel_endpoint);
- EXPECT_EQ(ChannelEndpointId::GetBootstrap(), local_id);
-
- channel()->RunEndpoint(channel_endpoint, ChannelEndpointId::GetBootstrap());
+ channel()->AttachAndRunEndpoint(channel_endpoint, true);
io_thread()->PostTaskAndWait(
FROM_HERE,
diff --git a/mojo/edk/system/data_pipe.cc b/mojo/edk/system/data_pipe.cc
index ace5fd3..e9c4903 100644
--- a/mojo/edk/system/data_pipe.cc
+++ b/mojo/edk/system/data_pipe.cc
@@ -9,7 +9,6 @@
#include <algorithm>
#include <limits>
-#include "base/compiler_specific.h"
#include "base/logging.h"
#include "mojo/edk/system/constants.h"
#include "mojo/edk/system/memory.h"
@@ -442,7 +441,7 @@
producer_two_phase_max_num_bytes_written_(0),
consumer_two_phase_max_num_bytes_read_(0) {
// Check that the passed in options actually are validated.
- MojoCreateDataPipeOptions unused ALLOW_UNUSED = {0};
+ MojoCreateDataPipeOptions unused = {0};
DCHECK_EQ(ValidateCreateOptions(MakeUserPointer(&validated_options), &unused),
MOJO_RESULT_OK);
}
diff --git a/mojo/edk/system/message_pipe_test_utils.cc b/mojo/edk/system/message_pipe_test_utils.cc
index 879a6da..8f217ca 100644
--- a/mojo/edk/system/message_pipe_test_utils.cc
+++ b/mojo/edk/system/message_pipe_test_utils.cc
@@ -78,16 +78,13 @@
channel_ = new Channel(platform_support_);
CHECK(channel_->Init(RawChannel::Create(platform_handle.Pass())));
- // Attach the message pipe endpoint.
- // Note: On the "server" (parent process) side, we need not attach the
- // message pipe endpoint immediately. However, on the "client" (child
- // process) side, this *must* be done here -- otherwise, the |Channel| may
- // receive/process messages (which it can do as soon as it's hooked up to
- // the IO thread message loop, and that message loop runs) before the
- // message pipe endpoint is attached.
- CHECK_EQ(channel_->AttachEndpoint(channel_endpoint),
- ChannelEndpointId::GetBootstrap());
- channel_->RunEndpoint(channel_endpoint, ChannelEndpointId::GetBootstrap());
+ // Attach and run the endpoint.
+ // Note: On the "server" (parent process) side, we need not attach/run the
+ // endpoint immediately. However, on the "client" (child process) side, this
+ // *must* be done here -- otherwise, the |Channel| may receive/process
+ // messages (which it can do as soon as it's hooked up to the IO thread
+ // message loop, and that message loop runs) before the endpoint is attached.
+ channel_->AttachAndRunEndpoint(channel_endpoint, true);
}
void ChannelThread::ShutdownChannelOnIOThread() {
diff --git a/mojo/edk/system/remote_message_pipe_unittest.cc b/mojo/edk/system/remote_message_pipe_unittest.cc
index 0193393..f7095d2 100644
--- a/mojo/edk/system/remote_message_pipe_unittest.cc
+++ b/mojo/edk/system/remote_message_pipe_unittest.cc
@@ -150,14 +150,7 @@
CHECK(channel_index == 0 || channel_index == 1);
CreateAndInitChannel(channel_index);
- ChannelEndpointId endpoint_id =
- channels_[channel_index]->AttachEndpoint(ep);
- if (!endpoint_id.is_valid())
- return;
-
- CHECK_EQ(endpoint_id, ChannelEndpointId::GetBootstrap());
- channels_[channel_index]->RunEndpoint(ep,
- ChannelEndpointId::GetBootstrap());
+ channels_[channel_index]->AttachAndRunEndpoint(ep, true);
}
void RestoreInitialStateOnIOThread() {
diff --git a/mojo/examples/BUILD.gn b/mojo/examples/BUILD.gn
index 7708161..bdd09f7 100644
--- a/mojo/examples/BUILD.gn
+++ b/mojo/examples/BUILD.gn
@@ -9,9 +9,10 @@
deps = [
"//mojo/examples/apptest",
- "//mojo/examples/compositor_app",
"//mojo/examples/content_handler_demo",
"//mojo/examples/echo",
+ "//mojo/examples/http_server",
+ "//mojo/examples/pepper_container_app",
"//mojo/examples/png_viewer",
"//mojo/examples/sample_app",
"//mojo/examples/surfaces_app",
diff --git a/mojo/examples/apptest/example_apptest.cc b/mojo/examples/apptest/example_apptest.cc
index cd1c7d8..c754c85 100644
--- a/mojo/examples/apptest/example_apptest.cc
+++ b/mojo/examples/apptest/example_apptest.cc
@@ -2,13 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <limits.h>
+
#include "mojo/examples/apptest/example_client_application.h"
#include "mojo/examples/apptest/example_client_impl.h"
#include "mojo/examples/apptest/example_service.mojom.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/bindings/array.h"
#include "mojo/public/cpp/bindings/callback.h"
+#include "mojo/public/cpp/bindings/string.h"
#include "mojo/public/cpp/environment/environment.h"
+#include "mojo/public/cpp/environment/logging.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/cpp/utility/run_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -89,10 +94,19 @@
g_application_impl_hack = &app;
MOJO_CHECK(app.WaitForInitialize());
- // TODO(msw): Plumb commandline arguments through app->args().
- int argc = 0;
- char** argv = NULL;
- testing::InitGoogleTest(&argc, argv);
+ {
+ // InitGoogleTest expects (argc + 1) elements, including a terminating NULL.
+ // It also removes GTEST arguments from |argv| and updates the |argc| count.
+ const mojo::Array<mojo::String>& args = app.args();
+ MOJO_CHECK(args.size() < INT_MAX);
+ int argc = static_cast<int>(args.size());
+ std::vector<char*> argv(argc + 1);
+ for (int i = 0; i < argc; ++i)
+ argv[i] = const_cast<char*>(args[i].data());
+ argv[argc] = NULL;
+ testing::InitGoogleTest(&argc, &argv[0]);
+ }
+
mojo_ignore_result(RUN_ALL_TESTS());
delete delegate;
diff --git a/mojo/examples/aura_demo/BUILD.gn b/mojo/examples/aura_demo/BUILD.gn
index ba2fc37..ecd1843 100644
--- a/mojo/examples/aura_demo/BUILD.gn
+++ b/mojo/examples/aura_demo/BUILD.gn
@@ -24,10 +24,10 @@
"//ui/gfx/geometry",
"//mojo/application",
"//mojo/common",
+ "//mojo/converters/geometry",
"//mojo/aura",
"//mojo/public/c/system:for_shared_library",
"//mojo/services/public/interfaces/geometry",
- "//mojo/services/public/cpp/geometry",
"//mojo/services/public/cpp/view_manager",
]
diff --git a/mojo/examples/bitmap_uploader/BUILD.gn b/mojo/examples/bitmap_uploader/BUILD.gn
index 1ed540e..3606c44 100644
--- a/mojo/examples/bitmap_uploader/BUILD.gn
+++ b/mojo/examples/bitmap_uploader/BUILD.gn
@@ -21,16 +21,16 @@
deps = [
"//gpu",
"//mojo/application",
+ "//mojo/converters/geometry",
+ "//mojo/converters/surfaces",
"//mojo/public/cpp/bindings:bindings",
"//mojo/public/interfaces/application",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/input_events:input_events",
"//mojo/services/public/interfaces/surfaces:surface_id",
"//mojo/services/public/interfaces/view_manager",
- "//mojo/services/public/interfaces/window_manager",
+ "//mojo/services/public/interfaces/window_manager2",
"//ui/events",
"//ui/gfx",
]
diff --git a/mojo/examples/bitmap_uploader/bitmap_uploader.cc b/mojo/examples/bitmap_uploader/bitmap_uploader.cc
index facc58a..ef19156 100644
--- a/mojo/examples/bitmap_uploader/bitmap_uploader.cc
+++ b/mojo/examples/bitmap_uploader/bitmap_uploader.cc
@@ -14,12 +14,12 @@
#include "gpu/GLES2/gl2chromium.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/common/mailbox.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_utils.h"
#include "mojo/public/c/gles2/gles2.h"
#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_utils.h"
#include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "ui/gfx/geometry/rect.h"
diff --git a/mojo/examples/browser/BUILD.gn b/mojo/examples/browser/BUILD.gn
index 2a62913..3228870 100644
--- a/mojo/examples/browser/BUILD.gn
+++ b/mojo/examples/browser/BUILD.gn
@@ -20,10 +20,10 @@
"//mojo/application",
"//mojo/aura",
"//mojo/common",
+ "//mojo/converters/geometry",
+ "//mojo/converters/input_events",
"//mojo/examples/window_manager:bindings",
"//mojo/public/c/system:for_shared_library",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/input_events",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/input_events",
diff --git a/mojo/examples/browser/browser.cc b/mojo/examples/browser/browser.cc
index 2f22d16..39ddc6b 100644
--- a/mojo/examples/browser/browser.cc
+++ b/mojo/examples/browser/browser.cc
@@ -7,13 +7,13 @@
#include "base/strings/utf_string_conversions.h"
#include "mojo/application/application_runner_chromium.h"
#include "mojo/common/common_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/examples/window_manager/window_manager.mojom.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/connect.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
#include "mojo/services/public/cpp/view_manager/view.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h"
diff --git a/mojo/examples/compositor_app/BUILD.gn b/mojo/examples/compositor_app/BUILD.gn
deleted file mode 100644
index 8ef8ad7..0000000
--- a/mojo/examples/compositor_app/BUILD.gn
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# GYP version mojo/mojo_examples.gypi:mojo_compositor_app
-shared_library("compositor_app") {
- output_name = "mojo_compositor_app"
-
- sources = [
- "compositor_app.cc",
- "compositor_host.cc",
- "compositor_host.h",
- ]
-
- deps = [
- "//base",
- "//cc",
- "//mojo/application",
- "//mojo/cc",
- "//mojo/common",
- "//mojo/public/c/system:for_shared_library",
- "//mojo/public/gles2:for_shared_library",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/interfaces/geometry",
- "//mojo/services/public/interfaces/gpu",
- "//mojo/services/public/interfaces/native_viewport",
- ]
-}
diff --git a/mojo/examples/compositor_app/DEPS b/mojo/examples/compositor_app/DEPS
deleted file mode 100644
index 70688d6..0000000
--- a/mojo/examples/compositor_app/DEPS
+++ /dev/null
@@ -1,6 +0,0 @@
-include_rules = [
- "+cc",
- "-cc/blink",
- "+ui/gfx",
- "+gpu/command_buffer/client",
-]
diff --git a/mojo/examples/compositor_app/compositor_app.cc b/mojo/examples/compositor_app/compositor_app.cc
deleted file mode 100644
index 516edbb..0000000
--- a/mojo/examples/compositor_app/compositor_app.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdio.h>
-#include <string>
-
-#include "base/bind.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "mojo/application/application_runner_chromium.h"
-#include "mojo/examples/compositor_app/compositor_host.h"
-#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/application_impl.h"
-#include "mojo/public/cpp/system/core.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
-#include "mojo/services/public/interfaces/native_viewport/native_viewport.mojom.h"
-#include "ui/gfx/rect.h"
-
-namespace mojo {
-namespace examples {
-
-class SampleApp : public ApplicationDelegate, public NativeViewportClient {
- public:
- SampleApp() : weak_factory_(this) {}
- virtual ~SampleApp() {}
-
- virtual void Initialize(ApplicationImpl* app) override {
- app->ConnectToService("mojo:mojo_native_viewport_service", &viewport_);
- viewport_.set_client(this);
- viewport_->Create(Size::From(gfx::Size(800, 600)),
- base::Bind(&SampleApp::OnCreatedNativeViewport,
- weak_factory_.GetWeakPtr()));
- viewport_->Show();
-
- // TODO(jamesr): Should be mojo:mojo_gpu_service
- app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_);
- }
-
- virtual void OnDestroyed() override { base::MessageLoop::current()->Quit(); }
-
- virtual void OnSizeChanged(SizePtr size) override {
- if (host_)
- host_->SetSize(size.To<gfx::Size>());
- }
-
- virtual void OnEvent(EventPtr event,
- const mojo::Callback<void()>& callback) override {
- callback.Run();
- }
-
- private:
- void OnCreatedNativeViewport(uint64_t native_viewport_id) {
- CommandBufferPtr cb;
- // TODO(jamesr): Output to a surface instead.
- gpu_service_->CreateOnscreenGLES2Context(
- native_viewport_id, Size::From(gfx::Size(800, 600)), GetProxy(&cb));
- host_.reset(new CompositorHost(cb.PassMessagePipe()));
- }
-
-
- NativeViewportPtr viewport_;
- GpuPtr gpu_service_;
- scoped_ptr<CompositorHost> host_;
- base::WeakPtrFactory<SampleApp> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(SampleApp);
-};
-
-} // namespace examples
-} // namespace mojo
-
-MojoResult MojoMain(MojoHandle shell_handle) {
- mojo::ApplicationRunnerChromium runner(new mojo::examples::SampleApp);
- return runner.Run(shell_handle);
-}
diff --git a/mojo/examples/compositor_app/compositor_host.cc b/mojo/examples/compositor_app/compositor_host.cc
deleted file mode 100644
index 0cd6fb9..0000000
--- a/mojo/examples/compositor_app/compositor_host.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/examples/compositor_app/compositor_host.h"
-
-#include "cc/layers/layer.h"
-#include "cc/layers/solid_color_layer.h"
-#include "cc/output/begin_frame_args.h"
-#include "cc/output/context_provider.h"
-#include "cc/output/output_surface.h"
-#include "cc/trees/layer_tree_host.h"
-#include "mojo/cc/context_provider_mojo.h"
-
-namespace mojo {
-namespace examples {
-
-CompositorHost::CompositorHost(ScopedMessagePipeHandle command_buffer_handle)
- : command_buffer_handle_(command_buffer_handle.Pass()),
- compositor_thread_("compositor") {
- DCHECK(command_buffer_handle_.is_valid());
- bool started = compositor_thread_.Start();
- DCHECK(started);
-
- cc::LayerTreeSettings settings;
- tree_ = cc::LayerTreeHost::CreateThreaded(
- this,
- NULL,
- settings,
- base::MessageLoopProxy::current(),
- compositor_thread_.message_loop_proxy());
- SetupScene();
-}
-
-CompositorHost::~CompositorHost() {}
-
-void CompositorHost::SetSize(const gfx::Size& viewport_size) {
- tree_->SetViewportSize(viewport_size);
- tree_->SetLayerTreeHostClientReady();
-}
-
-void CompositorHost::SetupScene() {
- scoped_refptr<cc::Layer> root_layer = cc::SolidColorLayer::Create();
- root_layer->SetBounds(gfx::Size(500, 500));
- root_layer->SetBackgroundColor(SK_ColorBLUE);
- root_layer->SetIsDrawable(true);
- tree_->SetRootLayer(root_layer);
-
- child_layer_ = cc::SolidColorLayer::Create();
- child_layer_->SetBounds(gfx::Size(100, 100));
- child_layer_->SetBackgroundColor(SK_ColorGREEN);
- child_layer_->SetIsDrawable(true);
- gfx::Transform child_transform;
- child_transform.Translate(200, 200);
- child_layer_->SetTransform(child_transform);
- root_layer->AddChild(child_layer_);
-}
-
-void CompositorHost::WillBeginMainFrame(int frame_id) {}
-void CompositorHost::DidBeginMainFrame() {}
-
-void CompositorHost::BeginMainFrame(const cc::BeginFrameArgs& args) {
- // TODO(jamesr): Should use cc's animation system.
- static const double kDegreesPerSecond = 70.0;
- double time_in_seconds = (args.frame_time - base::TimeTicks()).InSecondsF();
- double child_rotation_degrees = kDegreesPerSecond * time_in_seconds;
- gfx::Transform child_transform;
- child_transform.Translate(200, 200);
- child_transform.Rotate(child_rotation_degrees);
- child_layer_->SetTransform(child_transform);
- tree_->SetNeedsAnimate();
-}
-
-void CompositorHost::Layout() {}
-void CompositorHost::ApplyViewportDeltas(const gfx::Vector2d& inner_delta,
- const gfx::Vector2d& outer_delta,
- float page_scale,
- float top_controls_delta) {}
-void CompositorHost::ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
- float page_scale,
- float top_controls_delta) {}
-
-void CompositorHost::RequestNewOutputSurface(bool fallback) {
- tree_->SetOutputSurface(make_scoped_ptr(new cc::OutputSurface(
- new ContextProviderMojo(command_buffer_handle_.Pass()))));
-}
-
-void CompositorHost::DidInitializeOutputSurface() {
-}
-
-void CompositorHost::WillCommit() {}
-void CompositorHost::DidCommit() {}
-void CompositorHost::DidCommitAndDrawFrame() {}
-void CompositorHost::DidCompleteSwapBuffers() {}
-
-} // namespace examples
-} // namespace mojo
diff --git a/mojo/examples/compositor_app/compositor_host.h b/mojo/examples/compositor_app/compositor_host.h
deleted file mode 100644
index 3725212..0000000
--- a/mojo/examples/compositor_app/compositor_host.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_EXAMPLES_COMPOSITOR_APP_COMPOSITOR_HOST_H_
-#define MOJO_EXAMPLES_COMPOSITOR_APP_COMPOSITOR_HOST_H_
-
-#include "base/memory/scoped_ptr.h"
-#include "base/threading/thread.h"
-#include "cc/trees/layer_tree_host_client.h"
-#include "mojo/public/cpp/system/core.h"
-#include "ui/gfx/size.h"
-
-namespace cc {
-class Layer;
-class LayerTreeHost;
-} // namespace cc
-
-namespace mojo {
-namespace examples {
-class GLES2ClientImpl;
-
-class CompositorHost : public cc::LayerTreeHostClient {
- public:
- explicit CompositorHost(ScopedMessagePipeHandle command_buffer_handle);
- virtual ~CompositorHost();
-
- void SetSize(const gfx::Size& viewport_size);
-
- // cc::LayerTreeHostClient implementation.
- virtual void WillBeginMainFrame(int frame_id) override;
- virtual void DidBeginMainFrame() override;
- virtual void BeginMainFrame(const cc::BeginFrameArgs& args) override;
- virtual void Layout() override;
- virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta,
- const gfx::Vector2d& outer_delta,
- float page_scale,
- float top_controls_delta) override;
- virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
- float page_scale,
- float top_controls_delta) override;
- virtual void RequestNewOutputSurface(bool fallback) override;
- virtual void DidInitializeOutputSurface() override;
- virtual void WillCommit() override;
- virtual void DidCommit() override;
- virtual void DidCommitAndDrawFrame() override;
- virtual void DidCompleteSwapBuffers() override;
-
- private:
- void SetupScene();
-
- ScopedMessagePipeHandle command_buffer_handle_;
- scoped_ptr<cc::LayerTreeHost> tree_;
- scoped_refptr<cc::Layer> child_layer_;
- base::Thread compositor_thread_;
-};
-
-} // namespace examples
-} // namespace mojo
-
-#endif // MOJO_EXAMPLES_COMPOSITOR_APP_COMPOSITOR_HOST_H_
diff --git a/mojo/examples/http_server/BUILD.gn b/mojo/examples/http_server/BUILD.gn
new file mode 100644
index 0000000..d4013c4
--- /dev/null
+++ b/mojo/examples/http_server/BUILD.gn
@@ -0,0 +1,20 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+shared_library("http_server") {
+ output_name = "mojo_http_server"
+
+ sources = [
+ "http_server.cc",
+ ]
+
+ deps = [
+ "//base",
+ "//mojo/public/c/system:for_shared_library",
+ "//mojo/public/cpp/application:standalone",
+ "//mojo/public/cpp/bindings",
+ "//mojo/public/cpp/utility",
+ "//mojo/services/public/interfaces/network",
+ ]
+}
diff --git a/mojo/examples/http_server/http_server.cc b/mojo/examples/http_server/http_server.cc
new file mode 100644
index 0000000..cc8df20
--- /dev/null
+++ b/mojo/examples/http_server/http_server.cc
@@ -0,0 +1,74 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stdio.h>
+
+#include "base/bind.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/application/application_runner.h"
+#include "mojo/services/public/interfaces/network/network_service.mojom.h"
+
+namespace mojo {
+namespace examples {
+
+class HttpServerApp : public ApplicationDelegate {
+ public:
+ virtual void Initialize(ApplicationImpl* app) override {
+ app->ConnectToService("mojo:mojo_network_service", &network_service_);
+ Start();
+ }
+
+ private:
+ void OnListeningStarted(NetworkErrorPtr err) {
+ }
+
+ void OnSocketBound(NetworkErrorPtr err, NetAddressPtr bound_address) {
+ if (err->code != 0) {
+ printf("Bound err = %d\n", err->code);
+ return;
+ }
+
+ printf("Got address = %d.%d.%d.%d:%d\n",
+ (int)bound_address->ipv4->addr[0],
+ (int)bound_address->ipv4->addr[1],
+ (int)bound_address->ipv4->addr[2],
+ (int)bound_address->ipv4->addr[3],
+ (int)bound_address->ipv4->port);
+
+ bound_socket_->StartListening(
+ GetProxy(&server_socket_),
+ base::Bind(&HttpServerApp::OnListeningStarted,
+ base::Unretained(this)));
+ }
+
+ void Start() {
+ NetAddressPtr net_address(NetAddress::New());
+ net_address->family = NET_ADDRESS_FAMILY_IPV4;
+ net_address->ipv4 = NetAddressIPv4::New();
+ net_address->ipv4->addr.resize(4);
+ net_address->ipv4->addr[0] = 0;
+ net_address->ipv4->addr[1] = 0;
+ net_address->ipv4->addr[2] = 0;
+ net_address->ipv4->addr[3] = 0;
+
+ network_service_->CreateTCPBoundSocket(
+ net_address.Pass(),
+ GetProxy(&bound_socket_),
+ base::Bind(&HttpServerApp::OnSocketBound, base::Unretained(this)));
+ }
+
+ NetworkServicePtr network_service_;
+ TCPBoundSocketPtr bound_socket_;
+ TCPServerSocketPtr server_socket_;
+};
+
+} // namespace examples
+} // namespace mojo
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+ mojo::ApplicationRunner runner(new mojo::examples::HttpServerApp);
+ return runner.Run(shell_handle);
+}
diff --git a/mojo/examples/keyboard/BUILD.gn b/mojo/examples/keyboard/BUILD.gn
index fb3e726..19c5ab0 100644
--- a/mojo/examples/keyboard/BUILD.gn
+++ b/mojo/examples/keyboard/BUILD.gn
@@ -27,9 +27,9 @@
"//mojo/application",
"//mojo/aura",
"//mojo/common",
+ "//mojo/converters/geometry",
+ "//mojo/converters/input_events",
"//mojo/public/c/system:for_shared_library",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/input_events",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/navigation",
diff --git a/mojo/examples/media_viewer/BUILD.gn b/mojo/examples/media_viewer/BUILD.gn
index d322ca0..cbac84d 100644
--- a/mojo/examples/media_viewer/BUILD.gn
+++ b/mojo/examples/media_viewer/BUILD.gn
@@ -19,8 +19,8 @@
":bindings",
"//base",
"//mojo/application",
+ "//mojo/converters/input_events",
"//mojo/public/c/system:for_shared_library",
- "//mojo/services/public/cpp/input_events",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/navigation",
"//mojo/services/public/interfaces/view_manager",
diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc
index ca60ee0..96cdac9 100644
--- a/mojo/examples/sample_app/sample_app.cc
+++ b/mojo/examples/sample_app/sample_app.cc
@@ -28,7 +28,7 @@
virtual ~SampleApp() {
// TODO(darin): Fix shutdown so we don't need to leak this.
- MOJO_ALLOW_UNUSED GLES2ClientImpl* leaked = gles2_client_.release();
+ mojo_ignore_result(gles2_client_.release());
}
virtual void Initialize(mojo::ApplicationImpl* app) override {
diff --git a/mojo/examples/surfaces_app/BUILD.gn b/mojo/examples/surfaces_app/BUILD.gn
index 448e954..5474752 100644
--- a/mojo/examples/surfaces_app/BUILD.gn
+++ b/mojo/examples/surfaces_app/BUILD.gn
@@ -27,11 +27,11 @@
"//ui/gfx/geometry",
"//mojo/application",
"//mojo/common",
+ "//mojo/converters/geometry",
+ "//mojo/converters/surfaces",
"//mojo/environment:chromium",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/system",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/gpu",
"//mojo/services/public/interfaces/surfaces",
@@ -58,11 +58,11 @@
"//cc/surfaces",
"//mojo/application",
"//mojo/common",
+ "//mojo/converters/geometry",
+ "//mojo/converters/surfaces",
"//mojo/environment:chromium",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/surfaces",
"//mojo/services/public/interfaces/surfaces:surface_id",
@@ -91,6 +91,8 @@
"//gpu/command_buffer/common",
"//mojo/application",
"//mojo/common",
+ "//mojo/converters/geometry",
+ "//mojo/converters/surfaces",
"//mojo/environment:chromium",
"//mojo/examples/sample_app:spinning_cube",
"//mojo/public/c/system:for_shared_library",
@@ -98,8 +100,6 @@
"//mojo/public/cpp/environment",
"//mojo/public/cpp/system",
"//mojo/public/gles2:for_shared_library",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/gpu",
"//mojo/services/public/interfaces/surfaces",
diff --git a/mojo/examples/surfaces_app/child_gl_impl.cc b/mojo/examples/surfaces_app/child_gl_impl.cc
index 77b3823..175ab7f 100644
--- a/mojo/examples/surfaces_app/child_gl_impl.cc
+++ b/mojo/examples/surfaces_app/child_gl_impl.cc
@@ -18,11 +18,11 @@
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/mailbox_holder.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "mojo/examples/surfaces_app/surfaces_util.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/environment/environment.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
#include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h"
#include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
#include "third_party/khronos/GLES2/gl2.h"
diff --git a/mojo/examples/surfaces_app/child_impl.cc b/mojo/examples/surfaces_app/child_impl.cc
index 963afb6..5ce6238 100644
--- a/mojo/examples/surfaces_app/child_impl.cc
+++ b/mojo/examples/surfaces_app/child_impl.cc
@@ -9,10 +9,10 @@
#include "cc/output/delegated_frame_data.h"
#include "cc/quads/render_pass.h"
#include "cc/quads/solid_color_draw_quad.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "mojo/examples/surfaces_app/surfaces_util.h"
#include "mojo/public/cpp/application/application_connection.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
#include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h"
#include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
#include "ui/gfx/rect.h"
diff --git a/mojo/examples/surfaces_app/embedder.cc b/mojo/examples/surfaces_app/embedder.cc
index 4a5ff27..8363ce9 100644
--- a/mojo/examples/surfaces_app/embedder.cc
+++ b/mojo/examples/surfaces_app/embedder.cc
@@ -9,8 +9,8 @@
#include "cc/quads/render_pass.h"
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/quads/surface_draw_quad.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "mojo/examples/surfaces_app/surfaces_util.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
#include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
diff --git a/mojo/examples/surfaces_app/surfaces_app.cc b/mojo/examples/surfaces_app/surfaces_app.cc
index 2086407..0776e01 100644
--- a/mojo/examples/surfaces_app/surfaces_app.cc
+++ b/mojo/examples/surfaces_app/surfaces_app.cc
@@ -8,14 +8,14 @@
#include "base/message_loop/message_loop.h"
#include "cc/surfaces/surface_id_allocator.h"
#include "mojo/application/application_runner_chromium.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "mojo/examples/surfaces_app/child.mojom.h"
#include "mojo/examples/surfaces_app/embedder.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/system/core.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
#include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h"
#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
#include "mojo/services/public/interfaces/native_viewport/native_viewport.mojom.h"
diff --git a/mojo/examples/window_manager/BUILD.gn b/mojo/examples/window_manager/BUILD.gn
index 8c89c04..a6283c9 100644
--- a/mojo/examples/window_manager/BUILD.gn
+++ b/mojo/examples/window_manager/BUILD.gn
@@ -22,13 +22,13 @@
"//base",
"//mojo/application",
"//mojo/aura",
+ "//mojo/converters/geometry",
+ "//mojo/converters/input_events",
"//mojo/examples/keyboard:bindings",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/utility",
"//mojo/public/gles2:for_shared_library",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/input_events",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/input_events",
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc
index fbbf074..057ba67 100644
--- a/mojo/examples/window_manager/window_manager.cc
+++ b/mojo/examples/window_manager/window_manager.cc
@@ -5,6 +5,8 @@
#include "base/bind.h"
#include "base/macros.h"
#include "mojo/application/application_runner_chromium.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
#include "mojo/examples/keyboard/keyboard.mojom.h"
#include "mojo/examples/window_manager/debug_panel.h"
#include "mojo/examples/window_manager/window_manager.mojom.h"
@@ -14,16 +16,14 @@
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/interface_factory_impl.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
#include "mojo/services/public/cpp/view_manager/view.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
-#include "mojo/services/public/cpp/view_manager/window_manager_delegate.h"
#include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
#include "mojo/services/public/interfaces/navigation/navigation.mojom.h"
#include "mojo/services/window_manager/window_manager_app.h"
+#include "mojo/services/window_manager/window_manager_delegate.h"
#include "mojo/views/views_init.h"
#include "ui/aura/window.h"
#include "ui/events/event.h"
@@ -181,32 +181,9 @@
virtual void OnKeyboardEvent(Id view_id,
int32_t code,
int32_t flags) override {
- View* view = view_manager_->GetViewById(view_id);
- if (!view)
- return;
-#if defined(OS_WIN)
- const bool is_char = code != ui::VKEY_BACK && code != ui::VKEY_RETURN;
-#else
- const bool is_char = false;
-#endif
- if (is_char) {
- view_manager_->DispatchEvent(
- view,
- Event::From(ui::KeyEvent(ui::ET_KEY_PRESSED,
- static_cast<ui::KeyboardCode>(code),
- flags)));
- } else {
- view_manager_->DispatchEvent(
- view,
- Event::From(ui::KeyEvent(static_cast<base::char16>(code),
- static_cast<ui::KeyboardCode>(code),
- flags)));
- }
- view_manager_->DispatchEvent(
- view,
- Event::From(ui::KeyEvent(ui::ET_KEY_RELEASED,
- static_cast<ui::KeyboardCode>(code),
- flags)));
+ // TODO(sky): figure this out. Code use to dispatch events, but that's a
+ // hack. Instead strings should be passed through, or maybe a richer text
+ // input interface.
}
// Overridden from ViewObserver:
@@ -463,7 +440,6 @@
const Id kInvalidSourceViewId = 0;
OnLaunch(kInvalidSourceViewId, TARGET_DEFAULT, url);
}
- virtual void DispatchEvent(EventPtr event) override {}
// Overridden from ui::EventHandler:
virtual void OnEvent(ui::Event* event) override {
diff --git a/mojo/examples/wm_flow/wm/wm.cc b/mojo/examples/wm_flow/wm/wm.cc
index 56d8b39..b781f60 100644
--- a/mojo/examples/wm_flow/wm/wm.cc
+++ b/mojo/examples/wm_flow/wm/wm.cc
@@ -13,9 +13,9 @@
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
-#include "mojo/services/public/cpp/view_manager/window_manager_delegate.h"
#include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
#include "mojo/services/window_manager/window_manager_app.h"
+#include "mojo/services/window_manager/window_manager_delegate.h"
#include "mojo/views/views_init.h"
#include "ui/aura/window.h"
#include "ui/wm/core/focus_rules.h"
@@ -148,7 +148,6 @@
app_view->Embed(url, scoped_ptr<mojo::ServiceProviderImpl>(
new mojo::ServiceProviderImpl).Pass());
}
- virtual void DispatchEvent(mojo::EventPtr event) override {}
// Overridden from mojo::ViewObserver:
virtual void OnViewInputEvent(mojo::View* view,
diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc
index 5c317a0..a379020 100644
--- a/mojo/gles2/command_buffer_client_impl.cc
+++ b/mojo/gles2/command_buffer_client_impl.cc
@@ -191,20 +191,28 @@
return gpu::Capabilities();
}
-gfx::GpuMemoryBuffer* CommandBufferClientImpl::CreateGpuMemoryBuffer(
+int32_t CommandBufferClientImpl::CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) {
+ // TODO(piman)
+ NOTIMPLEMENTED();
+ return -1;
+}
+
+void CommandBufferClientImpl::DestroyImage(int32 id) {
+ // TODO(piman)
+ NOTIMPLEMENTED();
+}
+
+int32_t CommandBufferClientImpl::CreateGpuMemoryBufferImage(
size_t width,
size_t height,
unsigned internalformat,
- unsigned usage,
- int32* id) {
+ unsigned usage) {
// TODO(piman)
NOTIMPLEMENTED();
- return NULL;
-}
-
-void CommandBufferClientImpl::DestroyGpuMemoryBuffer(int32 id) {
- // TODO(piman)
- NOTIMPLEMENTED();
+ return -1;
}
uint32 CommandBufferClientImpl::InsertSyncPoint() {
diff --git a/mojo/gles2/command_buffer_client_impl.h b/mojo/gles2/command_buffer_client_impl.h
index 65de5a7..5e6ffe1 100644
--- a/mojo/gles2/command_buffer_client_impl.h
+++ b/mojo/gles2/command_buffer_client_impl.h
@@ -54,12 +54,15 @@
// gpu::GpuControl implementation:
virtual gpu::Capabilities GetCapabilities() override;
- virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width,
- size_t height,
- unsigned internalformat,
- unsigned usage,
- int32* id) override;
- virtual void DestroyGpuMemoryBuffer(int32 id) override;
+ virtual int32_t CreateImage(ClientBuffer buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat) override;
+ virtual void DestroyImage(int32_t id) override;
+ virtual int32_t CreateGpuMemoryBufferImage(size_t width,
+ size_t height,
+ unsigned internalformat,
+ unsigned usage) override;
virtual uint32 InsertSyncPoint() override;
virtual uint32 InsertFutureSyncPoint() override;
virtual void RetireSyncPoint(uint32 sync_point) override;
diff --git a/mojo/mojo.gyp b/mojo/mojo.gyp
index 2225224..0f5e11b 100644
--- a/mojo/mojo.gyp
+++ b/mojo/mojo.gyp
@@ -15,6 +15,7 @@
},
'includes': [
'mojo_apps.gypi',
+ 'mojo_converters.gypi',
'mojo_examples.gypi',
'mojo_services.gypi',
'mojo_variables.gypi',
@@ -32,7 +33,6 @@
'mojo_base.gyp:mojo_base',
'mojo_clipboard',
'mojo_clipboard_unittests',
- 'mojo_compositor_app',
'mojo_content_handler_demo',
'mojo_echo_client',
'mojo_echo_service',
@@ -282,6 +282,7 @@
'shell/child_process_host_unittest.cc',
'shell/dynamic_application_loader_unittest.cc',
'shell/in_process_dynamic_service_runner_unittest.cc',
+ 'shell/mojo_url_resolver_unittest.cc',
'shell/shell_test_base.cc',
'shell/shell_test_base.h',
'shell/shell_test_base_unittest.cc',
@@ -373,6 +374,8 @@
'sources': [
'cc/context_provider_mojo.cc',
'cc/context_provider_mojo.h',
+ 'cc/direct_output_surface.cc',
+ 'cc/direct_output_surface.h',
'cc/output_surface_mojo.cc',
'cc/output_surface_mojo.h',
],
diff --git a/mojo/mojo_apps.gypi b/mojo/mojo_apps.gypi
index 0a7aa5c..1994130 100644
--- a/mojo/mojo_apps.gypi
+++ b/mojo/mojo_apps.gypi
@@ -96,7 +96,7 @@
'sources': [
'apps/js/application_delegate_impl.cc',
'apps/js/js_app.cc',
- 'apps/js/mojo_module.cc',
+ 'apps/js/mojo_bridge_module.cc',
],
},
{
diff --git a/mojo/mojo_base.gyp b/mojo/mojo_base.gyp
index 704651f..03614df 100644
--- a/mojo/mojo_base.gyp
+++ b/mojo/mojo_base.gyp
@@ -241,6 +241,7 @@
'type': 'none',
'dependencies': [
'../base/base.gyp:base_java',
+ 'libmojo_system_java',
'public/mojo_public.gyp:mojo_public_java',
],
'variables': {
diff --git a/mojo/mojo_converters.gypi b/mojo/mojo_converters.gypi
new file mode 100644
index 0000000..c6d91dd
--- /dev/null
+++ b/mojo/mojo_converters.gypi
@@ -0,0 +1,140 @@
+# Copyright (c) 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ # GN version: //mojo/converters/input_events
+ 'target_name': 'mojo_input_events_lib',
+ 'type': '<(component)',
+ 'defines': [
+ 'MOJO_INPUT_EVENTS_IMPLEMENTATION',
+ ],
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../ui/events/events.gyp:events',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ 'mojo_geometry_lib',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_input_events_bindings',
+ '<(mojo_system_for_component)',
+ ],
+ 'sources': [
+ 'converters/input_events/input_events_type_converters.cc',
+ 'converters/input_events/input_events_type_converters.h',
+ 'converters/input_events/mojo_extended_key_event_data.cc',
+ 'converters/input_events/mojo_extended_key_event_data.h',
+ 'converters/input_events/mojo_input_events_export.h',
+ ],
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'dependencies': [
+ 'mojo_base.gyp:mojo_environment_chromium',
+ ],
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/converters/geometry
+ 'target_name': 'mojo_geometry_lib',
+ 'type': '<(component)',
+ 'defines': [
+ 'MOJO_GEOMETRY_IMPLEMENTATION',
+ ],
+ 'dependencies': [
+ '../skia/skia.gyp:skia',
+ '../ui/gfx/gfx.gyp:gfx',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ '<(mojo_system_for_component)',
+ ],
+ 'export_dependent_settings': [
+ '../ui/gfx/gfx.gyp:gfx',
+ ],
+ 'sources': [
+ 'converters/geometry/geometry_type_converters.cc',
+ 'converters/geometry/geometry_type_converters.h',
+ 'converters/geometry/mojo_geometry_export.h',
+ ],
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'dependencies': [
+ 'mojo_base.gyp:mojo_environment_chromium',
+ ],
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/converters/surfaces
+ 'target_name': 'mojo_surfaces_lib',
+ 'type': '<(component)',
+ 'defines': [
+ 'MOJO_SURFACES_IMPLEMENTATION',
+ ],
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../cc/cc.gyp:cc',
+ '../cc/cc.gyp:cc_surfaces',
+ '../skia/skia.gyp:skia',
+ '../gpu/gpu.gyp:gpu',
+ '../ui/gfx/gfx.gyp:gfx',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ 'mojo_geometry_lib',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ '<(mojo_system_for_component)',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_geometry_lib',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ ],
+ 'sources': [
+ 'converters/surfaces/surfaces_type_converters.cc',
+ 'converters/surfaces/surfaces_type_converters.h',
+ 'converters/surfaces/surfaces_utils.cc',
+ 'converters/surfaces/surfaces_utils.h',
+ 'converters/surfaces/mojo_surfaces_export.h',
+ ],
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'dependencies': [
+ 'mojo_base.gyp:mojo_environment_chromium',
+ ],
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/converters/surfaces/tests
+ 'target_name': 'mojo_surfaces_lib_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:test_support_base',
+ '../cc/cc.gyp:cc',
+ '../cc/cc.gyp:cc_surfaces',
+ '../gpu/gpu.gyp:gpu',
+ '../skia/skia.gyp:skia',
+ '../testing/gtest.gyp:gtest',
+ '../ui/gfx/gfx.gyp:gfx',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ '../ui/gfx/gfx.gyp:gfx_test_support',
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
+ 'mojo_base.gyp:mojo_environment_chromium',
+ 'mojo_geometry_lib',
+ 'mojo_surfaces_lib',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ ],
+ 'sources': [
+ 'converters/surfaces/tests/surface_unittest.cc',
+ ],
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'dependencies': [
+ 'mojo_base.gyp:mojo_environment_chromium',
+ ],
+ }],
+ ],
+ },
+ ],
+}
diff --git a/mojo/mojo_examples.gypi b/mojo/mojo_examples.gypi
index 382d61f..087f5cc 100644
--- a/mojo/mojo_examples.gypi
+++ b/mojo/mojo_examples.gypi
@@ -156,40 +156,22 @@
'includes': [ 'build/package_app.gypi' ],
},
{
- # GN version: //mojo/examples/compositor_app
- 'target_name': 'mojo_compositor_app',
+ # GN version: //mojo/examples/http_server
+ 'target_name': 'mojo_http_server',
'type': 'loadable_module',
'dependencies': [
'../base/base.gyp:base',
- '../cc/cc.gyp:cc',
- '../ui/gfx/gfx.gyp:gfx',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- 'mojo_base.gyp:mojo_application_chromium',
- 'mojo_base.gyp:mojo_common_lib',
- 'mojo_cc_support',
- 'mojo_geometry_lib',
- 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
- 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
- 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
+ 'public/mojo_public.gyp:mojo_application_standalone',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
'<(mojo_system_for_loadable_module)',
],
- 'includes': [
- 'mojo_public_gles2_for_loadable_module.gypi',
- ],
'sources': [
- 'examples/compositor_app/compositor_app.cc',
- 'examples/compositor_app/compositor_host.cc',
- 'examples/compositor_app/compositor_host.h',
+ 'examples/http_server/http_server.cc',
],
},
{
- 'target_name': 'package_mojo_compositor_app',
- 'variables': {
- 'app_name': 'mojo_compositor_app',
- },
- 'includes': [ 'build/package_app.gypi' ],
- },
- {
# GN version: //mojo/examples/wget
'target_name': 'mojo_wget',
'type': 'loadable_module',
diff --git a/mojo/mojo_services.gypi b/mojo/mojo_services.gypi
index 5b2bd9c..e26b0d3 100644
--- a/mojo/mojo_services.gypi
+++ b/mojo/mojo_services.gypi
@@ -94,6 +94,9 @@
'include_dirs': [
'third_party/WebKit'
],
+ 'includes': [
+ 'mojo_public_gles2_for_loadable_module.gypi',
+ ],
'sources': [
'services/html_viewer/blink_basic_type_converters.cc',
'services/html_viewer/blink_basic_type_converters.h',
@@ -168,6 +171,7 @@
'mojo_geometry_lib',
'mojo_gles2_service',
'mojo_input_events_lib',
+ 'mojo_native_viewport_service_args',
'mojo_surfaces_lib',
'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
@@ -259,10 +263,22 @@
'sources': [
'services/network/cookie_store_impl.cc',
'services/network/cookie_store_impl.h',
+ 'services/network/net_adapters.cc',
+ 'services/network/net_adapters.h',
+ 'services/network/net_address_type_converters.cc',
+ 'services/network/net_address_type_converters.h',
'services/network/network_context.cc',
'services/network/network_context.h',
'services/network/network_service_impl.cc',
'services/network/network_service_impl.h',
+ 'services/network/tcp_bound_socket_impl.cc',
+ 'services/network/tcp_bound_socket_impl.h',
+ 'services/network/tcp_connected_socket_impl.cc',
+ 'services/network/tcp_connected_socket_impl.h',
+ 'services/network/tcp_server_socket_impl.cc',
+ 'services/network/tcp_server_socket_impl.h',
+ 'services/network/udp_socket_impl.cc',
+ 'services/network/udp_socket_impl.h',
'services/network/url_loader_impl.cc',
'services/network/url_loader_impl.h',
'services/network/web_socket_impl.cc',
@@ -290,6 +306,26 @@
],
},
{
+ # GN version: //mojo/services/network:unittests
+ 'target_name': 'mojo_network_service_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:test_support_base',
+ '../testing/gtest.gyp:gtest',
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
+ 'mojo_application_manager',
+ 'mojo_base.gyp:mojo_environment_chromium',
+ 'mojo_network_service',
+ 'mojo_shell_test_support',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
+ ],
+ 'sources': [
+ 'services/network/udp_socket_unittest.cc',
+ ],
+ },
+ {
# GN version: //mojo/services/surfaces
'target_name': 'mojo_surfaces_service',
'type': 'loadable_module',
@@ -359,7 +395,6 @@
'dependencies': [
'../base/base.gyp:base',
'../ui/gfx/gfx.gyp:gfx_geometry',
- 'mojo_application_manager',
'mojo_base.gyp:mojo_application_chromium',
'mojo_geometry_lib',
'public/mojo_public.gyp:mojo_application_base',
@@ -390,7 +425,6 @@
'services/public/cpp/view_manager/view_manager_context.h',
'services/public/cpp/view_manager/view_manager_delegate.h',
'services/public/cpp/view_manager/view_observer.h',
- 'services/public/cpp/view_manager/window_manager_delegate.h',
],
'export_dependent_settings': [
'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
@@ -458,135 +492,15 @@
],
},
{
- # GN version: //mojo/services/public/cpp/input_events
- 'target_name': 'mojo_input_events_lib',
- 'type': '<(component)',
- 'defines': [
- 'MOJO_INPUT_EVENTS_IMPLEMENTATION',
- ],
- 'dependencies': [
- '../base/base.gyp:base',
- '../ui/events/events.gyp:events',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- 'mojo_geometry_lib',
- 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
- 'services/public/mojo_services_public.gyp:mojo_input_events_bindings',
- '<(mojo_system_for_component)',
- ],
+ # GN version: //mojo/services/public/cpp/native_viewport:args
+ 'target_name': 'mojo_native_viewport_service_args',
+ 'type': 'static_library',
'sources': [
- 'services/public/cpp/input_events/lib/input_events_type_converters.cc',
- 'services/public/cpp/input_events/lib/mojo_extended_key_event_data.cc',
- 'services/public/cpp/input_events/lib/mojo_extended_key_event_data.h',
- 'services/public/cpp/input_events/input_events_type_converters.h',
- 'services/public/cpp/input_events/mojo_input_events_export.h',
+ 'services/public/cpp/native_viewport/lib/args.cc',
+ 'services/public/cpp/native_viewport/args.h',
],
- 'conditions': [
- ['component=="shared_library"', {
- 'dependencies': [
- 'mojo_base.gyp:mojo_environment_chromium',
- ],
- }],
- ],
- },
- {
- # GN version: //mojo/services/public/cpp/geometry
- 'target_name': 'mojo_geometry_lib',
- 'type': '<(component)',
- 'defines': [
- 'MOJO_GEOMETRY_IMPLEMENTATION',
- ],
- 'dependencies': [
- '../skia/skia.gyp:skia',
- '../ui/gfx/gfx.gyp:gfx',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
- '<(mojo_system_for_component)',
- ],
- 'export_dependent_settings': [
- '../ui/gfx/gfx.gyp:gfx',
- ],
- 'sources': [
- 'services/public/cpp/geometry/lib/geometry_type_converters.cc',
- 'services/public/cpp/geometry/geometry_type_converters.h',
- 'services/public/cpp/geometry/mojo_geometry_export.h',
- ],
- 'conditions': [
- ['component=="shared_library"', {
- 'dependencies': [
- 'mojo_base.gyp:mojo_environment_chromium',
- ],
- }],
- ],
- },
- {
- # GN version: //mojo/services/public/cpp/surfaces
- 'target_name': 'mojo_surfaces_lib',
- 'type': '<(component)',
- 'defines': [
- 'MOJO_SURFACES_IMPLEMENTATION',
- ],
- 'dependencies': [
- '../base/base.gyp:base',
- '../cc/cc.gyp:cc',
- '../cc/cc.gyp:cc_surfaces',
- '../skia/skia.gyp:skia',
- '../gpu/gpu.gyp:gpu',
- '../ui/gfx/gfx.gyp:gfx',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- 'mojo_geometry_lib',
- 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
- 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
- '<(mojo_system_for_component)',
- ],
- 'export_dependent_settings': [
- 'mojo_geometry_lib',
- 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
- ],
- 'sources': [
- 'services/public/cpp/surfaces/lib/surfaces_type_converters.cc',
- 'services/public/cpp/surfaces/lib/surfaces_utils.cc',
- 'services/public/cpp/surfaces/surfaces_type_converters.h',
- 'services/public/cpp/surfaces/surfaces_utils.h',
- 'services/public/cpp/surfaces/mojo_surfaces_export.h',
- ],
- 'conditions': [
- ['component=="shared_library"', {
- 'dependencies': [
- 'mojo_base.gyp:mojo_environment_chromium',
- ],
- }],
- ],
- },
- {
- # GN version: //mojo/services/public/cpp/surfaces/tests
- 'target_name': 'mojo_surfaces_lib_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/base.gyp:test_support_base',
- '../cc/cc.gyp:cc',
- '../cc/cc.gyp:cc_surfaces',
- '../gpu/gpu.gyp:gpu',
- '../skia/skia.gyp:skia',
- '../testing/gtest.gyp:gtest',
- '../ui/gfx/gfx.gyp:gfx',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- '../ui/gfx/gfx.gyp:gfx_test_support',
- 'edk/mojo_edk.gyp:mojo_run_all_unittests',
- 'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_geometry_lib',
- 'mojo_surfaces_lib',
- 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
- ],
- 'sources': [
- 'services/public/cpp/surfaces/tests/surface_unittest.cc',
- ],
- 'conditions': [
- ['component=="shared_library"', {
- 'dependencies': [
- 'mojo_base.gyp:mojo_environment_chromium',
- ],
- }],
+ 'include_dirs': [
+ '..'
],
},
],
@@ -608,18 +522,17 @@
'../ui/gfx/gfx.gyp:gfx_geometry',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_base.gyp:mojo_common_lib',
'mojo_geometry_lib',
'mojo_input_events_lib',
'mojo_surfaces_lib',
'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
- 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
'services/public/mojo_services_public.gyp:mojo_input_events_bindings',
'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'services/public/mojo_services_public.gyp:mojo_view_manager_common',
+ 'services/public/mojo_services_public.gyp:mojo_window_manager_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -645,6 +558,8 @@
'services/view_manager/view_manager_service_impl.h',
'services/view_manager/window_manager_access_policy.cc',
'services/view_manager/window_manager_access_policy.h',
+ 'services/view_manager/window_manager_client_impl.cc',
+ 'services/view_manager/window_manager_client_impl.h',
],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
@@ -669,12 +584,14 @@
'mojo_base.gyp:mojo_application_chromium',
'mojo_geometry_lib',
'mojo_input_events_lib',
+ 'mojo_native_viewport_service_args',
'mojo_shell_test_support',
'mojo_view_manager_run_unittests',
'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
'services/public/mojo_services_public.gyp:mojo_input_events_bindings',
'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'services/public/mojo_services_public.gyp:mojo_view_manager_common',
+ 'services/public/mojo_services_public.gyp:mojo_window_manager_bindings',
# Included only to force deps for bots.
'mojo_native_viewport_service',
'mojo_surfaces_service',
@@ -715,13 +632,18 @@
'mojo_base.gyp:mojo_common_lib',
'mojo_input_events_lib',
'mojo_view_manager_lib',
+ 'public/mojo_public.gyp:mojo_application_bindings',
'services/public/mojo_services_public.gyp:mojo_core_window_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_window_manager_bindings',
],
'sources': [
'services/window_manager/window_manager_app.cc',
'services/window_manager/window_manager_app.h',
+ 'services/window_manager/window_manager_delegate.h',
'services/window_manager/window_manager_service_impl.cc',
'services/window_manager/window_manager_service_impl.h',
+ 'services/window_manager/window_manager_service2_impl.cc',
+ 'services/window_manager/window_manager_service2_impl.h',
],
},
{
diff --git a/mojo/public/BUILD.gn b/mojo/public/BUILD.gn
index 8eb4647..b661383 100644
--- a/mojo/public/BUILD.gn
+++ b/mojo/public/BUILD.gn
@@ -13,6 +13,7 @@
"//mojo/public/cpp/environment:standalone",
"//mojo/public/cpp/utility",
"//mojo/public/interfaces/bindings/tests:test_interfaces",
+ "//mojo/public/html",
]
if (is_linux) {
@@ -37,6 +38,7 @@
"//mojo/public/cpp/environment:standalone",
"//mojo/public/cpp/utility",
"//mojo/public/interfaces/application",
+ "//mojo/public/js/bindings",
]
}
diff --git a/mojo/public/c/system/data_pipe.h b/mojo/public/c/system/data_pipe.h
index e4a15e9..a7498e4 100644
--- a/mojo/public/c/system/data_pipe.h
+++ b/mojo/public/c/system/data_pipe.h
@@ -187,9 +187,10 @@
// that thread can then wait for |data_pipe_producer_handle| to become writable
// again.
//
-// Once the caller has finished writing data to |*buffer|, it should call
-// |MojoEndWriteData()| to specify the amount written and to complete the
-// two-phase write.
+// When |MojoBeginWriteData()| returns MOJO_RESULT_OK, and the caller has
+// finished writing data to |*buffer|, it should call |MojoEndWriteData()| to
+// specify the amount written and to complete the two-phase write.
+// |MojoEndWriteData()| need not be called for other return values.
//
// Note: If the data pipe has the "may discard" option flag (specified on
// creation) and |flags| has |MOJO_WRITE_DATA_FLAG_ALL_OR_NONE| set, this may
diff --git a/mojo/public/c/system/macros.h b/mojo/public/c/system/macros.h
index dde65ff..7f28e18 100644
--- a/mojo/public/c/system/macros.h
+++ b/mojo/public/c/system/macros.h
@@ -9,12 +9,9 @@
// Annotate a variable indicating it's okay if it's unused.
// Use like:
-// int x MOJO_ALLOW_UNUSED = ...;
-#if defined(__GNUC__)
-#define MOJO_ALLOW_UNUSED __attribute__((unused))
-#else
-#define MOJO_ALLOW_UNUSED
-#endif
+// int x = ...;
+// MOJO_ALLOW_UNUSED_LOCAL(x);
+#define MOJO_ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
// Annotate a function indicating that the caller must examine the return value.
// Use like:
diff --git a/mojo/public/c/system/tests/core_perftest.cc b/mojo/public/c/system/tests/core_perftest.cc
index b9a8114..188854a 100644
--- a/mojo/public/c/system/tests/core_perftest.cc
+++ b/mojo/public/c/system/tests/core_perftest.cc
@@ -118,8 +118,8 @@
static void MessagePipe_CreateAndClose(void* closure) {
CorePerftest* self = static_cast<CorePerftest*>(closure);
- MojoResult result MOJO_ALLOW_UNUSED;
- result = MojoCreateMessagePipe(NULL, &self->h0_, &self->h1_);
+ MojoResult result = MojoCreateMessagePipe(NULL, &self->h0_, &self->h1_);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
result = MojoClose(self->h0_);
assert(result == MOJO_RESULT_OK);
@@ -129,29 +129,22 @@
static void MessagePipe_WriteAndRead(void* closure) {
CorePerftest* self = static_cast<CorePerftest*>(closure);
- MojoResult result MOJO_ALLOW_UNUSED;
- result = MojoWriteMessage(self->h0_,
- self->buffer_,
- self->num_bytes_,
- NULL,
- 0,
- MOJO_WRITE_MESSAGE_FLAG_NONE);
+ MojoResult result = MojoWriteMessage(self->h0_, self->buffer_,
+ self->num_bytes_, NULL, 0,
+ MOJO_WRITE_MESSAGE_FLAG_NONE);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
uint32_t read_bytes = self->num_bytes_;
- result = MojoReadMessage(self->h1_,
- self->buffer_,
- &read_bytes,
- NULL,
- NULL,
+ result = MojoReadMessage(self->h1_, self->buffer_, &read_bytes, NULL, NULL,
MOJO_READ_MESSAGE_FLAG_NONE);
assert(result == MOJO_RESULT_OK);
}
static void MessagePipe_EmptyRead(void* closure) {
CorePerftest* self = static_cast<CorePerftest*>(closure);
- MojoResult result MOJO_ALLOW_UNUSED;
- result = MojoReadMessage(
- self->h0_, NULL, NULL, NULL, NULL, MOJO_READ_MESSAGE_FLAG_MAY_DISCARD);
+ MojoResult result = MojoReadMessage(self->h0_, NULL, NULL, NULL, NULL,
+ MOJO_READ_MESSAGE_FLAG_MAY_DISCARD);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_SHOULD_WAIT);
}
@@ -165,8 +158,8 @@
assert(num_writers > 0);
assert(num_readers > 0);
- MojoResult result MOJO_ALLOW_UNUSED;
- result = MojoCreateMessagePipe(NULL, &h0_, &h1_);
+ MojoResult result = MojoCreateMessagePipe(NULL, &h0_, &h1_);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
std::vector<MessagePipeWriterThread*> writers;
@@ -254,8 +247,8 @@
static_cast<time_t>(microseconds / 1000000), // Seconds.
static_cast<long>(microseconds % 1000000) * 1000L // Nanoseconds.
};
- int rv MOJO_ALLOW_UNUSED;
- rv = nanosleep(&req, NULL);
+ int rv = nanosleep(&req, NULL);
+ MOJO_ALLOW_UNUSED_LOCAL(rv);
assert(rv == 0);
}
#endif // !defined(WIN32)
@@ -275,8 +268,8 @@
}
TEST_F(CorePerftest, MessagePipe_WriteAndRead) {
- MojoResult result MOJO_ALLOW_UNUSED;
- result = MojoCreateMessagePipe(NULL, &h0_, &h1_);
+ MojoResult result = MojoCreateMessagePipe(NULL, &h0_, &h1_);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
char buffer[10000] = {0};
buffer_ = buffer;
@@ -303,8 +296,8 @@
}
TEST_F(CorePerftest, MessagePipe_EmptyRead) {
- MojoResult result MOJO_ALLOW_UNUSED;
- result = MojoCreateMessagePipe(NULL, &h0_, &h1_);
+ MojoResult result = MojoCreateMessagePipe(NULL, &h0_, &h1_);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
mojo::test::IterateAndReportPerf(
"MessagePipe_EmptyRead", &CorePerftest::MessagePipe_EmptyRead, this);
diff --git a/mojo/public/c/system/tests/macros_unittest.cc b/mojo/public/c/system/tests/macros_unittest.cc
index d4292cf..b22e124 100644
--- a/mojo/public/c/system/tests/macros_unittest.cc
+++ b/mojo/public/c/system/tests/macros_unittest.cc
@@ -21,7 +21,8 @@
TEST(MacrosTest, AllowUnused) {
// Test that no warning/error is issued even though |x| is unused.
- int x MOJO_ALLOW_UNUSED = 123;
+ int x = 123;
+ MOJO_ALLOW_UNUSED_LOCAL(x);
}
int MustUseReturnedResult() MOJO_WARN_UNUSED_RESULT;
diff --git a/mojo/public/cpp/bindings/BUILD.gn b/mojo/public/cpp/bindings/BUILD.gn
index dad10d8..86ccae0 100644
--- a/mojo/public/cpp/bindings/BUILD.gn
+++ b/mojo/public/cpp/bindings/BUILD.gn
@@ -7,6 +7,7 @@
"array.h",
"error_handler.h",
"interface_ptr.h",
+ "map.h",
"message.h",
"message_filter.h",
"no_interface.h",
@@ -28,6 +29,9 @@
"lib/filter_chain.h",
"lib/fixed_buffer.cc",
"lib/fixed_buffer.h",
+ "lib/map_data_internal.h",
+ "lib/map_internal.h",
+ "lib/map_serialization.h",
"lib/message.cc",
"lib/message_builder.cc",
"lib/message_builder.h",
@@ -42,6 +46,7 @@
"lib/router.h",
"lib/string_serialization.cc",
"lib/string_serialization.h",
+ "lib/validate_params.h",
"lib/validation_errors.cc",
"lib/validation_errors.h",
]
diff --git a/mojo/public/cpp/bindings/array.h b/mojo/public/cpp/bindings/array.h
index b7f3cc0..2544abb 100644
--- a/mojo/public/cpp/bindings/array.h
+++ b/mojo/public/cpp/bindings/array.h
@@ -12,12 +12,12 @@
#include <vector>
#include "mojo/public/cpp/bindings/lib/array_internal.h"
+#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
#include "mojo/public/cpp/bindings/lib/template_util.h"
#include "mojo/public/cpp/bindings/type_converter.h"
namespace mojo {
-// Provides read-only access to array data.
template <typename T>
class Array {
MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(Array, RValue)
@@ -108,6 +108,18 @@
return result.Pass();
}
+ bool Equals(const Array& other) const {
+ if (is_null() != other.is_null())
+ return false;
+ if (size() != other.size())
+ return false;
+ for (size_t i = 0; i < size(); ++i) {
+ if (!internal::ValueTraits<T>::Equals(at(i), other.at(i)))
+ return false;
+ }
+ return true;
+ }
+
private:
typedef std::vector<StorageType> Array::*Testable;
diff --git a/mojo/public/cpp/bindings/callback.h b/mojo/public/cpp/bindings/callback.h
index 0cd4924..d7bab16 100644
--- a/mojo/public/cpp/bindings/callback.h
+++ b/mojo/public/cpp/bindings/callback.h
@@ -1,9 +1,3 @@
-// This file was GENERATED by command:
-// pump.py callback.h.pump
-// DO NOT EDIT BY HAND!!!
-
-
-
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -20,12 +14,14 @@
template <typename Sig>
class Callback;
-template <>
-class Callback<void()> {
+template <typename... Args>
+class Callback<void(Args...)> {
public:
struct Runnable {
virtual ~Runnable() {}
- virtual void Run() const = 0;
+ virtual void Run(
+ typename internal::Callback_ParamTraits<Args>::ForwardType...)
+ const = 0;
};
Callback() {}
@@ -36,478 +32,27 @@
// Any class that is copy-constructable and has a compatible Run method may
// be adapted to a Callback using this constructor.
template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
+ Callback(const Sink& sink)
+ : sink_(new Adapter<Sink>(sink)) {}
- void Run() const {
+ void Run(typename internal::Callback_ParamTraits<Args>::ForwardType... args)
+ const {
if (sink_.get())
- sink_->Run();
+ sink_->Run(internal::Forward(args)...);
}
- bool is_null() const {
- return !sink_.get();
- }
+ bool is_null() const { return !sink_.get(); }
- void reset() {
- sink_.reset();
- }
-
- private:
- template <typename Sink>
- struct Adapter : public Runnable {
- explicit Adapter(const Sink& sink) : sink(sink) {}
- virtual void Run() const override { sink.Run(); }
- Sink sink;
- };
-
- internal::SharedPtr<Runnable> sink_;
-};
-
-template <typename A1>
-class Callback<void(A1)> {
- public:
- struct Runnable {
- virtual ~Runnable() {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1) const = 0;
- };
-
- Callback() {}
-
- // The Callback assumes ownership of |runnable|.
- explicit Callback(Runnable* runnable) : sink_(runnable) {}
-
- // Any class that is copy-constructable and has a compatible Run method may
- // be adapted to a Callback using this constructor.
- template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
-
- void Run(typename internal::Callback_ParamTraits<A1>::ForwardType a1) const {
- if (sink_.get())
- sink_->Run(internal::Forward(a1));
- }
-
- bool is_null() const {
- return !sink_.get();
- }
-
- void reset() {
- sink_.reset();
- }
-
- private:
- template <typename Sink>
- struct Adapter : public Runnable {
- explicit Adapter(const Sink& sink) : sink(sink) {}
- virtual void Run(typename internal::Callback_ParamTraits<A1>::ForwardType
- a1) const override {
- sink.Run(internal::Forward(a1));
- }
- Sink sink;
- };
-
- internal::SharedPtr<Runnable> sink_;
-};
-
-template <typename A1, typename A2>
-class Callback<void(A1, A2)> {
- public:
- struct Runnable {
- virtual ~Runnable() {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2) const = 0;
- };
-
- Callback() {}
-
- // The Callback assumes ownership of |runnable|.
- explicit Callback(Runnable* runnable) : sink_(runnable) {}
-
- // Any class that is copy-constructable and has a compatible Run method may
- // be adapted to a Callback using this constructor.
- template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
-
- void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2) const {
- if (sink_.get())
- sink_->Run(
- internal::Forward(a1),
- internal::Forward(a2));
- }
-
- bool is_null() const {
- return !sink_.get();
- }
-
- void reset() {
- sink_.reset();
- }
+ void reset() { sink_.reset(); }
private:
template <typename Sink>
struct Adapter : public Runnable {
explicit Adapter(const Sink& sink) : sink(sink) {}
virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2)
+ typename internal::Callback_ParamTraits<Args>::ForwardType... args)
const override {
- sink.Run(
- internal::Forward(a1),
- internal::Forward(a2));
- }
- Sink sink;
- };
-
- internal::SharedPtr<Runnable> sink_;
-};
-
-template <typename A1, typename A2, typename A3>
-class Callback<void(A1, A2, A3)> {
- public:
- struct Runnable {
- virtual ~Runnable() {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3) const = 0;
- };
-
- Callback() {}
-
- // The Callback assumes ownership of |runnable|.
- explicit Callback(Runnable* runnable) : sink_(runnable) {}
-
- // Any class that is copy-constructable and has a compatible Run method may
- // be adapted to a Callback using this constructor.
- template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
-
- void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3) const {
- if (sink_.get())
- sink_->Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3));
- }
-
- bool is_null() const {
- return !sink_.get();
- }
-
- void reset() {
- sink_.reset();
- }
-
- private:
- template <typename Sink>
- struct Adapter : public Runnable {
- explicit Adapter(const Sink& sink) : sink(sink) {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3)
- const override {
- sink.Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3));
- }
- Sink sink;
- };
-
- internal::SharedPtr<Runnable> sink_;
-};
-
-template <typename A1, typename A2, typename A3, typename A4>
-class Callback<void(A1, A2, A3, A4)> {
- public:
- struct Runnable {
- virtual ~Runnable() {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4) const = 0;
- };
-
- Callback() {}
-
- // The Callback assumes ownership of |runnable|.
- explicit Callback(Runnable* runnable) : sink_(runnable) {}
-
- // Any class that is copy-constructable and has a compatible Run method may
- // be adapted to a Callback using this constructor.
- template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
-
- void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4) const {
- if (sink_.get())
- sink_->Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3),
- internal::Forward(a4));
- }
-
- bool is_null() const {
- return !sink_.get();
- }
-
- void reset() {
- sink_.reset();
- }
-
- private:
- template <typename Sink>
- struct Adapter : public Runnable {
- explicit Adapter(const Sink& sink) : sink(sink) {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4)
- const override {
- sink.Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3),
- internal::Forward(a4));
- }
- Sink sink;
- };
-
- internal::SharedPtr<Runnable> sink_;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5>
-class Callback<void(A1, A2, A3, A4, A5)> {
- public:
- struct Runnable {
- virtual ~Runnable() {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5) const = 0;
- };
-
- Callback() {}
-
- // The Callback assumes ownership of |runnable|.
- explicit Callback(Runnable* runnable) : sink_(runnable) {}
-
- // Any class that is copy-constructable and has a compatible Run method may
- // be adapted to a Callback using this constructor.
- template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
-
- void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5) const {
- if (sink_.get())
- sink_->Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3),
- internal::Forward(a4),
- internal::Forward(a5));
- }
-
- bool is_null() const {
- return !sink_.get();
- }
-
- void reset() {
- sink_.reset();
- }
-
- private:
- template <typename Sink>
- struct Adapter : public Runnable {
- explicit Adapter(const Sink& sink) : sink(sink) {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5)
- const override {
- sink.Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3),
- internal::Forward(a4),
- internal::Forward(a5));
- }
- Sink sink;
- };
-
- internal::SharedPtr<Runnable> sink_;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6>
-class Callback<void(A1, A2, A3, A4, A5, A6)> {
- public:
- struct Runnable {
- virtual ~Runnable() {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5,
- typename internal::Callback_ParamTraits<A6>::ForwardType a6) const = 0;
- };
-
- Callback() {}
-
- // The Callback assumes ownership of |runnable|.
- explicit Callback(Runnable* runnable) : sink_(runnable) {}
-
- // Any class that is copy-constructable and has a compatible Run method may
- // be adapted to a Callback using this constructor.
- template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
-
- void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5,
- typename internal::Callback_ParamTraits<A6>::ForwardType a6) const {
- if (sink_.get())
- sink_->Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3),
- internal::Forward(a4),
- internal::Forward(a5),
- internal::Forward(a6));
- }
-
- bool is_null() const {
- return !sink_.get();
- }
-
- void reset() {
- sink_.reset();
- }
-
- private:
- template <typename Sink>
- struct Adapter : public Runnable {
- explicit Adapter(const Sink& sink) : sink(sink) {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5,
- typename internal::Callback_ParamTraits<A6>::ForwardType a6)
- const override {
- sink.Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3),
- internal::Forward(a4),
- internal::Forward(a5),
- internal::Forward(a6));
- }
- Sink sink;
- };
-
- internal::SharedPtr<Runnable> sink_;
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7>
-class Callback<void(A1, A2, A3, A4, A5, A6, A7)> {
- public:
- struct Runnable {
- virtual ~Runnable() {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5,
- typename internal::Callback_ParamTraits<A6>::ForwardType a6,
- typename internal::Callback_ParamTraits<A7>::ForwardType a7) const = 0;
- };
-
- Callback() {}
-
- // The Callback assumes ownership of |runnable|.
- explicit Callback(Runnable* runnable) : sink_(runnable) {}
-
- // Any class that is copy-constructable and has a compatible Run method may
- // be adapted to a Callback using this constructor.
- template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
-
- void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5,
- typename internal::Callback_ParamTraits<A6>::ForwardType a6,
- typename internal::Callback_ParamTraits<A7>::ForwardType a7) const {
- if (sink_.get())
- sink_->Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3),
- internal::Forward(a4),
- internal::Forward(a5),
- internal::Forward(a6),
- internal::Forward(a7));
- }
-
- bool is_null() const {
- return !sink_.get();
- }
-
- void reset() {
- sink_.reset();
- }
-
- private:
- template <typename Sink>
- struct Adapter : public Runnable {
- explicit Adapter(const Sink& sink) : sink(sink) {}
- virtual void Run(
- typename internal::Callback_ParamTraits<A1>::ForwardType a1,
- typename internal::Callback_ParamTraits<A2>::ForwardType a2,
- typename internal::Callback_ParamTraits<A3>::ForwardType a3,
- typename internal::Callback_ParamTraits<A4>::ForwardType a4,
- typename internal::Callback_ParamTraits<A5>::ForwardType a5,
- typename internal::Callback_ParamTraits<A6>::ForwardType a6,
- typename internal::Callback_ParamTraits<A7>::ForwardType a7)
- const override {
- sink.Run(
- internal::Forward(a1),
- internal::Forward(a2),
- internal::Forward(a3),
- internal::Forward(a4),
- internal::Forward(a5),
- internal::Forward(a6),
- internal::Forward(a7));
+ sink.Run(internal::Forward(args)...);
}
Sink sink;
};
diff --git a/mojo/public/cpp/bindings/callback.h.pump b/mojo/public/cpp/bindings/callback.h.pump
deleted file mode 100644
index 856e85b..0000000
--- a/mojo/public/cpp/bindings/callback.h.pump
+++ /dev/null
@@ -1,95 +0,0 @@
-$$ This is a pump file for generating file templates. Pump is a python
-$$ script that is part of the Google Test suite of utilities. Description
-$$ can be found here:
-$$
-$$ http://code.google.com/p/googletest/wiki/PumpManual
-$$
-
-$var MAX_ARITY = 7
-
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_
-
-#include "mojo/public/cpp/bindings/lib/callback_internal.h"
-#include "mojo/public/cpp/bindings/lib/shared_ptr.h"
-#include "mojo/public/cpp/bindings/lib/template_util.h"
-
-namespace mojo {
-
-template <typename Sig>
-class Callback;
-
-$range ARITY 0..MAX_ARITY
-$for ARITY [[
-$range ARG 1..ARITY
-
-template <$for ARG , [[typename A$(ARG)]]>
-class Callback<void($for ARG , [[A$(ARG)]])> {
- public:
- struct Runnable {
- virtual ~Runnable() {}
- virtual void Run($if ARITY > 0 [[
-
- ]]$for ARG ,
- [[typename internal::Callback_ParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) const = 0;
- };
-
- Callback() {}
-
- // The Callback assumes ownership of |runnable|.
- explicit Callback(Runnable* runnable) : sink_(runnable) {}
-
- // Any class that is copy-constructable and has a compatible Run method may
- // be adapted to a Callback using this constructor.
- template <typename Sink>
- Callback(const Sink& sink) : sink_(new Adapter<Sink>(sink)) {}
-
- void Run($if ARITY > 1 [[
-
- ]]$for ARG ,
- [[typename internal::Callback_ParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) const {
- if (sink_.get())
- sink_->Run($if ARITY > 1 [[
-
- ]]$for ARG ,
- [[internal::Forward(a$(ARG))]]);
- }
-
- bool is_null() const {
- return !sink_.get();
- }
-
- void reset() {
- sink_.reset();
- }
-
- private:
- template <typename Sink>
- struct Adapter : public Runnable {
- explicit Adapter(const Sink& sink) : sink(sink) {}
- virtual void Run($if ARITY > 0 [[
-
- ]]$for ARG ,
- [[typename internal::Callback_ParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) const override {
- sink.Run($if ARITY > 1 [[
-
- ]]$for ARG ,
- [[internal::Forward(a$(ARG))]]);
- }
- Sink sink;
- };
-
- internal::SharedPtr<Runnable> sink_;
-};
-
-]] $$ for ARITY
-
-typedef Callback<void()> Closure;
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_CALLBACK_H_
diff --git a/mojo/public/cpp/bindings/lib/array_internal.h b/mojo/public/cpp/bindings/lib/array_internal.h
index ded07b9..eb25e35 100644
--- a/mojo/public/cpp/bindings/lib/array_internal.h
+++ b/mojo/public/cpp/bindings/lib/array_internal.h
@@ -13,7 +13,9 @@
#include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
#include "mojo/public/cpp/bindings/lib/bounds_checker.h"
#include "mojo/public/cpp/bindings/lib/buffer.h"
+#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
#include "mojo/public/cpp/bindings/lib/template_util.h"
+#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/environment/logging.h"
@@ -141,26 +143,6 @@
}
};
-// Array type information needed for valdiation.
-template <uint32_t in_expected_num_elements,
- bool in_element_is_nullable,
- typename InElementValidateParams>
-class ArrayValidateParams {
- public:
- // Validation information for elements. It is either another specialization of
- // ArrayValidateParams (if elements are arrays) or NoValidateParams.
- typedef InElementValidateParams ElementValidateParams;
-
- // If |expected_num_elements| is not 0, the array is expected to have exactly
- // that number of elements.
- static const uint32_t expected_num_elements = in_expected_num_elements;
- // Whether the elements are nullable.
- static const bool element_is_nullable = in_element_is_nullable;
-};
-
-// NoValidateParams is used to indicate the end of an ArrayValidateParams chain.
-class NoValidateParams {};
-
// What follows is code to support the serialization of Array_Data<T>. There
// are two interesting cases: arrays of primitives and arrays of objects.
// Arrays of objects are represented as arrays of pointers to objects.
@@ -313,6 +295,14 @@
}
};
+ template <typename Key, typename Value, typename Params>
+ struct ValidateCaller<Map_Data<Key, Value>, Params> {
+ static bool Run(const void* data, BoundsChecker* bounds_checker) {
+ return Map_Data<Key, Value>::template Validate<Params>(data,
+ bounds_checker);
+ }
+ };
+
template <typename T, typename Params>
struct ValidateCaller<Array_Data<T>, Params> {
static bool Run(const void* data, BoundsChecker* bounds_checker) {
@@ -416,7 +406,7 @@
header_.num_bytes = num_bytes;
header_.num_elements = num_elements;
}
- ~Array_Data() {}
+ ~Array_Data() = delete;
internal::ArrayHeader header_;
diff --git a/mojo/public/cpp/bindings/lib/array_serialization.h b/mojo/public/cpp/bindings/lib/array_serialization.h
index fd18863..e73553d 100644
--- a/mojo/public/cpp/bindings/lib/array_serialization.h
+++ b/mojo/public/cpp/bindings/lib/array_serialization.h
@@ -11,6 +11,7 @@
#include "mojo/public/c/system/macros.h"
#include "mojo/public/cpp/bindings/lib/array_internal.h"
+#include "mojo/public/cpp/bindings/lib/map_serialization.h"
#include "mojo/public/cpp/bindings/lib/string_serialization.h"
#include "mojo/public/cpp/bindings/lib/template_util.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
@@ -29,6 +30,16 @@
internal::Buffer* buf,
internal::Array_Data<F>** output);
+template <typename ValueValidateParams,
+ typename KeyWrapperType,
+ typename ValueWrapperType,
+ typename KeySerializationType,
+ typename ValueSerializationType>
+inline void SerializeMap_(
+ Map<KeyWrapperType, ValueWrapperType> input,
+ internal::Buffer* buf,
+ internal::Map_Data<KeySerializationType, ValueSerializationType>** output);
+
template <typename E, typename F>
inline void Deserialize_(internal::Array_Data<F>* data, Array<E>* output);
@@ -121,12 +132,20 @@
}
};
+// This template must only apply to pointer mojo entity (structs and arrays).
+// This is done by ensuring that WrapperTraits<S>::DataType is a pointer.
template <typename S>
-struct ArraySerializer<S, typename S::Data_*, true> {
+struct ArraySerializer<S,
+ typename internal::EnableIf<
+ internal::IsPointer<typename internal::WrapperTraits<
+ S>::DataType>::value,
+ typename internal::WrapperTraits<S>::DataType>::type,
+ true> {
+ typedef typename internal::RemovePointer<
+ typename internal::WrapperTraits<S>::DataType>::type S_Data;
static size_t GetSerializedSize(const Array<S>& input) {
- size_t size =
- sizeof(Array_Data<typename S::Data_*>) +
- input.size() * sizeof(internal::StructPointer<typename S::Data_>);
+ size_t size = sizeof(Array_Data<S_Data*>) +
+ input.size() * sizeof(internal::StructPointer<S_Data>);
for (size_t i = 0; i < input.size(); ++i)
size += GetSerializedSize_(input[i]);
return size;
@@ -134,9 +153,9 @@
template <bool element_is_nullable, typename ElementValidateParams>
static void SerializeElements(Array<S> input,
Buffer* buf,
- Array_Data<typename S::Data_*>* output) {
+ Array_Data<S_Data*>* output) {
for (size_t i = 0; i < input.size(); ++i) {
- typename S::Data_* element;
+ S_Data* element;
SerializeCaller<S, ElementValidateParams>::Run(
input[i].Pass(), buf, &element);
output->at(i) = element;
@@ -147,7 +166,7 @@
"null in array expecting valid pointers", input.size(), i));
}
}
- static void DeserializeElements(Array_Data<typename S::Data_*>* input,
+ static void DeserializeElements(Array_Data<S_Data*>* input,
Array<S>* output) {
Array<S> result(input->size());
for (size_t i = 0; i < input->size(); ++i) {
@@ -161,7 +180,9 @@
private:
template <typename T, typename Params>
struct SerializeCaller {
- static void Run(T input, Buffer* buf, typename T::Data_** output) {
+ static void Run(T input,
+ Buffer* buf,
+ typename internal::WrapperTraits<T>::DataType* output) {
static_assert((IsSame<Params, NoValidateParams>::value),
"Struct type should not have array validate params");
@@ -177,6 +198,15 @@
SerializeArray_<Params>(input.Pass(), buf, output);
}
};
+
+ template <typename T, typename U, typename Params>
+ struct SerializeCaller<Map<T, U>, Params> {
+ static void Run(Map<T, U> input,
+ Buffer* buf,
+ typename Map<T, U>::Data_** output) {
+ SerializeMap_<Params>(input.Pass(), buf, output);
+ }
+ };
};
template <>
diff --git a/mojo/public/cpp/bindings/lib/bindings_internal.h b/mojo/public/cpp/bindings/lib/bindings_internal.h
index 8650191..ec70d37 100644
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h
@@ -6,11 +6,18 @@
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
#include "mojo/public/cpp/bindings/lib/template_util.h"
+#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/system/core.h"
namespace mojo {
class String;
+template <typename T>
+class Array;
+
+template <typename K, typename V>
+class Map;
+
namespace internal {
template <typename T>
class Array_Data;
@@ -81,10 +88,41 @@
typedef H DataType;
};
template <typename S>
+struct WrapperTraits<StructPtr<S>, true> {
+ typedef typename S::Data_* DataType;
+};
+template <typename S>
+struct WrapperTraits<InlinedStructPtr<S>, true> {
+ typedef typename S::Data_* DataType;
+};
+template <typename S>
struct WrapperTraits<S, true> {
typedef typename S::Data_* DataType;
};
+template <typename T, typename Enable = void>
+struct ValueTraits {
+ static bool Equals(const T& a, const T& b) { return a == b; }
+};
+
+template <typename T>
+struct ValueTraits<
+ T,
+ typename EnableIf<IsSpecializationOf<Array, T>::value ||
+ IsSpecializationOf<Map, T>::value ||
+ IsSpecializationOf<StructPtr, T>::value ||
+ IsSpecializationOf<InlinedStructPtr, T>::value>::type> {
+ static bool Equals(const T& a, const T& b) { return a.Equals(b); }
+};
+
+template <typename T>
+struct ValueTraits<ScopedHandleBase<T>> {
+ static bool Equals(const ScopedHandleBase<T>& a,
+ const ScopedHandleBase<T>& b) {
+ return a.get().value() == b.get().value();
+ }
+};
+
} // namespace internal
} // namespace mojo
diff --git a/mojo/public/cpp/bindings/lib/map_data_internal.h b/mojo/public/cpp/bindings/lib/map_data_internal.h
new file mode 100644
index 0000000..7787714
--- /dev/null
+++ b/mojo/public/cpp/bindings/lib/map_data_internal.h
@@ -0,0 +1,118 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_DATA_INTERNAL_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_DATA_INTERNAL_H_
+
+#include "mojo/public/cpp/bindings/lib/array_internal.h"
+#include "mojo/public/cpp/bindings/lib/validate_params.h"
+#include "mojo/public/cpp/bindings/lib/validation_errors.h"
+
+namespace mojo {
+namespace internal {
+
+// Data types for keys.
+template <typename MapKey>
+struct MapKeyValidateParams {
+ public:
+ typedef NoValidateParams ElementValidateParams;
+ static const uint32_t expected_num_elements = 0;
+ static const bool element_is_nullable = false;
+};
+
+// For non-nullable strings only. (Which is OK; map keys can't be null.)
+template <>
+struct MapKeyValidateParams<mojo::internal::Array_Data<char>*> {
+ public:
+ typedef ArrayValidateParams<0, false, NoValidateParams> ElementValidateParams;
+ static const uint32_t expected_num_elements = 0;
+ static const bool element_is_nullable = false;
+};
+
+// Map serializes into a struct which has two arrays as struct fields, the keys
+// and the values.
+template <typename Key, typename Value>
+class Map_Data {
+ public:
+ static Map_Data* New(Buffer* buf) {
+ return new (buf->Allocate(sizeof(Map_Data))) Map_Data();
+ }
+
+ template <typename ValueParams>
+ static bool Validate(const void* data, BoundsChecker* bounds_checker) {
+ if (!data)
+ return true;
+
+ if (!ValidateStructHeader(data, sizeof(Map_Data), 2, bounds_checker))
+ return false;
+
+ const Map_Data* object = static_cast<const Map_Data*>(data);
+ if (!ValidateEncodedPointer(&object->keys.offset)) {
+ ReportValidationError(VALIDATION_ERROR_ILLEGAL_POINTER);
+ return false;
+ }
+ if (!object->keys.offset) {
+ ReportValidationError(VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
+ "null key array in map struct");
+ return false;
+ }
+ if (!Array_Data<Key>::template Validate<MapKeyValidateParams<Key>>(
+ DecodePointerRaw(&object->keys.offset), bounds_checker)) {
+ return false;
+ }
+
+ if (!ValidateEncodedPointer(&object->values.offset)) {
+ ReportValidationError(VALIDATION_ERROR_ILLEGAL_POINTER);
+ return false;
+ }
+ if (!object->values.offset) {
+ ReportValidationError(VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
+ "null value array in map struct");
+ return false;
+ }
+ if (!Array_Data<Value>::template Validate<ValueParams>(
+ DecodePointerRaw(&object->values.offset), bounds_checker)) {
+ return false;
+ }
+
+ const ArrayHeader* key_header =
+ static_cast<const ArrayHeader*>(DecodePointerRaw(&object->keys.offset));
+ const ArrayHeader* value_header = static_cast<const ArrayHeader*>(
+ DecodePointerRaw(&object->values.offset));
+ if (key_header->num_elements != value_header->num_elements) {
+ ReportValidationError(VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP);
+ return false;
+ }
+
+ return true;
+ }
+
+ StructHeader header_;
+
+ ArrayPointer<Key> keys;
+ ArrayPointer<Value> values;
+
+ void EncodePointersAndHandles(std::vector<mojo::Handle>* handles) {
+ Encode(&keys, handles);
+ Encode(&values, handles);
+ }
+
+ void DecodePointersAndHandles(std::vector<mojo::Handle>* handles) {
+ Decode(&keys, handles);
+ Decode(&values, handles);
+ }
+
+ private:
+ Map_Data() {
+ header_.num_bytes = sizeof(*this);
+ header_.num_fields = 2;
+ }
+ ~Map_Data() = delete;
+};
+static_assert(sizeof(Map_Data<char, char>) == 24, "Bad sizeof(Map_Data)");
+
+} // namespace internal
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_DATA_INTERNAL_H_
diff --git a/mojo/public/cpp/bindings/lib/map_internal.h b/mojo/public/cpp/bindings/lib/map_internal.h
new file mode 100644
index 0000000..aa0fe7e
--- /dev/null
+++ b/mojo/public/cpp/bindings/lib/map_internal.h
@@ -0,0 +1,200 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_INTERNAL_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_INTERNAL_H_
+
+#include <map>
+
+#include "mojo/public/cpp/bindings/array.h"
+#include "mojo/public/cpp/bindings/lib/template_util.h"
+
+namespace mojo {
+namespace internal {
+
+template <typename Key, typename Value, bool kValueIsMoveOnlyType>
+struct MapTraits {};
+
+template <typename Key, typename Value>
+struct MapTraits<Key, Value, false> {
+ // Map keys can't be move only types.
+ static_assert(!internal::IsMoveOnlyType<Key>::value,
+ "Map keys can not be move only types.");
+
+ typedef Key KeyStorageType;
+ typedef Key& KeyRefType;
+ typedef const Key& KeyConstRefType;
+ typedef KeyConstRefType KeyForwardType;
+
+ typedef Value ValueStorageType;
+ typedef Value& ValueRefType;
+ typedef const Value& ValueConstRefType;
+ typedef ValueConstRefType ValueForwardType;
+
+ static inline void InitializeFrom(
+ std::map<KeyStorageType, ValueStorageType>* m,
+ mojo::Array<Key> keys,
+ mojo::Array<Value> values) {
+ for (size_t i = 0; i < keys.size(); ++i)
+ Insert(m, keys[i], values[i]);
+ }
+ static inline void Decompose(std::map<KeyStorageType, ValueStorageType>* m,
+ mojo::Array<Key>* keys,
+ mojo::Array<Value>* values) {
+ keys->resize(m->size());
+ values->resize(m->size());
+ int i = 0;
+ for (typename std::map<KeyStorageType, ValueStorageType>::iterator
+ it = m->begin();
+ it != m->end();
+ ++it, ++i) {
+ (*keys)[i] = it->first;
+ (*values)[i] = it->second;
+ }
+ }
+ static inline void Finalize(std::map<KeyStorageType, ValueStorageType>* m) {}
+ static inline ValueRefType at(std::map<KeyStorageType, ValueStorageType>* m,
+ KeyForwardType key) {
+ // We don't have C++11 library support yet, so we have to emulate the crash
+ // on a non-existant key.
+ auto it = m->find(key);
+ MOJO_CHECK(it != m->end());
+ return it->second;
+ }
+ static inline ValueConstRefType at(
+ const std::map<KeyStorageType, ValueStorageType>* m,
+ KeyForwardType key) {
+ // We don't have C++11 library support yet, so we have to emulate the crash
+ // on a non-existant key.
+ auto it = m->find(key);
+ MOJO_CHECK(it != m->end());
+ return it->second;
+ }
+ static inline void Insert(std::map<KeyStorageType, ValueStorageType>* m,
+ KeyForwardType key,
+ ValueForwardType value) {
+ m->insert(std::make_pair(key, value));
+ }
+ static inline KeyConstRefType GetKey(
+ const typename std::map<KeyStorageType, ValueStorageType>::const_iterator&
+ it) {
+ return it->first;
+ }
+ static inline ValueConstRefType GetValue(
+ const typename std::map<KeyStorageType, ValueStorageType>::const_iterator&
+ it) {
+ return it->second;
+ }
+ static inline ValueRefType GetValue(
+ const typename std::map<KeyStorageType, ValueStorageType>::iterator& it) {
+ return it->second;
+ }
+ static inline void Clone(
+ const std::map<KeyStorageType, ValueStorageType>& src,
+ std::map<KeyStorageType, ValueStorageType>* dst) {
+ dst->clear();
+ for (auto it = src.begin(); it != src.end(); ++it)
+ dst->insert(*it);
+ }
+};
+
+template <typename Key, typename Value>
+struct MapTraits<Key, Value, true> {
+ // Map keys can't be move only types.
+ static_assert(!internal::IsMoveOnlyType<Key>::value,
+ "Map keys can not be move only types.");
+
+ typedef Key KeyStorageType;
+ typedef Key& KeyRefType;
+ typedef const Key& KeyConstRefType;
+ typedef KeyConstRefType KeyForwardType;
+
+ struct ValueStorageType {
+ // Make 8-byte aligned.
+ char buf[sizeof(Value) + (8 - (sizeof(Value) % 8)) % 8];
+ };
+ typedef Value& ValueRefType;
+ typedef const Value& ValueConstRefType;
+ typedef Value ValueForwardType;
+
+ static inline void InitializeFrom(
+ std::map<KeyStorageType, ValueStorageType>* m,
+ mojo::Array<Key> keys,
+ mojo::Array<Value> values) {
+ for (size_t i = 0; i < keys.size(); ++i)
+ Insert(m, keys[i], values[i]);
+ }
+ static inline void Decompose(std::map<KeyStorageType, ValueStorageType>* m,
+ mojo::Array<Key>* keys,
+ mojo::Array<Value>* values) {
+ keys->resize(m->size());
+ values->resize(m->size());
+ int i = 0;
+ for (typename std::map<KeyStorageType, ValueStorageType>::iterator
+ it = m->begin();
+ it != m->end();
+ ++it, ++i) {
+ (*keys)[i] = it->first;
+ (*values)[i] = GetValue(it).Pass();
+ }
+ }
+ static inline void Finalize(std::map<KeyStorageType, ValueStorageType>* m) {
+ for (auto& pair : *m)
+ reinterpret_cast<Value*>(pair.second.buf)->~Value();
+ }
+ static inline ValueRefType at(std::map<KeyStorageType, ValueStorageType>* m,
+ KeyForwardType key) {
+ // We don't have C++11 library support yet, so we have to emulate the crash
+ // on a non-existant key.
+ auto it = m->find(key);
+ MOJO_CHECK(it != m->end());
+ return GetValue(it);
+ }
+ static inline ValueConstRefType at(
+ const std::map<KeyStorageType, ValueStorageType>* m,
+ KeyForwardType key) {
+ // We don't have C++11 library support yet, so we have to emulate the crash
+ // on a non-existant key.
+ auto it = m->find(key);
+ MOJO_CHECK(it != m->end());
+ return GetValue(it);
+ }
+ static inline void Insert(std::map<KeyStorageType, ValueStorageType>* m,
+ KeyForwardType key,
+ ValueRefType value) {
+ // STL insert() doesn't insert |value| if |key| is already part of |m|. We
+ // have to use operator[] to initialize into the storage buffer, but we
+ // have to do a manual check so that we don't overwrite an existing object.
+ auto it = m->find(key);
+ if (it == m->end())
+ new ((*m)[key].buf) Value(value.Pass());
+ }
+ static inline KeyConstRefType GetKey(
+ const typename std::map<KeyStorageType, ValueStorageType>::const_iterator&
+ it) {
+ return it->first;
+ }
+ static inline ValueConstRefType GetValue(
+ const typename std::map<KeyStorageType, ValueStorageType>::const_iterator&
+ it) {
+ return *reinterpret_cast<const Value*>(it->second.buf);
+ }
+ static inline ValueRefType GetValue(
+ const typename std::map<KeyStorageType, ValueStorageType>::iterator& it) {
+ return *reinterpret_cast<Value*>(it->second.buf);
+ }
+ static inline void Clone(
+ const std::map<KeyStorageType, ValueStorageType>& src,
+ std::map<KeyStorageType, ValueStorageType>* dst) {
+ Finalize(dst);
+ dst->clear();
+ for (auto it = src.begin(); it != src.end(); ++it)
+ new ((*dst)[it->first].buf) Value(GetValue(it).Clone());
+ }
+};
+
+} // namespace internal
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_INTERNAL_H_
diff --git a/mojo/public/cpp/bindings/lib/map_serialization.h b/mojo/public/cpp/bindings/lib/map_serialization.h
new file mode 100644
index 0000000..4525a00
--- /dev/null
+++ b/mojo/public/cpp/bindings/lib/map_serialization.h
@@ -0,0 +1,156 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_
+
+#include "mojo/public/cpp/bindings/lib/array_internal.h"
+#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
+#include "mojo/public/cpp/bindings/lib/map_internal.h"
+#include "mojo/public/cpp/bindings/lib/string_serialization.h"
+#include "mojo/public/cpp/bindings/map.h"
+
+namespace mojo {
+
+template <typename Key, typename Value>
+inline size_t GetSerializedSize_(const Map<Key, Value>& input);
+
+template <typename ValidateParams, typename E, typename F>
+inline void SerializeArray_(Array<E> input,
+ internal::Buffer* buf,
+ internal::Array_Data<F>** output);
+
+namespace internal {
+
+template <typename MapType,
+ typename DataType,
+ bool kValueIsMoveOnlyType = IsMoveOnlyType<MapType>::value>
+struct MapSerializer;
+
+template <typename MapType, typename DataType>
+struct MapSerializer<MapType, DataType, false> {
+ static size_t GetBaseArraySize(size_t count) {
+ return Align(count * sizeof(DataType));
+ }
+ static size_t GetItemSize(const MapType& item) { return 0; }
+};
+
+template <>
+struct MapSerializer<bool, bool, false> {
+ static size_t GetBaseArraySize(size_t count) {
+ return Align((count + 7) / 8);
+ }
+ static size_t GetItemSize(bool item) { return 0; }
+};
+
+template <typename H>
+struct MapSerializer<ScopedHandleBase<H>, H, true> {
+ static size_t GetBaseArraySize(size_t count) {
+ return Align(count * sizeof(H));
+ }
+ static size_t GetItemSize(const H& item) { return 0; }
+};
+
+template <typename S>
+struct MapSerializer<S, typename S::Data_*, true> {
+ static size_t GetBaseArraySize(size_t count) {
+ return count * sizeof(internal::StructPointer<typename S::Data_>);
+ }
+ static size_t GetItemSize(const S& item) { return GetSerializedSize_(item); }
+};
+
+template <>
+struct MapSerializer<String, String_Data*, false> {
+ static size_t GetBaseArraySize(size_t count) {
+ return count * sizeof(internal::StringPointer);
+ }
+ static size_t GetItemSize(const String& item) {
+ return GetSerializedSize_(item);
+ }
+};
+
+} // namespace internal
+
+// TODO(erg): This can't go away yet. We still need to calculate out the size
+// of a struct header, and two arrays.
+template <typename MapKey, typename MapValue>
+inline size_t GetSerializedSize_(const Map<MapKey, MapValue>& input) {
+ if (!input)
+ return 0;
+ typedef typename internal::WrapperTraits<MapKey>::DataType DataKey;
+ typedef typename internal::WrapperTraits<MapValue>::DataType DataValue;
+
+ size_t count = input.size();
+ size_t struct_overhead = sizeof(mojo::internal::Map_Data<DataKey, DataValue>);
+ size_t key_base_size =
+ sizeof(internal::ArrayHeader) +
+ internal::MapSerializer<MapKey, DataKey>::GetBaseArraySize(count);
+ size_t value_base_size =
+ sizeof(internal::ArrayHeader) +
+ internal::MapSerializer<MapValue, DataValue>::GetBaseArraySize(count);
+
+ size_t key_data_size = 0;
+ size_t value_data_size = 0;
+ for (auto it = input.begin(); it != input.end(); ++it) {
+ key_data_size +=
+ internal::MapSerializer<MapKey, DataKey>::GetItemSize(it.GetKey());
+ value_data_size +=
+ internal::MapSerializer<MapValue, DataValue>::GetItemSize(
+ it.GetValue());
+ }
+
+ return struct_overhead + key_base_size + key_data_size + value_base_size +
+ value_data_size;
+}
+
+// We don't need a KeyValidateParams, because we konw exactly what params are
+// needed. (Keys are primitive types or non-nullable strings.)
+template <typename ValueValidateParams,
+ typename MapKey,
+ typename MapValue,
+ typename DataKey,
+ typename DataValue>
+inline void SerializeMap_(Map<MapKey, MapValue> input,
+ internal::Buffer* buf,
+ internal::Map_Data<DataKey, DataValue>** output) {
+ if (input) {
+ internal::Map_Data<DataKey, DataValue>* result =
+ internal::Map_Data<DataKey, DataValue>::New(buf);
+ if (result) {
+ Array<MapKey> keys;
+ Array<MapValue> values;
+ input.DecomposeMapTo(&keys, &values);
+ SerializeArray_<internal::MapKeyValidateParams<DataKey>>(
+ keys.Pass(), buf, &result->keys.ptr);
+ SerializeArray_<ValueValidateParams>(
+ values.Pass(), buf, &result->values.ptr);
+ }
+ *output = result;
+ } else {
+ *output = nullptr;
+ }
+}
+
+template <typename MapKey,
+ typename MapValue,
+ typename DataKey,
+ typename DataValue>
+inline void Deserialize_(internal::Map_Data<DataKey, DataValue>* input,
+ Map<MapKey, MapValue>* output) {
+ if (input) {
+ Array<MapKey> keys;
+ Array<MapValue> values;
+
+ Deserialize_(input->keys.ptr, &keys);
+ Deserialize_(input->values.ptr, &values);
+
+ *output = Map<MapKey, MapValue>(keys.Pass(), values.Pass());
+ } else {
+ output->reset();
+ }
+}
+
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_
diff --git a/mojo/public/cpp/bindings/lib/template_util.h b/mojo/public/cpp/bindings/lib/template_util.h
index bc459f1..c221a54 100644
--- a/mojo/public/cpp/bindings/lib/template_util.h
+++ b/mojo/public/cpp/bindings/lib/template_util.h
@@ -24,6 +24,11 @@
template <class T>
struct IsConst<const T> : TrueType {};
+template <class T>
+struct IsPointer : FalseType {};
+template <class T>
+struct IsPointer<T*> : TrueType {};
+
template <bool B, typename T = void>
struct EnableIf {};
@@ -92,6 +97,19 @@
!IsSame<Base const, void const>::value;
};
+template <class T>
+struct RemovePointer {};
+template <class T>
+struct RemovePointer<T*> {
+ typedef T type;
+};
+
+template <template <typename...> class Template, typename T>
+struct IsSpecializationOf : FalseType {};
+
+template <template <typename...> class Template, typename... Args>
+struct IsSpecializationOf<Template, Template<Args...>> : TrueType {};
+
} // namespace internal
} // namespace mojo
diff --git a/mojo/public/cpp/bindings/lib/validate_params.h b/mojo/public/cpp/bindings/lib/validate_params.h
new file mode 100644
index 0000000..25bd98c
--- /dev/null
+++ b/mojo/public/cpp/bindings/lib/validate_params.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_
+
+namespace mojo {
+namespace internal {
+
+// Array type information needed for valdiation.
+template <uint32_t in_expected_num_elements,
+ bool in_element_is_nullable,
+ typename InElementValidateParams>
+class ArrayValidateParams {
+ public:
+ // Validation information for elements. It is either another specialization
+ // of ArrayValidateParams (if elements are arrays or maps), or
+ // NoValidateParams. In the case of maps, this is used to validate the value
+ // array.
+ typedef InElementValidateParams ElementValidateParams;
+
+ // If |expected_num_elements| is not 0, the array is expected to have exactly
+ // that number of elements.
+ static const uint32_t expected_num_elements = in_expected_num_elements;
+ // Whether the elements are nullable.
+ static const bool element_is_nullable = in_element_is_nullable;
+};
+
+// NoValidateParams is used to indicate the end of an ArrayValidateParams chain.
+class NoValidateParams {};
+
+} // namespace internal
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.cc b/mojo/public/cpp/bindings/lib/validation_errors.cc
index 0f55789..b065d90 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.cc
+++ b/mojo/public/cpp/bindings/lib/validation_errors.cc
@@ -40,6 +40,8 @@
return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION";
case VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID:
return "VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID";
+ case VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP:
+ return "VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP";
}
return "Unknown error";
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.h b/mojo/public/cpp/bindings/lib/validation_errors.h
index ef5ab9e..2abb1b7 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.h
+++ b/mojo/public/cpp/bindings/lib/validation_errors.h
@@ -44,6 +44,9 @@
// |flags| in the message header indicates that a request ID is required but
// there isn't one.
VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID,
+ // Two parallel arrays which are supposed to represent a map have different
+ // lengths.
+ VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP
};
const char* ValidationErrorToString(ValidationError error);
diff --git a/mojo/public/cpp/bindings/map.h b/mojo/public/cpp/bindings/map.h
new file mode 100644
index 0000000..f09937a
--- /dev/null
+++ b/mojo/public/cpp/bindings/map.h
@@ -0,0 +1,225 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_MAP_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_MAP_H_
+
+#include <map>
+
+#include "mojo/public/cpp/bindings/lib/map_internal.h"
+
+namespace mojo {
+
+template <typename Key, typename Value>
+class Map {
+ MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(Map, RValue)
+ public:
+ // Map keys can not be move only classes.
+ static_assert(!internal::IsMoveOnlyType<Key>::value,
+ "Map keys can not be move only types.");
+
+ typedef internal::MapTraits<Key,
+ Value,
+ internal::IsMoveOnlyType<Value>::value> Traits;
+ typedef typename Traits::KeyStorageType KeyStorageType;
+ typedef typename Traits::KeyRefType KeyRefType;
+ typedef typename Traits::KeyConstRefType KeyConstRefType;
+ typedef typename Traits::KeyForwardType KeyForwardType;
+
+ typedef typename Traits::ValueStorageType ValueStorageType;
+ typedef typename Traits::ValueRefType ValueRefType;
+ typedef typename Traits::ValueConstRefType ValueConstRefType;
+ typedef typename Traits::ValueForwardType ValueForwardType;
+
+ typedef internal::Map_Data<typename internal::WrapperTraits<Key>::DataType,
+ typename internal::WrapperTraits<Value>::DataType>
+ Data_;
+
+ Map() : is_null_(true) {}
+
+ Map(mojo::Array<Key> keys, mojo::Array<Value> values) : is_null_(false) {
+ MOJO_DCHECK(keys.size() == values.size());
+ Traits::InitializeFrom(&map_, keys.Pass(), values.Pass());
+ }
+
+ ~Map() { Traits::Finalize(&map_); }
+
+ Map(RValue other) : is_null_(true) { Take(other.object); }
+ Map& operator=(RValue other) {
+ Take(other.object);
+ return *this;
+ }
+
+ template <typename U>
+ static Map From(const U& other) {
+ return TypeConverter<Map, U>::Convert(other);
+ }
+
+ template <typename U>
+ U To() const {
+ return TypeConverter<U, Map>::Convert(*this);
+ }
+
+ void reset() {
+ if (!map_.empty()) {
+ Traits::Finalize(&map_);
+ map_.clear();
+ }
+ is_null_ = true;
+ }
+
+ bool is_null() const { return is_null_; }
+
+ size_t size() const { return map_.size(); }
+
+ // Used to mark an empty map as non-null for serialization purposes.
+ void mark_non_null() { is_null_ = false; }
+
+ // Inserts a key-value pair into the map. Like std::map, this does not insert
+ // |value| if |key| is already a member of the map.
+ void insert(KeyForwardType key, ValueForwardType value) {
+ is_null_ = false;
+ Traits::Insert(&map_, key, value);
+ }
+
+ ValueRefType at(KeyForwardType key) { return Traits::at(&map_, key); }
+ ValueConstRefType at(KeyForwardType key) const {
+ return Traits::at(&map_, key);
+ }
+
+ void Swap(Map<Key, Value>* other) {
+ std::swap(is_null_, other->is_null_);
+ map_.swap(other->map_);
+ }
+ void Swap(std::map<Key, Value>* other) {
+ is_null_ = false;
+ map_.swap(*other);
+ }
+
+ // This moves all values in the map to a set of parallel arrays. This action
+ // is destructive because we can have move-only objects as values; therefore
+ // we can't have copy semantics here.
+ void DecomposeMapTo(mojo::Array<Key>* keys, mojo::Array<Value>* values) {
+ Traits::Decompose(&map_, keys, values);
+ Traits::Finalize(&map_);
+ map_.clear();
+ is_null_ = true;
+ }
+
+ // Please note that calling this method will fail compilation if the value
+ // type cannot be cloned (which usually means that it is a Mojo handle type or
+ // a type contains Mojo handles).
+ Map Clone() const {
+ Map result;
+ result.is_null_ = is_null_;
+ Traits::Clone(map_, &result.map_);
+ return result.Pass();
+ }
+
+ bool Equals(const Map& other) const {
+ if (is_null() != other.is_null())
+ return false;
+ if (size() != other.size())
+ return false;
+ auto i = begin();
+ auto j = other.begin();
+ while (i != end()) {
+ if (i.GetKey() != j.GetKey())
+ return false;
+ if (!internal::ValueTraits<Value>::Equals(i.GetValue(), j.GetValue()))
+ return false;
+ ++i;
+ ++j;
+ }
+ return true;
+ }
+
+ class ConstMapIterator {
+ public:
+ ConstMapIterator(
+ const typename std::map<KeyStorageType,
+ ValueStorageType>::const_iterator& it)
+ : it_(it) {}
+
+ KeyConstRefType GetKey() { return Traits::GetKey(it_); }
+ ValueConstRefType GetValue() { return Traits::GetValue(it_); }
+
+ ConstMapIterator& operator++() {
+ it_++;
+ return *this;
+ }
+ bool operator!=(const ConstMapIterator& rhs) const {
+ return it_ != rhs.it_;
+ }
+ bool operator==(const ConstMapIterator& rhs) const {
+ return it_ == rhs.it_;
+ }
+
+ private:
+ typename std::map<KeyStorageType, ValueStorageType>::const_iterator it_;
+ };
+
+ // Provide read-only iteration over map members.
+ ConstMapIterator begin() const { return ConstMapIterator(map_.begin()); }
+ ConstMapIterator end() const { return ConstMapIterator(map_.end()); }
+
+ ConstMapIterator find(KeyForwardType key) const {
+ return ConstMapIterator(map_.find(key));
+ }
+
+ private:
+ typedef std::map<KeyStorageType, ValueStorageType> Map::*Testable;
+
+ public:
+ operator Testable() const { return is_null_ ? 0 : &Map::map_; }
+
+ private:
+ void Take(Map* other) {
+ reset();
+ Swap(other);
+ }
+
+ std::map<KeyStorageType, ValueStorageType> map_;
+ bool is_null_;
+};
+
+template <typename MojoKey,
+ typename MojoValue,
+ typename STLKey,
+ typename STLValue>
+struct TypeConverter<Map<MojoKey, MojoValue>, std::map<STLKey, STLValue>> {
+ static Map<MojoKey, MojoValue> Convert(
+ const std::map<STLKey, STLValue>& input) {
+ Map<MojoKey, MojoValue> result;
+ result.mark_non_null();
+ for (auto& pair : input) {
+ result.insert(TypeConverter<MojoKey, STLKey>::Convert(pair.first),
+ TypeConverter<MojoValue, STLValue>::Convert(pair.second));
+ }
+ return result.Pass();
+ }
+};
+
+template <typename MojoKey,
+ typename MojoValue,
+ typename STLKey,
+ typename STLValue>
+struct TypeConverter<std::map<STLKey, STLValue>, Map<MojoKey, MojoValue>> {
+ static std::map<STLKey, STLValue> Convert(
+ const Map<MojoKey, MojoValue>& input) {
+ std::map<STLKey, STLValue> result;
+ if (!input.is_null()) {
+ for (auto it = input.begin(); it != input.end(); ++it) {
+ result.insert(std::make_pair(
+ TypeConverter<STLKey, MojoKey>::Convert(it.GetKey()),
+ TypeConverter<STLValue, MojoValue>::Convert(it.GetValue())));
+ }
+ }
+ return result;
+ }
+};
+
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_MAP_H_
diff --git a/mojo/public/cpp/bindings/string.h b/mojo/public/cpp/bindings/string.h
index 3c1520a..ba0d8fa 100644
--- a/mojo/public/cpp/bindings/string.h
+++ b/mojo/public/cpp/bindings/string.h
@@ -25,6 +25,9 @@
}
String(const char* chars, size_t num_chars)
: value_(chars, num_chars), is_null_(false) {}
+ String(const mojo::String& str)
+ : value_(str.value_), is_null_(str.is_null_) {}
+
template <size_t N>
String(const char chars[N])
: value_(chars, N - 1), is_null_(false) {}
@@ -39,6 +42,11 @@
return TypeConverter<U, String>::Convert(*this);
}
+ String& operator=(const mojo::String& str) {
+ value_ = str.value_;
+ is_null_ = str.is_null_;
+ return *this;
+ }
String& operator=(const std::string& str) {
value_ = str;
is_null_ = false;
@@ -115,6 +123,15 @@
return out << s.get();
}
+inline bool operator<(const String& a, const String& b) {
+ if (a.is_null())
+ return !b.is_null();
+ if (b.is_null())
+ return false;
+
+ return a.get() < b.get();
+}
+
// TODO(darin): Add similar variants of operator<,<=,>,>=
template <>
diff --git a/mojo/public/cpp/bindings/struct_ptr.h b/mojo/public/cpp/bindings/struct_ptr.h
index 75a46bb..efcf255 100644
--- a/mojo/public/cpp/bindings/struct_ptr.h
+++ b/mojo/public/cpp/bindings/struct_ptr.h
@@ -7,6 +7,7 @@
#include <new>
+#include "mojo/public/cpp/bindings/type_converter.h"
#include "mojo/public/cpp/environment/logging.h"
#include "mojo/public/cpp/system/macros.h"
@@ -29,7 +30,6 @@
MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(StructPtr, RValue);
public:
- typedef typename Struct::Data_ Data_;
StructPtr() : ptr_(nullptr) {}
~StructPtr() { delete ptr_; }
@@ -71,6 +71,12 @@
// that it contains Mojo handles).
StructPtr Clone() const { return is_null() ? StructPtr() : ptr_->Clone(); }
+ bool Equals(const StructPtr& other) const {
+ if (is_null() || other.is_null())
+ return is_null() && other.is_null();
+ return ptr_->Equals(*other.ptr_);
+ }
+
private:
typedef Struct* StructPtr::*Testable;
@@ -98,7 +104,6 @@
MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(InlinedStructPtr, RValue);
public:
- typedef typename Struct::Data_ Data_;
InlinedStructPtr() : is_null_(true) {}
~InlinedStructPtr() {}
@@ -140,6 +145,11 @@
InlinedStructPtr Clone() const {
return is_null() ? InlinedStructPtr() : value_.Clone();
}
+ bool Equals(const InlinedStructPtr& other) const {
+ if (is_null() || other.is_null())
+ return is_null() && other.is_null();
+ return value_.Equals(other.value_);
+ }
private:
typedef Struct InlinedStructPtr::*Testable;
diff --git a/mojo/public/cpp/bindings/tests/BUILD.gn b/mojo/public/cpp/bindings/tests/BUILD.gn
index 12b122c..9e6deab 100644
--- a/mojo/public/cpp/bindings/tests/BUILD.gn
+++ b/mojo/public/cpp/bindings/tests/BUILD.gn
@@ -9,8 +9,11 @@
"bounds_checker_unittest.cc",
"buffer_unittest.cc",
"connector_unittest.cc",
+ "container_test_util.cc",
+ "equals_unittest.cc",
"handle_passing_unittest.cc",
"interface_ptr_unittest.cc",
+ "map_unittest.cc",
"request_response_unittest.cc",
"router_unittest.cc",
"sample_service_unittest.cc",
diff --git a/mojo/public/cpp/bindings/tests/array_unittest.cc b/mojo/public/cpp/bindings/tests/array_unittest.cc
index b899513..133fa8b 100644
--- a/mojo/public/cpp/bindings/tests/array_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/array_unittest.cc
@@ -6,6 +6,7 @@
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/array_serialization.h"
#include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
+#include "mojo/public/cpp/bindings/tests/container_test_util.h"
#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -20,60 +21,6 @@
using mojo::internal::NoValidateParams;
using mojo::internal::String_Data;
-class CopyableType {
- public:
- CopyableType() : copied_(false), ptr_(this) { num_instances_++; }
- CopyableType(const CopyableType& other) : copied_(true), ptr_(other.ptr()) {
- num_instances_++;
- }
- CopyableType& operator=(const CopyableType& other) {
- copied_ = true;
- ptr_ = other.ptr();
- return *this;
- }
- ~CopyableType() { num_instances_--; }
-
- bool copied() const { return copied_; }
- static size_t num_instances() { return num_instances_; }
- CopyableType* ptr() const { return ptr_; }
- void ResetCopied() { copied_ = false; }
-
- private:
- bool copied_;
- static size_t num_instances_;
- CopyableType* ptr_;
-};
-
-size_t CopyableType::num_instances_ = 0;
-
-class MoveOnlyType {
- MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(MoveOnlyType, RValue)
- public:
- typedef MoveOnlyType Data_;
- MoveOnlyType() : moved_(false), ptr_(this) { num_instances_++; }
- MoveOnlyType(RValue other) : moved_(true), ptr_(other.object->ptr()) {
- num_instances_++;
- }
- MoveOnlyType& operator=(RValue other) {
- moved_ = true;
- ptr_ = other.object->ptr();
- return *this;
- }
- ~MoveOnlyType() { num_instances_--; }
-
- bool moved() const { return moved_; }
- static size_t num_instances() { return num_instances_; }
- MoveOnlyType* ptr() const { return ptr_; }
- void ResetMoved() { moved_ = false; }
-
- private:
- bool moved_;
- static size_t num_instances_;
- MoveOnlyType* ptr_;
-};
-
-size_t MoveOnlyType::num_instances_ = 0;
-
class ArrayTest : public testing::Test {
public:
virtual ~ArrayTest() {}
diff --git a/mojo/public/cpp/bindings/tests/container_test_util.cc b/mojo/public/cpp/bindings/tests/container_test_util.cc
new file mode 100644
index 0000000..12fdaba
--- /dev/null
+++ b/mojo/public/cpp/bindings/tests/container_test_util.cc
@@ -0,0 +1,50 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/public/cpp/bindings/tests/container_test_util.h"
+
+namespace mojo {
+
+size_t CopyableType::num_instances_ = 0;
+size_t MoveOnlyType::num_instances_ = 0;
+
+CopyableType::CopyableType() : copied_(false), ptr_(this) {
+ num_instances_++;
+}
+
+CopyableType::CopyableType(const CopyableType& other)
+ : copied_(true), ptr_(other.ptr()) {
+ num_instances_++;
+}
+
+CopyableType& CopyableType::operator=(const CopyableType& other) {
+ copied_ = true;
+ ptr_ = other.ptr();
+ return *this;
+}
+
+CopyableType::~CopyableType() {
+ num_instances_--;
+}
+
+MoveOnlyType::MoveOnlyType() : moved_(false), ptr_(this) {
+ num_instances_++;
+}
+
+MoveOnlyType::MoveOnlyType(RValue other)
+ : moved_(true), ptr_(other.object->ptr()) {
+ num_instances_++;
+}
+
+MoveOnlyType& MoveOnlyType::operator=(RValue other) {
+ moved_ = true;
+ ptr_ = other.object->ptr();
+ return *this;
+}
+
+MoveOnlyType::~MoveOnlyType() {
+ num_instances_--;
+}
+
+} // namespace mojo
diff --git a/mojo/public/cpp/bindings/tests/container_test_util.h b/mojo/public/cpp/bindings/tests/container_test_util.h
new file mode 100644
index 0000000..1c3e5ee
--- /dev/null
+++ b/mojo/public/cpp/bindings/tests/container_test_util.h
@@ -0,0 +1,52 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_CONTAINER_TEST_UTIL_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_TESTS_CONTAINER_TEST_UTIL_H_
+
+#include "mojo/public/cpp/system/macros.h"
+
+namespace mojo {
+
+class CopyableType {
+ public:
+ CopyableType();
+ CopyableType(const CopyableType& other);
+ CopyableType& operator=(const CopyableType& other);
+ ~CopyableType();
+
+ bool copied() const { return copied_; }
+ static size_t num_instances() { return num_instances_; }
+ CopyableType* ptr() const { return ptr_; }
+ void ResetCopied() { copied_ = false; }
+
+ private:
+ bool copied_;
+ static size_t num_instances_;
+ CopyableType* ptr_;
+};
+
+class MoveOnlyType {
+ MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(MoveOnlyType, RValue)
+ public:
+ typedef MoveOnlyType Data_;
+ MoveOnlyType();
+ MoveOnlyType(RValue other);
+ MoveOnlyType& operator=(RValue other);
+ ~MoveOnlyType();
+
+ bool moved() const { return moved_; }
+ static size_t num_instances() { return num_instances_; }
+ MoveOnlyType* ptr() const { return ptr_; }
+ void ResetMoved() { moved_ = false; }
+
+ private:
+ bool moved_;
+ static size_t num_instances_;
+ MoveOnlyType* ptr_;
+};
+
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_CONTAINER_TEST_UTIL_H_
diff --git a/mojo/public/cpp/bindings/tests/equals_unittest.cc b/mojo/public/cpp/bindings/tests/equals_unittest.cc
new file mode 100644
index 0000000..38c78cb
--- /dev/null
+++ b/mojo/public/cpp/bindings/tests/equals_unittest.cc
@@ -0,0 +1,120 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/public/cpp/environment/environment.h"
+#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mojo {
+namespace test {
+
+namespace {
+
+RectPtr CreateRect() {
+ RectPtr r = Rect::New();
+ r->x = 1;
+ r->y = 2;
+ r->width = 3;
+ r->height = 4;
+ return r.Pass();
+}
+
+class EqualsTest : public testing::Test {
+ public:
+ virtual ~EqualsTest() {}
+
+ private:
+ Environment env_;
+};
+}
+
+TEST_F(EqualsTest, Null) {
+ RectPtr r1;
+ RectPtr r2;
+ EXPECT_TRUE(r1.Equals(r2));
+ EXPECT_TRUE(r2.Equals(r1));
+
+ r1 = CreateRect();
+ EXPECT_FALSE(r1.Equals(r2));
+ EXPECT_FALSE(r2.Equals(r1));
+}
+
+TEST_F(EqualsTest, EqualsStruct) {
+ RectPtr r1(CreateRect());
+ RectPtr r2(r1.Clone());
+ EXPECT_TRUE(r1.Equals(r2));
+ r2->y = 1;
+ EXPECT_FALSE(r1.Equals(r2));
+ r2.reset();
+ EXPECT_FALSE(r1.Equals(r2));
+}
+
+TEST_F(EqualsTest, EqualsStructNested) {
+ RectPairPtr p1(RectPair::New());
+ p1->first = CreateRect();
+ p1->second = CreateRect();
+ RectPairPtr p2(p1.Clone());
+ EXPECT_TRUE(p1.Equals(p2));
+ p2->second->width = 0;
+ EXPECT_FALSE(p1.Equals(p2));
+ p2->second.reset();
+ EXPECT_FALSE(p1.Equals(p2));
+}
+
+TEST_F(EqualsTest, EqualsArray) {
+ NamedRegionPtr n1(NamedRegion::New());
+ n1->name = "n1";
+ n1->rects.push_back(CreateRect());
+ NamedRegionPtr n2(n1.Clone());
+ EXPECT_TRUE(n1.Equals(n2));
+
+ n2->rects.reset();
+ EXPECT_FALSE(n1.Equals(n2));
+ n2->rects.resize(0);
+ EXPECT_FALSE(n1.Equals(n2));
+
+ n2->rects.push_back(CreateRect());
+ n2->rects.push_back(CreateRect());
+ EXPECT_FALSE(n1.Equals(n2));
+
+ n2->rects.resize(1);
+ n2->rects[0]->width = 0;
+ EXPECT_FALSE(n1.Equals(n2));
+
+ n2->rects[0] = CreateRect();
+ EXPECT_TRUE(n1.Equals(n2));
+}
+
+TEST_F(EqualsTest, EqualsMap) {
+ auto n1(NamedRegion::New());
+ n1->name = "foo";
+ n1->rects.push_back(CreateRect());
+
+ Map<std::string, NamedRegionPtr> m1;
+ m1.insert("foo", n1.Pass());
+
+ decltype(m1) m2;
+ EXPECT_FALSE(m1.Equals(m2));
+
+ m2.insert("bar", m1.at("foo").Clone());
+ EXPECT_FALSE(m1.Equals(m2));
+
+ m2 = m1.Clone();
+ m2.at("foo")->name = "monkey";
+ EXPECT_FALSE(m1.Equals(m2));
+
+ m2 = m1.Clone();
+ m2.at("foo")->rects.push_back(Rect::New());
+ EXPECT_FALSE(m1.Equals(m2));
+
+ m2.at("foo")->rects.resize(1);
+ m2.at("foo")->rects[0]->width = 1;
+ EXPECT_FALSE(m1.Equals(m2));
+
+ m2 = m1.Clone();
+ EXPECT_TRUE(m1.Equals(m2));
+}
+
+} // test
+} // mojo
diff --git a/mojo/public/cpp/bindings/tests/map_unittest.cc b/mojo/public/cpp/bindings/tests/map_unittest.cc
new file mode 100644
index 0000000..159afb9
--- /dev/null
+++ b/mojo/public/cpp/bindings/tests/map_unittest.cc
@@ -0,0 +1,338 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/public/cpp/bindings/array.h"
+#include "mojo/public/cpp/bindings/lib/array_serialization.h"
+#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
+#include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
+#include "mojo/public/cpp/bindings/map.h"
+#include "mojo/public/cpp/bindings/string.h"
+#include "mojo/public/cpp/bindings/struct_ptr.h"
+#include "mojo/public/cpp/bindings/tests/container_test_util.h"
+#include "mojo/public/cpp/environment/environment.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mojo {
+namespace test {
+
+namespace {
+
+struct StringIntData {
+ const char* string_data;
+ int int_data;
+} kStringIntData[] = {
+ {"one", 1},
+ {"two", 2},
+ {"three", 3},
+ {"four", 4},
+};
+
+const size_t kStringIntDataSize = 4;
+
+class MapTest : public testing::Test {
+ public:
+ virtual ~MapTest() {}
+
+ private:
+ Environment env_;
+};
+
+// Tests that basic Map operations work.
+TEST_F(MapTest, InsertWorks) {
+ Map<String, int> map;
+ for (size_t i = 0; i < kStringIntDataSize; ++i)
+ map.insert(kStringIntData[i].string_data, kStringIntData[i].int_data);
+
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ EXPECT_EQ(kStringIntData[i].int_data,
+ map.at(kStringIntData[i].string_data));
+ }
+}
+
+TEST_F(MapTest, ConstructedFromArray) {
+ Array<String> keys(kStringIntDataSize);
+ Array<int> values(kStringIntDataSize);
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ keys[i] = kStringIntData[i].string_data;
+ values[i] = kStringIntData[i].int_data;
+ }
+
+ Map<String, int> map(keys.Pass(), values.Pass());
+
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ EXPECT_EQ(kStringIntData[i].int_data,
+ map.at(mojo::String(kStringIntData[i].string_data)));
+ }
+}
+
+TEST_F(MapTest, DecomposeMapTo) {
+ Array<String> keys(kStringIntDataSize);
+ Array<int> values(kStringIntDataSize);
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ keys[i] = kStringIntData[i].string_data;
+ values[i] = kStringIntData[i].int_data;
+ }
+
+ Map<String, int> map(keys.Pass(), values.Pass());
+ EXPECT_EQ(kStringIntDataSize, map.size());
+
+ Array<String> keys2;
+ Array<int> values2;
+ map.DecomposeMapTo(&keys2, &values2);
+ EXPECT_EQ(0u, map.size());
+
+ EXPECT_EQ(kStringIntDataSize, keys2.size());
+ EXPECT_EQ(kStringIntDataSize, values2.size());
+
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ // We are not guaranteed that the copies have the same sorting as the
+ // originals.
+ String key = kStringIntData[i].string_data;
+ int value = kStringIntData[i].int_data;
+
+ bool found = false;
+ for (size_t j = 0; j < keys2.size(); ++j) {
+ if (keys2[j] == key) {
+ EXPECT_EQ(value, values2[j]);
+ found = true;
+ break;
+ }
+ }
+
+ EXPECT_TRUE(found);
+ }
+}
+
+TEST_F(MapTest, Insert_Copyable) {
+ ASSERT_EQ(0u, CopyableType::num_instances());
+ mojo::Map<mojo::String, CopyableType> map;
+ std::vector<CopyableType*> value_ptrs;
+
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ const char* key = kStringIntData[i].string_data;
+ CopyableType value;
+ value_ptrs.push_back(value.ptr());
+ map.insert(key, value);
+ ASSERT_EQ(i + 1, map.size());
+ ASSERT_EQ(i + 1, value_ptrs.size());
+ EXPECT_EQ(map.size() + 1, CopyableType::num_instances());
+ EXPECT_TRUE(map.at(key).copied());
+ EXPECT_EQ(value_ptrs[i], map.at(key).ptr());
+ map.at(key).ResetCopied();
+ EXPECT_TRUE(map);
+ }
+
+ // std::map doesn't have a capacity() method like std::vector so this test is
+ // a lot more boring.
+
+ map.reset();
+ EXPECT_EQ(0u, CopyableType::num_instances());
+}
+
+TEST_F(MapTest, Insert_MoveOnly) {
+ ASSERT_EQ(0u, MoveOnlyType::num_instances());
+ mojo::Map<mojo::String, MoveOnlyType> map;
+ std::vector<MoveOnlyType*> value_ptrs;
+
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ const char* key = kStringIntData[i].string_data;
+ MoveOnlyType value;
+ value_ptrs.push_back(value.ptr());
+ map.insert(key, value.Pass());
+ ASSERT_EQ(i + 1, map.size());
+ ASSERT_EQ(i + 1, value_ptrs.size());
+ EXPECT_EQ(map.size() + 1, MoveOnlyType::num_instances());
+ EXPECT_TRUE(map.at(key).moved());
+ EXPECT_EQ(value_ptrs[i], map.at(key).ptr());
+ map.at(key).ResetMoved();
+ EXPECT_TRUE(map);
+ }
+
+ // std::map doesn't have a capacity() method like std::vector so this test is
+ // a lot more boring.
+
+ map.reset();
+ EXPECT_EQ(0u, CopyableType::num_instances());
+}
+
+TEST_F(MapTest, STLToMojo) {
+ std::map<std::string, int> stl_data;
+ for (size_t i = 0; i < kStringIntDataSize; ++i)
+ stl_data[kStringIntData[i].string_data] = kStringIntData[i].int_data;
+
+ Map<String, int32_t> mojo_data = Map<String, int32_t>::From(stl_data);
+
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ EXPECT_EQ(kStringIntData[i].int_data,
+ mojo_data.at(kStringIntData[i].string_data));
+ }
+}
+
+TEST_F(MapTest, MojoToSTL) {
+ Map<String, int32_t> mojo_map;
+ for (size_t i = 0; i < kStringIntDataSize; ++i)
+ mojo_map.insert(kStringIntData[i].string_data, kStringIntData[i].int_data);
+
+ std::map<std::string, int> stl_map =
+ mojo_map.To<std::map<std::string, int>>();
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ auto it = stl_map.find(kStringIntData[i].string_data);
+ ASSERT_TRUE(it != stl_map.end());
+ EXPECT_EQ(kStringIntData[i].int_data, it->second);
+ }
+}
+
+TEST_F(MapTest, MapArrayClone) {
+ Map<String, Array<String>> m;
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ Array<String> s;
+ s.push_back(kStringIntData[i].string_data);
+ m.insert(kStringIntData[i].string_data, s.Pass());
+ }
+
+ Map<String, Array<String>> m2 = m.Clone();
+
+ for (auto it = m2.begin(); it != m2.end(); ++it) {
+ ASSERT_EQ(1u, it.GetValue().size());
+ EXPECT_EQ(it.GetKey(), it.GetValue().at(0));
+ }
+}
+
+// Data class for an end-to-end test of serialization. Because making a more
+// limited test case tickles a clang compiler bug, we copy a minimal version of
+// what our current cpp bindings do.
+namespace internal {
+
+class ArrayOfMap_Data {
+ public:
+ static ArrayOfMap_Data* New(mojo::internal::Buffer* buf) {
+ return new (buf->Allocate(sizeof(ArrayOfMap_Data))) ArrayOfMap_Data();
+ }
+
+ mojo::internal::StructHeader header_;
+
+ mojo::internal::ArrayPointer<mojo::internal::Map_Data<int32_t, int8_t>*>
+ first;
+ mojo::internal::ArrayPointer<
+ mojo::internal::Map_Data<mojo::internal::String_Data*,
+ mojo::internal::Array_Data<bool>*>*> second;
+
+ private:
+ ArrayOfMap_Data() {
+ header_.num_bytes = sizeof(*this);
+ header_.num_fields = 2;
+ }
+ ~ArrayOfMap_Data(); // NOT IMPLEMENTED
+};
+static_assert(sizeof(ArrayOfMap_Data) == 24, "Bad sizeof(ArrayOfMap_Data)");
+
+} // namespace internal
+
+class ArrayOfMapImpl;
+typedef mojo::StructPtr<ArrayOfMapImpl> ArrayOfMapImplPtr;
+
+class ArrayOfMapImpl {
+ public:
+ typedef internal::ArrayOfMap_Data Data_;
+ static ArrayOfMapImplPtr New() {
+ ArrayOfMapImplPtr rv;
+ mojo::internal::StructHelper<ArrayOfMapImpl>::Initialize(&rv);
+ return rv.Pass();
+ }
+
+ mojo::Array<mojo::Map<int32_t, int8_t>> first;
+ mojo::Array<mojo::Map<mojo::String, mojo::Array<bool>>> second;
+};
+
+size_t GetSerializedSize_(const ArrayOfMapImplPtr& input) {
+ if (!input)
+ return 0;
+ size_t size = sizeof(internal::ArrayOfMap_Data);
+ size += GetSerializedSize_(input->first);
+ size += GetSerializedSize_(input->second);
+ return size;
+}
+
+void Serialize_(ArrayOfMapImplPtr input,
+ mojo::internal::Buffer* buf,
+ internal::ArrayOfMap_Data** output) {
+ if (input) {
+ internal::ArrayOfMap_Data* result = internal::ArrayOfMap_Data::New(buf);
+ mojo::SerializeArray_<mojo::internal::ArrayValidateParams<
+ 0,
+ false,
+ mojo::internal::
+ ArrayValidateParams<0, false, mojo::internal::NoValidateParams>>>(
+ mojo::internal::Forward(input->first), buf, &result->first.ptr);
+ MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
+ !result->first.ptr,
+ mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
+ "null first field in ArrayOfMapImpl struct");
+ mojo::SerializeArray_<mojo::internal::ArrayValidateParams<
+ 0,
+ false,
+ mojo::internal::ArrayValidateParams<
+ 0,
+ false,
+ mojo::internal::ArrayValidateParams<
+ 0,
+ false,
+ mojo::internal::NoValidateParams>>>>(
+ mojo::internal::Forward(input->second), buf, &result->second.ptr);
+ MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
+ !result->second.ptr,
+ mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
+ "null second field in ArrayOfMapImpl struct");
+ *output = result;
+ } else {
+ *output = nullptr;
+ }
+}
+
+void Deserialize_(internal::ArrayOfMap_Data* input, ArrayOfMapImplPtr* output) {
+ if (input) {
+ ArrayOfMapImplPtr result(ArrayOfMapImpl::New());
+ Deserialize_(input->first.ptr, &result->first);
+ Deserialize_(input->second.ptr, &result->second);
+ *output = result.Pass();
+ } else {
+ output->reset();
+ }
+}
+
+TEST_F(MapTest, ArrayOfMap) {
+ Array<Map<int32_t, int8_t>> first_array(1);
+ first_array[0].insert(1, 42);
+
+ Array<Map<String, Array<bool>>> second_array(1);
+ Array<bool> map_value(2);
+ map_value[0] = false;
+ map_value[1] = true;
+ second_array[0].insert("hello world", map_value.Pass());
+
+ ArrayOfMapImplPtr to_pass(ArrayOfMapImpl::New());
+ to_pass->first = first_array.Pass();
+ to_pass->second = second_array.Pass();
+
+ size_t size = GetSerializedSize_(to_pass);
+ mojo::internal::FixedBuffer buf(size);
+ internal::ArrayOfMap_Data* data;
+ Serialize_(mojo::internal::Forward(to_pass), &buf, &data);
+
+ ArrayOfMapImplPtr to_receive(ArrayOfMapImpl::New());
+ Deserialize_(data, &to_receive);
+
+ ASSERT_EQ(1u, to_receive->first.size());
+ ASSERT_EQ(1u, to_receive->first[0].size());
+ ASSERT_EQ(42, to_receive->first[0].at(1));
+
+ ASSERT_EQ(1u, to_receive->second.size());
+ ASSERT_EQ(1u, to_receive->second[0].size());
+ ASSERT_FALSE(to_receive->second[0].at("hello world")[0]);
+ ASSERT_TRUE(to_receive->second[0].at("hello world")[1]);
+}
+
+} // namespace
+} // namespace test
+} // namespace mojo
diff --git a/mojo/public/cpp/bindings/tests/router_unittest.cc b/mojo/public/cpp/bindings/tests/router_unittest.cc
index 287a96d..e48b91f 100644
--- a/mojo/public/cpp/bindings/tests/router_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/router_unittest.cc
@@ -96,7 +96,7 @@
private:
MessageReceiver* responder_;
uint32_t name_;
- uint32_t request_id_;
+ uint64_t request_id_;
};
class RouterTest : public testing::Test {
diff --git a/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc b/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
index b8eeaa6..fc0508c 100644
--- a/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
@@ -44,7 +44,8 @@
protected:
template <typename T>
- void TestWarning(T obj, mojo::internal::ValidationError expected_warning) {
+ void TestWarning(StructPtr<T> obj,
+ mojo::internal::ValidationError expected_warning) {
warning_observer_.set_last_warning(mojo::internal::VALIDATION_ERROR_NONE);
mojo::internal::FixedBuffer buf(GetSerializedSize_(obj));
diff --git a/mojo/public/cpp/bindings/tests/string_unittest.cc b/mojo/public/cpp/bindings/tests/string_unittest.cc
index 6f85443..7e3d910 100644
--- a/mojo/public/cpp/bindings/tests/string_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/string_unittest.cc
@@ -61,5 +61,16 @@
EXPECT_TRUE(s != "not");
}
+TEST(StringTest, LessThanNullness) {
+ String null;
+ String null2;
+ EXPECT_FALSE(null < null2);
+ EXPECT_FALSE(null2 < null);
+
+ String real("real");
+ EXPECT_TRUE(null < real);
+ EXPECT_FALSE(real < null);
+}
+
} // namespace test
} // namespace mojo
diff --git a/mojo/public/cpp/bindings/tests/validation_unittest.cc b/mojo/public/cpp/bindings/tests/validation_unittest.cc
index e7f8cc2..8a3b19b 100644
--- a/mojo/public/cpp/bindings/tests/validation_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/validation_unittest.cc
@@ -168,7 +168,7 @@
std::string result;
mojo::internal::ValidationErrorObserverForTesting observer;
- bool unused MOJO_ALLOW_UNUSED = test_message_receiver->Accept(&message);
+ mojo_ignore_result(test_message_receiver->Accept(&message));
if (observer.last_error() == mojo::internal::VALIDATION_ERROR_NONE)
result = "PASS";
else
diff --git a/mojo/public/cpp/environment/logging.h b/mojo/public/cpp/environment/logging.h
index 00baf01..5df18fb 100644
--- a/mojo/public/cpp/environment/logging.h
+++ b/mojo/public/cpp/environment/logging.h
@@ -46,7 +46,8 @@
#define MOJO_DLOG(level) MOJO_LAZY_LOG_STREAM(level, false)
#define MOJO_DLOG_IF(level, condition) MOJO_LAZY_LOG_STREAM(level, false)
-#define MOJO_DCHECK(condition) MOJO_LAZY_LOG_STREAM(FATAL, false && (condition))
+#define MOJO_DCHECK(condition) \
+ MOJO_LAZY_LOG_STREAM(FATAL, false ? !(condition) : false)
#else
diff --git a/mojo/public/cpp/system/buffer.h b/mojo/public/cpp/system/buffer.h
index 8b6a618..6817297 100644
--- a/mojo/public/cpp/system/buffer.h
+++ b/mojo/public/cpp/system/buffer.h
@@ -91,16 +91,16 @@
};
inline SharedBuffer::SharedBuffer(uint64_t num_bytes) {
- MojoResult result MOJO_ALLOW_UNUSED =
- CreateSharedBuffer(nullptr, num_bytes, &handle);
+ MojoResult result = CreateSharedBuffer(nullptr, num_bytes, &handle);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
}
inline SharedBuffer::SharedBuffer(
uint64_t num_bytes,
const MojoCreateSharedBufferOptions& options) {
- MojoResult result MOJO_ALLOW_UNUSED =
- CreateSharedBuffer(&options, num_bytes, &handle);
+ MojoResult result = CreateSharedBuffer(&options, num_bytes, &handle);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
}
diff --git a/mojo/public/cpp/system/data_pipe.h b/mojo/public/cpp/system/data_pipe.h
index b645a0f..5d3396c 100644
--- a/mojo/public/cpp/system/data_pipe.h
+++ b/mojo/public/cpp/system/data_pipe.h
@@ -120,14 +120,16 @@
};
inline DataPipe::DataPipe() {
- MojoResult result MOJO_ALLOW_UNUSED =
+ MojoResult result =
CreateDataPipe(nullptr, &producer_handle, &consumer_handle);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
}
inline DataPipe::DataPipe(const MojoCreateDataPipeOptions& options) {
- MojoResult result MOJO_ALLOW_UNUSED =
+ MojoResult result =
CreateDataPipe(&options, &producer_handle, &consumer_handle);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
}
diff --git a/mojo/public/cpp/system/handle.h b/mojo/public/cpp/system/handle.h
index f84c559..d1f287b 100644
--- a/mojo/public/cpp/system/handle.h
+++ b/mojo/public/cpp/system/handle.h
@@ -136,7 +136,8 @@
void CloseIfNecessary() {
if (!handle_.is_valid())
return;
- MojoResult result MOJO_ALLOW_UNUSED = MojoClose(handle_.value());
+ MojoResult result = MojoClose(handle_.value());
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
}
diff --git a/mojo/public/cpp/system/message_pipe.h b/mojo/public/cpp/system/message_pipe.h
index d960189..b41469e 100644
--- a/mojo/public/cpp/system/message_pipe.h
+++ b/mojo/public/cpp/system/message_pipe.h
@@ -82,14 +82,14 @@
};
inline MessagePipe::MessagePipe() {
- MojoResult result MOJO_ALLOW_UNUSED =
- CreateMessagePipe(nullptr, &handle0, &handle1);
+ MojoResult result = CreateMessagePipe(nullptr, &handle0, &handle1);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
}
inline MessagePipe::MessagePipe(const MojoCreateMessagePipeOptions& options) {
- MojoResult result MOJO_ALLOW_UNUSED =
- CreateMessagePipe(&options, &handle0, &handle1);
+ MojoResult result = CreateMessagePipe(&options, &handle0, &handle1);
+ MOJO_ALLOW_UNUSED_LOCAL(result);
assert(result == MOJO_RESULT_OK);
}
diff --git a/mojo/public/cpp/utility/lib/thread.cc b/mojo/public/cpp/utility/lib/thread.cc
index ab772d7..a248b1a 100644
--- a/mojo/public/cpp/utility/lib/thread.cc
+++ b/mojo/public/cpp/utility/lib/thread.cc
@@ -25,7 +25,8 @@
assert(!joined_);
pthread_attr_t attr;
- int rv MOJO_ALLOW_UNUSED = pthread_attr_init(&attr);
+ int rv = pthread_attr_init(&attr);
+ MOJO_ALLOW_UNUSED_LOCAL(rv);
assert(rv == 0);
// Non-default stack size?
@@ -48,7 +49,8 @@
assert(!joined_);
joined_ = true;
- int rv MOJO_ALLOW_UNUSED = pthread_join(thread_, NULL);
+ int rv = pthread_join(thread_, NULL);
+ MOJO_ALLOW_UNUSED_LOCAL(rv);
assert(rv == 0);
}
diff --git a/mojo/public/cpp/utility/tests/mutex_unittest.cc b/mojo/public/cpp/utility/tests/mutex_unittest.cc
index eb5a330..a95495e 100644
--- a/mojo/public/cpp/utility/tests/mutex_unittest.cc
+++ b/mojo/public/cpp/utility/tests/mutex_unittest.cc
@@ -90,7 +90,8 @@
0, // Seconds.
(rand() % 10) * kNanosPerMilli // Nanoseconds.
};
- int rv MOJO_ALLOW_UNUSED = nanosleep(&req, NULL);
+ int rv = nanosleep(&req, NULL);
+ MOJO_ALLOW_UNUSED_LOCAL(rv);
assert(rv == 0);
}
diff --git a/mojo/public/html/BUILD.gn b/mojo/public/html/BUILD.gn
new file mode 100644
index 0000000..a580437
--- /dev/null
+++ b/mojo/public/html/BUILD.gn
@@ -0,0 +1,25 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+action_foreach("html") {
+ script = "convert_amd_modules_to_html.py"
+ sources = [
+ "//mojo/public/js/bindings/buffer.js",
+ "//mojo/public/js/bindings/codec.js",
+ "//mojo/public/js/bindings/connection.js",
+ "//mojo/public/js/bindings/connector.js",
+ "//mojo/public/js/bindings/router.js",
+ "//mojo/public/js/bindings/unicode.js",
+ "//mojo/public/js/bindings/validator.js",
+ ]
+ outputs = [
+ "$target_gen_dir/{{source_name_part}}.html",
+ ]
+ args = [
+ "--input",
+ "{{source}}",
+ "--output",
+ rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.html"
+ ]
+}
diff --git a/mojo/public/html/convert_amd_modules_to_html.py b/mojo/public/html/convert_amd_modules_to_html.py
new file mode 100755
index 0000000..043bf80
--- /dev/null
+++ b/mojo/public/html/convert_amd_modules_to_html.py
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import argparse
+import sys
+import re
+
+IMPORT_TEMPLATE = '<link rel="import" href="/%s.html" as="%s" />'
+PREAMBLE_TEMPLATE = '<script>'
+POSTAMBLE_TEMPLATE = ' this.exports = exports;\n</script>'
+
+class Import(object):
+ def __init__(self, path, name):
+ self.path = path
+ self.name = name
+
+class Module(object):
+ def __init__(self):
+ self.name = ""
+ self.imports = []
+ self.body = ""
+
+def Serialize(module):
+ lines = []
+ for i in module.imports:
+ lines.append(IMPORT_TEMPLATE % (i.path, i.name))
+ lines.append(PREAMBLE_TEMPLATE)
+ lines.append(module.body)
+ lines.append(POSTAMBLE_TEMPLATE)
+ return "\n".join(lines)
+
+name_regex = re.compile(r'define\("([^"]+)"')
+import_regex = re.compile(r' +"([^"]+)",')
+begin_body_regexp = re.compile(r', function\(([^)]*)\)')
+end_body_regexp = re.compile(r'return exports')
+
+def AddImportNames(module, unparsed_names):
+ names = [n.strip() for n in unparsed_names.split(',')]
+ for i in range(len(module.imports)):
+ module.imports[i].name = names[i]
+
+def RewritePathNames(path):
+ return path.replace("mojo/public/js/bindings", "mojo/public/html")
+
+def Parse(amd_module):
+ module = Module()
+ body_lines = []
+ state = "name"
+ for line in amd_module.splitlines():
+ if state == "name":
+ m = name_regex.search(line)
+ if m:
+ module.name = m.group(1)
+ m = begin_body_regexp.search(line)
+ if m:
+ AddImportNames(module, m.group(1))
+ state = "body"
+ else:
+ state = "imports"
+ continue
+ if state == "imports":
+ m = import_regex.search(line)
+ if m:
+ module.imports.append(Import(RewritePathNames(m.group(1)), None))
+ continue
+ m = begin_body_regexp.search(line)
+ if m:
+ AddImportNames(module, m.group(1))
+ state = "body"
+ continue
+ raise Exception, "Unknown import declaration"
+ if state == "body":
+ if end_body_regexp.search(line):
+ module.body = "\n".join(body_lines)
+ return module
+ body_lines.append(line)
+ continue
+ raise Exception, "Unknown parser state"
+ raise Exception, "End of file reached with finding a module"
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--input")
+ parser.add_argument("--output")
+ args = parser.parse_args()
+
+ module = None
+ with open(args.input, "r") as input_file:
+ module = Parse(input_file.read())
+
+ with open(args.output, "w+") as output_file:
+ output_file.write(Serialize(module))
+
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/mojo/public/interfaces/bindings/tests/regression_tests.mojom b/mojo/public/interfaces/bindings/tests/regression_tests.mojom
index 49ab69a..3baf77e 100644
--- a/mojo/public/interfaces/bindings/tests/regression_tests.mojom
+++ b/mojo/public/interfaces/bindings/tests/regression_tests.mojom
@@ -34,4 +34,23 @@
K = 0
};
+struct Edge {
+ Vertex? v;
+};
+
+struct Vertex {
+ EmptyStruct? e;
+};
+
+struct EmptyStruct {
+};
+
+struct A {
+ B? b;
+};
+
+struct B {
+ A? a;
+};
+
} // module imported
diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java
index b18e5c5..d97547f 100644
--- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java
+++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java
@@ -4,6 +4,7 @@
package org.chromium.mojo.bindings;
+import org.chromium.mojo.bindings.Struct.DataHeader;
import org.chromium.mojo.system.AsyncWaiter;
import org.chromium.mojo.system.Handle;
@@ -29,18 +30,16 @@
public static final int POINTER_SIZE = 8;
/**
+ * The header for a serialized map element.
+ */
+ public static final DataHeader MAP_STRUCT_HEADER = new DataHeader(24, 2);
+
+ /**
* The value used for the expected length of a non-fixed size array.
*/
public static final int UNSPECIFIED_ARRAY_LENGTH = -1;
/**
- * Align |size| on {@link BindingsHelper#ALIGNMENT}.
- */
- public static int align(int size) {
- return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
- }
-
- /**
* Passed as |arrayNullability| when neither the array nor its elements are nullable.
*/
public static final int NOTHING_NULLABLE = 0;
@@ -66,6 +65,13 @@
/**
* Align |size| on {@link BindingsHelper#ALIGNMENT}.
*/
+ public static int align(int size) {
+ return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
+ }
+
+ /**
+ * Align |size| on {@link BindingsHelper#ALIGNMENT}.
+ */
public static long align(long size) {
return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
}
diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Decoder.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Decoder.java
index efb9842..80ed9d1 100644
--- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Decoder.java
+++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Decoder.java
@@ -145,6 +145,21 @@
}
/**
+ * Deserializes a {@link DataHeader} at the given offset and checks if it is correct for a map.
+ */
+ public void readDataHeaderForMap() {
+ DataHeader si = readDataHeader();
+ if (si.size != BindingsHelper.MAP_STRUCT_HEADER.size) {
+ throw new DeserializationException(
+ "Incorrect header for map. The size is incorrect.");
+ }
+ if (si.numFields != BindingsHelper.MAP_STRUCT_HEADER.numFields) {
+ throw new DeserializationException(
+ "Incorrect header for map. The number of fields is incorrect.");
+ }
+ }
+
+ /**
* Deserializes a byte at the given offset.
*/
public byte readByte(int offset) {
diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
index e3b2bfe..ef04f6d 100644
--- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
+++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
@@ -422,6 +422,11 @@
}
}
+ public Encoder encoderForMap(int offset) {
+ encodePointerToNextUnclaimedData(offset);
+ return getEncoderAtDataOffset(BindingsHelper.MAP_STRUCT_HEADER);
+ }
+
/**
* Encodes an array of {@link InterfaceRequest}.
*/
diff --git a/mojo/public/js/bindings/codec.js b/mojo/public/js/bindings/codec.js
index 623cca7..b922a82 100644
--- a/mojo/public/js/bindings/codec.js
+++ b/mojo/public/js/bindings/codec.js
@@ -4,8 +4,8 @@
define("mojo/public/js/bindings/codec", [
"mojo/public/js/bindings/unicode",
- "mojo/public/js/bindings/buffer"
- ], function(unicode, buffer) {
+ "mojo/public/js/bindings/buffer",
+], function(unicode, buffer) {
var kErrorUnsigned = "Passing negative value to unsigned";
diff --git a/mojo/public/js/bindings/connection.js b/mojo/public/js/bindings/connection.js
index 01e33e9..7d92e8c 100644
--- a/mojo/public/js/bindings/connection.js
+++ b/mojo/public/js/bindings/connection.js
@@ -13,11 +13,11 @@
routerFactory = router.Router;
this.router_ = new routerFactory(handle, connectorFactory);
this.remote = new remoteFactory(this.router_);
- this.local = new localFactory(this.remote);
+ this.local = localFactory && new localFactory(this.remote);
this.router_.setIncomingReceiver(this.local);
// Validate incoming messages: remote responses and local requests.
- var validateRequest = localFactory.prototype.validator;
+ var validateRequest = localFactory && localFactory.prototype.validator;
var validateResponse = remoteFactory.prototype.validator;
var payloadValidators = [];
if (validateRequest)
diff --git a/mojo/public/mojo_public.gyp b/mojo/public/mojo_public.gyp
index 6911209..92fa394 100644
--- a/mojo/public/mojo_public.gyp
+++ b/mojo/public/mojo_public.gyp
@@ -98,6 +98,9 @@
'cpp/bindings/lib/fixed_buffer.h',
'cpp/bindings/lib/interface_impl_internal.h',
'cpp/bindings/lib/interface_ptr_internal.h',
+ 'cpp/bindings/lib/map_data_internal.h',
+ 'cpp/bindings/lib/map_internal.h',
+ 'cpp/bindings/lib/map_serialization.h',
'cpp/bindings/lib/message.cc',
'cpp/bindings/lib/message_builder.cc',
'cpp/bindings/lib/message_builder.h',
@@ -114,6 +117,7 @@
'cpp/bindings/lib/shared_ptr.h',
'cpp/bindings/lib/string_serialization.h',
'cpp/bindings/lib/string_serialization.cc',
+ 'cpp/bindings/lib/validate_params.h',
'cpp/bindings/lib/validation_errors.cc',
'cpp/bindings/lib/validation_errors.h',
],
diff --git a/mojo/public/python/mojo/bindings/descriptor.py b/mojo/public/python/mojo/bindings/descriptor.py
index d56789a..44c0f39 100644
--- a/mojo/public/python/mojo/bindings/descriptor.py
+++ b/mojo/public/python/mojo/bindings/descriptor.py
@@ -10,8 +10,10 @@
import itertools
import struct
-# pylint: disable=F0401
+import mojo.bindings.reflection as reflection
import mojo.bindings.serialization as serialization
+
+# pylint: disable=E0611,F0401
import mojo.system
@@ -372,11 +374,18 @@
class StructType(PointerType):
"""Type object for structs."""
- def __init__(self, struct_type, nullable=False):
+ def __init__(self, struct_type_getter, nullable=False):
PointerType.__init__(self)
- self.struct_type = struct_type
+ self._struct_type_getter = struct_type_getter
+ self._struct_type = None
self.nullable = nullable
+ @property
+ def struct_type(self):
+ if not self._struct_type:
+ self._struct_type = self._struct_type_getter()
+ return self._struct_type
+
def Convert(self, value):
if value is None or isinstance(value, self.struct_type):
return value
@@ -396,6 +405,61 @@
return self.struct_type.Deserialize(data, handles)
+class MapType(SerializableType):
+ """Type objects for maps."""
+
+ def __init__(self, key_type, value_type, nullable=False):
+ self._key_type = key_type
+ self._value_type = value_type
+ dictionary = {
+ '__metaclass__': reflection.MojoStructType,
+ '__module__': __name__,
+ 'DESCRIPTOR': {
+ 'fields': [
+ SingleFieldGroup('keys', MapType._GetArrayType(key_type), 0, 0),
+ SingleFieldGroup('values', MapType._GetArrayType(value_type), 1, 1),
+ ],
+ }
+ }
+ self.struct = reflection.MojoStructType('MapStruct', (object,), dictionary)
+ self.struct_type = StructType(lambda: self.struct, nullable)
+ SerializableType.__init__(self, self.struct_type.typecode)
+
+ def Convert(self, value):
+ if value is None:
+ return value
+ if isinstance(value, dict):
+ return dict([(self._key_type.Convert(x), self._value_type.Convert(y)) for
+ x, y in value.iteritems()])
+ raise TypeError('%r is not a dictionary.')
+
+ def Serialize(self, value, data_offset, data, handle_offset):
+ s = None
+ if value:
+ keys, values = [], []
+ for key, value in value.iteritems():
+ keys.append(key)
+ values.append(value)
+ s = self.struct(keys=keys, values=values)
+ return self.struct_type.Serialize(s, data_offset, data, handle_offset)
+
+ def Deserialize(self, value, data, handles):
+ s = self.struct_type.Deserialize(value, data, handles)
+ if s:
+ if len(s.keys) != len(s.values):
+ raise serialization.DeserializationException(
+ 'keys and values do not have the same length.')
+ return dict(zip(s.keys, s.values))
+ return None
+
+ @staticmethod
+ def _GetArrayType(t):
+ if t == TYPE_BOOL:
+ return BooleanArrayType()
+ else:
+ return GenericArrayType(t)
+
+
class NoneType(SerializableType):
"""Placeholder type, used temporarily until all mojo types are handled."""
diff --git a/mojo/public/python/mojo/bindings/messaging.py b/mojo/public/python/mojo/bindings/messaging.py
index 956f5b3..e5a765e 100644
--- a/mojo/public/python/mojo/bindings/messaging.py
+++ b/mojo/public/python/mojo/bindings/messaging.py
@@ -8,8 +8,9 @@
import struct
import weakref
-# pylint: disable=F0401
import mojo.bindings.serialization as serialization
+
+# pylint: disable=E0611,F0401
import mojo.system as system
diff --git a/mojo/public/python/mojo/bindings/reflection.py b/mojo/public/python/mojo/bindings/reflection.py
index c682e5e..e976db3 100644
--- a/mojo/public/python/mojo/bindings/reflection.py
+++ b/mojo/public/python/mojo/bindings/reflection.py
@@ -116,6 +116,9 @@
return result
dictionary['Deserialize'] = classmethod(Deserialize)
+ dictionary['__eq__'] = _StructEq(fields)
+ dictionary['__ne__'] = _StructNe
+
return type.__new__(mcs, name, bases, dictionary)
# Prevent adding new attributes, or mutating constants.
@@ -161,3 +164,16 @@
self._fields[field.name] = field.field_type.Convert(value)
return property(Get, Set)
+
+def _StructEq(fields):
+ def _Eq(self, other):
+ if type(self) is not type(other):
+ return False
+ for field in fields:
+ if getattr(self, field.name) != getattr(other, field.name):
+ return False
+ return True
+ return _Eq
+
+def _StructNe(self, other):
+ return not self.__eq__(other)
diff --git a/mojo/public/python/mojo/c_environment.pxd b/mojo/public/python/mojo/c_environment.pxd
index 13a0934..3dfa799 100644
--- a/mojo/public/python/mojo/c_environment.pxd
+++ b/mojo/public/python/mojo/c_environment.pxd
@@ -41,6 +41,7 @@
void RunUntilIdle() except *
void Quit()
void PostDelayedTask(CClosure&, int64_t)
+ cdef CRunLoop CRunLoopCurrent "mojo::RunLoop::current"()
cdef extern from "mojo/public/cpp/environment/environment.h" nogil:
diff --git a/mojo/public/python/mojo/system.pyx b/mojo/public/python/mojo/system.pyx
index 4768247..8285261 100644
--- a/mojo/public/python/mojo/system.pyx
+++ b/mojo/public/python/mojo/system.pyx
@@ -15,8 +15,12 @@
from cpython.buffer cimport PyBuffer_Release
from cpython.buffer cimport PyObject_GetBuffer
from cpython.mem cimport PyMem_Malloc, PyMem_Free
+from cpython.object cimport Py_EQ, Py_NE
from libc.stdint cimport int32_t, int64_t, uint32_t, uint64_t, uintptr_t
+import ctypes
+import threading
+
def SetSystemThunks(system_thunks_as_object):
"""Bind the basic Mojo Core functions.
@@ -293,6 +297,19 @@
"""
self._mojo_handle = c_core.MOJO_HANDLE_INVALID
+ def __richcmp__(self, other, op):
+ if op != Py_EQ and op != Py_NE:
+ raise TypeError('Handle is not ordered')
+ cdef int equality
+ if type(self) is not type(other):
+ equality = id(self) == id(other)
+ else:
+ equality = (<Handle>self)._mojo_handle == (<Handle>other)._mojo_handle
+ if op == Py_EQ:
+ return equality
+ else:
+ return not equality
+
def IsValid(self):
"""Returns whether this handle is valid."""
return self._mojo_handle != c_core.MOJO_HANDLE_INVALID
@@ -711,10 +728,29 @@
self.flags = DuplicateSharedBufferOptions.FLAG_NONE
+# Keeps a thread local weak reference to the current run loop.
+_RUN_LOOPS = threading.local()
+
+
cdef class RunLoop(object):
"""RunLoop to use when using asynchronous operations on handles."""
- cdef c_environment.CRunLoop c_run_loop
+ cdef c_environment.CRunLoop* c_run_loop
+
+ def __init__(self):
+ assert not <uintptr_t>(c_environment.CRunLoopCurrent())
+ self.c_run_loop = new c_environment.CRunLoop()
+ _RUN_LOOPS.loop = id(self)
+
+ def __dealloc__(self):
+ del _RUN_LOOPS.loop
+ del self.c_run_loop
+
+ @staticmethod
+ def Current():
+ if hasattr(_RUN_LOOPS, 'loop'):
+ return ctypes.cast(_RUN_LOOPS.loop, ctypes.py_object).value
+ return None
def Run(self):
"""Run the runloop until Quit is called."""
diff --git a/mojo/public/python/src/python_system_helper.cc b/mojo/public/python/src/python_system_helper.cc
index f42e671..50b5fb0 100644
--- a/mojo/public/python/src/python_system_helper.cc
+++ b/mojo/public/python/src/python_system_helper.cc
@@ -25,38 +25,55 @@
MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedGIL);
};
-class PythonClosure : public mojo::Closure::Runnable {
+enum ScopedPyRefAcquire {
+ kAcquire,
+};
+
+class ScopedPyRef {
public:
- PythonClosure(PyObject* callable) : callable_(callable) {
- MOJO_DCHECK(callable);
- Py_XINCREF(callable);
+ ScopedPyRef(PyObject* object) : object_(object) {}
+ ScopedPyRef(PyObject* object, ScopedPyRefAcquire) : object_(object) {
+ Py_XINCREF(object_);
}
- virtual ~PythonClosure() {
- ScopedGIL acquire_gil;
- Py_DECREF(callable_);
+ ~ScopedPyRef() {
+ if (object_) {
+ ScopedGIL acquire_gil;
+ Py_DECREF(object_);
+ }
+ }
+
+ operator PyObject*() const { return object_; }
+
+ private:
+ PyObject* object_;
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedPyRef);
+};
+
+class PythonClosure : public mojo::Closure::Runnable {
+ public:
+ PythonClosure(PyObject* callable) : callable_(callable, kAcquire) {
+ MOJO_DCHECK(callable);
}
virtual void Run() const override {
ScopedGIL acquire_gil;
- PyObject* empty_tuple = PyTuple_New(0);
+ ScopedPyRef empty_tuple(PyTuple_New(0));
if (!empty_tuple) {
mojo::RunLoop::current()->Quit();
return;
}
- PyObject* result = PyObject_CallObject(callable_, empty_tuple);
- Py_DECREF(empty_tuple);
- if (result) {
- Py_DECREF(result);
- } else {
+ ScopedPyRef result(PyObject_CallObject(callable_, empty_tuple));
+ if (!result) {
mojo::RunLoop::current()->Quit();
return;
}
}
private:
- PyObject* callable_;
+ ScopedPyRef callable_;
MOJO_DISALLOW_COPY_AND_ASSIGN(PythonClosure);
};
@@ -77,15 +94,9 @@
: public mojo::Callback<void(MojoResult)>::Runnable {
public:
AsyncWaiterRunnable(PyObject* callable, CallbackMap* callbacks)
- : wait_id_(0), callable_(callable), callbacks_(callbacks) {
+ : wait_id_(0), callable_(callable, kAcquire), callbacks_(callbacks) {
MOJO_DCHECK(callable);
MOJO_DCHECK(callbacks_);
- Py_XINCREF(callable);
- }
-
- virtual ~AsyncWaiterRunnable() {
- ScopedGIL acquire_gil;
- Py_DECREF(callable_);
}
void set_wait_id(int wait_id) { wait_id_ = wait_id; }
@@ -96,22 +107,19 @@
// Remove to reference to this object from PythonAsyncWaiter and ensure this
// object will be destroyed when this method exits.
MOJO_DCHECK(callbacks_->find(wait_id_) != callbacks_->end());
- internal::SharedPtr<mojo::Callback<void(MojoResult)> > self =
+ internal::SharedPtr<mojo::Callback<void(MojoResult)>> self =
(*callbacks_)[wait_id_];
callbacks_->erase(wait_id_);
ScopedGIL acquire_gil;
- PyObject* args_tuple = Py_BuildValue("(i)", mojo_result);
+ ScopedPyRef args_tuple(Py_BuildValue("(i)", mojo_result));
if (!args_tuple) {
mojo::RunLoop::current()->Quit();
return;
}
- PyObject* result = PyObject_CallObject(callable_, args_tuple);
- Py_DECREF(args_tuple);
- if (result) {
- Py_DECREF(result);
- } else {
+ ScopedPyRef result(PyObject_CallObject(callable_, args_tuple));
+ if (!result) {
mojo::RunLoop::current()->Quit();
return;
}
@@ -119,7 +127,7 @@
private:
MojoAsyncWaitID wait_id_;
- PyObject* callable_;
+ ScopedPyRef callable_;
CallbackMap* callbacks_;
MOJO_DISALLOW_COPY_AND_ASSIGN(AsyncWaiterRunnable);
@@ -150,7 +158,7 @@
MojoDeadline deadline,
PyObject* callable) {
AsyncWaiterRunnable* runner = new AsyncWaiterRunnable(callable, &callbacks_);
- internal::SharedPtr<mojo::Callback<void(MojoResult)> > callback(
+ internal::SharedPtr<mojo::Callback<void(MojoResult)>> callback(
new mojo::Callback<void(MojoResult)>(
static_cast<mojo::Callback<void(MojoResult)>::Runnable*>(runner)));
MojoAsyncWaitID wait_id = async_waiter_->AsyncWait(
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
index bb5b777..ea2750b 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -55,6 +55,9 @@
{%- if param.kind|is_any_array_kind %}
mojo::SerializeArray_<{{param.kind|get_array_validate_params|indent(24)}}>(
mojo::internal::Forward(in_{{param.name}}), builder.buffer(), ¶ms->{{param.name}}.ptr);
+{%- elif param.kind|is_map_kind %}
+ mojo::SerializeMap_<{{param.kind.value_kind|get_map_validate_params|indent(24)}}>(
+ mojo::internal::Forward(in_{{param.name}}), builder.buffer(), ¶ms->{{param.name}}.ptr);
{%- else %}
Serialize_(mojo::internal::Forward(in_{{param.name}}), builder.buffer(), ¶ms->{{param.name}}.ptr);
{%- endif %}
@@ -154,9 +157,10 @@
if (!receiver_->AcceptWithResponder(&message, responder))
delete responder;
{%- else %}
- bool ok MOJO_ALLOW_UNUSED = receiver_->Accept(&message);
+ bool ok = receiver_->Accept(&message);
// This return value may be ignored as !ok implies the Connector has
// encountered an error, which will be visible through other means.
+ MOJO_ALLOW_UNUSED_LOCAL(ok);
{%- endif %}
}
{%- endfor %}
@@ -197,7 +201,8 @@
mojo::internal::ResponseMessageBuilder builder(
{{message_name}}, payload_size, request_id_);
{{build_message(params_name, method.response_parameters, params_description)}}
- bool ok MOJO_ALLOW_UNUSED = responder_->Accept(&message);
+ bool ok = responder_->Accept(&message);
+ MOJO_ALLOW_UNUSED_LOCAL(ok);
// TODO(darin): !ok returned here indicates a malformed message, and that may
// be good reason to close the connection. However, we don't have a way to do
// that from here. We should add a way.
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl
index f0cf33b..ab981b8 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl
@@ -32,6 +32,11 @@
namespace internal {
+{#--- Internal forward declarations #}
+{% for struct in structs %}
+class {{struct.name}}_Data;
+{%- endfor %}
+
#pragma pack(push, 1)
{#--- Class declarations #}
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
index 8f5e812..f003b1e 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
@@ -18,8 +18,11 @@
#include "mojo/public/cpp/bindings/lib/array_serialization.h"
#include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
#include "mojo/public/cpp/bindings/lib/bounds_checker.h"
+#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
+#include "mojo/public/cpp/bindings/lib/map_serialization.h"
#include "mojo/public/cpp/bindings/lib/message_builder.h"
#include "mojo/public/cpp/bindings/lib/string_serialization.h"
+#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
{%- for namespace in namespaces_as_array %}
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
index 4e21d47..3da6c32 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
@@ -13,6 +13,7 @@
#include "mojo/public/cpp/bindings/interface_impl.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/cpp/bindings/map.h"
#include "mojo/public/cpp/bindings/message_filter.h"
#include "mojo/public/cpp/bindings/no_interface.h"
#include "mojo/public/cpp/bindings/string.h"
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
index b206f20..34c0f11 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
@@ -16,7 +16,7 @@
private:
{{class_name}}();
- ~{{class_name}}(); // NOT IMPLEMENTED
+ ~{{class_name}}() = delete;
};
static_assert(sizeof({{class_name}}) == {{struct.packed|struct_size}},
"Bad sizeof({{class_name}})");
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
index 0e51193..c65d3e4 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
@@ -8,8 +8,8 @@
return false;
}
- const {{class_name}}* MOJO_ALLOW_UNUSED object =
- static_cast<const {{class_name}}*>(data);
+ const {{class_name}}* object = static_cast<const {{class_name}}*>(data);
+ MOJO_ALLOW_UNUSED_LOCAL(object);
{%- for packed_field in struct.packed.packed_fields %}
{%- set name = packed_field.field.name %}
@@ -33,6 +33,15 @@
{{kind|get_array_validate_params|indent(10)}}>(
mojo::internal::DecodePointerRaw(&object->{{name}}.offset),
bounds_checker)) {
+{%- elif kind|is_map_kind %}
+ if (!{{wrapper_type}}::Data_::Validate<
+ {{kind.value_kind|get_map_validate_params|indent(10)}}>(
+ mojo::internal::DecodePointerRaw(&object->{{name}}.offset),
+ bounds_checker)) {
+{%- elif kind|is_struct_kind %}
+ if (!{{kind|get_name_for_kind}}::Data_::Validate(
+ mojo::internal::DecodePointerRaw(&object->{{name}}.offset),
+ bounds_checker)) {
{%- else %}
if (!{{wrapper_type}}::Data_::Validate(
mojo::internal::DecodePointerRaw(&object->{{name}}.offset),
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
index 09bf392..f765f20 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
@@ -18,6 +18,9 @@
{%- if pf.field.kind|is_any_array_kind %}
mojo::SerializeArray_<{{pf.field.kind|get_array_validate_params|indent(26)}}>(
mojo::internal::Forward(input->{{pf.field.name}}), buf, &result->{{pf.field.name}}.ptr);
+{%- elif pf.field.kind|is_map_kind %}
+ mojo::SerializeMap_<{{pf.field.kind.value_kind|get_map_validate_params|indent(26)}}>(
+ mojo::internal::Forward(input->{{pf.field.name}}), buf, &result->{{pf.field.name}}.ptr);
{%- else %}
Serialize_(mojo::internal::Forward(input->{{pf.field.name}}), buf, &result->{{pf.field.name}}.ptr);
{%- endif %}
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl
index 21f2968..f6bea2c 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl
@@ -21,9 +21,11 @@
{{struct.name}}();
~{{struct.name}}();
+
{% if struct|is_cloneable_kind %}
{{struct.name}}Ptr Clone() const;
{%- endif %}
+ bool Equals(const {{struct.name}}& other) const;
{#--- Getters #}
{% for field in struct.fields %}
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
index 42f7575..cb5a5fa 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
@@ -13,11 +13,12 @@
{{struct.name}}::~{{struct.name}}() {
}
+
{% if struct|is_cloneable_kind %}
{{struct.name}}Ptr {{struct.name}}::Clone() const {
{{struct.name}}Ptr rv(New());
{%- for field in struct.fields %}
-{%- if field.kind|is_struct_kind or field.kind|is_any_array_kind %}
+{%- if field.kind|is_struct_kind or field.kind|is_any_array_kind or field.kind|is_map_kind %}
rv->{{field.name}} = {{field.name}}.Clone();
{%- else %}
rv->{{field.name}} = {{field.name}};
@@ -26,3 +27,11 @@
return rv.Pass();
}
{% endif %}
+
+bool {{struct.name}}::Equals(const {{struct.name}}& other) const {
+{%- for field in struct.fields %}
+ if (!mojo::internal::ValueTraits<{{field.kind|cpp_wrapper_type}}>::Equals({{field.name}}, other.{{field.name}}))
+ return false;
+{%- endfor %}
+ return true;
+}
diff --git a/mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl
index 2fc4439..d95a4d4 100644
--- a/mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl
@@ -1,44 +1,68 @@
{% from "constant_definition.tmpl" import constant_def %}
{% from "enum_definition.tmpl" import enum_def %}
-{%- macro array_expected_length(kind) -%}
-{%- if kind|is_fixed_array_kind -%}
-{{kind.length}}
-{%- else -%}
-org.chromium.mojo.bindings.BindingsHelper.UNSPECIFIED_ARRAY_LENGTH
-{%- endif -%}
-{%- endmacro -%}
-
{% macro encode(variable, kind, offset, bit, level=0) %}
{% if kind|is_pointer_array_kind %}
{% set sub_kind = kind.kind %}
if ({{variable}} == null) {
encoder{{level}}.encodeNullPointer({{offset}}, {{kind|is_nullable_kind|java_true_false}});
} else {
- org.chromium.mojo.bindings.Encoder encoder{{level + 1}} = encoder{{level}}.encodePointerArray({{variable}}.length, {{offset}}, {{array_expected_length(kind)}});
+ org.chromium.mojo.bindings.Encoder encoder{{level + 1}} = encoder{{level}}.encodePointerArray({{variable}}.length, {{offset}}, {{kind|array_expected_length}});
for (int i{{level}} = 0; i{{level}} < {{variable}}.length; ++i{{level}}) {
{{encode(variable~'[i'~level~']', sub_kind, 'DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i'~level, 0, level+1)|indent(8)}}
}
}
+{% elif kind|is_map_kind %}
+if ({{variable}} == null) {
+ encoder{{level}}.encodeNullPointer({{offset}}, {{kind|is_nullable_kind|java_true_false}});
+} else {
+ org.chromium.mojo.bindings.Encoder encoder{{level + 1}} = encoder{{level}}.encoderForMap({{offset}});
+ int size{{level}} = {{variable}}.size();
+ {{kind.key_kind|java_type}}[] keys{{level}} = {{kind.key_kind|array|new_array('size'~level)}};
+ {{kind.value_kind|java_type}}[] values{{level}} = {{kind.value_kind|array|new_array('size'~level)}};
+ int index{{level}} = 0;
+ for (java.util.Map.Entry<{{kind.key_kind|java_type(true)}}, {{kind.value_kind|java_type(true)}}> entry{{level}} : {{variable}}.entrySet()) {
+ keys{{level}}[index{{level}}] = entry{{level}}.getKey();
+ values{{level}}[index{{level}}] = entry{{level}}.getValue();
+ }
+ {{encode('keys'~level, kind.key_kind|array, 'DataHeader.HEADER_SIZE', 0, level+1)|indent(4)}}
+ {{encode('values'~level, kind.value_kind|array, 'DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE', 0, level+1)|indent(4)}}
+}
{% else %}
encoder{{level}}.{{kind|encode_method(variable, offset, bit)}};
{% endif %}
{% endmacro %}
{% macro decode(variable, kind, offset, bit, level=0) %}
-{% if kind|is_struct_kind or kind|is_pointer_array_kind %}
+{% if kind|is_struct_kind or kind|is_pointer_array_kind or kind|is_map_kind %}
org.chromium.mojo.bindings.Decoder decoder{{level+1}} = decoder{{level}}.readPointer({{offset}}, {{kind|is_nullable_kind|java_true_false}});
{% if kind|is_struct_kind %}
{{variable}} = {{kind|java_type}}.decode(decoder{{level+1}});
-{% else %}{# kind|is_pointer_array_kind #}
+{% else %}{# kind|is_pointer_array_kind or is_map_kind #}
if (decoder{{level+1}} == null) {
{{variable}} = null;
} else {
- DataHeader si{{level+1}} = decoder{{level+1}}.readDataHeaderForPointerArray({{array_expected_length(kind)}});
+{% if kind|is_map_kind %}
+ decoder{{level+1}}.readDataHeaderForMap();
+ {{kind.key_kind|java_type}}[] keys{{level}};
+ {{kind.value_kind|java_type}}[] values{{level}};
+ {
+ {{decode('keys'~level, kind.key_kind|array, 'DataHeader.HEADER_SIZE', 0, level+1)|indent(8)}}
+ }
+ {
+ {{decode('values'~level, kind.value_kind|array('keys'~level~'.length'), 'DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE', 0, level+1)|indent(8)}}
+ }
+ {{variable}} = new java.util.HashMap<{{kind.key_kind|java_type(true)}}, {{kind.value_kind|java_type(true)}}>();
+ for (int index{{level}} = 0; index{{level}} < keys{{level}}.length; ++index{{level}}) {
+ {{variable}}.put(keys{{level}}[index{{level}}], values{{level}}[index{{level}}]);
+ }
+{% else %}
+ DataHeader si{{level+1}} = decoder{{level+1}}.readDataHeaderForPointerArray({{kind|array_expected_length}});
{{variable}} = {{kind|new_array('si'~(level+1)~'.numFields')}};
for (int i{{level+1}} = 0; i{{level+1}} < si{{level+1}}.numFields; ++i{{level+1}}) {
{{decode(variable~'[i'~(level+1)~']', kind.kind, 'DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i'~(level+1), 0, level+1)|indent(8)}}
}
+{% endif %}
}
{% endif %}
{% else %}
diff --git a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
index 391d375..1212dae 100644
--- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
@@ -103,6 +103,24 @@
}
};
+ function {{interface.name}}DelegatingStub() {
+ }
+
+ {{interface.name}}DelegatingStub.prototype =
+ Object.create({{interface.name}}Stub.prototype);
+
+ {{interface.name}}DelegatingStub.prototype.callDelegateMethod$ = function(methodName, args) {
+ var method = this.delegate$ && this.delegate$[methodName];
+ return method && method.apply(this.delegate$, args);
+ }
+
+{%- for method in interface.methods %}
+{%- set method_name = method.name|stylize_method %}
+ {{interface.name}}DelegatingStub.prototype.{{method_name}} = function() {
+ return this.callDelegateMethod$("{{method_name}}", arguments);
+ }
+{%- endfor %}
+
{#--- Validation #}
function validate{{interface.name}}Request(messageValidator) {
@@ -156,6 +174,7 @@
name: '{{namespace|replace(".","::")}}::{{interface.name}}',
proxyClass: {{interface.name}}Proxy,
stubClass: {{interface.name}}Stub,
+ delegatingStubClass: {{interface.name}}DelegatingStub,
validateRequest: validate{{interface.name}}Request,
{%- if interface|has_callbacks %}
validateResponse: validate{{interface.name}}Response,
diff --git a/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl b/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl
new file mode 100644
index 0000000..e830a84
--- /dev/null
+++ b/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl
@@ -0,0 +1,20 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+define("{{module.path}}", [
+ "mojo/public/js/bindings/codec",
+ "mojo/public/js/bindings/validator",
+{%- for import in imports %}
+ "{{import.module.path}}",
+{%- endfor %}
+], function(codec, validator
+{%- for import in imports -%}
+ , {{import.unique_name}}
+{%- endfor -%}
+) {
+
+{%- include "module_definition.tmpl" %}
+
+ return exports;
+});
diff --git a/mojo/public/tools/bindings/generators/js_templates/module.html.tmpl b/mojo/public/tools/bindings/generators/js_templates/module.html.tmpl
new file mode 100644
index 0000000..f0a2236
--- /dev/null
+++ b/mojo/public/tools/bindings/generators/js_templates/module.html.tmpl
@@ -0,0 +1,13 @@
+<!-- Copyright 2014 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file. -->
+
+<link rel="import" href="/mojo/public/html/codec.html" as="codec" />
+<link rel="import" href="/mojo/public/html/validator.html" as="validator" />
+{%- for import in imports %}
+<link rel="import" href="/{{import.module.path}}.html" as="{{import.unique_name}}" />
+{%- endfor %}
+<script>
+{%- include "module_definition.tmpl" %}
+ this.exports = exports;
+</script>
diff --git a/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl b/mojo/public/tools/bindings/generators/js_templates/module_definition.tmpl
similarity index 67%
rename from mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
rename to mojo/public/tools/bindings/generators/js_templates/module_definition.tmpl
index 397a120..6448081 100644
--- a/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/module_definition.tmpl
@@ -1,21 +1,5 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-define("{{module.path}}", [
- "mojo/public/js/bindings/codec",
- "mojo/public/js/bindings/validator",
-{%- for import in imports %}
- "{{import.module.path}}",
-{%- endfor %}
- ], function(codec, validator
-{%- for import in imports -%}
- , {{import.unique_name}}
-{%- endfor -%}
-) {
-
{#--- Constants #}
-{% for constant in module.constants %}
+{%- for constant in module.constants %}
var {{constant.name}} = {{constant.value|expression_to_text}};
{%- endfor %}
@@ -50,8 +34,7 @@
{#--- Interface Client #}
{%- if interface.client in interfaces|map(attribute='name') %}
exports.{{interface.name}}.client = {{interface.client}};
+{%- elif interface.client in imported_interfaces %}
+ exports.{{interface.name}}.client = {{imported_interfaces[interface.client]}};
{%- endif %}
{%- endfor %}
-
- return exports;
-});
diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
index 68e0379..c7fd50e 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -68,10 +68,13 @@
return "::".join(parts)
def GetCppType(kind):
- if mojom.IsStructKind(kind):
- return "%s_Data*" % GetNameForKind(kind, internal=True)
if mojom.IsAnyArrayKind(kind):
return "mojo::internal::Array_Data<%s>*" % GetCppType(kind.kind)
+ if mojom.IsMapKind(kind):
+ return "mojo::internal::Map_Data<%s, %s>*" % (
+ GetCppType(kind.key_kind), GetCppType(kind.value_kind))
+ if mojom.IsStructKind(kind):
+ return "%s_Data*" % GetNameForKind(kind, internal=True)
if mojom.IsInterfaceKind(kind) or mojom.IsInterfaceRequestKind(kind):
return "mojo::MessagePipeHandle"
if mojom.IsEnumKind(kind):
@@ -92,6 +95,9 @@
return "%sPtr" % GetNameForKind(kind)
if mojom.IsAnyArrayKind(kind):
return "mojo::Array<%s> " % GetCppArrayArgWrapperType(kind.kind)
+ if mojom.IsMapKind(kind):
+ return "mojo::Map<%s, %s> " % (GetCppArrayArgWrapperType(kind.key_kind),
+ GetCppArrayArgWrapperType(kind.value_kind))
if mojom.IsInterfaceKind(kind):
raise Exception("Arrays of interfaces not yet supported!")
if mojom.IsInterfaceRequestKind(kind):
@@ -117,6 +123,9 @@
return "%sPtr" % GetNameForKind(kind)
if mojom.IsAnyArrayKind(kind):
return "mojo::Array<%s>" % GetCppArrayArgWrapperType(kind.kind)
+ if mojom.IsMapKind(kind):
+ return "mojo::Map<%s, %s>" % (GetCppArrayArgWrapperType(kind.key_kind),
+ GetCppArrayArgWrapperType(kind.value_kind))
if mojom.IsInterfaceKind(kind):
return "%sPtr" % GetNameForKind(kind)
if mojom.IsInterfaceRequestKind(kind):
@@ -142,6 +151,9 @@
return "%sPtr" % GetNameForKind(kind)
if mojom.IsAnyArrayKind(kind):
return "mojo::Array<%s>" % GetCppArrayArgWrapperType(kind.kind)
+ if mojom.IsMapKind(kind):
+ return "mojo::Map<%s, %s>" % (GetCppArrayArgWrapperType(kind.key_kind),
+ GetCppArrayArgWrapperType(kind.value_kind))
if mojom.IsInterfaceKind(kind):
return "%sPtr" % GetNameForKind(kind)
if mojom.IsInterfaceRequestKind(kind):
@@ -165,6 +177,9 @@
return "%sPtr" % GetNameForKind(kind)
if mojom.IsAnyArrayKind(kind):
return "mojo::Array<%s>" % GetCppArrayArgWrapperType(kind.kind)
+ if mojom.IsMapKind(kind):
+ return "mojo::Map<%s, %s>" % (GetCppArrayArgWrapperType(kind.key_kind),
+ GetCppArrayArgWrapperType(kind.value_kind))
if mojom.IsInterfaceKind(kind):
return "%sPtr" % GetNameForKind(kind)
if mojom.IsInterfaceRequestKind(kind):
@@ -193,6 +208,9 @@
GetNameForKind(kind, internal=True))
if mojom.IsAnyArrayKind(kind):
return "mojo::internal::ArrayPointer<%s>" % GetCppType(kind.kind)
+ if mojom.IsMapKind(kind):
+ return ("mojo::internal::StructPointer<mojo::internal::Map_Data<%s, %s>>" %
+ (GetCppType(kind.key_kind), GetCppType(kind.value_kind)))
if mojom.IsInterfaceKind(kind) or mojom.IsInterfaceRequestKind(kind):
return "mojo::MessagePipeHandle"
if mojom.IsEnumKind(kind):
@@ -251,13 +269,18 @@
return True
def GetArrayValidateParams(kind):
- if not mojom.IsAnyArrayKind(kind) and not mojom.IsStringKind(kind):
+ if (not mojom.IsAnyArrayKind(kind) and not mojom.IsMapKind(kind) and
+ not mojom.IsStringKind(kind)):
return "mojo::internal::NoValidateParams"
if mojom.IsStringKind(kind):
expected_num_elements = 0
element_is_nullable = False
element_validate_params = "mojo::internal::NoValidateParams"
+ elif mojom.IsMapKind(kind):
+ expected_num_elements = 0
+ element_is_nullable = mojom.IsNullableKind(kind.value_kind)
+ element_validate_params = GetArrayValidateParams(kind.value_kind)
else:
expected_num_elements = generator.ExpectedArraySize(kind)
element_is_nullable = mojom.IsNullableKind(kind.kind)
@@ -268,6 +291,14 @@
'true' if element_is_nullable else 'false',
element_validate_params)
+def GetMapValidateParams(value_kind):
+ # Unlike GetArrayValidateParams, we are given the wrapped kind, instead of
+ # the raw array kind. So we wrap the return value of GetArrayValidateParams.
+ element_is_nullable = mojom.IsNullableKind(value_kind)
+ return "mojo::internal::ArrayValidateParams<0, %s,\n%s> " % (
+ 'true' if element_is_nullable else 'false',
+ GetArrayValidateParams(value_kind))
+
_HEADER_SIZE = 8
class Generator(generator.Generator):
@@ -284,6 +315,7 @@
"expected_array_size": generator.ExpectedArraySize,
"expression_to_text": ExpressionToText,
"get_array_validate_params": GetArrayValidateParams,
+ "get_map_validate_params": GetMapValidateParams,
"get_name_for_kind": GetNameForKind,
"get_pad": pack.GetPad,
"has_callbacks": mojom.HasCallbacks,
@@ -295,6 +327,7 @@
"is_any_handle_kind": mojom.IsAnyHandleKind,
"is_interface_kind": mojom.IsInterfaceKind,
"is_interface_request_kind": mojom.IsInterfaceRequestKind,
+ "is_map_kind": mojom.IsMapKind,
"is_nullable_kind": mojom.IsNullableKind,
"is_object_kind": mojom.IsObjectKind,
"is_string_kind": mojom.IsStringKind,
@@ -332,7 +365,9 @@
return self.GetJinjaExports()
def GenerateFiles(self, args):
- self.Write(self.GenerateModuleHeader(), "%s.h" % self.module.name)
+ self.Write(self.GenerateModuleHeader(),
+ self.MatchMojomFilePath("%s.h" % self.module.name))
self.Write(self.GenerateModuleInternalHeader(),
- "%s-internal.h" % self.module.name)
- self.Write(self.GenerateModuleSource(), "%s.cc" % self.module.name)
+ self.MatchMojomFilePath("%s-internal.h" % self.module.name))
+ self.Write(self.GenerateModuleSource(),
+ self.MatchMojomFilePath("%s.cc" % self.module.name))
diff --git a/mojo/public/tools/bindings/generators/mojom_java_generator.py b/mojo/public/tools/bindings/generators/mojom_java_generator.py
index 043d9e3..542b32e 100644
--- a/mojo/public/tools/bindings/generators/mojom_java_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_java_generator.py
@@ -181,11 +181,7 @@
else:
params.append(GetJavaTrueFalse(mojom.IsNullableKind(kind)))
if mojom.IsAnyArrayKind(kind):
- if mojom.IsFixedArrayKind(kind):
- params.append(str(kind.length))
- else:
- params.append(
- 'org.chromium.mojo.bindings.BindingsHelper.UNSPECIFIED_ARRAY_LENGTH');
+ params.append(GetArrayExpectedLength(kind))
if mojom.IsInterfaceKind(kind):
params.append('%s.MANAGER' % GetJavaType(context, kind))
if mojom.IsAnyArrayKind(kind) and mojom.IsInterfaceKind(kind.kind):
@@ -253,6 +249,10 @@
if mojom.IsInterfaceRequestKind(kind):
return ('org.chromium.mojo.bindings.InterfaceRequest<%s>' %
GetNameForKind(context, kind.kind))
+ if mojom.IsMapKind(kind):
+ return 'java.util.Map<%s, %s>' % (
+ GetBoxedJavaType(context, kind.key_kind),
+ GetBoxedJavaType(context, kind.value_kind))
if mojom.IsAnyArrayKind(kind):
return '%s[]' % GetJavaType(context, kind.kind)
if mojom.IsEnumKind(kind):
@@ -323,6 +323,20 @@
return 'java.lang.Float.NaN'
return token
+def GetArrayKind(kind, size = None):
+ if size is None:
+ return mojom.Array(kind)
+ else:
+ array = mojom.FixedArray(0, kind)
+ array.java_map_size = size
+ return array
+
+def GetArrayExpectedLength(kind):
+ if mojom.IsFixedArrayKind(kind):
+ return getattr(kind, 'java_map_size', str(kind.length))
+ else:
+ return 'org.chromium.mojo.bindings.BindingsHelper.UNSPECIFIED_ARRAY_LENGTH'
+
def IsPointerArrayKind(kind):
if not mojom.IsAnyArrayKind(kind):
return False
@@ -379,6 +393,8 @@
class Generator(generator.Generator):
java_filters = {
+ 'array': GetArrayKind,
+ 'array_expected_length': GetArrayExpectedLength,
'interface_response_name': GetInterfaceResponseName,
'constant_value': ConstantValue,
'default_value': DefaultValue,
@@ -389,6 +405,7 @@
'has_method_without_response': HasMethodWithoutResponse,
'is_fixed_array_kind': mojom.IsFixedArrayKind,
'is_handle': mojom.IsNonInterfaceHandleKind,
+ 'is_map_kind': mojom.IsMapKind,
'is_nullable_kind': mojom.IsNullableKind,
'is_pointer_array_kind': IsPointerArrayKind,
'is_struct_kind': mojom.IsStructKind,
@@ -479,8 +496,8 @@
# Generate the java files in a temporary directory and place a single
# srcjar in the output directory.
- zip_filename = os.path.join(self.output_dir,
- "%s.srcjar" % self.module.name)
+ basename = self.MatchMojomFilePath("%s.srcjar" % self.module.name)
+ zip_filename = os.path.join(self.output_dir, basename)
with TempDir() as temp_java_root:
self.output_dir = os.path.join(temp_java_root, package_path)
self.DoGenerateFiles();
diff --git a/mojo/public/tools/bindings/generators/mojom_js_generator.py b/mojo/public/tools/bindings/generators/mojom_js_generator.py
index c9109fb..c56561c 100644
--- a/mojo/public/tools/bindings/generators/mojom_js_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_js_generator.py
@@ -250,8 +250,7 @@
"validate_struct_params": JavaScriptValidateStructParams,
}
- @UseJinja("js_templates/module.js.tmpl", filters=js_filters)
- def GenerateJsModule(self):
+ def GetParameters(self):
return {
"namespace": self.module.namespace,
"imports": self.GetImports(),
@@ -260,16 +259,46 @@
"module": self.module,
"structs": self.GetStructs() + self.GetStructsFromMethods(),
"interfaces": self.module.interfaces,
+ "imported_interfaces": self.GetImportedInterfaces(),
}
+ @UseJinja("js_templates/module.amd.tmpl", filters=js_filters)
+ def GenerateAMDModule(self):
+ return self.GetParameters()
+
+ @UseJinja("js_templates/module.html.tmpl", filters=js_filters)
+ def GenerateHTMLModule(self):
+ return self.GetParameters()
+
def GenerateFiles(self, args):
- self.Write(self.GenerateJsModule(), "%s.js" % self.module.name)
+ self.Write(self.GenerateAMDModule(),
+ self.MatchMojomFilePath("%s.js" % self.module.name))
+ self.Write(self.GenerateHTMLModule(),
+ self.MatchMojomFilePath("%s.html" % self.module.name))
def GetImports(self):
- # Since each import is assigned a variable in JS, they need to have unique
- # names.
- counter = 1
- for each in self.module.imports:
- each["unique_name"] = "import" + str(counter)
+ used_names = set()
+ for each_import in self.module.imports:
+ simple_name = each_import["module_name"].split(".")[0]
+
+ # Since each import is assigned a variable in JS, they need to have unique
+ # names.
+ unique_name = simple_name
+ counter = 0
+ while unique_name in used_names:
+ counter += 1
+ unique_name = simple_name + str(counter)
+
+ used_names.add(unique_name)
+ each_import["unique_name"] = unique_name
counter += 1
return self.module.imports
+
+ def GetImportedInterfaces(self):
+ interface_to_import = {};
+ for each_import in self.module.imports:
+ for each_interface in each_import["module"].interfaces:
+ name = each_interface.name
+ interface_to_import[name] = each_import["unique_name"] + "." + name
+ return interface_to_import;
+
diff --git a/mojo/public/tools/bindings/generators/mojom_python_generator.py b/mojo/public/tools/bindings/generators/mojom_python_generator.py
index 8034480..684eda2 100644
--- a/mojo/public/tools/bindings/generators/mojom_python_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_python_generator.py
@@ -145,8 +145,17 @@
array_type = 'NativeArrayType'
return '_descriptor.%s(%s)' % (array_type, ', '.join(arguments))
+ if mojom.IsMapKind(kind):
+ arguments = [
+ GetFieldType(kind.key_kind),
+ GetFieldType(kind.value_kind),
+ ]
+ if mojom.IsNullableKind(kind):
+ arguments.append('nullable=True')
+ return '_descriptor.MapType(%s)' % ', '.join(arguments)
+
if mojom.IsStructKind(kind):
- arguments = [ GetStructClass(kind) ]
+ arguments = [ 'lambda: %s' % GetStructClass(kind) ]
if mojom.IsNullableKind(kind):
arguments.append('nullable=True')
return '_descriptor.StructType(%s)' % ', '.join(arguments)
@@ -257,6 +266,8 @@
return module
+def MojomToPythonImport(mojom):
+ return mojom.replace('.mojom', '_mojom')
class Generator(generator.Generator):
@@ -276,12 +287,13 @@
}
def GenerateFiles(self, args):
+ import_path = MojomToPythonImport(self.module.name)
self.Write(self.GeneratePythonModule(),
- '%s.py' % self.module.name.replace('.mojom', '_mojom'))
+ self.MatchMojomFilePath('%s.py' % import_path))
def GetImports(self):
for each in self.module.imports:
- each['python_module'] = each['module_name'].replace('.mojom', '_mojom')
+ each['python_module'] = MojomToPythonImport(each['module_name'])
return self.module.imports
def GetJinjaParameters(self):
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni
index 5f65c27..e54ab0f 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -59,7 +59,9 @@
"$generator_root/generators/java_templates/struct_definition.tmpl",
"$generator_root/generators/js_templates/enum_definition.tmpl",
"$generator_root/generators/js_templates/interface_definition.tmpl",
- "$generator_root/generators/js_templates/module.js.tmpl",
+ "$generator_root/generators/js_templates/module.amd.tmpl",
+ "$generator_root/generators/js_templates/module.html.tmpl",
+ "$generator_root/generators/js_templates/module_definition.tmpl",
"$generator_root/generators/js_templates/struct_definition.tmpl",
"$generator_root/generators/python_templates/module_macros.tmpl",
"$generator_root/generators/python_templates/module.py.tmpl",
@@ -120,7 +122,7 @@
"--use_chromium_bundled_pylibs",
"-d", rebase_path("//", root_build_dir),
"-I", rebase_path("//", root_build_dir),
- "-o", "{{source_gen_dir}}",
+ "-o", rebase_path(root_gen_dir),
]
}
diff --git a/mojo/public/tools/bindings/mojom_bindings_generator.gypi b/mojo/public/tools/bindings/mojom_bindings_generator.gypi
index c6e9f98..c6b10af 100644
--- a/mojo/public/tools/bindings/mojom_bindings_generator.gypi
+++ b/mojo/public/tools/bindings/mojom_bindings_generator.gypi
@@ -50,7 +50,9 @@
'<(DEPTH)/mojo/public/tools/bindings/generators/java_templates/struct.java.tmpl',
'<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl',
'<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl',
- '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl',
+ '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/module_definition.tmpl',
+ '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl',
+ '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/module.html.tmpl',
'<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl',
'<(DEPTH)/mojo/public/tools/bindings/generators/python_templates/module_macros.tmpl',
'<(DEPTH)/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl',
@@ -85,7 +87,7 @@
'--use_chromium_bundled_pylibs',
'-d', '<(DEPTH)',
'<@(mojom_import_args)',
- '-o', '<(SHARED_INTERMEDIATE_DIR)/<(mojom_base_output_dir)/<(RULE_INPUT_DIRNAME)',
+ '-o', '<(SHARED_INTERMEDIATE_DIR)',
'--java_output_directory=<(java_out_dir)',
],
'message': 'Generating Mojo bindings from <(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).mojom',
diff --git a/mojo/public/tools/bindings/mojom_bindings_generator.py b/mojo/public/tools/bindings/mojom_bindings_generator.py
index 53e3a33..cccc42a 100755
--- a/mojo/public/tools/bindings/mojom_bindings_generator.py
+++ b/mojo/public/tools/bindings/mojom_bindings_generator.py
@@ -86,78 +86,78 @@
return path
return os.path.join(dir_name, file_name)
+class MojomProcessor(object):
+ def __init__(self, should_generate):
+ self._should_generate = should_generate
+ self._processed_files = {}
-# Disable check for dangerous default arguments (they're "private" keyword
-# arguments; note that we want |_processed_files| to memoize across invocations
-# of |ProcessFile()|):
-# pylint: disable=W0102
-def ProcessFile(args, remaining_args, generator_modules, filename,
- _processed_files={}, _imported_filename_stack=None):
- # Memoized results.
- if filename in _processed_files:
- return _processed_files[filename]
+ def ProcessFile(self, args, remaining_args, generator_modules, filename,
+ _imported_filename_stack=None):
+ # Memoized results.
+ if filename in self._processed_files:
+ return self._processed_files[filename]
- if _imported_filename_stack is None:
- _imported_filename_stack = []
+ if _imported_filename_stack is None:
+ _imported_filename_stack = []
- # Ensure we only visit each file once.
- if filename in _imported_filename_stack:
- print "%s: Error: Circular dependency" % filename + \
- MakeImportStackMessage(_imported_filename_stack + [filename])
- sys.exit(1)
+ # Ensure we only visit each file once.
+ if filename in _imported_filename_stack:
+ print "%s: Error: Circular dependency" % filename + \
+ MakeImportStackMessage(_imported_filename_stack + [filename])
+ sys.exit(1)
- try:
- with open(filename) as f:
- source = f.read()
- except IOError as e:
- print "%s: Error: %s" % (e.filename, e.strerror) + \
- MakeImportStackMessage(_imported_filename_stack + [filename])
- sys.exit(1)
+ try:
+ with open(filename) as f:
+ source = f.read()
+ except IOError as e:
+ print "%s: Error: %s" % (e.filename, e.strerror) + \
+ MakeImportStackMessage(_imported_filename_stack + [filename])
+ sys.exit(1)
- try:
- tree = Parse(source, filename)
- except Error as e:
- print str(e) + MakeImportStackMessage(_imported_filename_stack + [filename])
- sys.exit(1)
+ try:
+ tree = Parse(source, filename)
+ except Error as e:
+ full_stack = _imported_filename_stack + [filename]
+ print str(e) + MakeImportStackMessage(full_stack)
+ sys.exit(1)
- dirname, name = os.path.split(filename)
- mojom = Translate(tree, name)
- if args.debug_print_intermediate:
- pprint.PrettyPrinter().pprint(mojom)
+ dirname, name = os.path.split(filename)
+ mojom = Translate(tree, name)
+ if args.debug_print_intermediate:
+ pprint.PrettyPrinter().pprint(mojom)
- # Process all our imports first and collect the module object for each.
- # We use these to generate proper type info.
- for import_data in mojom['imports']:
- import_filename = FindImportFile(dirname,
- import_data['filename'],
- args.import_directories)
- import_data['module'] = ProcessFile(
- args, remaining_args, generator_modules, import_filename,
- _processed_files=_processed_files,
- _imported_filename_stack=_imported_filename_stack + [filename])
+ # Process all our imports first and collect the module object for each.
+ # We use these to generate proper type info.
+ for import_data in mojom['imports']:
+ import_filename = FindImportFile(dirname,
+ import_data['filename'],
+ args.import_directories)
+ import_data['module'] = self.ProcessFile(
+ args, remaining_args, generator_modules, import_filename,
+ _imported_filename_stack=_imported_filename_stack + [filename])
- module = OrderedModuleFromData(mojom)
+ module = OrderedModuleFromData(mojom)
- # Set the path as relative to the source root.
- module.path = os.path.relpath(os.path.abspath(filename),
- os.path.abspath(args.depth))
+ # Set the path as relative to the source root.
+ module.path = os.path.relpath(os.path.abspath(filename),
+ os.path.abspath(args.depth))
- # Normalize to unix-style path here to keep the generators simpler.
- module.path = module.path.replace('\\', '/')
+ # Normalize to unix-style path here to keep the generators simpler.
+ module.path = module.path.replace('\\', '/')
- for generator_module in generator_modules:
- generator = generator_module.Generator(module, args.output_dir)
- filtered_args = []
- if hasattr(generator_module, 'GENERATOR_PREFIX'):
- prefix = '--' + generator_module.GENERATOR_PREFIX + '_'
- filtered_args = [arg for arg in remaining_args if arg.startswith(prefix)]
- generator.GenerateFiles(filtered_args)
+ if self._should_generate(filename):
+ for generator_module in generator_modules:
+ generator = generator_module.Generator(module, args.output_dir)
+ filtered_args = []
+ if hasattr(generator_module, 'GENERATOR_PREFIX'):
+ prefix = '--' + generator_module.GENERATOR_PREFIX + '_'
+ filtered_args = [arg for arg in remaining_args
+ if arg.startswith(prefix)]
+ generator.GenerateFiles(filtered_args)
- # Save result.
- _processed_files[filename] = module
- return module
-# pylint: enable=W0102
-
+ # Save result.
+ self._processed_files[filename] = module
+ return module
def main():
parser = argparse.ArgumentParser(
@@ -186,8 +186,9 @@
if not os.path.exists(args.output_dir):
os.makedirs(args.output_dir)
+ processor = MojomProcessor(lambda filename: filename in args.filename)
for filename in args.filename:
- ProcessFile(args, remaining_args, generator_modules, filename)
+ processor.ProcessFile(args, remaining_args, generator_modules, filename)
return 0
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/data.py b/mojo/public/tools/bindings/pylib/mojom/generate/data.py
index fab7e2e..829f3b2 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/data.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/data.py
@@ -123,6 +123,12 @@
kind = mojom.Array(KindFromData(kinds, data[2:], scope))
elif data.startswith('r:'):
kind = mojom.InterfaceRequest(KindFromData(kinds, data[2:], scope))
+ elif data.startswith('m['):
+ # Isolate the two types from their brackets
+ first_kind = data[2:data.find(']')]
+ second_kind = data[data.rfind('[')+1:data.rfind(']')]
+ kind = mojom.Map(KindFromData(kinds, first_kind, scope),
+ KindFromData(kinds, second_kind, scope))
elif data.startswith('a'):
colon = data.find(':')
length = int(data[1:colon])
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/generator.py b/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
index eb433bf..4f7f86e 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
@@ -47,6 +47,16 @@
return '_'.join(
word for word in re.split(r'([A-Z][^A-Z]+)', camel_case) if word).upper()
+def WriteFile(contents, full_path):
+ # Make sure the containing directory exists.
+ full_dir = os.path.dirname(full_path)
+ if not os.path.exists(full_dir):
+ os.makedirs(full_dir)
+
+ # Dump the data to disk.
+ with open(full_path, "w+") as f:
+ f.write(contents)
+
class Generator(object):
# Pass |output_dir| to emit files to disk. Omit |output_dir| to echo all
# files to stdout.
@@ -66,12 +76,17 @@
def GetStructs(self):
return map(partial(GetDataHeader, True), self.module.structs)
+ # Prepend the filename with a directory that matches the directory of the
+ # original .mojom file, relative to the import root.
+ def MatchMojomFilePath(self, filename):
+ return os.path.join(os.path.dirname(self.module.path), filename)
+
def Write(self, contents, filename):
if self.output_dir is None:
print contents
return
- with open(os.path.join(self.output_dir, filename), "w+") as f:
- f.write(contents)
+ full_path = os.path.join(self.output_dir, filename)
+ WriteFile(contents, full_path)
def GenerateFiles(self, args):
raise NotImplementedError("Subclasses must override/implement this method")
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/module.py b/mojo/public/tools/bindings/pylib/mojom/generate/module.py
index 7ae7a83..4f87b35 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/module.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/module.py
@@ -228,6 +228,33 @@
self.length = length
+class Map(ReferenceKind):
+ ReferenceKind.AddSharedProperty('key_kind')
+ ReferenceKind.AddSharedProperty('value_kind')
+
+ def __init__(self, key_kind=None, value_kind=None):
+ if (key_kind is not None and value_kind is not None):
+ ReferenceKind.__init__(self,
+ 'm[' + key_kind.spec + '][' + value_kind.spec +
+ ']')
+ if IsNullableKind(key_kind):
+ raise Exception("Nullable kinds can not be keys in maps.")
+ if IsStructKind(key_kind):
+ # TODO(erg): It would sometimes be nice if we could key on struct
+ # values. However, what happens if the struct has a handle in it? Or
+ # non-copyable data like an array?
+ raise Exception("Structs can not be keys in maps.")
+ if IsAnyHandleKind(key_kind):
+ raise Exception("Handles can not be keys in maps.")
+ if IsAnyArrayKind(key_kind):
+ raise Exception("Arrays can not be keys in maps.")
+ else:
+ ReferenceKind.__init__(self)
+
+ self.key_kind = key_kind
+ self.value_kind = value_kind
+
+
class InterfaceRequest(ReferenceKind):
ReferenceKind.AddSharedProperty('kind')
@@ -399,8 +426,13 @@
return IsArrayKind(kind) or IsFixedArrayKind(kind)
+def IsMapKind(kind):
+ return isinstance(kind, Map)
+
+
def IsObjectKind(kind):
- return IsStructKind(kind) or IsAnyArrayKind(kind) or IsStringKind(kind)
+ return (IsStructKind(kind) or IsAnyArrayKind(kind) or IsStringKind(kind) or
+ IsMapKind(kind))
def IsNonInterfaceHandleKind(kind):
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/pack.py b/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
index 4661941..50b7098 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
@@ -40,7 +40,8 @@
@classmethod
def GetSizeForKind(cls, kind):
- if isinstance(kind, (mojom.Array, mojom.Struct, mojom.FixedArray)):
+ if isinstance(kind, (mojom.Array, mojom.Map, mojom.Struct,
+ mojom.FixedArray)):
return 8
if isinstance(kind, mojom.Interface) or \
isinstance(kind, mojom.InterfaceRequest):
diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/lexer.py b/mojo/public/tools/bindings/pylib/mojom/parse/lexer.py
index b13fac3..ef0a63e 100644
--- a/mojo/public/tools/bindings/pylib/mojom/parse/lexer.py
+++ b/mojo/public/tools/bindings/pylib/mojom/parse/lexer.py
@@ -62,7 +62,8 @@
'TRUE',
'FALSE',
'DEFAULT',
- 'ARRAY'
+ 'ARRAY',
+ 'MAP'
)
keyword_map = {}
diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/parser.py b/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
index 551c049..7d668f1 100644
--- a/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
+++ b/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
@@ -237,6 +237,7 @@
"""nonnullable_typename : basictypename
| array
| fixed_array
+ | associative_array
| interfacerequest"""
p[0] = p[1]
@@ -275,6 +276,10 @@
snippet=self._GetSnippet(p.lineno(5)))
p[0] = p[3] + "[" + p[5] + "]"
+ def p_associative_array(self, p):
+ """associative_array : MAP LANGLE identifier COMMA typename RANGLE"""
+ p[0] = p[5] + "{" + p[3] + "}"
+
def p_interfacerequest(self, p):
"""interfacerequest : identifier AMP"""
p[0] = p[1] + "&"
diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/translate.py b/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
index 77e92c5..958b0c4 100644
--- a/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
+++ b/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
@@ -40,11 +40,15 @@
base_kind = _MapKind(kind[0:-1])
# NOTE: This doesn't rule out enum types. Those will be detected later, when
# cross-reference is established.
- reference_kinds = ('s', 'h', 'a', 'r', 'x')
+ reference_kinds = ('m', 's', 'h', 'a', 'r', 'x')
if base_kind[0] not in reference_kinds:
raise Exception(
'A type (spec "%s") cannot be made nullable' % base_kind)
return '?' + base_kind
+ if kind.endswith('}'):
+ lbracket = kind.rfind('{')
+ value = kind[0:lbracket]
+ return 'm[' + _MapKind(kind[lbracket+1:-1]) + '][' + _MapKind(value) + ']'
if kind.endswith('[]'):
typename = kind[0:-2]
if _FIXED_ARRAY_REGEXP.search(typename):
diff --git a/mojo/public/tools/bindings/pylib/mojom_tests/parse/lexer_unittest.py b/mojo/public/tools/bindings/pylib/mojom_tests/parse/lexer_unittest.py
index d24b7e2..fe7f3fc 100644
--- a/mojo/public/tools/bindings/pylib/mojom_tests/parse/lexer_unittest.py
+++ b/mojo/public/tools/bindings/pylib/mojom_tests/parse/lexer_unittest.py
@@ -84,6 +84,8 @@
_MakeLexTokenForKeyword("default"))
self.assertEquals(self._SingleTokenForInput("array"),
_MakeLexTokenForKeyword("array"))
+ self.assertEquals(self._SingleTokenForInput("map"),
+ _MakeLexTokenForKeyword("map"))
def testValidIdentifiers(self):
"""Tests identifiers."""
diff --git a/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py b/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py
index 8671b1a..9218b3d 100644
--- a/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py
+++ b/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py
@@ -683,6 +683,47 @@
r" *array<int32, abcdefg> not_a_number;"):
parser.Parse(source3, "my_file.mojom")
+ def testValidAssociativeArrays(self):
+ """Tests that we can parse valid associative array structures."""
+
+ source1 = "struct MyStruct { map<string, uint8> data; };"
+ expected1 = ast.Mojom(
+ None,
+ ast.ImportList(),
+ [ast.Struct(
+ 'MyStruct',
+ None,
+ ast.StructBody(
+ [ast.StructField('data', None, 'uint8{string}', None)]))])
+ self.assertEquals(parser.Parse(source1, "my_file.mojom"), expected1)
+
+ source2 = "interface MyInterface { MyMethod(map<string, uint8> a); };"
+ expected2 = ast.Mojom(
+ None,
+ ast.ImportList(),
+ [ast.Interface(
+ 'MyInterface',
+ None,
+ ast.InterfaceBody(
+ ast.Method(
+ 'MyMethod',
+ None,
+ ast.ParameterList(
+ ast.Parameter('a', None, 'uint8{string}')),
+ None)))])
+ self.assertEquals(parser.Parse(source2, "my_file.mojom"), expected2)
+
+ source3 = "struct MyStruct { map<string, array<uint8>> data; };"
+ expected3 = ast.Mojom(
+ None,
+ ast.ImportList(),
+ [ast.Struct(
+ 'MyStruct',
+ None,
+ ast.StructBody(
+ [ast.StructField('data', None, 'uint8[]{string}', None)]))])
+ self.assertEquals(parser.Parse(source3, "my_file.mojom"), expected3)
+
def testValidMethod(self):
"""Tests parsing method declarations."""
diff --git a/mojo/public/tools/bindings/pylib/mojom_tests/parse/translate_unittest.py b/mojo/public/tools/bindings/pylib/mojom_tests/parse/translate_unittest.py
new file mode 100644
index 0000000..2b08bb7
--- /dev/null
+++ b/mojo/public/tools/bindings/pylib/mojom_tests/parse/translate_unittest.py
@@ -0,0 +1,47 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import imp
+import os.path
+import sys
+import unittest
+
+def _GetDirAbove(dirname):
+ """Returns the directory "above" this file containing |dirname| (which must
+ also be "above" this file)."""
+ path = os.path.abspath(__file__)
+ while True:
+ path, tail = os.path.split(path)
+ assert tail
+ if tail == dirname:
+ return path
+
+try:
+ imp.find_module("mojom")
+except ImportError:
+ sys.path.append(os.path.join(_GetDirAbove("pylib"), "pylib"))
+import mojom.parse.translate as translate
+
+
+class TranslateTest(unittest.TestCase):
+ """Tests |parser.Parse()|."""
+
+ def testSimpleArray(self):
+ """Tests a simple int32[]."""
+ # pylint: disable=W0212
+ self.assertEquals(translate._MapKind("int32[]"), "a:i32")
+
+ def testAssociativeArray(self):
+ """Tests a simple uint8{string}."""
+ # pylint: disable=W0212
+ self.assertEquals(translate._MapKind("uint8{string}"), "m[s][u8]")
+
+ def testLeftToRightAssociativeArray(self):
+ """Makes sure that parsing is done from right to left on the internal kinds
+ in the presence of an associative array."""
+ # pylint: disable=W0212
+ self.assertEquals(translate._MapKind("uint8[]{string}"), "m[s][a:u8]")
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/mojo/python/tests/async_wait_unittest.py b/mojo/python/tests/async_wait_unittest.py
index 849b3cb..71b7e75 100644
--- a/mojo/python/tests/async_wait_unittest.py
+++ b/mojo/python/tests/async_wait_unittest.py
@@ -2,18 +2,16 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import unittest
+import mojo_unittest
-# pylint: disable=F0401
-import mojo.embedder
+# pylint: disable=E0611
from mojo import system
-class AsyncWaitTest(unittest.TestCase):
+class AsyncWaitTest(mojo_unittest.MojoTestCase):
def setUp(self):
- mojo.embedder.Init()
- self.loop = system.RunLoop()
+ super(AsyncWaitTest, self).setUp()
self.array = []
self.handles = system.MessagePipe()
self.cancel = self.handles.handle0.AsyncWait(system.HANDLE_SIGNAL_READABLE,
@@ -24,7 +22,7 @@
self.cancel()
self.handles = None
self.array = None
- self.loop = None
+ super(AsyncWaitTest, self).tearDown()
def _OnResult(self, value):
self.array.append(value)
diff --git a/mojo/python/tests/bindings_serialization_deserialization_unittest.py b/mojo/python/tests/bindings_serialization_deserialization_unittest.py
index 8d86495..89599bb 100644
--- a/mojo/python/tests/bindings_serialization_deserialization_unittest.py
+++ b/mojo/python/tests/bindings_serialization_deserialization_unittest.py
@@ -5,8 +5,7 @@
import math
import unittest
-# pylint: disable=F0401
-import mojo.bindings.reflection as reflection
+# pylint: disable=E0611,F0401
import mojo.system
# Generated files
@@ -20,40 +19,6 @@
return mojo.system.MessagePipe().handle0
-def _TestEquality(x, y):
- if x == y:
- return True
-
- if type(x) != type(y):
- print '\n%r != %r. Element are not of the same type.' % (x, y)
- return False
-
- if isinstance(x, float) and math.isnan(x) and math.isnan(y):
- return True
-
- if hasattr(x, '__len__'):
- if len(x) != len(y):
- print '\n%r != %r. Iterables are not of the same size.' % (x, y)
- return False
- for (x1, y1) in zip(x, y):
- if not _TestEquality(x1, y1):
- return False
- return True
-
- if (hasattr(x, '__metaclass__') and
- x.__metaclass__ == reflection.MojoStructType):
- properties = [p for p in dir(x) if not p.startswith('_')]
- for p in properties:
- p1 = getattr(x, p)
- p2 = getattr(y, p)
- if not hasattr(p1, '__call__') and not _TestEquality(p1, p2):
- print '\n%r != %r. Not equal for property %r.' % (x, y, p)
- return False
- return True
-
- return False
-
-
def _NewBar():
bar_instance = sample_service_mojom.Bar()
bar_instance.alpha = 22
@@ -95,9 +60,6 @@
class SerializationDeserializationTest(unittest.TestCase):
- def testTestEquality(self):
- self.assertFalse(_TestEquality(1, 2))
-
def testFooSerialization(self):
(data, _) = _NewFoo().Serialize()
self.assertTrue(len(data))
@@ -112,7 +74,7 @@
foo1 = _NewFoo()
(data, handles) = foo1.Serialize()
foo2 = sample_service_mojom.Foo.Deserialize(data, handles)
- self.assertTrue(_TestEquality(foo1, foo2))
+ self.assertEquals(foo1, foo2)
def testDefaultsTestSerializationDeserialization(self):
v1 = sample_service_mojom.DefaultsTest()
@@ -123,7 +85,12 @@
v1.a22.size = sample_import2_mojom.Size()
(data, handles) = v1.Serialize()
v2 = sample_service_mojom.DefaultsTest.Deserialize(data, handles)
- self.assertTrue(_TestEquality(v1, v2))
+ # NaN needs to be a special case.
+ self.assertNotEquals(v1, v2)
+ self.assertTrue(math.isnan(v2.a28))
+ self.assertTrue(math.isnan(v2.a31))
+ v1.a28 = v2.a28 = v1.a31 = v2.a31 = 0
+ self.assertEquals(v1, v2)
def testFooDeserializationError(self):
with self.assertRaises(Exception):
diff --git a/mojo/python/tests/bindings_structs_unittest.py b/mojo/python/tests/bindings_structs_unittest.py
index 97c1245..5a4c064 100644
--- a/mojo/python/tests/bindings_structs_unittest.py
+++ b/mojo/python/tests/bindings_structs_unittest.py
@@ -5,11 +5,12 @@
import math
import unittest
-# pylint: disable=F0401
+# pylint: disable=E0611,F0401
import mojo.system
# Generated files
# pylint: disable=F0401
+import regression_tests_mojom
import sample_import_mojom
import sample_import2_mojom
import sample_service_mojom
@@ -66,7 +67,7 @@
defaults_test1 = sample_service_mojom.DefaultsTest()
defaults_test2 = sample_service_mojom.DefaultsTest()
- self.assertNotEquals(defaults_test1.a22, defaults_test2.a22)
+ self.assertIsNot(defaults_test1.a22, defaults_test2.a22)
def testImmutableAttributeSet(self):
foo_instance = sample_service_mojom.Foo()
@@ -206,3 +207,11 @@
p = sample_import_mojom.Point(0, x=0)
with self.assertRaises(TypeError):
p = sample_import_mojom.Point(c=0)
+
+ def testCyclicDefinition(self):
+ a = regression_tests_mojom.A()
+ b = regression_tests_mojom.B()
+ self.assertIsNone(a.b)
+ self.assertIsNone(b.a)
+ a.b = b
+ self.assertIs(a.b, b)
diff --git a/mojo/python/tests/messaging_unittest.py b/mojo/python/tests/messaging_unittest.py
index 2d08941..767ba74 100644
--- a/mojo/python/tests/messaging_unittest.py
+++ b/mojo/python/tests/messaging_unittest.py
@@ -4,26 +4,27 @@
import unittest
-# pylint: disable=F0401
-import mojo.embedder
+import mojo_unittest
from mojo.bindings import messaging
+
+# pylint: disable=E0611
from mojo import system
class _ForwardingConnectionErrorHandler(messaging.ConnectionErrorHandler):
def __init__(self, callback):
+ messaging.ConnectionErrorHandler.__init__(self)
self._callback = callback
def OnError(self, result):
self._callback(result)
-class ConnectorTest(unittest.TestCase):
+class ConnectorTest(mojo_unittest.MojoTestCase):
def setUp(self):
- mojo.embedder.Init()
- self.loop = system.RunLoop()
+ super(ConnectorTest, self).setUp()
self.received_messages = []
self.received_errors = []
def _OnMessage(message):
@@ -44,7 +45,7 @@
def tearDown(self):
self.connector = None
self.handle = None
- self.loop = None
+ super(ConnectorTest, self).tearDown()
def testConnectorRead(self):
self.handle.WriteMessage()
@@ -134,11 +135,10 @@
self.assertEqual(other_header.request_id, 0xdeadbeafdeadbeaf)
-class RouterTest(unittest.TestCase):
+class RouterTest(mojo_unittest.MojoTestCase):
def setUp(self):
- mojo.embedder.Init()
- self.loop = system.RunLoop()
+ super(RouterTest, self).setUp()
self.received_messages = []
self.received_errors = []
def _OnMessage(message):
@@ -158,7 +158,7 @@
def tearDown(self):
self.router = None
self.handle = None
- self.loop = None
+ super(RouterTest, self).tearDown()
def testSimpleMessage(self):
header_data = messaging.MessageHeader(0, messaging.NO_FLAG).Serialize()
diff --git a/mojo/python/tests/mojo_unittest.py b/mojo/python/tests/mojo_unittest.py
new file mode 100644
index 0000000..e8961ac
--- /dev/null
+++ b/mojo/python/tests/mojo_unittest.py
@@ -0,0 +1,19 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import unittest
+
+# pylint: disable=E0611,F0401
+import mojo.embedder
+import mojo.system as system
+
+
+class MojoTestCase(unittest.TestCase):
+
+ def setUp(self):
+ mojo.embedder.Init()
+ self.loop = system.RunLoop()
+
+ def tearDown(self):
+ self.loop = None
diff --git a/mojo/python/tests/runloop_unittest.py b/mojo/python/tests/runloop_unittest.py
index 3549dbe..5c1ca83 100644
--- a/mojo/python/tests/runloop_unittest.py
+++ b/mojo/python/tests/runloop_unittest.py
@@ -2,10 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import unittest
+import mojo_unittest
-# pylint: disable=F0401
-import mojo.embedder
+# pylint: disable=E0611
from mojo import system
@@ -15,28 +14,28 @@
return _Closure
-class RunLoopTest(unittest.TestCase):
-
- def setUp(self):
- mojo.embedder.Init()
+class RunLoopTest(mojo_unittest.MojoTestCase):
def testRunLoop(self):
- loop = system.RunLoop()
array = []
for _ in xrange(10):
- loop.PostDelayedTask(_Increment(array))
- loop.RunUntilIdle()
+ self.loop.PostDelayedTask(_Increment(array))
+ self.loop.RunUntilIdle()
self.assertEquals(len(array), 10)
def testRunLoopWithException(self):
- loop = system.RunLoop()
def Throw():
raise Exception("error")
array = []
- loop.PostDelayedTask(Throw)
- loop.PostDelayedTask(_Increment(array))
+ self.loop.PostDelayedTask(Throw)
+ self.loop.PostDelayedTask(_Increment(array))
with self.assertRaisesRegexp(Exception, '^error$'):
- loop.Run()
+ self.loop.Run()
self.assertEquals(len(array), 0)
- loop.RunUntilIdle()
+ self.loop.RunUntilIdle()
self.assertEquals(len(array), 1)
+
+ def testCurrent(self):
+ self.assertEquals(system.RunLoop.Current(), self.loop)
+ self.loop = None
+ self.assertIsNone(system.RunLoop.Current())
diff --git a/mojo/python/tests/system_unittest.py b/mojo/python/tests/system_unittest.py
index 2f0e36a..e3b7c10 100644
--- a/mojo/python/tests/system_unittest.py
+++ b/mojo/python/tests/system_unittest.py
@@ -3,12 +3,11 @@
# found in the LICENSE file.
import random
-import sys
import time
-import unittest
-# pylint: disable=F0401
-import mojo.embedder
+import mojo_unittest
+
+# pylint: disable=E0611
from mojo import system
DATA_SIZE = 1024
@@ -19,13 +18,7 @@
return bytearray(''.join(chr(random.randint(0, 255)) for i in xrange(size)))
-class BaseMojoTest(unittest.TestCase):
-
- def setUp(self):
- mojo.embedder.Init()
-
-
-class CoreTest(BaseMojoTest):
+class CoreTest(mojo_unittest.MojoTestCase):
def testResults(self):
self.assertEquals(system.RESULT_OK, 0)
@@ -64,14 +57,12 @@
self.assertGreaterEqual(system.MAP_BUFFER_FLAG_NONE, 0)
def testGetTimeTicksNow(self):
- pt1 = time.time()
v1 = system.GetTimeTicksNow()
time.sleep(1e-3)
v2 = system.GetTimeTicksNow()
- pt2 = time.time()
self.assertGreater(v1, 0)
- self.assertGreater(v2, v1 + 1000)
- self.assertGreater(1e6 * (pt2 - pt1), v2 - v1)
+ self.assertGreater(v2, v1 + 1e2)
+ self.assertLess(v2, v1 + 1e5)
def _testHandlesCreation(self, *args):
for handle in args:
@@ -300,11 +291,3 @@
self.assertEquals(data, buf1.buffer)
self.assertEquals(data, buf2.buffer)
self.assertEquals(buf1.buffer, buf2.buffer)
-
-
-if __name__ == '__main__':
- suite = unittest.TestLoader().loadTestsFromTestCase(CoreTest)
- test_results = unittest.TextTestRunner(verbosity=0).run(suite)
- if not test_results.wasSuccessful():
- sys.exit(1)
- sys.exit(0)
diff --git a/mojo/services/BUILD.gn b/mojo/services/BUILD.gn
index 7b3168d..fdddd3d 100644
--- a/mojo/services/BUILD.gn
+++ b/mojo/services/BUILD.gn
@@ -8,6 +8,7 @@
deps = [
"//mojo/services/clipboard",
"//mojo/services/gles2:lib",
+ "//mojo/services/html_viewer",
"//mojo/services/network",
"//mojo/services/public/interfaces/clipboard",
"//mojo/services/public/interfaces/content_handler",
@@ -26,7 +27,7 @@
if (use_aura) {
deps += [
"//mojo/services/public/interfaces/view_manager",
- "//mojo/services/public/interfaces/window_manager",
+ "//mojo/services/public/interfaces/window_manager2",
"//mojo/services/view_manager",
"//mojo/services/window_manager",
]
diff --git a/mojo/services/html_viewer/BUILD.gn b/mojo/services/html_viewer/BUILD.gn
index ca20a24..31bc4d4 100644
--- a/mojo/services/html_viewer/BUILD.gn
+++ b/mojo/services/html_viewer/BUILD.gn
@@ -52,9 +52,10 @@
"//media/audio",
"//media/base",
"//media/blink",
+ "//mojo/application",
"//mojo/cc",
"//mojo/common",
- "//mojo/application",
+ "//mojo/converters/surfaces",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/utility",
@@ -68,7 +69,6 @@
"//mojo/services/public/interfaces/navigation",
"//mojo/services/public/interfaces/network",
"//mojo/services/public/interfaces/surfaces",
- "//mojo/services/public/cpp/surfaces",
"//net",
"//skia",
"//third_party/WebKit/public:blink",
diff --git a/mojo/services/html_viewer/DEPS b/mojo/services/html_viewer/DEPS
index ca538ee..7a6a36a 100644
--- a/mojo/services/html_viewer/DEPS
+++ b/mojo/services/html_viewer/DEPS
@@ -2,6 +2,7 @@
"+cc",
"+media",
"+mojo/cc",
+ "+mojo/converters/surfaces",
"+mojo/application",
"+mojo/services",
"+net/base",
diff --git a/mojo/services/html_viewer/weblayertreeview_impl.cc b/mojo/services/html_viewer/weblayertreeview_impl.cc
index 24eaaf9..3c7f251 100644
--- a/mojo/services/html_viewer/weblayertreeview_impl.cc
+++ b/mojo/services/html_viewer/weblayertreeview_impl.cc
@@ -11,7 +11,7 @@
#include "cc/trees/layer_tree_host.h"
#include "mojo/cc/context_provider_mojo.h"
#include "mojo/cc/output_surface_mojo.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "mojo/services/public/cpp/view_manager/view.h"
#include "third_party/WebKit/public/web/WebWidget.h"
@@ -39,10 +39,12 @@
settings.layer_transforms_should_scale_layer_contents = true;
cc::SharedBitmapManager* shared_bitmap_manager = NULL;
+ cc::GpuMemoryBufferManager* gpu_memory_buffer_manager = NULL;
layer_tree_host_ =
cc::LayerTreeHost::CreateThreaded(this,
shared_bitmap_manager,
+ gpu_memory_buffer_manager,
settings,
base::MessageLoopProxy::current(),
compositor_message_loop_proxy);
diff --git a/mojo/services/native_viewport/BUILD.gn b/mojo/services/native_viewport/BUILD.gn
index 72901f9..9c30fa5 100644
--- a/mojo/services/native_viewport/BUILD.gn
+++ b/mojo/services/native_viewport/BUILD.gn
@@ -15,6 +15,7 @@
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings:bindings",
"//mojo/services/public/interfaces/native_viewport",
+ "//mojo/services/public/cpp/native_viewport:args",
"//ui/gl",
]
@@ -29,11 +30,11 @@
"//gpu/command_buffer/service",
"//mojo/application",
"//mojo/common",
+ "//mojo/converters/geometry",
+ "//mojo/converters/input_events",
+ "//mojo/converters/surfaces",
"//mojo/environment:chromium",
"//mojo/services/gles2",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/input_events",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/gpu",
"//mojo/services/public/interfaces/native_viewport",
diff --git a/mojo/services/native_viewport/DEPS b/mojo/services/native_viewport/DEPS
index abf7ef8..60e2518 100644
--- a/mojo/services/native_viewport/DEPS
+++ b/mojo/services/native_viewport/DEPS
@@ -2,9 +2,10 @@
"+cc/surfaces",
"+gpu/command_buffer/service/mailbox_manager.h",
"+mojo/application",
- "+mojo/services/public/cpp/geometry",
- "+mojo/services/public/cpp/input_events",
- "+mojo/services/public/cpp/surfaces",
+ "+mojo/converters/geometry",
+ "+mojo/converters/input_events",
+ "+mojo/converters/surfaces",
+ "+mojo/services/public/cpp/native_viewport",
"+mojo/services/public/interfaces/gpu",
"+mojo/services/public/interfaces/native_viewport",
"+mojo/services/public/interfaces/geometry",
diff --git a/mojo/services/native_viewport/gpu_impl.cc b/mojo/services/native_viewport/gpu_impl.cc
index de0b69e..7da4659 100644
--- a/mojo/services/native_viewport/gpu_impl.cc
+++ b/mojo/services/native_viewport/gpu_impl.cc
@@ -5,8 +5,8 @@
#include "mojo/services/native_viewport/gpu_impl.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/services/gles2/command_buffer_impl.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
#include "ui/gl/gl_share_group.h"
namespace mojo {
diff --git a/mojo/services/native_viewport/main.cc b/mojo/services/native_viewport/main.cc
index 0185e67..7db4705 100644
--- a/mojo/services/native_viewport/main.cc
+++ b/mojo/services/native_viewport/main.cc
@@ -9,9 +9,11 @@
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/interface_factory_impl.h"
#include "mojo/services/native_viewport/gpu_impl.h"
#include "mojo/services/native_viewport/native_viewport_impl.h"
+#include "mojo/services/public/cpp/native_viewport/args.h"
#include "ui/gl/gl_share_group.h"
#include "ui/gl/gl_surface.h"
@@ -20,64 +22,43 @@
class NativeViewportAppDelegate
: public ApplicationDelegate,
public InterfaceFactory<NativeViewport>,
- public InterfaceFactory<Gpu>,
- public InterfaceFactory<NativeViewportConfig> {
+ public InterfaceFactory<Gpu> {
public:
NativeViewportAppDelegate()
: share_group_(new gfx::GLShareGroup),
mailbox_manager_(new gpu::gles2::MailboxManager),
- is_test_(false),
- is_headless_(false),
- is_initialized_(false) {}
+ is_headless_(false) {}
virtual ~NativeViewportAppDelegate() {}
private:
- class NativeViewportConfigImpl : public InterfaceImpl<NativeViewportConfig> {
- public:
- NativeViewportConfigImpl(NativeViewportAppDelegate* app_delegate)
- : app_delegate_(app_delegate) {}
-
- virtual void UseTestConfig(
- const Callback<void()>& callback) override {
- app_delegate_->is_test_ = true;
- callback.Run();
- }
-
- virtual void UseHeadlessConfig(
- const Callback<void()>& callback) override {
- app_delegate_->is_headless_ = true;
- callback.Run();
- }
-
- private:
- NativeViewportAppDelegate* app_delegate_;
- };
+ bool HasArg(const std::string& arg) {
+ return std::find(args_.begin(), args_.end(), arg) != args_.end();
+ }
// ApplicationDelegate implementation.
virtual void Initialize(ApplicationImpl* application) override {
app_ = application;
+ args_ = application->args().To<std::vector<std::string> >();
+
+#if !defined(COMPONENT_BUILD)
+ if (HasArg(kUseTestConfig))
+ gfx::GLSurface::InitializeOneOffForTests();
+ else
+ gfx::GLSurface::InitializeOneOff();
+#endif
+ is_headless_ = HasArg(kUseHeadlessConfig);
}
virtual bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override {
connection->AddService<NativeViewport>(this);
connection->AddService<Gpu>(this);
- connection->AddService<NativeViewportConfig>(this);
return true;
}
// InterfaceFactory<NativeViewport> implementation.
virtual void Create(ApplicationConnection* connection,
InterfaceRequest<NativeViewport> request) override {
-#if !defined(COMPONENT_BUILD)
- if (!is_initialized_) {
- if (is_test_)
- gfx::GLSurface::InitializeOneOffForTests();
- else
- gfx::GLSurface::InitializeOneOff();
- is_initialized_ = true;
- }
-#endif
BindToRequest(new NativeViewportImpl(app_, is_headless_), &request);
}
@@ -88,18 +69,11 @@
&request);
}
- // InterfaceFactory<NVTestConfig> implementation.
- virtual void Create(ApplicationConnection* connection,
- InterfaceRequest<NativeViewportConfig> request) override {
- BindToRequest(new NativeViewportConfigImpl(this), &request);
- }
-
ApplicationImpl* app_;
+ std::vector<std::string> args_;
scoped_refptr<gfx::GLShareGroup> share_group_;
scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
- bool is_test_;
bool is_headless_;
- bool is_initialized_;
DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
};
}
diff --git a/mojo/services/native_viewport/native_viewport_impl.cc b/mojo/services/native_viewport/native_viewport_impl.cc
index 3006612..5e749ee 100644
--- a/mojo/services/native_viewport/native_viewport_impl.cc
+++ b/mojo/services/native_viewport/native_viewport_impl.cc
@@ -9,14 +9,14 @@
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/time/time.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/interface_factory.h"
#include "mojo/services/native_viewport/platform_viewport_headless.h"
#include "mojo/services/native_viewport/viewport_surface.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
#include "ui/events/event.h"
namespace mojo {
diff --git a/mojo/services/native_viewport/platform_viewport_x11.cc b/mojo/services/native_viewport/platform_viewport_x11.cc
index 0813a56..b34928e 100644
--- a/mojo/services/native_viewport/platform_viewport_x11.cc
+++ b/mojo/services/native_viewport/platform_viewport_x11.cc
@@ -6,7 +6,7 @@
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
-#include "mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h"
+#include "mojo/converters/input_events/mojo_extended_key_event_data.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/events/platform/platform_event_dispatcher.h"
diff --git a/mojo/services/native_viewport/viewport_surface.cc b/mojo/services/native_viewport/viewport_surface.cc
index 883be4f..60b24c5 100644
--- a/mojo/services/native_viewport/viewport_surface.cc
+++ b/mojo/services/native_viewport/viewport_surface.cc
@@ -6,9 +6,9 @@
#include "base/bind.h"
#include "cc/surfaces/surface_id_allocator.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_utils.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_utils.h"
#include "ui/gfx/transform.h"
namespace mojo {
diff --git a/mojo/services/network/BUILD.gn b/mojo/services/network/BUILD.gn
index d6ae427..6fa511c 100644
--- a/mojo/services/network/BUILD.gn
+++ b/mojo/services/network/BUILD.gn
@@ -35,13 +35,45 @@
sources = [
"cookie_store_impl.cc",
"cookie_store_impl.h",
+ "net_adapters.cc",
+ "net_adapters.h",
+ "net_address_type_converters.cc",
+ "net_address_type_converters.h",
"network_context.cc",
"network_context.h",
"network_service_impl.cc",
"network_service_impl.h",
+ "tcp_bound_socket_impl.cc",
+ "tcp_bound_socket_impl.h",
+ "tcp_connected_socket_impl.cc",
+ "tcp_connected_socket_impl.h",
+ "tcp_server_socket_impl.cc",
+ "tcp_server_socket_impl.h",
+ "udp_socket_impl.cc",
+ "udp_socket_impl.h",
"url_loader_impl.cc",
"url_loader_impl.h",
"web_socket_impl.cc",
"web_socket_impl.h",
]
}
+
+# GYP version: mojo/mojo_services.gypi:mojo_network_service_unittests
+test("unittests") {
+ deps = [
+ ":network",
+ "//base",
+ "//base/test:test_support",
+ "//mojo/application_manager",
+ "//mojo/edk/system",
+ "//mojo/edk/test:run_all_unittests",
+ "//mojo/environment:chromium",
+ "//mojo/services/public/interfaces/network",
+ "//mojo/shell:test_support",
+ "//testing/gtest",
+ ]
+
+ sources = [
+ "udp_socket_unittest.cc",
+ ]
+}
diff --git a/mojo/services/network/net_adapters.cc b/mojo/services/network/net_adapters.cc
new file mode 100644
index 0000000..551481d
--- /dev/null
+++ b/mojo/services/network/net_adapters.cc
@@ -0,0 +1,118 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/network/net_adapters.h"
+
+#include "net/base/net_errors.h"
+
+namespace mojo {
+
+namespace {
+
+const uint32_t kMaxBufSize = 64 * 1024;
+
+} // namespace
+
+NetToMojoPendingBuffer::NetToMojoPendingBuffer(
+ ScopedDataPipeProducerHandle handle,
+ void* buffer)
+ : handle_(handle.Pass()),
+ buffer_(buffer) {
+}
+
+NetToMojoPendingBuffer::~NetToMojoPendingBuffer() {
+ if (handle_.is_valid())
+ EndWriteDataRaw(handle_.get(), 0);
+}
+
+// static
+MojoResult NetToMojoPendingBuffer::BeginWrite(
+ ScopedDataPipeProducerHandle* handle,
+ scoped_refptr<NetToMojoPendingBuffer>* pending,
+ uint32_t* num_bytes) {
+ void* buf;
+ *num_bytes = 0;
+
+ MojoResult result = BeginWriteDataRaw(handle->get(), &buf, num_bytes,
+ MOJO_WRITE_DATA_FLAG_NONE);
+ if (result == MOJO_RESULT_OK) {
+ if (*num_bytes > kMaxBufSize)
+ *num_bytes = kMaxBufSize;
+ *pending = new NetToMojoPendingBuffer(handle->Pass(), buf);
+ }
+ return result;
+}
+
+ScopedDataPipeProducerHandle NetToMojoPendingBuffer::Complete(
+ uint32_t num_bytes) {
+ EndWriteDataRaw(handle_.get(), num_bytes);
+ buffer_ = NULL;
+ return handle_.Pass();
+}
+
+// -----------------------------------------------------------------------------
+
+NetToMojoIOBuffer::NetToMojoIOBuffer(
+ NetToMojoPendingBuffer* pending_buffer)
+ : net::WrappedIOBuffer(pending_buffer->buffer()),
+ pending_buffer_(pending_buffer) {
+}
+
+NetToMojoIOBuffer::~NetToMojoIOBuffer() {
+}
+
+// -----------------------------------------------------------------------------
+
+MojoToNetPendingBuffer::MojoToNetPendingBuffer(
+ ScopedDataPipeConsumerHandle handle,
+ const void* buffer)
+ : handle_(handle.Pass()),
+ buffer_(buffer) {
+}
+
+MojoToNetPendingBuffer::~MojoToNetPendingBuffer() {
+}
+
+// static
+MojoResult MojoToNetPendingBuffer::BeginRead(
+ ScopedDataPipeConsumerHandle* handle,
+ scoped_refptr<MojoToNetPendingBuffer>* pending,
+ uint32_t* num_bytes) {
+ const void* buffer = NULL;
+ *num_bytes = 0;
+ MojoResult result = BeginReadDataRaw(handle->get(), &buffer, num_bytes,
+ MOJO_READ_DATA_FLAG_NONE);
+ if (result == MOJO_RESULT_OK)
+ *pending = new MojoToNetPendingBuffer(handle->Pass(), buffer);
+ return result;
+}
+
+ScopedDataPipeConsumerHandle MojoToNetPendingBuffer::Complete(
+ uint32_t num_bytes) {
+ EndReadDataRaw(handle_.get(), num_bytes);
+ buffer_ = NULL;
+ return handle_.Pass();
+}
+
+// -----------------------------------------------------------------------------
+
+MojoToNetIOBuffer::MojoToNetIOBuffer(MojoToNetPendingBuffer* pending_buffer)
+ : net::WrappedIOBuffer(pending_buffer->buffer()),
+ pending_buffer_(pending_buffer) {
+}
+
+MojoToNetIOBuffer::~MojoToNetIOBuffer() {
+}
+
+// -----------------------------------------------------------------------------
+
+NetworkErrorPtr MakeNetworkError(int error_code) {
+ NetworkErrorPtr error = NetworkError::New();
+ error->code = error_code;
+ if (error_code <= 0)
+ error->description = net::ErrorToString(error_code);
+ return error.Pass();
+}
+
+} // namespace mojo
diff --git a/mojo/services/network/net_adapters.h b/mojo/services/network/net_adapters.h
new file mode 100644
index 0000000..89c6976
--- /dev/null
+++ b/mojo/services/network/net_adapters.h
@@ -0,0 +1,131 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_NETWORK_NET_ADAPTERS_H_
+#define MOJO_SERVICES_NETWORK_NET_ADAPTERS_H_
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "mojo/services/public/interfaces/network/network_error.mojom.h"
+#include "net/base/io_buffer.h"
+
+namespace mojo {
+
+// These adapters are used to transfer data between a Mojo pipe and the net
+// library. There are four adapters, one for each end in each direction:
+//
+// Mojo pipe Data flow Network library
+// ----------------------------------------------------------
+// MojoToNetPendingBuffer ---> MojoToNetIOBuffer
+// NetToMojoPendingBuffer <--- NetToMojoIOBuffer
+//
+// While the operation is in progress, the Mojo-side objects keep ownership
+// of the Mojo pipe, which in turn is kept alive by the IOBuffer. This allows
+// the request to potentially outlive the object managing the translation.
+
+// Mojo side of a Net -> Mojo copy. The buffer is allocated by Mojo.
+class NetToMojoPendingBuffer
+ : public base::RefCountedThreadSafe<NetToMojoPendingBuffer> {
+ public:
+ // Begins a two-phase write to the data pipe.
+ //
+ // On success, MOJO_RESULT_OK will be returned. The ownership of the given
+ // producer handle will be transferred to the new NetToMojoPendingBuffer that
+ // will be placed into *pending, and the size of the buffer will be in
+ // *num_bytes.
+ //
+ // On failure or MOJO_RESULT_SHOULD_WAIT, there will be no change to the
+ // handle, and *pending and *num_bytes will be unused.
+ static MojoResult BeginWrite(ScopedDataPipeProducerHandle* handle,
+ scoped_refptr<NetToMojoPendingBuffer>* pending,
+ uint32_t* num_bytes);
+
+ // Called to indicate the buffer is done being written to. Passes ownership
+ // of the pipe back to the caller.
+ ScopedDataPipeProducerHandle Complete(uint32_t num_bytes);
+
+ char* buffer() { return static_cast<char*>(buffer_); }
+
+ private:
+ friend class base::RefCountedThreadSafe<NetToMojoPendingBuffer>;
+
+ // Takes ownership of the handle.
+ NetToMojoPendingBuffer(ScopedDataPipeProducerHandle handle, void* buffer);
+ ~NetToMojoPendingBuffer();
+
+ ScopedDataPipeProducerHandle handle_;
+ void* buffer_;
+
+ DISALLOW_COPY_AND_ASSIGN(NetToMojoPendingBuffer);
+};
+
+// Net side of a Net -> Mojo copy. The data will be read from the network and
+// copied into the buffer associated with the pending mojo write.
+class NetToMojoIOBuffer : public net::WrappedIOBuffer {
+ public:
+ explicit NetToMojoIOBuffer(NetToMojoPendingBuffer* pending_buffer);
+
+ private:
+ virtual ~NetToMojoIOBuffer();
+
+ scoped_refptr<NetToMojoPendingBuffer> pending_buffer_;
+};
+
+// Mojo side of a Mojo -> Net copy.
+class MojoToNetPendingBuffer
+ : public base::RefCountedThreadSafe<MojoToNetPendingBuffer> {
+ public:
+ // Starts reading from Mojo.
+ //
+ // On success, MOJO_RESULT_OK will be returned. The ownership of the given
+ // consumer handle will be transferred to the new MojoToNetPendingBuffer that
+ // will be placed into *pending, and the size of the buffer will be in
+ // *num_bytes.
+ //
+ // On failure or MOJO_RESULT_SHOULD_WAIT, there will be no change to the
+ // handle, and *pending and *num_bytes will be unused.
+ static MojoResult BeginRead(ScopedDataPipeConsumerHandle* handle,
+ scoped_refptr<MojoToNetPendingBuffer>* pending,
+ uint32_t* num_bytes);
+
+ // Indicates the buffer is done being read from. Passes ownership of the pipe
+ // back to the caller. The argument is the number of bytes actually read,
+ // since net may do partial writes, which will result in partial reads from
+ // the Mojo pipe's perspective.
+ ScopedDataPipeConsumerHandle Complete(uint32_t num_bytes);
+
+ const char* buffer() { return static_cast<const char*>(buffer_); }
+
+ private:
+ friend class base::RefCountedThreadSafe<MojoToNetPendingBuffer>;
+
+ // Takes ownership of the handle.
+ explicit MojoToNetPendingBuffer(ScopedDataPipeConsumerHandle handle,
+ const void* buffer);
+ ~MojoToNetPendingBuffer();
+
+ ScopedDataPipeConsumerHandle handle_;
+ const void* buffer_;
+
+ DISALLOW_COPY_AND_ASSIGN(MojoToNetPendingBuffer);
+};
+
+// Net side of a Mojo -> Net copy. The data will already be in the
+// MojoToNetPendingBuffer's buffer.
+class MojoToNetIOBuffer : public net::WrappedIOBuffer {
+ public:
+ explicit MojoToNetIOBuffer(MojoToNetPendingBuffer* pending_buffer);
+
+ private:
+ virtual ~MojoToNetIOBuffer();
+
+ scoped_refptr<MojoToNetPendingBuffer> pending_buffer_;
+};
+
+// Creates a new Mojo network error object from a net error code.
+NetworkErrorPtr MakeNetworkError(int error_code);
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_NETWORK_NET_ADAPTERS_H_
diff --git a/mojo/services/network/net_address_type_converters.cc b/mojo/services/network/net_address_type_converters.cc
new file mode 100644
index 0000000..573c0ff
--- /dev/null
+++ b/mojo/services/network/net_address_type_converters.cc
@@ -0,0 +1,64 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/network/net_address_type_converters.h"
+
+#include "base/sys_byteorder.h"
+
+namespace mojo {
+
+// static
+net::IPEndPoint TypeConverter<net::IPEndPoint, NetAddressPtr>::Convert(
+ const NetAddressPtr& obj) {
+ if (!obj)
+ return net::IPEndPoint();
+
+ switch (obj->family) {
+ case NET_ADDRESS_FAMILY_IPV4:
+ if (!obj->ipv4)
+ break;
+ return net::IPEndPoint(
+ obj->ipv4->addr.storage(), base::NetToHost16(obj->ipv4->port));
+
+ case NET_ADDRESS_FAMILY_IPV6:
+ if (!obj->ipv6)
+ break;
+ return net::IPEndPoint(
+ obj->ipv6->addr.storage(), base::NetToHost16(obj->ipv6->port));
+
+ default:
+ break;
+ }
+
+ return net::IPEndPoint();
+}
+
+// static
+NetAddressPtr TypeConverter<NetAddressPtr, net::IPEndPoint>::Convert(
+ const net::IPEndPoint& obj) {
+ NetAddressPtr net_address(NetAddress::New());
+
+ switch (obj.GetFamily()) {
+ case net::ADDRESS_FAMILY_IPV4:
+ net_address->family = NET_ADDRESS_FAMILY_IPV4;
+ net_address->ipv4 = NetAddressIPv4::New();
+ net_address->ipv4->port =
+ base::HostToNet16(static_cast<uint16>(obj.port()));
+ net_address->ipv4->addr = Array<uint8_t>::From(obj.address());
+ break;
+ case NET_ADDRESS_FAMILY_IPV6:
+ net_address->ipv6 = NetAddressIPv6::New();
+ net_address->family = NET_ADDRESS_FAMILY_IPV6;
+ net_address->ipv6->port =
+ base::HostToNet16(static_cast<uint16>(obj.port()));
+ net_address->ipv6->addr = Array<uint8_t>::From(obj.address());
+ break;
+ default:
+ break;
+ }
+
+ return net_address.Pass();
+}
+
+} // namespace mojo
diff --git a/mojo/services/network/net_address_type_converters.h b/mojo/services/network/net_address_type_converters.h
new file mode 100644
index 0000000..8ac63e3
--- /dev/null
+++ b/mojo/services/network/net_address_type_converters.h
@@ -0,0 +1,26 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_NETWORK_NET_ADDRESS_TYPE_CONVERTERS_H_
+#define MOJO_SERVICES_NETWORK_NET_ADDRESS_TYPE_CONVERTERS_H_
+
+#include "mojo/public/cpp/bindings/type_converter.h"
+#include "mojo/services/public/interfaces/network/net_address.mojom.h"
+#include "net/base/ip_endpoint.h"
+
+namespace mojo {
+
+template <>
+struct TypeConverter<net::IPEndPoint, NetAddressPtr> {
+ static net::IPEndPoint Convert(const NetAddressPtr& obj);
+};
+
+template <>
+struct TypeConverter<NetAddressPtr, net::IPEndPoint> {
+ static NetAddressPtr Convert(const net::IPEndPoint& obj);
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_NETWORK_NET_ADDRESS_TYPE_CONVERTERS_H_
diff --git a/mojo/services/network/network_service_impl.cc b/mojo/services/network/network_service_impl.cc
index a576975..a622322 100644
--- a/mojo/services/network/network_service_impl.cc
+++ b/mojo/services/network/network_service_impl.cc
@@ -6,11 +6,27 @@
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/services/network/cookie_store_impl.h"
+#include "mojo/services/network/net_adapters.h"
+#include "mojo/services/network/tcp_bound_socket_impl.h"
+#include "mojo/services/network/udp_socket_impl.h"
#include "mojo/services/network/url_loader_impl.h"
#include "mojo/services/network/web_socket_impl.h"
namespace mojo {
+namespace {
+
+// Allows a Callback<NetworkErrorPtr, NetAddressPtr> to be called by a
+// Callback<NetworkErrorPtr> when the address is already known.
+void BoundAddressCallbackAdapter(
+ const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback,
+ NetAddressPtr address,
+ NetworkErrorPtr err) {
+ callback.Run(err.Pass(), address.Pass());
+}
+
+} // namespace
+
NetworkServiceImpl::NetworkServiceImpl(ApplicationConnection* connection,
NetworkContext* context)
: context_(context),
@@ -37,18 +53,40 @@
NetAddressPtr local_address,
InterfaceRequest<TCPBoundSocket> bound_socket,
const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback) {
- // TODO(brettw) implement this.
- callback.Run(NetworkErrorPtr(), NetAddressPtr());
+ scoped_ptr<TCPBoundSocketImpl> bound(new TCPBoundSocketImpl);
+ int net_error = bound->Bind(local_address.Pass());
+ if (net_error != net::OK) {
+ callback.Run(MakeNetworkError(net_error), NetAddressPtr());
+ return;
+ }
+ NetAddressPtr resulting_local_address(bound->GetLocalAddress());
+ BindToRequest(bound.release(), &bound_socket);
+ callback.Run(MakeNetworkError(net::OK), resulting_local_address.Pass());
}
-void NetworkServiceImpl::CreateTCPClientSocket(
+void NetworkServiceImpl::CreateTCPConnectedSocket(
NetAddressPtr remote_address,
ScopedDataPipeConsumerHandle send_stream,
ScopedDataPipeProducerHandle receive_stream,
- InterfaceRequest<TCPClientSocket> client_socket,
+ InterfaceRequest<TCPConnectedSocket> client_socket,
const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback) {
- // TODO(brettw) implement this.
- callback.Run(NetworkErrorPtr(), NetAddressPtr());
+ TCPBoundSocketImpl bound_socket;
+ int net_error = bound_socket.Bind(NetAddressPtr());
+ if (net_error != net::OK) {
+ callback.Run(MakeNetworkError(net_error), NetAddressPtr());
+ return;
+ }
+
+ bound_socket.Connect(
+ remote_address.Pass(), send_stream.Pass(), receive_stream.Pass(),
+ client_socket.Pass(),
+ base::Bind(&BoundAddressCallbackAdapter,
+ callback,
+ base::Passed(bound_socket.GetLocalAddress().Pass())));
+}
+
+void NetworkServiceImpl::CreateUDPSocket(InterfaceRequest<UDPSocket> socket) {
+ BindToRequest(new UDPSocketImpl(), &socket);
}
} // namespace mojo
diff --git a/mojo/services/network/network_service_impl.h b/mojo/services/network/network_service_impl.h
index 9088e36..5ae2cfd 100644
--- a/mojo/services/network/network_service_impl.h
+++ b/mojo/services/network/network_service_impl.h
@@ -28,12 +28,13 @@
NetAddressPtr local_address,
InterfaceRequest<TCPBoundSocket> bound_socket,
const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback) override;
- virtual void CreateTCPClientSocket(
+ virtual void CreateTCPConnectedSocket(
NetAddressPtr remote_address,
ScopedDataPipeConsumerHandle send_stream,
ScopedDataPipeProducerHandle receive_stream,
- InterfaceRequest<TCPClientSocket> client_socket,
+ InterfaceRequest<TCPConnectedSocket> client_socket,
const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback) override;
+ virtual void CreateUDPSocket(InterfaceRequest<UDPSocket> socket) override;
private:
NetworkContext* context_;
diff --git a/mojo/services/network/tcp_bound_socket_impl.cc b/mojo/services/network/tcp_bound_socket_impl.cc
new file mode 100644
index 0000000..6660520
--- /dev/null
+++ b/mojo/services/network/tcp_bound_socket_impl.cc
@@ -0,0 +1,82 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/network/tcp_bound_socket_impl.h"
+
+#include "mojo/services/network/net_adapters.h"
+#include "mojo/services/network/net_address_type_converters.h"
+#include "mojo/services/network/tcp_connected_socket_impl.h"
+#include "mojo/services/network/tcp_server_socket_impl.h"
+#include "net/base/net_errors.h"
+
+namespace mojo {
+
+TCPBoundSocketImpl::TCPBoundSocketImpl() {
+}
+
+TCPBoundSocketImpl::~TCPBoundSocketImpl() {
+}
+
+int TCPBoundSocketImpl::Bind(NetAddressPtr local_address) {
+ // The local address might be null to match any port.
+ net::IPEndPoint end_point;
+ if (!local_address.is_null())
+ end_point = local_address.To<net::IPEndPoint>();
+
+ socket_.reset(new net::TCPSocket(NULL, net::NetLog::Source()));
+ int result = socket_->Open(end_point.GetFamily());
+ if (result != net::OK)
+ return result;
+
+ result = socket_->SetDefaultOptionsForServer();
+ if (result != net::OK)
+ return result;
+
+ result = socket_->Bind(end_point);
+ if (result != net::OK)
+ return result;
+
+ return net::OK;
+}
+
+NetAddressPtr TCPBoundSocketImpl::GetLocalAddress() const {
+ net::IPEndPoint resolved_local_address;
+ if (socket_->GetLocalAddress(&resolved_local_address) != net::OK)
+ return NetAddressPtr();
+ return NetAddress::From(resolved_local_address);
+}
+
+void TCPBoundSocketImpl::StartListening(
+ InterfaceRequest<TCPServerSocket> server,
+ const Callback<void(NetworkErrorPtr)>& callback) {
+ if (!socket_) {
+ // A bound socket will only be returned to the caller after binding
+ // succeeds, so if the socket doesn't exist, that means ownership was
+ // already passed to a server socket or client socket.
+ callback.Run(MakeNetworkError(net::ERR_FAILED));
+ return;
+ }
+
+ // TODO(brettw) set the backlog properly.
+ int result = socket_->Listen(4);
+ if (result != net::OK) {
+ callback.Run(MakeNetworkError(result));
+ return;
+ }
+
+ // The server socket object takes ownership of the socket.
+ BindToRequest(new TCPServerSocketImpl(socket_.Pass()), &server);
+ callback.Run(MakeNetworkError(net::OK));
+}
+
+void TCPBoundSocketImpl::Connect(
+ NetAddressPtr remote_address,
+ ScopedDataPipeConsumerHandle send_stream,
+ ScopedDataPipeProducerHandle receive_stream,
+ InterfaceRequest<TCPConnectedSocket> client_socket,
+ const Callback<void(NetworkErrorPtr)>& callback) {
+ // TODO(brettw) write this.
+}
+
+} // namespace mojo
diff --git a/mojo/services/network/tcp_bound_socket_impl.h b/mojo/services/network/tcp_bound_socket_impl.h
new file mode 100644
index 0000000..5fb1bf3
--- /dev/null
+++ b/mojo/services/network/tcp_bound_socket_impl.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_NETWORK_TCP_BOUND_SOCKET_H_
+#define MOJO_SERVICES_NETWORK_TCP_BOUND_SOCKET_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "mojo/public/cpp/bindings/interface_impl.h"
+#include "mojo/services/public/interfaces/network/tcp_bound_socket.mojom.h"
+#include "net/socket/tcp_socket.h"
+
+namespace mojo {
+
+class TCPBoundSocketImpl : public InterfaceImpl<TCPBoundSocket> {
+ public:
+ TCPBoundSocketImpl();
+ virtual ~TCPBoundSocketImpl();
+
+ int Bind(NetAddressPtr local_address);
+
+ // Returns the local address associated with this socket. This should only
+ // be called after Bind has succeeded.
+ NetAddressPtr GetLocalAddress() const;
+
+ // TCPBoundSocket.
+ virtual void StartListening(
+ InterfaceRequest<TCPServerSocket> server,
+ const Callback<void(NetworkErrorPtr)>& callback) override;
+ virtual void Connect(
+ NetAddressPtr remote_address,
+ ScopedDataPipeConsumerHandle send_stream,
+ ScopedDataPipeProducerHandle receive_stream,
+ InterfaceRequest<TCPConnectedSocket> client_socket,
+ const Callback<void(NetworkErrorPtr)>& callback) override;
+
+ private:
+ scoped_ptr<net::TCPSocket> socket_;
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_NETWORK_TCP_BOUND_SOCKET_H_
diff --git a/mojo/services/network/tcp_connected_socket_impl.cc b/mojo/services/network/tcp_connected_socket_impl.cc
new file mode 100644
index 0000000..0c6f2eb
--- /dev/null
+++ b/mojo/services/network/tcp_connected_socket_impl.cc
@@ -0,0 +1,21 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/network/tcp_connected_socket_impl.h"
+
+namespace mojo {
+
+TCPConnectedSocketImpl::TCPConnectedSocketImpl(
+ scoped_ptr<net::TCPSocket> socket,
+ ScopedDataPipeConsumerHandle send_stream,
+ ScopedDataPipeProducerHandle receive_stream)
+ : socket_(socket.Pass()),
+ send_stream_(send_stream.Pass()),
+ receive_stream_(receive_stream.Pass()) {
+}
+
+TCPConnectedSocketImpl::~TCPConnectedSocketImpl() {
+}
+
+} // namespace mojo
diff --git a/mojo/services/network/tcp_connected_socket_impl.h b/mojo/services/network/tcp_connected_socket_impl.h
new file mode 100644
index 0000000..5c24011
--- /dev/null
+++ b/mojo/services/network/tcp_connected_socket_impl.h
@@ -0,0 +1,30 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_NETWORK_TCP_CONNECTED_SOCKET_H_
+#define MOJO_SERVICES_NETWORK_TCP_CONNECTED_SOCKET_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "mojo/public/cpp/bindings/interface_impl.h"
+#include "mojo/services/public/interfaces/network/tcp_connected_socket.mojom.h"
+#include "net/socket/tcp_socket.h"
+
+namespace mojo {
+
+class TCPConnectedSocketImpl : public InterfaceImpl<TCPConnectedSocket> {
+ public:
+ TCPConnectedSocketImpl(scoped_ptr<net::TCPSocket> socket,
+ ScopedDataPipeConsumerHandle send_stream,
+ ScopedDataPipeProducerHandle receive_stream);
+ virtual ~TCPConnectedSocketImpl();
+
+ private:
+ scoped_ptr<net::TCPSocket> socket_;
+ ScopedDataPipeConsumerHandle send_stream_;
+ ScopedDataPipeProducerHandle receive_stream_;
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_NETWORK_TCP_CONNECTED_SOCKET_H_
diff --git a/mojo/services/network/tcp_server_socket_impl.cc b/mojo/services/network/tcp_server_socket_impl.cc
new file mode 100644
index 0000000..3fb88e0
--- /dev/null
+++ b/mojo/services/network/tcp_server_socket_impl.cc
@@ -0,0 +1,69 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/network/tcp_server_socket_impl.h"
+
+#include "mojo/services/network/net_adapters.h"
+#include "mojo/services/network/net_address_type_converters.h"
+#include "mojo/services/network/tcp_connected_socket_impl.h"
+#include "net/base/net_errors.h"
+
+namespace mojo {
+
+TCPServerSocketImpl::TCPServerSocketImpl(scoped_ptr<net::TCPSocket> socket)
+ : socket_(socket.Pass()) {
+}
+
+TCPServerSocketImpl::~TCPServerSocketImpl() {
+}
+
+void TCPServerSocketImpl::Accept(
+ ScopedDataPipeConsumerHandle send_stream,
+ ScopedDataPipeProducerHandle receive_stream,
+ InterfaceRequest<TCPConnectedSocket> client_socket,
+ const AcceptCallback& callback) {
+ // One possible future enhancement would be to enqueue multiple Accept calls
+ // on this object. This would allow the client to accept some number of
+ // incoming connections rapidly without doing an IPC round-trip.
+ if (!pending_callback_.is_null()) {
+ // Already have a pending accept on this socket.
+ callback.Run(MakeNetworkError(net::ERR_UNEXPECTED), NetAddressPtr());
+ return;
+ }
+
+ int result = socket_->Accept(
+ &accepted_socket_, &accepted_address_,
+ base::Bind(&TCPServerSocketImpl::OnAcceptCompleted,
+ base::Unretained(this)));
+ if (result == net::OK || result == net::ERR_IO_PENDING) {
+ pending_callback_ = callback;
+ pending_send_stream_ = send_stream.Pass();
+ pending_receive_stream_ = receive_stream.Pass();
+ pending_client_socket_ = client_socket.Pass();
+ if (result == net::OK)
+ OnAcceptCompleted(net::OK);
+ } else {
+ callback.Run(MakeNetworkError(result), NetAddressPtr());
+ }
+}
+
+void TCPServerSocketImpl::OnAcceptCompleted(int result) {
+ if (result != net::OK) {
+ pending_callback_.Run(MakeNetworkError(result), NetAddressPtr());
+ pending_send_stream_.reset();
+ pending_receive_stream_.reset();
+ pending_client_socket_ = InterfaceRequest<TCPConnectedSocket>();
+ } else {
+ BindToRequest(new TCPConnectedSocketImpl(
+ accepted_socket_.Pass(),
+ pending_send_stream_.Pass(),
+ pending_receive_stream_.Pass()), &pending_client_socket_);
+ pending_callback_.Run(MakeNetworkError(net::OK),
+ NetAddress::From(accepted_address_));
+ }
+
+ pending_callback_ = AcceptCallback();
+}
+
+} // namespace mojo
diff --git a/mojo/services/network/tcp_server_socket_impl.h b/mojo/services/network/tcp_server_socket_impl.h
new file mode 100644
index 0000000..c1f2e48
--- /dev/null
+++ b/mojo/services/network/tcp_server_socket_impl.h
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_NETWORK_TCP_SERVER_SOCKET_H_
+#define MOJO_SERVICES_NETWORK_TCP_SERVER_SOCKET_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "mojo/public/cpp/bindings/interface_impl.h"
+#include "mojo/services/public/interfaces/network/tcp_server_socket.mojom.h"
+#include "net/base/ip_endpoint.h"
+#include "net/socket/tcp_socket.h"
+
+namespace mojo {
+
+class TCPServerSocketImpl : public InterfaceImpl<TCPServerSocket> {
+ public:
+ typedef Callback<void(NetworkErrorPtr, NetAddressPtr)> AcceptCallback;
+
+ // Passed ownership of a socket already in listening mode.
+ explicit TCPServerSocketImpl(scoped_ptr<net::TCPSocket> socket);
+ virtual ~TCPServerSocketImpl();
+
+ // TCPServerSocket.
+ virtual void Accept(
+ ScopedDataPipeConsumerHandle send_stream,
+ ScopedDataPipeProducerHandle receive_stream,
+ InterfaceRequest<TCPConnectedSocket> client_socket,
+ const AcceptCallback& callback) override;
+
+ private:
+ void OnAcceptCompleted(int result);
+
+ scoped_ptr<net::TCPSocket> socket_;
+
+ // Non-null when accept is pending.
+ AcceptCallback pending_callback_;
+
+ // The parameters associated with the pending Accept call.
+ ScopedDataPipeConsumerHandle pending_send_stream_;
+ ScopedDataPipeProducerHandle pending_receive_stream_;
+ InterfaceRequest<TCPConnectedSocket> pending_client_socket_;
+
+ // These are written to by net::TCPSocket when Accept is completed.
+ scoped_ptr<net::TCPSocket> accepted_socket_;
+ net::IPEndPoint accepted_address_;
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_NETWORK_TCP_SERVER_SOCKET_H_
diff --git a/mojo/services/network/udp_socket_impl.cc b/mojo/services/network/udp_socket_impl.cc
new file mode 100644
index 0000000..e39d4a7
--- /dev/null
+++ b/mojo/services/network/udp_socket_impl.cc
@@ -0,0 +1,275 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/network/udp_socket_impl.h"
+
+#include <string.h>
+
+#include <algorithm>
+#include <limits>
+
+#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/stl_util.h"
+#include "mojo/services/network/net_adapters.h"
+#include "mojo/services/network/net_address_type_converters.h"
+#include "net/base/io_buffer.h"
+#include "net/base/net_errors.h"
+
+namespace mojo {
+
+namespace {
+
+const int kMaxReadSize = 128 * 1024;
+const size_t kMaxWriteSize = 128 * 1024;
+const size_t kMaxPendingSendRequestsUpperbound = 128;
+const size_t kDefaultMaxPendingSendRequests = 32;
+
+} // namespace
+
+UDPSocketImpl::PendingSendRequest::PendingSendRequest() {}
+
+UDPSocketImpl::PendingSendRequest::~PendingSendRequest() {}
+
+UDPSocketImpl::UDPSocketImpl()
+ : socket_(nullptr, net::NetLog::Source()),
+ bound_(false),
+ remaining_recv_slots_(0),
+ max_pending_send_requests_(kDefaultMaxPendingSendRequests) {
+}
+
+UDPSocketImpl::~UDPSocketImpl() {
+ STLDeleteElements(&pending_send_requests_);
+}
+
+void UDPSocketImpl::AllowAddressReuse(
+ const Callback<void(NetworkErrorPtr)>& callback) {
+ if (bound_) {
+ callback.Run(MakeNetworkError(net::ERR_FAILED));
+ return;
+ }
+
+ socket_.AllowAddressReuse();
+ callback.Run(MakeNetworkError(net::OK));
+}
+
+void UDPSocketImpl::Bind(
+ NetAddressPtr addr,
+ const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback) {
+ if (bound_) {
+ callback.Run(MakeNetworkError(net::ERR_FAILED), NetAddressPtr());
+ return;
+ }
+
+ net::IPEndPoint ip_end_point = addr.To<net::IPEndPoint>();
+ if (ip_end_point.GetFamily() == net::ADDRESS_FAMILY_UNSPECIFIED) {
+ callback.Run(MakeNetworkError(net::ERR_ADDRESS_INVALID), NetAddressPtr());
+ return;
+ }
+
+ int net_result = socket_.Listen(ip_end_point);
+ if (net_result != net::OK) {
+ callback.Run(MakeNetworkError(net_result), NetAddressPtr());
+ return;
+ }
+
+ net::IPEndPoint bound_ip_end_point;
+ NetAddressPtr bound_addr;
+ net_result = socket_.GetLocalAddress(&bound_ip_end_point);
+ if (net_result == net::OK)
+ bound_addr = NetAddress::From(bound_ip_end_point);
+
+ bound_ = true;
+ callback.Run(MakeNetworkError(net::OK), bound_addr.Pass());
+}
+
+void UDPSocketImpl::SetSendBufferSize(
+ uint32_t size,
+ const Callback<void(NetworkErrorPtr)>& callback) {
+ if (!bound_) {
+ callback.Run(MakeNetworkError(net::ERR_FAILED));
+ return;
+ }
+
+ if (size > static_cast<uint32_t>(std::numeric_limits<int32_t>::max()))
+ size = std::numeric_limits<int32_t>::max();
+
+ int net_result = socket_.SetSendBufferSize(static_cast<int32_t>(size));
+ callback.Run(MakeNetworkError(net_result));
+}
+
+void UDPSocketImpl::SetReceiveBufferSize(
+ uint32_t size,
+ const Callback<void(NetworkErrorPtr)>& callback) {
+ if (!bound_) {
+ callback.Run(MakeNetworkError(net::ERR_FAILED));
+ return;
+ }
+
+ if (size > static_cast<uint32_t>(std::numeric_limits<int32_t>::max()))
+ size = std::numeric_limits<int32_t>::max();
+
+ int net_result = socket_.SetReceiveBufferSize(static_cast<int32_t>(size));
+ callback.Run(MakeNetworkError(net_result));
+}
+
+void UDPSocketImpl::NegotiateMaxPendingSendRequests(
+ uint32_t requested_size,
+ const Callback<void(uint32_t)>& callback) {
+ if (requested_size != 0) {
+ max_pending_send_requests_ =
+ std::min(kMaxPendingSendRequestsUpperbound,
+ static_cast<size_t>(requested_size));
+ }
+ callback.Run(static_cast<uint32_t>(max_pending_send_requests_));
+
+ if (pending_send_requests_.size() > max_pending_send_requests_) {
+ std::deque<PendingSendRequest*> discarded_requests(
+ pending_send_requests_.begin() + max_pending_send_requests_,
+ pending_send_requests_.end());
+ pending_send_requests_.resize(max_pending_send_requests_);
+ for (auto& discarded_request : discarded_requests) {
+ discarded_request->callback.Run(
+ MakeNetworkError(net::ERR_INSUFFICIENT_RESOURCES));
+ delete discarded_request;
+ }
+ }
+}
+
+void UDPSocketImpl::ReceiveMore(uint32_t datagram_number) {
+ if (!bound_ || datagram_number == 0)
+ return;
+ if (std::numeric_limits<size_t>::max() - remaining_recv_slots_ <
+ datagram_number) {
+ return;
+ }
+
+ remaining_recv_slots_ += datagram_number;
+
+ if (!recvfrom_buffer_.get()) {
+ DCHECK_EQ(datagram_number, remaining_recv_slots_);
+ DoRecvFrom();
+ }
+}
+
+void UDPSocketImpl::SendTo(NetAddressPtr dest_addr,
+ Array<uint8_t> data,
+ const Callback<void(NetworkErrorPtr)>& callback) {
+ if (!bound_) {
+ callback.Run(MakeNetworkError(net::ERR_FAILED));
+ return;
+ }
+
+ if (sendto_buffer_.get()) {
+ if (pending_send_requests_.size() >= max_pending_send_requests_) {
+ callback.Run(MakeNetworkError(net::ERR_INSUFFICIENT_RESOURCES));
+ return;
+ }
+
+ PendingSendRequest* request = new PendingSendRequest;
+ request->addr = dest_addr.Pass();
+ request->data = data.Pass();
+ request->callback = callback;
+ pending_send_requests_.push_back(request);
+ return;
+ }
+
+ DCHECK_EQ(0u, pending_send_requests_.size());
+
+ DoSendTo(dest_addr.Pass(), data.Pass(), callback);
+}
+
+void UDPSocketImpl::DoRecvFrom() {
+ DCHECK(bound_);
+ DCHECK(!recvfrom_buffer_.get());
+ DCHECK_GT(remaining_recv_slots_, 0u);
+
+ recvfrom_buffer_ = new net::IOBuffer(kMaxReadSize);
+
+ // It is safe to use base::Unretained(this) because |socket_| is owned by this
+ // object. If this object gets destroyed (and so does |socket_|), the callback
+ // won't be called.
+ int net_result = socket_.RecvFrom(
+ recvfrom_buffer_.get(),
+ kMaxReadSize,
+ &recvfrom_address_,
+ base::Bind(&UDPSocketImpl::OnRecvFromCompleted, base::Unretained(this)));
+ if (net_result != net::ERR_IO_PENDING)
+ OnRecvFromCompleted(net_result);
+}
+
+void UDPSocketImpl::DoSendTo(NetAddressPtr addr,
+ Array<uint8_t> data,
+ const Callback<void(NetworkErrorPtr)>& callback) {
+ DCHECK(bound_);
+ DCHECK(!sendto_buffer_.get());
+
+ net::IPEndPoint ip_end_point = addr.To<net::IPEndPoint>();
+ if (ip_end_point.GetFamily() == net::ADDRESS_FAMILY_UNSPECIFIED) {
+ callback.Run(MakeNetworkError(net::ERR_ADDRESS_INVALID));
+ return;
+ }
+
+ if (data.size() > kMaxWriteSize) {
+ callback.Run(MakeNetworkError(net::ERR_INVALID_ARGUMENT));
+ return;
+ }
+ sendto_buffer_ = new net::IOBufferWithSize(static_cast<int>(data.size()));
+ if (data.size() > 0)
+ memcpy(sendto_buffer_->data(), &data.storage()[0], data.size());
+
+ // It is safe to use base::Unretained(this) because |socket_| is owned by this
+ // object. If this object gets destroyed (and so does |socket_|), the callback
+ // won't be called.
+ int net_result = socket_.SendTo(sendto_buffer_.get(), sendto_buffer_->size(),
+ ip_end_point,
+ base::Bind(&UDPSocketImpl::OnSendToCompleted,
+ base::Unretained(this), callback));
+ if (net_result != net::ERR_IO_PENDING)
+ OnSendToCompleted(callback, net_result);
+}
+
+void UDPSocketImpl::OnRecvFromCompleted(int net_result) {
+ DCHECK(recvfrom_buffer_.get());
+
+ NetAddressPtr net_address;
+ Array<uint8_t> array;
+ if (net_result >= 0) {
+ net_address = NetAddress::From(recvfrom_address_);
+ std::vector<uint8_t> data(net_result);
+ if (net_result > 0)
+ memcpy(&data[0], recvfrom_buffer_->data(), net_result);
+
+ array.Swap(&data);
+ }
+ recvfrom_buffer_ = nullptr;
+
+ client()->OnReceived(MakeNetworkError(net_result), net_address.Pass(),
+ array.Pass());
+
+ DCHECK_GT(remaining_recv_slots_, 0u);
+ remaining_recv_slots_--;
+ if (remaining_recv_slots_ > 0)
+ DoRecvFrom();
+}
+
+void UDPSocketImpl::OnSendToCompleted(
+ const Callback<void(NetworkErrorPtr)>& callback,
+ int net_result) {
+ DCHECK(sendto_buffer_.get());
+
+ sendto_buffer_ = nullptr;
+
+ callback.Run(MakeNetworkError(net_result));
+
+ if (pending_send_requests_.empty())
+ return;
+
+ scoped_ptr<PendingSendRequest> request(pending_send_requests_.front());
+ pending_send_requests_.pop_front();
+
+ DoSendTo(request->addr.Pass(), request->data.Pass(), request->callback);
+}
+
+} // namespace mojo
diff --git a/mojo/services/network/udp_socket_impl.h b/mojo/services/network/udp_socket_impl.h
new file mode 100644
index 0000000..e4c4d28
--- /dev/null
+++ b/mojo/services/network/udp_socket_impl.h
@@ -0,0 +1,98 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_NETWORK_UDP_SOCKET_IMPL_H_
+#define MOJO_SERVICES_NETWORK_UDP_SOCKET_IMPL_H_
+
+#include <deque>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "mojo/public/cpp/bindings/interface_impl.h"
+#include "mojo/services/public/interfaces/network/udp_socket.mojom.h"
+#include "net/base/ip_endpoint.h"
+#include "net/udp/udp_server_socket.h"
+
+namespace net {
+class IOBuffer;
+class IOBufferWithSize;
+}
+
+namespace mojo {
+
+class UDPSocketImpl : public InterfaceImpl<UDPSocket> {
+ public:
+ UDPSocketImpl();
+ virtual ~UDPSocketImpl();
+
+ // UDPSocket implementation.
+ virtual void AllowAddressReuse(
+ const Callback<void(NetworkErrorPtr)>& callback) override;
+
+ virtual void Bind(
+ NetAddressPtr addr,
+ const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback) override;
+
+ virtual void SetSendBufferSize(
+ uint32_t size,
+ const Callback<void(NetworkErrorPtr)>& callback) override;
+
+ virtual void SetReceiveBufferSize(
+ uint32_t size,
+ const Callback<void(NetworkErrorPtr)>& callback) override;
+
+ virtual void NegotiateMaxPendingSendRequests(
+ uint32_t requested_size,
+ const Callback<void(uint32_t)>& callback) override;
+
+ virtual void ReceiveMore(uint32_t datagram_number) override;
+
+ virtual void SendTo(NetAddressPtr dest_addr,
+ Array<uint8_t> data,
+ const Callback<void(NetworkErrorPtr)>& callback) override;
+
+ private:
+ struct PendingSendRequest {
+ PendingSendRequest();
+ ~PendingSendRequest();
+
+ NetAddressPtr addr;
+ Array<uint8_t> data;
+ Callback<void(NetworkErrorPtr)> callback;
+ };
+
+ void DoRecvFrom();
+ void DoSendTo(NetAddressPtr addr,
+ Array<uint8_t> data,
+ const Callback<void(NetworkErrorPtr)>& callback);
+
+ void OnRecvFromCompleted(int net_result);
+ void OnSendToCompleted(const Callback<void(NetworkErrorPtr)>& callback,
+ int net_result);
+
+ net::UDPServerSocket socket_;
+
+ bool bound_;
+
+ // Non-NULL when there is a pending RecvFrom operation on |socket_|.
+ scoped_refptr<net::IOBuffer> recvfrom_buffer_;
+ // Non-NULL when there is a pending SendTo operation on |socket_|.
+ scoped_refptr<net::IOBufferWithSize> sendto_buffer_;
+
+ net::IPEndPoint recvfrom_address_;
+
+ // How many more packets the client side expects to receive.
+ size_t remaining_recv_slots_;
+
+ // The queue owns the PendingSendRequest instances.
+ std::deque<PendingSendRequest*> pending_send_requests_;
+ // The maximum size of the |pending_send_requests_| queue.
+ size_t max_pending_send_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(UDPSocketImpl);
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_NETWORK_UDP_SOCKET_IMPL_H_
diff --git a/mojo/services/network/udp_socket_unittest.cc b/mojo/services/network/udp_socket_unittest.cc
new file mode 100644
index 0000000..46c443a
--- /dev/null
+++ b/mojo/services/network/udp_socket_unittest.cc
@@ -0,0 +1,386 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/at_exit.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "mojo/public/cpp/bindings/callback.h"
+#include "mojo/services/public/interfaces/network/network_service.mojom.h"
+#include "mojo/services/public/interfaces/network/udp_socket.mojom.h"
+#include "mojo/shell/shell_test_helper.h"
+#include "net/base/net_errors.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+namespace mojo {
+namespace service {
+namespace {
+
+NetAddressPtr GetLocalHostWithAnyPort() {
+ NetAddressPtr addr(NetAddress::New());
+ addr->family = NET_ADDRESS_FAMILY_IPV4;
+ addr->ipv4 = NetAddressIPv4::New();
+ addr->ipv4->port = 0;
+ addr->ipv4->addr.resize(4);
+ addr->ipv4->addr[0] = 127;
+ addr->ipv4->addr[1] = 0;
+ addr->ipv4->addr[2] = 0;
+ addr->ipv4->addr[3] = 1;
+
+ return addr.Pass();
+}
+
+Array<uint8_t> CreateTestMessage(uint8_t initial, size_t size) {
+ Array<uint8_t> array(size);
+ for (size_t i = 0; i < size; ++i)
+ array[i] = static_cast<uint8_t>((i + initial) % 256);
+ return array.Pass();
+}
+
+bool AreEqualArrays(const Array<uint8_t>& array_1,
+ const Array<uint8_t>& array_2) {
+ if (array_1.is_null() != array_2.is_null())
+ return false;
+ else if (array_1.is_null())
+ return true;
+
+ if (array_1.size() != array_2.size())
+ return false;
+
+ for (size_t i = 0; i < array_1.size(); ++i) {
+ if (array_1[i] != array_2[i])
+ return false;
+ }
+
+ return true;
+}
+
+template <typename CallbackType>
+class TestCallbackBase {
+ public:
+ TestCallbackBase() : state_(nullptr), run_loop_(nullptr), ran_(false) {}
+
+ ~TestCallbackBase() {
+ state_->set_test_callback(nullptr);
+ }
+
+ CallbackType callback() const { return callback_; }
+
+ void WaitForResult() {
+ if (ran_)
+ return;
+
+ base::RunLoop run_loop;
+ run_loop_ = &run_loop;
+ run_loop.Run();
+ run_loop_ = nullptr;
+ }
+
+ protected:
+ struct StateBase : public CallbackType::Runnable {
+ StateBase() : test_callback_(nullptr) {}
+ virtual ~StateBase() {}
+
+ void set_test_callback(TestCallbackBase* test_callback) {
+ test_callback_ = test_callback;
+ }
+
+ protected:
+ void NotifyRun() const {
+ if (test_callback_) {
+ test_callback_->ran_ = true;
+ if (test_callback_->run_loop_)
+ test_callback_->run_loop_->Quit();
+ }
+ }
+
+ TestCallbackBase* test_callback_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(StateBase);
+ };
+
+ // Takes ownership of |state|, and guarantees that it lives at least as long
+ // as this object.
+ void Initialize(StateBase* state) {
+ state_ = state;
+ state_->set_test_callback(this);
+ callback_ = CallbackType(
+ static_cast<typename CallbackType::Runnable*>(state_));
+ }
+
+ private:
+ // The lifespan is managed by |callback_| (and its copies).
+ StateBase* state_;
+ CallbackType callback_;
+ base::RunLoop* run_loop_;
+ bool ran_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestCallbackBase);
+};
+
+class TestCallback : public TestCallbackBase<Callback<void(NetworkErrorPtr)>> {
+ public:
+ TestCallback() {
+ Initialize(new State());
+ }
+ ~TestCallback() {}
+
+ const NetworkErrorPtr& result() const { return result_; }
+
+ private:
+ struct State: public StateBase {
+ virtual ~State() {}
+
+ virtual void Run(NetworkErrorPtr result) const override {
+ if (test_callback_) {
+ TestCallback* callback = static_cast<TestCallback*>(test_callback_);
+ callback->result_ = result.Pass();
+ }
+ NotifyRun();
+ }
+ };
+
+ NetworkErrorPtr result_;
+};
+
+class TestCallbackWithAddress
+ : public TestCallbackBase<Callback<void(NetworkErrorPtr, NetAddressPtr)>> {
+ public:
+ TestCallbackWithAddress() {
+ Initialize(new State());
+ }
+ ~TestCallbackWithAddress() {}
+
+ const NetworkErrorPtr& result() const { return result_; }
+ const NetAddressPtr& net_address() const { return net_address_; }
+
+ private:
+ struct State : public StateBase {
+ virtual ~State() {}
+
+ virtual void Run(NetworkErrorPtr result,
+ NetAddressPtr net_address) const override {
+ if (test_callback_) {
+ TestCallbackWithAddress* callback =
+ static_cast<TestCallbackWithAddress*>(test_callback_);
+ callback->result_ = result.Pass();
+ callback->net_address_ = net_address.Pass();
+ }
+ NotifyRun();
+ }
+ };
+
+ NetworkErrorPtr result_;
+ NetAddressPtr net_address_;
+};
+
+class TestCallbackWithUint32
+ : public TestCallbackBase<Callback<void(uint32_t)>> {
+ public:
+ TestCallbackWithUint32() : result_(0) {
+ Initialize(new State());
+ }
+ ~TestCallbackWithUint32() {}
+
+ uint32_t result() const { return result_; }
+
+ private:
+ struct State : public StateBase {
+ virtual ~State() {}
+
+ virtual void Run(uint32_t result) const override {
+ if (test_callback_) {
+ TestCallbackWithUint32* callback =
+ static_cast<TestCallbackWithUint32*>(test_callback_);
+ callback->result_ = result;
+ }
+ NotifyRun();
+ }
+ };
+
+ uint32_t result_;
+};
+
+class UDPSocketTest : public testing::Test {
+ public:
+ UDPSocketTest() {}
+ virtual ~UDPSocketTest() {}
+
+ virtual void SetUp() override {
+ test_helper_.Init();
+
+ test_helper_.application_manager()->ConnectToService(
+ GURL("mojo:mojo_network_service"), &network_service_);
+
+ network_service_->CreateUDPSocket(GetProxy(&udp_socket_));
+ udp_socket_.set_client(&udp_socket_client_);
+ }
+
+ protected:
+ struct ReceiveResult {
+ NetworkErrorPtr result;
+ NetAddressPtr addr;
+ Array<uint8_t> data;
+ };
+
+ class UDPSocketClientImpl : public UDPSocketClient {
+ public:
+
+ UDPSocketClientImpl() : run_loop_(nullptr), expected_receive_count_(0) {}
+
+ virtual ~UDPSocketClientImpl() {
+ while (!results_.empty()) {
+ delete results_.front();
+ results_.pop();
+ }
+ }
+
+ virtual void OnReceived(NetworkErrorPtr result,
+ NetAddressPtr src_addr,
+ Array<uint8_t> data) override {
+ ReceiveResult* entry = new ReceiveResult();
+ entry->result = result.Pass();
+ entry->addr = src_addr.Pass();
+ entry->data = data.Pass();
+
+ results_.push(entry);
+
+ if (results_.size() == expected_receive_count_ && run_loop_) {
+ expected_receive_count_ = 0;
+ run_loop_->Quit();
+ }
+ }
+
+ base::RunLoop* run_loop_;
+ std::queue<ReceiveResult*> results_;
+ size_t expected_receive_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(UDPSocketClientImpl);
+ };
+
+ std::queue<ReceiveResult*>* GetReceiveResults() {
+ return &udp_socket_client_.results_;
+ }
+
+ void WaitForReceiveResults(size_t count) {
+ if (GetReceiveResults()->size() == count)
+ return;
+
+ udp_socket_client_.expected_receive_count_ = count;
+ base::RunLoop run_loop;
+ udp_socket_client_.run_loop_ = &run_loop;
+ run_loop.Run();
+ udp_socket_client_.run_loop_ = nullptr;
+ }
+
+ base::ShadowingAtExitManager at_exit_;
+ shell::ShellTestHelper test_helper_;
+
+ NetworkServicePtr network_service_;
+ UDPSocketPtr udp_socket_;
+ UDPSocketClientImpl udp_socket_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(UDPSocketTest);
+};
+
+} // namespace
+
+TEST_F(UDPSocketTest, Settings) {
+ TestCallback callback1;
+ udp_socket_->AllowAddressReuse(callback1.callback());
+ callback1.WaitForResult();
+ EXPECT_EQ(net::OK, callback1.result()->code);
+
+ // Should fail because the socket hasn't been bound.
+ TestCallback callback2;
+ udp_socket_->SetSendBufferSize(1024, callback2.callback());
+ callback2.WaitForResult();
+ EXPECT_NE(net::OK, callback2.result()->code);
+
+ // Should fail because the socket hasn't been bound.
+ TestCallback callback3;
+ udp_socket_->SetReceiveBufferSize(2048, callback3.callback());
+ callback3.WaitForResult();
+ EXPECT_NE(net::OK, callback3.result()->code);
+
+ TestCallbackWithAddress callback4;
+ udp_socket_->Bind(GetLocalHostWithAnyPort(), callback4.callback());
+ callback4.WaitForResult();
+ EXPECT_EQ(net::OK, callback4.result()->code);
+ EXPECT_NE(0u, callback4.net_address()->ipv4->port);
+
+ // Should fail because the socket has been bound.
+ TestCallback callback5;
+ udp_socket_->AllowAddressReuse(callback5.callback());
+ callback5.WaitForResult();
+ EXPECT_NE(net::OK, callback5.result()->code);
+
+ TestCallback callback6;
+ udp_socket_->SetSendBufferSize(1024, callback6.callback());
+ callback6.WaitForResult();
+ EXPECT_EQ(net::OK, callback6.result()->code);
+
+ TestCallback callback7;
+ udp_socket_->SetReceiveBufferSize(2048, callback7.callback());
+ callback7.WaitForResult();
+ EXPECT_EQ(net::OK, callback7.result()->code);
+
+ TestCallbackWithUint32 callback8;
+ udp_socket_->NegotiateMaxPendingSendRequests(0, callback8.callback());
+ callback8.WaitForResult();
+ EXPECT_GT(callback8.result(), 0u);
+
+ TestCallbackWithUint32 callback9;
+ udp_socket_->NegotiateMaxPendingSendRequests(16, callback9.callback());
+ callback9.WaitForResult();
+ EXPECT_GT(callback9.result(), 0u);
+}
+
+TEST_F(UDPSocketTest, TestReadWrite) {
+ TestCallbackWithAddress callback1;
+ udp_socket_->Bind(GetLocalHostWithAnyPort(), callback1.callback());
+ callback1.WaitForResult();
+ ASSERT_EQ(net::OK, callback1.result()->code);
+ ASSERT_NE(0u, callback1.net_address()->ipv4->port);
+
+ NetAddressPtr server_addr = callback1.net_address().Clone();
+
+ UDPSocketPtr client_socket;
+ network_service_->CreateUDPSocket(GetProxy(&client_socket));
+
+ TestCallbackWithAddress callback2;
+ client_socket->Bind(GetLocalHostWithAnyPort(), callback2.callback());
+ callback2.WaitForResult();
+ ASSERT_EQ(net::OK, callback2.result()->code);
+ ASSERT_NE(0u, callback2.net_address()->ipv4->port);
+
+ const size_t kDatagramCount = 6;
+ const size_t kDatagramSize = 255;
+ udp_socket_->ReceiveMore(kDatagramCount);
+
+ for (size_t i = 0; i < kDatagramCount; ++i) {
+ TestCallback callback;
+ client_socket->SendTo(
+ server_addr.Clone(),
+ CreateTestMessage(static_cast<uint8_t>(i), kDatagramSize),
+ callback.callback());
+ callback.WaitForResult();
+ EXPECT_EQ(255, callback.result()->code);
+ }
+
+ WaitForReceiveResults(kDatagramCount);
+ for (size_t i = 0; i < kDatagramCount; ++i) {
+ scoped_ptr<ReceiveResult> result(GetReceiveResults()->front());
+ GetReceiveResults()->pop();
+
+ EXPECT_EQ(static_cast<int>(kDatagramSize), result->result->code);
+ EXPECT_TRUE(AreEqualArrays(
+ CreateTestMessage(static_cast<uint8_t>(i), kDatagramSize),
+ result->data));
+ }
+}
+
+} // namespace service
+} // namespace mojo
diff --git a/mojo/services/network/url_loader_impl.cc b/mojo/services/network/url_loader_impl.cc
index ab2ce8b..5e67c27 100644
--- a/mojo/services/network/url_loader_impl.cc
+++ b/mojo/services/network/url_loader_impl.cc
@@ -7,11 +7,12 @@
#include "base/memory/scoped_vector.h"
#include "base/message_loop/message_loop.h"
#include "mojo/common/common_type_converters.h"
+#include "mojo/services/network/net_adapters.h"
#include "mojo/services/network/network_context.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_data_stream.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/redirect_info.h"
#include "net/url_request/url_request_context.h"
@@ -19,8 +20,6 @@
namespace mojo {
namespace {
-const uint32_t kMaxReadSize = 64 * 1024;
-
// Generates an URLResponsePtr from the response state of a net::URLRequest.
URLResponsePtr MakeURLResponse(const net::URLRequest* url_request) {
URLResponsePtr response(URLResponse::New());
@@ -51,13 +50,6 @@
return response.Pass();
}
-NetworkErrorPtr MakeNetworkError(int error_code) {
- NetworkErrorPtr error = NetworkError::New();
- error->code = error_code;
- error->description = net::ErrorToString(error_code);
- return error.Pass();
-}
-
// Reads the request body upload data from a DataPipe.
class UploadDataPipeElementReader : public net::UploadElementReader {
public:
@@ -105,59 +97,6 @@
} // namespace
-// Keeps track of a pending two-phase write on a DataPipeProducerHandle.
-class URLLoaderImpl::PendingWriteToDataPipe :
- public base::RefCountedThreadSafe<PendingWriteToDataPipe> {
- public:
- explicit PendingWriteToDataPipe(ScopedDataPipeProducerHandle handle)
- : handle_(handle.Pass()),
- buffer_(NULL) {
- }
-
- MojoResult BeginWrite(uint32_t* num_bytes) {
- MojoResult result = BeginWriteDataRaw(handle_.get(), &buffer_, num_bytes,
- MOJO_WRITE_DATA_FLAG_NONE);
- if (*num_bytes > kMaxReadSize)
- *num_bytes = kMaxReadSize;
-
- return result;
- }
-
- ScopedDataPipeProducerHandle Complete(uint32_t num_bytes) {
- EndWriteDataRaw(handle_.get(), num_bytes);
- buffer_ = NULL;
- return handle_.Pass();
- }
-
- char* buffer() { return static_cast<char*>(buffer_); }
-
- private:
- friend class base::RefCountedThreadSafe<PendingWriteToDataPipe>;
-
- ~PendingWriteToDataPipe() {
- if (handle_.is_valid())
- EndWriteDataRaw(handle_.get(), 0);
- }
-
- ScopedDataPipeProducerHandle handle_;
- void* buffer_;
-
- DISALLOW_COPY_AND_ASSIGN(PendingWriteToDataPipe);
-};
-
-// Takes ownership of a pending two-phase write on a DataPipeProducerHandle,
-// and makes its buffer available as a net::IOBuffer.
-class URLLoaderImpl::DependentIOBuffer : public net::WrappedIOBuffer {
- public:
- DependentIOBuffer(PendingWriteToDataPipe* pending_write)
- : net::WrappedIOBuffer(pending_write->buffer()),
- pending_write_(pending_write) {
- }
- private:
- virtual ~DependentIOBuffer() {}
- scoped_refptr<PendingWriteToDataPipe> pending_write_;
-};
-
URLLoaderImpl::URLLoaderImpl(NetworkContext* context)
: context_(context),
response_body_buffer_size_(0),
@@ -198,8 +137,8 @@
element_readers.push_back(
new UploadDataPipeElementReader(request->body[i].Pass()));
}
- url_request_->set_upload(make_scoped_ptr(
- new net::UploadDataStream(element_readers.Pass(), 0)));
+ url_request_->set_upload(make_scoped_ptr<net::UploadDataStream>(
+ new net::ElementsUploadDataStream(element_readers.Pass(), 0)));
}
if (request->bypass_cache)
url_request_->SetLoadFlags(net::LOAD_BYPASS_CACHE);
@@ -318,44 +257,32 @@
ReadMore();
}
-void URLLoaderImpl::WaitToReadMore() {
- handle_watcher_.Start(response_body_stream_.get(),
- MOJO_HANDLE_SIGNAL_WRITABLE,
- MOJO_DEADLINE_INDEFINITE,
- base::Bind(&URLLoaderImpl::OnResponseBodyStreamReady,
- weak_ptr_factory_.GetWeakPtr()));
-}
-
void URLLoaderImpl::ReadMore() {
DCHECK(!pending_write_.get());
- pending_write_ = new PendingWriteToDataPipe(response_body_stream_.Pass());
-
uint32_t num_bytes;
- MojoResult result = pending_write_->BeginWrite(&num_bytes);
+ MojoResult result = NetToMojoPendingBuffer::BeginWrite(
+ &response_body_stream_, &pending_write_, &num_bytes);
+
if (result == MOJO_RESULT_SHOULD_WAIT) {
// The pipe is full. We need to wait for it to have more space.
- response_body_stream_ = pending_write_->Complete(num_bytes);
- pending_write_ = NULL;
- WaitToReadMore();
+ handle_watcher_.Start(response_body_stream_.get(),
+ MOJO_HANDLE_SIGNAL_WRITABLE,
+ MOJO_DEADLINE_INDEFINITE,
+ base::Bind(&URLLoaderImpl::OnResponseBodyStreamReady,
+ weak_ptr_factory_.GetWeakPtr()));
return;
- }
- if (result != MOJO_RESULT_OK) {
+ } else if (result != MOJO_RESULT_OK) {
// The response body stream is in a bad state. Bail.
// TODO(darin): How should this be communicated to our client?
return;
}
CHECK_GT(static_cast<uint32_t>(std::numeric_limits<int>::max()), num_bytes);
- scoped_refptr<net::IOBuffer> buf =
- new DependentIOBuffer(pending_write_.get());
+ scoped_refptr<net::IOBuffer> buf(new NetToMojoIOBuffer(pending_write_.get()));
int bytes_read;
url_request_->Read(buf.get(), static_cast<int>(num_bytes), &bytes_read);
-
- // Drop our reference to the buffer.
- buf = NULL;
-
if (url_request_->status().is_io_pending()) {
// Wait for OnReadCompleted.
} else if (url_request_->status().is_success() && bytes_read > 0) {
diff --git a/mojo/services/network/url_loader_impl.h b/mojo/services/network/url_loader_impl.h
index 2094999..76b4e52 100644
--- a/mojo/services/network/url_loader_impl.h
+++ b/mojo/services/network/url_loader_impl.h
@@ -14,7 +14,9 @@
#include "net/url_request/url_request.h"
namespace mojo {
+
class NetworkContext;
+class NetToMojoPendingBuffer;
class URLLoaderImpl : public InterfaceImpl<URLLoader>,
public net::URLRequest::Delegate {
@@ -23,9 +25,6 @@
virtual ~URLLoaderImpl();
private:
- class PendingWriteToDataPipe;
- class DependentIOBuffer;
-
// URLLoader methods:
virtual void Start(
URLRequestPtr request,
@@ -48,7 +47,6 @@
const Callback<void(URLResponsePtr)>& callback);
void SendResponse(URLResponsePtr response);
void OnResponseBodyStreamReady(MojoResult result);
- void WaitToReadMore();
void ReadMore();
void DidRead(uint32_t num_bytes, bool completed_synchronously);
@@ -56,7 +54,7 @@
scoped_ptr<net::URLRequest> url_request_;
Callback<void(URLResponsePtr)> callback_;
ScopedDataPipeProducerHandle response_body_stream_;
- scoped_refptr<PendingWriteToDataPipe> pending_write_;
+ scoped_refptr<NetToMojoPendingBuffer> pending_write_;
common::HandleWatcher handle_watcher_;
uint32 response_body_buffer_size_;
bool auto_follow_redirects_;
diff --git a/mojo/services/public/cpp/native_viewport/BUILD.gn b/mojo/services/public/cpp/native_viewport/BUILD.gn
new file mode 100644
index 0000000..637120d
--- /dev/null
+++ b/mojo/services/public/cpp/native_viewport/BUILD.gn
@@ -0,0 +1,10 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+source_set("args") {
+ sources = [
+ "lib/args.cc",
+ "args.h",
+ ]
+}
diff --git a/mojo/services/public/cpp/native_viewport/args.h b/mojo/services/public/cpp/native_viewport/args.h
new file mode 100644
index 0000000..623433d
--- /dev/null
+++ b/mojo/services/public/cpp/native_viewport/args.h
@@ -0,0 +1,17 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_PUBLIC_CPP_NATIVE_VIEWPORT_ARGS_H_
+#define MOJO_SERVICES_PUBLIC_CPP_NATIVE_VIEWPORT_ARGS_H_
+
+namespace mojo {
+
+// All args in alphabetical order. The switches should be documented
+// alongside the definition of their values in the .cc file.
+extern const char kUseTestConfig[];
+extern const char kUseHeadlessConfig[];
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_PUBLIC_CPP_NATIVE_VIEWPORT_ARGS_H_
diff --git a/mojo/services/public/cpp/native_viewport/lib/args.cc b/mojo/services/public/cpp/native_viewport/lib/args.cc
new file mode 100644
index 0000000..7831cad
--- /dev/null
+++ b/mojo/services/public/cpp/native_viewport/lib/args.cc
@@ -0,0 +1,15 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/public/cpp/native_viewport/args.h"
+
+namespace mojo {
+
+// Loads an app from the specified directory and launches it.
+// Force gl to be initialized in test mode.
+const char kUseTestConfig[] = "use-test-config";
+// Create native viewport in headless mode.
+const char kUseHeadlessConfig[] = "use-headless-config";
+
+} // namespace mojo
diff --git a/mojo/services/public/cpp/view_manager/BUILD.gn b/mojo/services/public/cpp/view_manager/BUILD.gn
index a505893..a3e29dd 100644
--- a/mojo/services/public/cpp/view_manager/BUILD.gn
+++ b/mojo/services/public/cpp/view_manager/BUILD.gn
@@ -27,17 +27,16 @@
]
deps = [
"//base",
- "//mojo/application",
+ "//mojo/converters/geometry",
+ "//mojo/converters/surfaces",
"//mojo/public/c/gles2",
"//mojo/public/cpp/bindings:bindings",
"//mojo/public/interfaces/application",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/input_events:input_events",
"//mojo/services/public/interfaces/surfaces:surface_id",
"//mojo/services/public/interfaces/view_manager",
- "//mojo/services/public/interfaces/window_manager",
+ "//mojo/services/public/interfaces/window_manager2",
"//ui/gfx/geometry",
]
}
diff --git a/mojo/services/public/cpp/view_manager/lib/DEPS b/mojo/services/public/cpp/view_manager/lib/DEPS
index 35adfd8..7423ce3 100644
--- a/mojo/services/public/cpp/view_manager/lib/DEPS
+++ b/mojo/services/public/cpp/view_manager/lib/DEPS
@@ -1,4 +1,5 @@
include_rules = [
+ "+mojo/converters/geometry",
"+mojo/geometry",
"+ui/gfx",
]
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
index 7a3005a..ac54417 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
@@ -5,7 +5,6 @@
#include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "mojo/public/cpp/application/application_impl.h"
@@ -17,7 +16,6 @@
#include "mojo/services/public/cpp/view_manager/util.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
-#include "mojo/services/public/cpp/view_manager/window_manager_delegate.h"
namespace mojo {
@@ -93,21 +91,9 @@
ViewManagerClientImpl::ViewManagerClientImpl(ViewManagerDelegate* delegate,
Shell* shell)
- : connected_(false),
- connection_id_(0),
- next_id_(1),
- delegate_(delegate),
- window_manager_delegate_(NULL) {
- // TODO(beng): Come up with a better way of establishing a configuration for
- // what the active window manager is.
- std::string window_manager_url = "mojo:mojo_window_manager";
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("window-manager")) {
- window_manager_url =
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- "window-manager");
- }
+ : connected_(false), connection_id_(0), next_id_(1), delegate_(delegate) {
InterfacePtr<ServiceProvider> sp;
- shell->ConnectToApplication(window_manager_url, GetProxy(&sp));
+ shell->ConnectToApplication("mojo:mojo_window_manager", GetProxy(&sp));
ConnectToService(sp.get(), &window_manager_);
window_manager_.set_client(this);
}
@@ -220,18 +206,6 @@
////////////////////////////////////////////////////////////////////////////////
// ViewManagerClientImpl, ViewManager implementation:
-void ViewManagerClientImpl::SetWindowManagerDelegate(
- WindowManagerDelegate* window_manager_delegate) {
- CHECK(NULL != GetViewById(1));
- CHECK(!window_manager_delegate_);
- window_manager_delegate_ = window_manager_delegate;
-}
-
-void ViewManagerClientImpl::DispatchEvent(View* target, EventPtr event) {
- CHECK(window_manager_delegate_);
- service_->DispatchOnViewInputEvent(target->id(), event.Pass());
-}
-
const std::string& ViewManagerClientImpl::GetEmbedderURL() const {
return creator_url_;
}
@@ -353,20 +327,8 @@
ack_callback.Run();
}
-void ViewManagerClientImpl::Embed(
- const String& url,
- InterfaceRequest<ServiceProvider> service_provider) {
- if (window_manager_delegate_)
- window_manager_delegate_->Embed(url, service_provider.Pass());
-}
-
-void ViewManagerClientImpl::DispatchOnViewInputEvent(EventPtr event) {
- if (window_manager_delegate_)
- window_manager_delegate_->DispatchEvent(event.Pass());
-}
-
////////////////////////////////////////////////////////////////////////////////
-// ViewManagerClientImpl, WindowManagerClient implementation:
+// ViewManagerClientImpl, WindowManagerClient2 implementation:
void ViewManagerClientImpl::OnWindowManagerReady() {}
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h
index e2dab1d..f2a2b8e 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h
@@ -9,12 +9,12 @@
#include "base/callback.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/cpp/view_manager/view.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
-#include "mojo/services/public/interfaces/window_manager/window_manager.mojom.h"
+#include "mojo/services/public/interfaces/window_manager2/window_manager2.mojom.h"
namespace mojo {
class Shell;
@@ -25,7 +25,7 @@
// Manages the connection with the View Manager service.
class ViewManagerClientImpl : public ViewManager,
public InterfaceImpl<ViewManagerClient>,
- public WindowManagerClient {
+ public WindowManagerClient2 {
public:
ViewManagerClientImpl(ViewManagerDelegate* delegate, Shell* shell);
virtual ~ViewManagerClientImpl();
@@ -77,9 +77,6 @@
typedef std::map<Id, View*> IdToViewMap;
// Overridden from ViewManager:
- virtual void SetWindowManagerDelegate(
- WindowManagerDelegate* delegate) override;
- virtual void DispatchEvent(View* target, EventPtr event) override;
virtual const std::string& GetEmbedderURL() const override;
virtual const std::vector<View*>& GetRoots() const override;
virtual View* GetViewById(Id id) override;
@@ -108,12 +105,8 @@
virtual void OnViewInputEvent(Id view_id,
EventPtr event,
const Callback<void()>& callback) override;
- virtual void Embed(
- const String& url,
- InterfaceRequest<ServiceProvider> service_provider) override;
- virtual void DispatchOnViewInputEvent(EventPtr event) override;
- // Overridden from WindowManagerClient:
+ // Overridden from WindowManagerClient2:
virtual void OnWindowManagerReady() override;
virtual void OnCaptureChanged(Id old_capture_view_id,
Id new_capture_view_id) override;
@@ -139,7 +132,6 @@
base::Callback<void(void)> change_acked_callback_;
ViewManagerDelegate* delegate_;
- WindowManagerDelegate* window_manager_delegate_;
std::vector<View*> roots_;
@@ -147,7 +139,7 @@
ViewManagerService* service_;
- WindowManagerServicePtr window_manager_;
+ WindowManagerService2Ptr window_manager_;
DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl);
};
diff --git a/mojo/services/public/cpp/view_manager/tests/BUILD.gn b/mojo/services/public/cpp/view_manager/tests/BUILD.gn
index 9b7fb67..5787cd1 100644
--- a/mojo/services/public/cpp/view_manager/tests/BUILD.gn
+++ b/mojo/services/public/cpp/view_manager/tests/BUILD.gn
@@ -18,9 +18,9 @@
"//ui/gfx",
"//ui/gfx:test_support",
"//mojo/application_manager",
+ "//mojo/converters/geometry",
"//mojo/environment:chromium",
"//mojo/services/public/interfaces/geometry",
- "//mojo/services/public/cpp/geometry",
"//mojo/shell:test_support",
"//mojo/services/public/interfaces/view_manager",
"//mojo/services/public/cpp/view_manager",
diff --git a/mojo/services/public/cpp/view_manager/view_manager.h b/mojo/services/public/cpp/view_manager/view_manager.h
index d153283..2586245 100644
--- a/mojo/services/public/cpp/view_manager/view_manager.h
+++ b/mojo/services/public/cpp/view_manager/view_manager.h
@@ -9,12 +9,9 @@
#include <vector>
#include "mojo/services/public/cpp/view_manager/types.h"
-#include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
namespace mojo {
class View;
-class ViewManagerDelegate;
-class WindowManagerDelegate;
// Encapsulates a connection to the view manager service.
// A unique connection is made for every unique embed path for an app. e.g. for
@@ -22,15 +19,6 @@
// and thus two instances of this class.
class ViewManager {
public:
- // Sets the window manager delegate. Can only be called by the app embedded at
- // the service root view. Can only be called once.
- virtual void SetWindowManagerDelegate(
- WindowManagerDelegate* window_manager_delegate) = 0;
-
- // Dispatches the supplied event to the specified View. Can be called only
- // by the application that called SetWindowManagerDelegate().
- virtual void DispatchEvent(View* target, EventPtr event) = 0;
-
// Returns the URL of the application that embedded this application.
virtual const std::string& GetEmbedderURL() const = 0;
diff --git a/mojo/services/public/cpp/view_manager/window_manager_delegate.h b/mojo/services/public/cpp/view_manager/window_manager_delegate.h
deleted file mode 100644
index 0ab271c..0000000
--- a/mojo/services/public/cpp/view_manager/window_manager_delegate.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_WINDOW_MANAGER_DELEGATE_H_
-#define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_WINDOW_MANAGER_DELEGATE_H_
-
-#include "mojo/public/interfaces/application/service_provider.mojom.h"
-#include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
-
-namespace mojo {
-
-class View;
-
-// A WindowManagerDelegate is provided by the application embedded at the
-// service root view.
-class WindowManagerDelegate {
- public:
- // Create an appropriate view to embed |url|.
- virtual void Embed(const String& url,
- InterfaceRequest<ServiceProvider> service_provider) {}
-
- // Dispatch the supplied input event to the appropriate view (taking into
- // account focus, activation, modality, etc.).
- virtual void DispatchEvent(EventPtr event) = 0;
-
- protected:
- virtual ~WindowManagerDelegate() {}
-};
-
-} // namespace mojo
-
-#endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_WINDOW_MANAGER_DELEGATE_H_
diff --git a/mojo/services/public/interfaces/native_viewport/native_viewport.mojom b/mojo/services/public/interfaces/native_viewport/native_viewport.mojom
index 990ad03..421f47c 100644
--- a/mojo/services/public/interfaces/native_viewport/native_viewport.mojom
+++ b/mojo/services/public/interfaces/native_viewport/native_viewport.mojom
@@ -29,16 +29,4 @@
OnEvent(Event event) => ();
};
-// Connect to this interface before any other connections are made to configure
-// the NativeViewport service.
-interface NativeViewportConfig {
- // Call UseTestConfig() and block on the reply. This will ensure that the
- // correct global initialization is done before subsequent connections.
- UseTestConfig() => ();
-
- // Call UseHeadlessConfig() and block on the reply. This will ensure that
- // the native viewport is later created in headless mode.
- UseHeadlessConfig() => ();
-};
-
}
diff --git a/mojo/services/public/interfaces/network/BUILD.gn b/mojo/services/public/interfaces/network/BUILD.gn
index e55c6aa..55e25aa 100644
--- a/mojo/services/public/interfaces/network/BUILD.gn
+++ b/mojo/services/public/interfaces/network/BUILD.gn
@@ -12,7 +12,7 @@
"network_error.mojom",
"network_service.mojom",
"tcp_bound_socket.mojom",
- "tcp_client_socket.mojom",
+ "tcp_connected_socket.mojom",
"tcp_server_socket.mojom",
"udp_socket.mojom",
"url_loader.mojom",
diff --git a/mojo/services/public/interfaces/network/network_service.mojom b/mojo/services/public/interfaces/network/network_service.mojom
index 7884144..74f9312 100644
--- a/mojo/services/public/interfaces/network/network_service.mojom
+++ b/mojo/services/public/interfaces/network/network_service.mojom
@@ -6,7 +6,8 @@
import "mojo/services/public/interfaces/network/net_address.mojom"
import "mojo/services/public/interfaces/network/network_error.mojom"
import "mojo/services/public/interfaces/network/tcp_bound_socket.mojom"
-import "mojo/services/public/interfaces/network/tcp_client_socket.mojom"
+import "mojo/services/public/interfaces/network/tcp_connected_socket.mojom"
+import "mojo/services/public/interfaces/network/udp_socket.mojom"
import "mojo/services/public/interfaces/network/url_loader.mojom"
import "mojo/services/public/interfaces/network/web_socket.mojom"
@@ -27,14 +28,14 @@
//
// If you want to create a client socket to connect to a server and are in
// the common case where you don't care about the local address it's bound
- // to, use CreateTCPClientSocket.
+ // to, use CreateTCPConnectedSocket.
//
// The local address can specify 0 for the port to specify that the OS should
// pick an available port for the given address, or it can pass 0 for the
// address and port for the OS to pick both the local address and port. In
// all success cases, the resulting local address will be passed to the
// callback as bound_to.
- CreateTCPBoundSocket(NetAddress local_address,
+ CreateTCPBoundSocket(NetAddress? local_address,
TCPBoundSocket& bound_socket)
=> (NetworkError result, NetAddress? bound_to);
@@ -44,12 +45,14 @@
//
// If you want control over the local address and port, instead use
// CreateTCPBoundSocket.
- CreateTCPClientSocket(NetAddress remote_address,
- handle<data_pipe_consumer> send_stream,
- handle<data_pipe_producer> receive_stream,
- TCPClientSocket& client_socket)
+ CreateTCPConnectedSocket(NetAddress remote_address,
+ handle<data_pipe_consumer> send_stream,
+ handle<data_pipe_producer> receive_stream,
+ TCPConnectedSocket& client_socket)
=> (NetworkError result,
NetAddress? local_address);
+
+ CreateUDPSocket(UDPSocket& socket);
};
}
diff --git a/mojo/services/public/interfaces/network/tcp_bound_socket.mojom b/mojo/services/public/interfaces/network/tcp_bound_socket.mojom
index 0772846..973afc3 100644
--- a/mojo/services/public/interfaces/network/tcp_bound_socket.mojom
+++ b/mojo/services/public/interfaces/network/tcp_bound_socket.mojom
@@ -4,7 +4,7 @@
import "mojo/services/public/interfaces/network/net_address.mojom"
import "mojo/services/public/interfaces/network/network_error.mojom"
-import "mojo/services/public/interfaces/network/tcp_client_socket.mojom"
+import "mojo/services/public/interfaces/network/tcp_connected_socket.mojom"
import "mojo/services/public/interfaces/network/tcp_server_socket.mojom"
module mojo {
@@ -14,17 +14,19 @@
//
// A bound socket can be used to create a server socket listening on the
// local address, or it can be used to create a client socket by connecting to
-// a remote host.
+// a remote host. Once StartListening or Connect is called on the bound socket,
+// ownership of the underlying socket will be transferred to the connected or
+// server socket, and the bound socket may be closed.
interface TCPBoundSocket {
// Puts the socket into server mode, awaiting incoming connections.
//
// Once this function is called, neither StartListening nor Connect can be
// used on this socket again.
- StartListening(TCPServerSocket& server);
+ StartListening(TCPServerSocket& server) => (NetworkError result);
// Puts this socket into client mode by connecting to a remote host. If you
// do not care about the local address or port, you can call
- // NetworkService.CreateTCPClientSocket to connect directly and skip the
+ // NetworkService.CreateTCPConnectedSocket to connect directly and skip the
// "bound" state.
//
// Once this function is called, neither StartListening nor Connect can be
@@ -32,7 +34,7 @@
Connect(NetAddress remote_address,
handle<data_pipe_consumer> send_stream,
handle<data_pipe_producer> receive_stream,
- TCPClientSocket& client_socket)
+ TCPConnectedSocket& client_socket)
=> (NetworkError result);
};
diff --git a/mojo/services/public/interfaces/network/tcp_client_socket.mojom b/mojo/services/public/interfaces/network/tcp_connected_socket.mojom
similarity index 67%
rename from mojo/services/public/interfaces/network/tcp_client_socket.mojom
rename to mojo/services/public/interfaces/network/tcp_connected_socket.mojom
index 2dd3544..832b496 100644
--- a/mojo/services/public/interfaces/network/tcp_client_socket.mojom
+++ b/mojo/services/public/interfaces/network/tcp_connected_socket.mojom
@@ -4,12 +4,12 @@
module mojo {
-// Represents a TCP socket connected to a report system.
+// Represents a TCP socket connected to a remote system.
//
// Reading and writing over the connection are done via the data pipe supplied
// by the caller when creating the socket.
-interface TCPClientSocket {
- // TODO(brettw) here we put options and whatnot for controlling the
+interface TCPConnectedSocket {
+ // TODO(brettw) here we put options and what not for controlling the
// connection.
};
diff --git a/mojo/services/public/interfaces/network/tcp_server_socket.mojom b/mojo/services/public/interfaces/network/tcp_server_socket.mojom
index 4b2e596..997f7e8 100644
--- a/mojo/services/public/interfaces/network/tcp_server_socket.mojom
+++ b/mojo/services/public/interfaces/network/tcp_server_socket.mojom
@@ -4,31 +4,21 @@
import "mojo/services/public/interfaces/network/net_address.mojom"
import "mojo/services/public/interfaces/network/network_error.mojom"
-import "mojo/services/public/interfaces/network/tcp_client_socket.mojom"
+import "mojo/services/public/interfaces/network/tcp_connected_socket.mojom"
module mojo {
// Represents a TCP server socket listening for incoming requests.
-[Client=TCPServerSocketClient]
interface TCPServerSocket {
- // Accepts an incoming connection request and hooks up a TCPClientSocket for
- // connecting with the remote host. This function is called in reponse to
- // OnConnectionAvailable().
+ // Waits for an incoming connection request and hooks up a TCPConnectedSocket
+ // for connecting with the remote host. Only one Accept call can be pending
+ // at a time.
//
// On success, the address of the remote host will be provided.
- AcceptConnection(handle<data_pipe_consumer> send_stream,
- handle<data_pipe_producer> receive_stream,
- TCPClientSocket& client_socket)
+ Accept(handle<data_pipe_consumer> send_stream,
+ handle<data_pipe_producer> receive_stream,
+ TCPConnectedSocket& client_socket)
=> (NetworkError result, NetAddress? remote_address);
};
-interface TCPServerSocketClient {
- // Notifies the client that an incoming connection is available.
- //
- // The client should call AcceptConnection() to accept the request.
- OnConnectionAvailable();
-
- // TODO(brettw) probably need some error reporting function here.
-};
-
}
diff --git a/mojo/services/public/interfaces/view_manager/view_manager.mojom b/mojo/services/public/interfaces/view_manager/view_manager.mojom
index 094f5d3..bf8b82f 100644
--- a/mojo/services/public/interfaces/view_manager/view_manager.mojom
+++ b/mojo/services/public/interfaces/view_manager/view_manager.mojom
@@ -137,11 +137,6 @@
Embed(string url,
uint32 view_id,
ServiceProvider? service_provider) => (bool success);
-
- // TODO(sky): move these to a separate interface when FIFO works.
-
- // Sends OnViewInputEvent() to the owner of the specified view.
- DispatchOnViewInputEvent(uint32 view_id, mojo.Event event);
};
// Changes to views are not sent to the connection that originated the
@@ -197,18 +192,6 @@
// Invoked when an event is targeted at the specified view.
OnViewInputEvent(uint32 view, mojo.Event event) => ();
-
- // TODO(sky): The following methods represent an interface between the view
- // manager and the application embedded at the service root view
- // (i.e. the window manager). These methods are not called on
- // any other clients. They should be moved to a separate interface
- // once support for derived FIFOs is landed.
-
- // Requests the window manager create a "top level" view embedding |url|.
- Embed(string url, ServiceProvider&? service_provider);
-
- // Requests the view manager dispatch the event.
- DispatchOnViewInputEvent(mojo.Event event);
};
}
diff --git a/mojo/services/public/interfaces/window_manager/BUILD.gn b/mojo/services/public/interfaces/window_manager/BUILD.gn
index ee50bc5..3d1e55f 100644
--- a/mojo/services/public/interfaces/window_manager/BUILD.gn
+++ b/mojo/services/public/interfaces/window_manager/BUILD.gn
@@ -4,9 +4,14 @@
import("//mojo/public/tools/bindings/mojom.gni")
-# GYP version: mojo/mojo_services.gypi:mojo_core_window_manager_bindings
+# GYP version: mojo/mojo_services.gypi:mojo_window_manager_bindings
mojom("window_manager") {
sources = [
"window_manager.mojom",
]
+
+ deps = [
+ "//mojo/public/interfaces/application",
+ "//mojo/services/public/interfaces/input_events",
+ ]
}
diff --git a/mojo/services/public/interfaces/window_manager/window_manager.mojom b/mojo/services/public/interfaces/window_manager/window_manager.mojom
index 41deb44..a0a4ed9 100644
--- a/mojo/services/public/interfaces/window_manager/window_manager.mojom
+++ b/mojo/services/public/interfaces/window_manager/window_manager.mojom
@@ -2,27 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import "mojo/public/interfaces/application/service_provider.mojom"
+import "mojo/services/public/interfaces/input_events/input_events.mojom"
+
module mojo {
+// WindowManagerService provides high level window management policies.
+// WindowManagerService is used by the ViewManager. More specifically the first
+// connection from the ViewManager is expected to provide the
+// WindowManagerService.
[Client=WindowManagerClient]
interface WindowManagerService {
- SetCapture(uint32 view_id) => (bool success);
- FocusWindow(uint32 view_id) => (bool success);
- ActivateWindow(uint32 view_id) => (bool success);
+ // Asks the WindowManager to embed |url| at the appropriate place. See
+ // ViewManager::Embed for details of |service_provider|.
+ Embed(string url, ServiceProvider&? service_provider);
+
+ // Called when an input event is received from the native system. It's
+ // expected that when this is received the WindowManagerService will call back
+ // to WindowManagerServieClient will call DispatchInputEventToView().
+ OnViewInputEvent(mojo.Event event);
};
+// ViewManager provides this interface for functionality only exposed to the
+// WindowManagerServie.
[Client=WindowManagerService]
interface WindowManagerClient {
- // Called when the window manager is ready to use (in the event a client
- // connects to it before it has been initialized).
- OnWindowManagerReady();
-
- // TODO(beng): how is the WM supposed to know if a view is known to a client
- // or not?
- OnCaptureChanged(uint32 old_capture_view_id, uint32 new_capture_view_id);
-
- OnFocusChanged(uint32 old_focused_node_id, uint32 new_focused_node_id);
- OnActiveWindowChanged(uint32 old_focused_window, uint32 new_focused_window);
+ // Dispatches the specified input event to the specified view.
+ DispatchInputEventToView(uint32 view_id, mojo.Event event);
};
}
diff --git a/mojo/services/public/interfaces/window_manager2/BUILD.gn b/mojo/services/public/interfaces/window_manager2/BUILD.gn
new file mode 100644
index 0000000..3067458
--- /dev/null
+++ b/mojo/services/public/interfaces/window_manager2/BUILD.gn
@@ -0,0 +1,12 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//mojo/public/tools/bindings/mojom.gni")
+
+# GYP version: mojo/mojo_services.gypi:mojo_core_window_manager_bindings
+mojom("window_manager2") {
+ sources = [
+ "window_manager2.mojom",
+ ]
+}
diff --git a/mojo/services/public/interfaces/window_manager2/window_manager2.mojom b/mojo/services/public/interfaces/window_manager2/window_manager2.mojom
new file mode 100644
index 0000000..f1b242d
--- /dev/null
+++ b/mojo/services/public/interfaces/window_manager2/window_manager2.mojom
@@ -0,0 +1,31 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module mojo {
+
+// TODO(sky): rethink these, and if we do in fact need it come up with a better
+// name.
+
+[Client=WindowManagerClient2]
+interface WindowManagerService2 {
+ SetCapture(uint32 view_id) => (bool success);
+ FocusWindow(uint32 view_id) => (bool success);
+ ActivateWindow(uint32 view_id) => (bool success);
+};
+
+[Client=WindowManagerService2]
+interface WindowManagerClient2 {
+ // Called when the window manager is ready to use (in the event a client
+ // connects to it before it has been initialized).
+ OnWindowManagerReady();
+
+ // TODO(beng): how is the WM supposed to know if a view is known to a client
+ // or not?
+ OnCaptureChanged(uint32 old_capture_view_id, uint32 new_capture_view_id);
+
+ OnFocusChanged(uint32 old_focused_node_id, uint32 new_focused_node_id);
+ OnActiveWindowChanged(uint32 old_focused_window, uint32 new_focused_window);
+};
+
+}
diff --git a/mojo/services/public/mojo_services_public.gyp b/mojo/services/public/mojo_services_public.gyp
index e5de1af..e344b9f 100644
--- a/mojo/services/public/mojo_services_public.gyp
+++ b/mojo/services/public/mojo_services_public.gyp
@@ -159,7 +159,7 @@
'interfaces/network/network_error.mojom',
'interfaces/network/network_service.mojom',
'interfaces/network/tcp_bound_socket.mojom',
- 'interfaces/network/tcp_client_socket.mojom',
+ 'interfaces/network/tcp_connected_socket.mojom',
'interfaces/network/tcp_server_socket.mojom',
'interfaces/network/udp_socket.mojom',
'interfaces/network/url_loader.mojom',
@@ -244,12 +244,31 @@
},
{
# GN version: //mojo/services/public/interfaces/window_manager
- 'target_name': 'mojo_core_window_manager_bindings',
+ 'target_name': 'mojo_window_manager_bindings',
'type': 'static_library',
'sources': [
'interfaces/window_manager/window_manager.mojom',
],
'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ 'mojo_input_events_bindings',
+ '../../public/mojo_public.gyp:mojo_application_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_input_events_bindings',
+ '../../public/mojo_public.gyp:mojo_application_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/window_manager2
+ 'target_name': 'mojo_core_window_manager_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/window_manager2/window_manager2.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
'../../public/mojo_public.gyp:mojo_cpp_bindings',
],
diff --git a/mojo/services/surfaces/BUILD.gn b/mojo/services/surfaces/BUILD.gn
index 9f154a5..40103ea 100644
--- a/mojo/services/surfaces/BUILD.gn
+++ b/mojo/services/surfaces/BUILD.gn
@@ -13,11 +13,11 @@
"//ui/gfx/geometry",
"//mojo/application",
"//mojo/cc",
+ "//mojo/converters/geometry",
+ "//mojo/converters/surfaces",
"//mojo/environment:chromium",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/gles2:for_shared_library",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/gpu",
"//mojo/services/public/interfaces/surfaces",
diff --git a/mojo/services/surfaces/DEPS b/mojo/services/surfaces/DEPS
index 3c07200..deb1892 100644
--- a/mojo/services/surfaces/DEPS
+++ b/mojo/services/surfaces/DEPS
@@ -3,6 +3,8 @@
"-cc/blink",
"+mojo/application",
"+mojo/cc",
+ "+mojo/converters/geometry",
+ "+mojo/converters/surfaces",
"+mojo/services/gles2",
"+mojo/services/public",
]
diff --git a/mojo/services/surfaces/surfaces_impl.cc b/mojo/services/surfaces/surfaces_impl.cc
index 9d79a7a..e323c02 100644
--- a/mojo/services/surfaces/surfaces_impl.cc
+++ b/mojo/services/surfaces/surfaces_impl.cc
@@ -9,8 +9,9 @@
#include "cc/surfaces/display.h"
#include "cc/surfaces/surface_id_allocator.h"
#include "mojo/cc/context_provider_mojo.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
+#include "mojo/cc/direct_output_surface.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
namespace mojo {
@@ -75,9 +76,9 @@
return;
}
if (!display_) {
- display_.reset(new cc::Display(this, manager_, NULL));
+ display_.reset(new cc::Display(this, manager_, NULL, NULL));
client_->SetDisplay(display_.get());
- display_->Initialize(make_scoped_ptr(new cc::OutputSurface(
+ display_->Initialize(make_scoped_ptr(new DirectOutputSurface(
new ContextProviderMojo(command_buffer_handle_.Pass()))));
}
factory_.Create(cc_id, size.To<gfx::Size>());
diff --git a/mojo/services/view_manager/BUILD.gn b/mojo/services/view_manager/BUILD.gn
index ddb76e2..a870c3f 100644
--- a/mojo/services/view_manager/BUILD.gn
+++ b/mojo/services/view_manager/BUILD.gn
@@ -13,18 +13,19 @@
"//cc/surfaces",
"//mojo/application",
"//mojo/common",
+ "//mojo/converters/geometry",
+ "//mojo/converters/input_events",
+ "//mojo/converters/surfaces",
"//mojo/environment:chromium",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings",
"//mojo/public/interfaces/application",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/input_events",
- "//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/input_events",
"//mojo/services/public/interfaces/native_viewport",
"//mojo/services/public/interfaces/surfaces",
"//mojo/services/public/interfaces/view_manager",
+ "//mojo/services/public/interfaces/window_manager",
"//ui/base",
"//ui/events",
"//ui/events:events_base",
@@ -58,6 +59,8 @@
"view_manager_service_impl.h",
"window_manager_access_policy.cc",
"window_manager_access_policy.h",
+ "window_manager_client_impl.cc",
+ "window_manager_client_impl.h",
]
}
@@ -68,13 +71,16 @@
"//base/test:test_support",
"//mojo/application",
"//mojo/application_manager",
+ "//mojo/converters/geometry",
+ "//mojo/converters/input_events",
"//mojo/edk/system",
"//mojo/environment:chromium",
"//mojo/public/cpp/bindings",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/input_events",
+ "//mojo/services/public/cpp/native_viewport:args",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/cpp/view_manager/lib:run_unittests",
+ "//mojo/services/public/interfaces/view_manager",
+ "//mojo/services/public/interfaces/window_manager",
"//mojo/shell:test_support",
"//testing/gtest",
"//ui/gfx/geometry",
diff --git a/mojo/services/view_manager/DEPS b/mojo/services/view_manager/DEPS
index d91b8be..b9172b5 100644
--- a/mojo/services/view_manager/DEPS
+++ b/mojo/services/view_manager/DEPS
@@ -4,6 +4,9 @@
"+gpu/command_buffer/service/mailbox_manager.h",
"+mojo/application",
"+mojo/cc",
+ "+mojo/converters/geometry",
+ "+mojo/converters/input_events",
+ "+mojo/converters/surfaces",
"+mojo/geometry",
"+mojo/services",
"+third_party/skia",
diff --git a/mojo/services/view_manager/connection_manager.cc b/mojo/services/view_manager/connection_manager.cc
index 6d9fe2a..d610392 100644
--- a/mojo/services/view_manager/connection_manager.cc
+++ b/mojo/services/view_manager/connection_manager.cc
@@ -5,9 +5,9 @@
#include "mojo/services/view_manager/connection_manager.h"
#include "base/logging.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
-#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
#include "mojo/services/view_manager/view_manager_service_impl.h"
namespace mojo {
@@ -31,10 +31,9 @@
ApplicationConnection* app_connection,
const Callback<void()>& native_viewport_closed_callback)
: app_connection_(app_connection),
+ wm_client_impl_(this),
next_connection_id_(1),
- display_manager_(app_connection,
- this,
- native_viewport_closed_callback),
+ display_manager_(app_connection, this, native_viewport_closed_callback),
root_(new ServerView(this, RootViewId())),
current_change_(NULL) {
root_->SetBounds(gfx::Rect(800, 600));
@@ -71,21 +70,22 @@
}
}
-void ConnectionManager::EmbedRoot(
+void ConnectionManager::Embed(
const std::string& url,
InterfaceRequest<ServiceProvider> service_provider) {
if (connection_map_.empty()) {
+ // TODO(sky): this is unsafe and racy. Need a better way to determine the
+ // window manager.
EmbedImpl(kInvalidConnectionId,
String::From(url),
RootViewId(),
service_provider.Pass());
return;
}
- ViewManagerServiceImpl* connection = GetConnection(kWindowManagerConnection);
- connection->client()->Embed(url, service_provider.Pass());
+ wm_client_impl_.client()->Embed(url, service_provider.Pass());
}
-void ConnectionManager::Embed(
+void ConnectionManager::EmbedAtView(
ConnectionSpecificId creator_id,
const String& url,
Id transport_view_id,
@@ -130,13 +130,9 @@
return NULL;
}
-void ConnectionManager::DispatchViewInputEventToWindowManager(EventPtr event) {
- // Input events are forwarded to the WindowManager. The WindowManager
- // eventually calls back to us with DispatchOnViewInputEvent().
- ViewManagerServiceImpl* connection = GetConnection(kWindowManagerConnection);
- if (!connection)
- return;
- connection->client()->DispatchOnViewInputEvent(event.Pass());
+void ConnectionManager::DispatchViewInputEventToDelegate(EventPtr event) {
+ if (wm_client_impl_.client())
+ wm_client_impl_.client()->OnViewInputEvent(event.Pass());
}
void ConnectionManager::ProcessViewBoundsChanged(const ServerView* view,
@@ -214,9 +210,17 @@
ServiceProvider* view_manager_service_provider =
app_connection_->ConnectToApplication(url)->GetServiceProvider();
+
view_manager_service_provider->ConnectToService(
ViewManagerServiceImpl::Client::Name_, pipe.handle1.Pass());
+ if (root_id == RootViewId()) {
+ MessagePipe wm_pipe;
+ view_manager_service_provider->ConnectToService(
+ WindowManagerClientImpl::Client::Name_, wm_pipe.handle1.Pass());
+ WeakBindToPipe(&wm_client_impl_, wm_pipe.handle0.Pass());
+ }
+
std::string creator_url;
ConnectionMap::const_iterator it = connection_map_.find(creator_id);
if (it != connection_map_.end())
diff --git a/mojo/services/view_manager/connection_manager.h b/mojo/services/view_manager/connection_manager.h
index 36fc354..1917439 100644
--- a/mojo/services/view_manager/connection_manager.h
+++ b/mojo/services/view_manager/connection_manager.h
@@ -15,6 +15,7 @@
#include "mojo/services/view_manager/server_view.h"
#include "mojo/services/view_manager/server_view_delegate.h"
#include "mojo/services/view_manager/view_manager_export.h"
+#include "mojo/services/view_manager/window_manager_client_impl.h"
namespace ui {
class Event;
@@ -75,17 +76,19 @@
void AddConnection(ViewManagerServiceImpl* connection);
void RemoveConnection(ViewManagerServiceImpl* connection);
- // Establishes the initial client. Similar to Connect(), but the resulting
- // client is allowed to do anything.
- void EmbedRoot(const std::string& url,
- InterfaceRequest<ServiceProvider> service_provider);
+ // Used in two cases:
+ // . Establishes the client for the root.
+ // . Requests to Embed() at an unspecified view. For this case the request
+ // is passed on to the WindowManagerService.
+ void Embed(const std::string& url,
+ InterfaceRequest<ServiceProvider> service_provider);
// See description of ViewManagerService::Embed() for details. This assumes
// |transport_view_id| is valid.
- void Embed(ConnectionSpecificId creator_id,
- const String& url,
- Id transport_view_id,
- InterfaceRequest<ServiceProvider> service_provider);
+ void EmbedAtView(ConnectionSpecificId creator_id,
+ const String& url,
+ Id transport_view_id,
+ InterfaceRequest<ServiceProvider> service_provider);
// Returns the connection by id.
ViewManagerServiceImpl* GetConnection(ConnectionSpecificId connection_id);
@@ -115,7 +118,7 @@
}
const ViewManagerServiceImpl* GetConnectionWithRoot(const ViewId& id) const;
- void DispatchViewInputEventToWindowManager(EventPtr event);
+ void DispatchViewInputEventToDelegate(EventPtr event);
// These functions trivially delegate to all ViewManagerServiceImpls, which in
// term notify their clients.
@@ -179,6 +182,8 @@
ApplicationConnection* app_connection_;
+ WindowManagerClientImpl wm_client_impl_;
+
// ID to use for next ViewManagerServiceImpl.
ConnectionSpecificId next_connection_id_;
diff --git a/mojo/services/view_manager/display_manager.cc b/mojo/services/view_manager/display_manager.cc
index 435951b..06162d1 100644
--- a/mojo/services/view_manager/display_manager.cc
+++ b/mojo/services/view_manager/display_manager.cc
@@ -6,10 +6,10 @@
#include "base/numerics/safe_conversions.h"
#include "cc/surfaces/surface_id_allocator.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_utils.h"
#include "mojo/public/cpp/application/application_connection.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_utils.h"
#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
#include "mojo/services/public/interfaces/surfaces/quads.mojom.h"
#include "mojo/services/view_manager/connection_manager.h"
@@ -160,7 +160,7 @@
void DisplayManager::OnEvent(EventPtr event,
const mojo::Callback<void()>& callback) {
- connection_manager_->DispatchViewInputEventToWindowManager(event.Pass());
+ connection_manager_->DispatchViewInputEventToDelegate(event.Pass());
callback.Run();
}
diff --git a/mojo/services/view_manager/test_change_tracker.cc b/mojo/services/view_manager/test_change_tracker.cc
index bf95ac5..2b127cd 100644
--- a/mojo/services/view_manager/test_change_tracker.cc
+++ b/mojo/services/view_manager/test_change_tracker.cc
@@ -7,7 +7,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "mojo/common/common_type_converters.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/services/public/cpp/view_manager/util.h"
namespace mojo {
diff --git a/mojo/services/view_manager/view_manager_init_service_context.cc b/mojo/services/view_manager/view_manager_init_service_context.cc
index bd93419..d23bec7 100644
--- a/mojo/services/view_manager/view_manager_init_service_context.cc
+++ b/mojo/services/view_manager/view_manager_init_service_context.cc
@@ -58,7 +58,7 @@
const String& url,
ServiceProviderPtr service_provider,
const Callback<void(bool)>& callback) {
- connection_manager_->EmbedRoot(url, GetProxy(&service_provider));
+ connection_manager_->Embed(url, GetProxy(&service_provider));
callback.Run(true);
}
diff --git a/mojo/services/view_manager/view_manager_service_impl.cc b/mojo/services/view_manager/view_manager_service_impl.cc
index ad0df79..f066b82 100644
--- a/mojo/services/view_manager/view_manager_service_impl.cc
+++ b/mojo/services/view_manager/view_manager_service_impl.cc
@@ -5,9 +5,9 @@
#include "mojo/services/view_manager/view_manager_service_impl.h"
#include "base/bind.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
-#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
-#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
+#include "mojo/converters/surfaces/surfaces_type_converters.h"
#include "mojo/services/view_manager/connection_manager.h"
#include "mojo/services/view_manager/default_access_policy.h"
#include "mojo/services/view_manager/server_view.h"
@@ -481,7 +481,7 @@
spir.Bind(service_provider.PassMessagePipe());
if (ViewIdFromTransportId(transport_view_id) == InvalidViewId()) {
- connection_manager_->EmbedRoot(url, spir.Pass());
+ connection_manager_->Embed(url, spir.Pass());
callback.Run(true);
return;
}
@@ -503,33 +503,10 @@
connection_manager_->OnConnectionMessagedClient(id_);
existing_owner->RemoveRoot(view_id);
}
- connection_manager_->Embed(id_, url, transport_view_id, spir.Pass());
+ connection_manager_->EmbedAtView(id_, url, transport_view_id, spir.Pass());
callback.Run(true);
}
-void ViewManagerServiceImpl::DispatchOnViewInputEvent(Id transport_view_id,
- EventPtr event) {
- // We only allow the WM to dispatch events. At some point this function will
- // move to a separate interface and the check can go away.
- if (id_ != kWindowManagerConnection)
- return;
-
- const ViewId view_id(ViewIdFromTransportId(transport_view_id));
-
- // If another app is embedded at this view, we forward the input event to the
- // embedded app, rather than the app that created the view.
- ViewManagerServiceImpl* connection =
- connection_manager_->GetConnectionWithRoot(view_id);
- if (!connection)
- connection = connection_manager_->GetConnection(view_id.connection_id);
- if (connection) {
- connection->client()->OnViewInputEvent(
- transport_view_id,
- event.Pass(),
- base::Bind(&base::DoNothing));
- }
-}
-
void ViewManagerServiceImpl::OnConnectionEstablished() {
connection_manager_->AddConnection(this);
diff --git a/mojo/services/view_manager/view_manager_service_impl.h b/mojo/services/view_manager/view_manager_service_impl.h
index 2f2ea9a..c77f285 100644
--- a/mojo/services/view_manager/view_manager_service_impl.h
+++ b/mojo/services/view_manager/view_manager_service_impl.h
@@ -177,7 +177,6 @@
Id view_id,
ServiceProviderPtr service_provider,
const Callback<void(bool)>& callback) override;
- virtual void DispatchOnViewInputEvent(Id view_id, EventPtr event) override;
// InterfaceImpl:
virtual void OnConnectionEstablished() override;
diff --git a/mojo/services/view_manager/view_manager_unittest.cc b/mojo/services/view_manager/view_manager_unittest.cc
index 4883cc8..c121659 100644
--- a/mojo/services/view_manager/view_manager_unittest.cc
+++ b/mojo/services/view_manager/view_manager_unittest.cc
@@ -15,16 +15,19 @@
#include "base/strings/stringprintf.h"
#include "mojo/application_manager/application_manager.h"
#include "mojo/common/common_type_converters.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/connect.h"
+#include "mojo/public/cpp/application/interface_factory_impl.h"
#include "mojo/public/cpp/bindings/lib/router.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/services/public/cpp/native_viewport/args.h"
#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/cpp/view_manager/util.h"
#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
+#include "mojo/services/public/interfaces/window_manager/window_manager.mojom.h"
#include "mojo/services/view_manager/ids.h"
#include "mojo/services/view_manager/test_change_tracker.h"
#include "mojo/shell/shell_test_helper.h"
@@ -54,10 +57,11 @@
public:
explicit ViewManagerProxy(TestChangeTracker* tracker)
: tracker_(tracker),
- main_loop_(NULL),
- view_manager_(NULL),
+ main_loop_(nullptr),
+ view_manager_(nullptr),
+ window_manager_client_(nullptr),
quit_count_(0),
- router_(NULL) {
+ router_(nullptr) {
SetInstance(this);
}
@@ -79,6 +83,9 @@
}
ViewManagerService* view_manager() { return view_manager_; }
+ WindowManagerClient* window_manager_client() {
+ return window_manager_client_;
+ }
// Runs the main loop until |count| changes have been received.
std::vector<Change> DoRunLoopUntilChangesCount(size_t count) {
@@ -224,6 +231,7 @@
private:
friend class TestViewManagerClientConnection;
+ friend class WindowManagerServiceImpl;
void set_router(mojo::internal::Router* router) { router_ = router; }
@@ -231,6 +239,10 @@
view_manager_ = view_manager;
}
+ void set_window_manager_client(WindowManagerClient* client) {
+ window_manager_client_ = client;
+ }
+
static void RunMainLoop() {
DCHECK(!main_run_loop_);
main_run_loop_ = new base::RunLoop;
@@ -291,6 +303,7 @@
base::MessageLoop* main_loop_;
ViewManagerService* view_manager_;
+ WindowManagerClient* window_manager_client_;
// Number of changes we're waiting on until we quit the current loop.
size_t quit_count_;
@@ -314,14 +327,18 @@
class TestViewManagerClientConnection
: public InterfaceImpl<ViewManagerClient> {
public:
- TestViewManagerClientConnection() : connection_(&tracker_) {
- tracker_.set_delegate(&connection_);
+ TestViewManagerClientConnection() : proxy_(&tracker_) {
+ tracker_.set_delegate(&proxy_);
}
+ TestChangeTracker* tracker() { return &tracker_; }
+
+ ViewManagerProxy* proxy() { return &proxy_; }
+
// InterfaceImpl:
virtual void OnConnectionEstablished() override {
- connection_.set_router(internal_state()->router());
- connection_.set_view_manager(client());
+ proxy_.set_router(internal_state()->router());
+ proxy_.set_view_manager(client());
}
// ViewManagerClient:
@@ -360,28 +377,47 @@
const Callback<void()>& callback) override {
tracker_.OnViewInputEvent(view_id, event.Pass());
}
- virtual void Embed(
- const String& url,
- InterfaceRequest<ServiceProvider> service_provider) override {
- tracker_.DelegateEmbed(url);
- }
- virtual void DispatchOnViewInputEvent(mojo::EventPtr event) override {
- }
private:
TestChangeTracker tracker_;
- ViewManagerProxy connection_;
+ ViewManagerProxy proxy_;
DISALLOW_COPY_AND_ASSIGN(TestViewManagerClientConnection);
};
+class WindowManagerServiceImpl : public InterfaceImpl<WindowManagerService> {
+ public:
+ explicit WindowManagerServiceImpl(TestViewManagerClientConnection* connection)
+ : connection_(connection) {}
+ virtual ~WindowManagerServiceImpl() {}
+
+ // InterfaceImpl:
+ virtual void OnConnectionEstablished() override {
+ connection_->proxy()->set_window_manager_client(client());
+ }
+
+ // WindowManagerService:
+ virtual void Embed(
+ const String& url,
+ InterfaceRequest<ServiceProvider> service_provider) override {
+ connection_->tracker()->DelegateEmbed(url);
+ }
+ virtual void OnViewInputEvent(mojo::EventPtr event) override {}
+
+ private:
+ TestViewManagerClientConnection* connection_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowManagerServiceImpl);
+};
+
// Used with ViewManagerService::Embed(). Creates a
// TestViewManagerClientConnection, which creates and owns the ViewManagerProxy.
class EmbedApplicationLoader : public ApplicationLoader,
ApplicationDelegate,
- public InterfaceFactory<ViewManagerClient> {
+ public InterfaceFactory<ViewManagerClient>,
+ public InterfaceFactory<WindowManagerService> {
public:
- EmbedApplicationLoader() {}
+ EmbedApplicationLoader() : last_view_manager_client_(nullptr) {}
virtual ~EmbedApplicationLoader() {}
// ApplicationLoader implementation:
@@ -401,17 +437,27 @@
// ApplicationDelegate implementation:
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
override {
- connection->AddService(this);
+ connection->AddService<ViewManagerClient>(this);
+ connection->AddService<WindowManagerService>(this);
return true;
}
// InterfaceFactory<ViewManagerClient> implementation:
virtual void Create(ApplicationConnection* connection,
InterfaceRequest<ViewManagerClient> request) override {
- BindToRequest(new TestViewManagerClientConnection, &request);
+ last_view_manager_client_ = new TestViewManagerClientConnection;
+ BindToRequest(last_view_manager_client_, &request);
+ }
+ virtual void Create(ApplicationConnection* connection,
+ InterfaceRequest<WindowManagerService> request) override {
+ BindToRequest(new WindowManagerServiceImpl(last_view_manager_client_),
+ &request);
}
private:
+ // Used so that TestViewManagerClientConnection and
+ // WindowManagerServiceImpl can share the same TestChangeTracker.
+ TestViewManagerClientConnection* last_view_manager_client_;
ScopedVector<ApplicationImpl> apps_;
DISALLOW_COPY_AND_ASSIGN(EmbedApplicationLoader);
@@ -460,6 +506,11 @@
virtual void SetUp() override {
ASSERT_TRUE(ViewManagerProxy::IsInInitialState());
test_helper_.Init();
+ std::vector<std::string> native_viewport_args;
+ native_viewport_args.push_back(kUseTestConfig);
+ test_helper_.application_manager()->SetArgsForURL(
+ native_viewport_args, GURL("mojo:mojo_native_viewport_service"));
+ printf("Setting args\n");
#if defined(OS_WIN)
// As we unload the wndproc of window classes we need to be sure to
@@ -1190,8 +1241,8 @@
{
EventPtr event(Event::New());
event->action = static_cast<EventType>(1);
- connection_->view_manager()->DispatchOnViewInputEvent(BuildViewId(1, 1),
- event.Pass());
+ connection_->window_manager_client()->DispatchInputEventToView(
+ BuildViewId(1, 1), event.Pass());
connection2_->DoRunLoopUntilChangesCount(1);
const Changes changes(ChangesToDescription1(connection2_->changes()));
ASSERT_EQ(1u, changes.size());
diff --git a/mojo/services/view_manager/window_manager_client_impl.cc b/mojo/services/view_manager/window_manager_client_impl.cc
new file mode 100644
index 0000000..493e8f1
--- /dev/null
+++ b/mojo/services/view_manager/window_manager_client_impl.cc
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/view_manager/window_manager_client_impl.h"
+
+#include "base/bind.h"
+#include "mojo/services/view_manager/connection_manager.h"
+#include "mojo/services/view_manager/view_manager_service_impl.h"
+
+namespace mojo {
+namespace service {
+
+WindowManagerClientImpl::WindowManagerClientImpl(
+ ConnectionManager* connection_manager)
+ : connection_manager_(connection_manager) {
+}
+
+WindowManagerClientImpl::~WindowManagerClientImpl() {
+}
+
+void WindowManagerClientImpl::DispatchInputEventToView(Id transport_view_id,
+ EventPtr event) {
+ const ViewId view_id(ViewIdFromTransportId(transport_view_id));
+
+ ViewManagerServiceImpl* connection =
+ connection_manager_->GetConnectionWithRoot(view_id);
+ if (!connection)
+ connection = connection_manager_->GetConnection(view_id.connection_id);
+ if (connection) {
+ connection->client()->OnViewInputEvent(
+ transport_view_id, event.Pass(), base::Bind(&base::DoNothing));
+ }
+}
+
+void WindowManagerClientImpl::OnConnectionError() {
+ // TODO(sky): deal with this. We may need to tear everything down here.
+}
+
+} // namespace service
+} // namespace mojo
diff --git a/mojo/services/view_manager/window_manager_client_impl.h b/mojo/services/view_manager/window_manager_client_impl.h
new file mode 100644
index 0000000..b25aafe
--- /dev/null
+++ b/mojo/services/view_manager/window_manager_client_impl.h
@@ -0,0 +1,55 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_VIEW_MANAGER_WINDOW_MANAGER_CLIENT_IMPL_H_
+#define MOJO_SERVICES_VIEW_MANAGER_WINDOW_MANAGER_CLIENT_IMPL_H_
+
+#include <set>
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "mojo/services/public/interfaces/window_manager/window_manager.mojom.h"
+#include "mojo/services/view_manager/ids.h"
+#include "mojo/services/view_manager/view_manager_export.h"
+
+namespace mojo {
+namespace service {
+
+class ConnectionManager;
+
+#if defined(OS_WIN)
+// Equivalent of NON_EXPORTED_BASE which does not work with the template snafu
+// below.
+#pragma warning(push)
+#pragma warning(disable : 4275)
+#endif
+
+class MOJO_VIEW_MANAGER_EXPORT WindowManagerClientImpl
+ : public InterfaceImpl<WindowManagerClient> {
+ public:
+ explicit WindowManagerClientImpl(ConnectionManager* connection_manager);
+ virtual ~WindowManagerClientImpl();
+
+ // WindowManagerClient:
+ virtual void DispatchInputEventToView(Id transport_view_id,
+ EventPtr event) override;
+
+ // InterfaceImp overrides:
+ virtual void OnConnectionError() override;
+
+ private:
+ ConnectionManager* connection_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowManagerClientImpl);
+};
+
+#if defined(OS_WIN)
+#pragma warning(pop)
+#endif
+
+} // namespace service
+} // namespace mojo
+
+#endif // MOJO_SERVICES_VIEW_MANAGER_WINDOW_MANAGER_CLIENT_IMPL_H_
diff --git a/mojo/services/window_manager/BUILD.gn b/mojo/services/window_manager/BUILD.gn
index 8a93b2f..02f3a8e 100644
--- a/mojo/services/window_manager/BUILD.gn
+++ b/mojo/services/window_manager/BUILD.gn
@@ -28,8 +28,11 @@
sources = [
"window_manager_app.cc",
"window_manager_app.h",
+ "window_manager_delegate.h",
"window_manager_service_impl.cc",
"window_manager_service_impl.h",
+ "window_manager_service2_impl.cc",
+ "window_manager_service2_impl.h",
]
public_deps = [
@@ -39,12 +42,13 @@
"//base",
"//mojo/application",
"//mojo/common",
+ "//mojo/converters/input_events",
"//mojo/environment:chromium",
"//mojo/public/cpp/bindings",
"//mojo/public/interfaces/application:application",
- "//mojo/services/public/cpp/input_events",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/window_manager",
+ "//mojo/services/public/interfaces/window_manager2",
"//ui/aura",
"//ui/base",
"//ui/events",
@@ -69,6 +73,7 @@
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/view_manager",
"//mojo/services/public/interfaces/window_manager",
+ "//mojo/services/public/interfaces/window_manager2",
"//mojo/shell:test_support",
"//testing/gtest",
"//ui/gl",
diff --git a/mojo/services/window_manager/DEPS b/mojo/services/window_manager/DEPS
index 3421f3b..bbaa409 100644
--- a/mojo/services/window_manager/DEPS
+++ b/mojo/services/window_manager/DEPS
@@ -2,6 +2,7 @@
"+mojo/aura",
"+mojo/application",
"+mojo/application_manager",
+ "+mojo/converters/input_events",
"+mojo/services/native_viewport",
"+mojo/services/public",
"+ui/aura",
diff --git a/mojo/services/window_manager/main.cc b/mojo/services/window_manager/main.cc
index ea0edb1..3e2d37c 100644
--- a/mojo/services/window_manager/main.cc
+++ b/mojo/services/window_manager/main.cc
@@ -9,8 +9,8 @@
#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
-#include "mojo/services/public/cpp/view_manager/window_manager_delegate.h"
#include "mojo/services/window_manager/window_manager_app.h"
+#include "mojo/services/window_manager/window_manager_delegate.h"
// ApplicationDelegate implementation file for WindowManager users (e.g.
// core window manager tests) that do not want to provide their own
@@ -46,7 +46,6 @@
scoped_ptr<ServiceProvider> imported_services) override {
view_manager_ = view_manager;
root_ = root;
- view_manager_->SetWindowManagerDelegate(this);
}
virtual void OnViewManagerDisconnected(ViewManager* view_manager) override {}
@@ -59,7 +58,6 @@
view->Embed(url, scoped_ptr<mojo::ServiceProviderImpl>(
new mojo::ServiceProviderImpl).Pass());
}
- virtual void DispatchEvent(EventPtr event) override {}
scoped_ptr<WindowManagerApp> window_manager_app_;
diff --git a/mojo/services/window_manager/window_manager_api_unittest.cc b/mojo/services/window_manager/window_manager_api_unittest.cc
index 49bd98e..690845e 100644
--- a/mojo/services/window_manager/window_manager_api_unittest.cc
+++ b/mojo/services/window_manager/window_manager_api_unittest.cc
@@ -15,7 +15,7 @@
#include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
-#include "mojo/services/public/interfaces/window_manager/window_manager.mojom.h"
+#include "mojo/services/public/interfaces/window_manager2/window_manager2.mojom.h"
#include "mojo/shell/shell_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -47,7 +47,7 @@
return result;
}
-class TestWindowManagerClient : public WindowManagerClient {
+class TestWindowManagerClient : public WindowManagerClient2 {
public:
typedef base::Callback<void(Id, Id)>
TwoNodeCallback;
@@ -192,7 +192,7 @@
return window_manager_client_.get();
}
- WindowManagerServicePtr window_manager_;
+ WindowManagerService2Ptr window_manager_;
private:
// Overridden from testing::Test:
diff --git a/mojo/services/window_manager/window_manager_app.cc b/mojo/services/window_manager/window_manager_app.cc
index 3f4c5f0..ffd80a8 100644
--- a/mojo/services/window_manager/window_manager_app.cc
+++ b/mojo/services/window_manager/window_manager_app.cc
@@ -7,10 +7,10 @@
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "mojo/aura/aura_init.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
-#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
#include "mojo/services/public/cpp/view_manager/view.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "ui/aura/window.h"
@@ -81,12 +81,14 @@
ViewManagerDelegate* view_manager_delegate,
WindowManagerDelegate* window_manager_delegate)
: shell_(nullptr),
+ window_manager_service2_factory_(this),
window_manager_service_factory_(this),
wrapped_view_manager_delegate_(view_manager_delegate),
- wrapped_window_manager_delegate_(window_manager_delegate),
+ window_manager_delegate_(window_manager_delegate),
view_manager_(NULL),
root_(NULL),
- dummy_delegate_(new DummyDelegate) {
+ dummy_delegate_(new DummyDelegate),
+ window_manager_client_(nullptr) {
}
WindowManagerApp::~WindowManagerApp() {}
@@ -101,12 +103,12 @@
return it != view_id_to_window_map_.end() ? it->second : NULL;
}
-void WindowManagerApp::AddConnection(WindowManagerServiceImpl* connection) {
+void WindowManagerApp::AddConnection(WindowManagerService2Impl* connection) {
DCHECK(connections_.find(connection) == connections_.end());
connections_.insert(connection);
}
-void WindowManagerApp::RemoveConnection(WindowManagerServiceImpl* connection) {
+void WindowManagerApp::RemoveConnection(WindowManagerService2Impl* connection) {
DCHECK(connections_.find(connection) != connections_.end());
connections_.erase(connection);
}
@@ -157,8 +159,9 @@
bool WindowManagerApp::ConfigureIncomingConnection(
ApplicationConnection* connection) {
- connection->AddService(&window_manager_service_factory_);
+ connection->AddService(&window_manager_service2_factory_);
connection->AddService(view_manager_client_factory_.get());
+ connection->AddService(&window_manager_service_factory_);
return true;
}
@@ -171,7 +174,6 @@
scoped_ptr<ServiceProvider> imported_services) {
DCHECK(!view_manager_ && !root_);
view_manager_ = view_manager;
- view_manager_->SetWindowManagerDelegate(this);
root_ = root;
window_tree_host_.reset(new WindowTreeHostMojo(shell_, root_));
@@ -204,22 +206,6 @@
}
////////////////////////////////////////////////////////////////////////////////
-// WindowManagerApp, WindowManagerDelegate implementation:
-
-void WindowManagerApp::Embed(
- const String& url,
- InterfaceRequest<ServiceProvider> service_provider) {
- if (wrapped_window_manager_delegate_)
- wrapped_window_manager_delegate_->Embed(url, service_provider.Pass());
-}
-
-void WindowManagerApp::DispatchEvent(EventPtr event) {
- scoped_ptr<ui::Event> ui_event = event.To<scoped_ptr<ui::Event> >();
- if (ui_event)
- window_tree_host_->SendEventToProcessor(ui_event.get());
-}
-
-////////////////////////////////////////////////////////////////////////////////
// WindowManagerApp, ViewObserver implementation:
void WindowManagerApp::OnTreeChanged(
@@ -243,9 +229,11 @@
}
}
-void WindowManagerApp::OnViewDestroyed(View* view) {
- if (view != root_)
+void WindowManagerApp::OnViewDestroying(View* view) {
+ if (view != root_) {
+ Unregister(view);
return;
+ }
aura::Window* window = GetWindowForViewId(view->id());
window->RemovePreTargetHandler(this);
root_ = NULL;
@@ -268,8 +256,15 @@
// WindowManagerApp, ui::EventHandler implementation:
void WindowManagerApp::OnEvent(ui::Event* event) {
- aura::Window* window = static_cast<aura::Window*>(event->target());
- view_manager_->DispatchEvent(GetViewForWindow(window), Event::From(*event));
+ if (!window_manager_client_)
+ return;
+
+ View* view = GetViewForWindow(static_cast<aura::Window*>(event->target()));
+ if (!view)
+ return;
+
+ window_manager_client_->DispatchInputEventToView(view->id(),
+ Event::From(*event));
}
////////////////////////////////////////////////////////////////////////////////
@@ -324,14 +319,24 @@
}
void WindowManagerApp::UnregisterSubtree(View* view) {
- view->RemoveObserver(this);
+ for (View* child : view->children())
+ UnregisterSubtree(child);
+ Unregister(view);
+}
+
+void WindowManagerApp::Unregister(View* view) {
ViewIdToWindowMap::iterator it = view_id_to_window_map_.find(view->id());
+ if (it == view_id_to_window_map_.end()) {
+ // Because we unregister in OnViewDestroying() we can still get a subsequent
+ // OnTreeChanged for the same view. Ignore this one.
+ return;
+ }
+ view->RemoveObserver(this);
DCHECK(it != view_id_to_window_map_.end());
- scoped_ptr<aura::Window> window(it->second);
+ // Delete before we remove from map as destruction may want to look up view
+ // for window.
+ delete it->second;
view_id_to_window_map_.erase(it);
- View::Children::const_iterator child = view->children().begin();
- for (; child != view->children().end(); ++child)
- UnregisterSubtree(*child);
}
} // namespace mojo
diff --git a/mojo/services/window_manager/window_manager_app.h b/mojo/services/window_manager/window_manager_app.h
index c168a16..8c9c244 100644
--- a/mojo/services/window_manager/window_manager_app.h
+++ b/mojo/services/window_manager/window_manager_app.h
@@ -16,7 +16,7 @@
#include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
-#include "mojo/services/public/cpp/view_manager/window_manager_delegate.h"
+#include "mojo/services/window_manager/window_manager_service2_impl.h"
#include "mojo/services/window_manager/window_manager_service_impl.h"
#include "ui/aura/client/focus_change_observer.h"
#include "ui/events/event_handler.h"
@@ -39,8 +39,9 @@
class AuraInit;
class DummyDelegate;
-class WindowManagerServiceImpl;
-class WindowTreeHostMojo;
+class WindowManagerClient;
+class WindowManagerDelegate;
+class WindowManagerService2Impl;
// Implements core window manager functionality that could conceivably be shared
// across multiple window managers implementing superficially different user
@@ -56,7 +57,6 @@
class WindowManagerApp
: public ApplicationDelegate,
public ViewManagerDelegate,
- public WindowManagerDelegate,
public ViewObserver,
public ui::EventHandler,
public aura::client::FocusChangeObserver,
@@ -70,8 +70,8 @@
aura::Window* GetWindowForViewId(Id view);
// Register/deregister new connections to the window manager service.
- void AddConnection(WindowManagerServiceImpl* connection);
- void RemoveConnection(WindowManagerServiceImpl* connection);
+ void AddConnection(WindowManagerService2Impl* connection);
+ void RemoveConnection(WindowManagerService2Impl* connection);
// These are canonical implementations of the window manager API methods.
void SetCapture(Id view);
@@ -82,17 +82,25 @@
// A client of this object will use this accessor to gain access to the
// aura::Window hierarchy and attach event handlers.
- aura::WindowTreeHost* host() { return window_tree_host_.get(); }
+ WindowTreeHostMojo* host() { return window_tree_host_.get(); }
+
+ WindowManagerDelegate* window_manager_delegate() {
+ return window_manager_delegate_;
+ }
void InitFocus(wm::FocusRules* rules);
+ void set_window_manager_client(WindowManagerClient* client) {
+ window_manager_client_ = client;
+ }
+
// Overridden from ApplicationDelegate:
virtual void Initialize(ApplicationImpl* impl) override;
virtual bool ConfigureIncomingConnection(
ApplicationConnection* connection) override;
private:
- typedef std::set<WindowManagerServiceImpl*> Connections;
+ typedef std::set<WindowManagerService2Impl*> Connections;
typedef std::map<Id, aura::Window*> ViewIdToWindowMap;
// Overridden from ViewManagerDelegate:
@@ -102,16 +110,10 @@
scoped_ptr<ServiceProvider> imported_services) override;
virtual void OnViewManagerDisconnected(ViewManager* view_manager) override;
- // Overridden from WindowManagerDelegate:
- virtual void Embed(
- const String& url,
- InterfaceRequest<ServiceProvider> service_provider) override;
- virtual void DispatchEvent(EventPtr event) override;
-
// Overridden from ViewObserver:
virtual void OnTreeChanged(
const ViewObserver::TreeChangeParams& params) override;
- virtual void OnViewDestroyed(View* view) override;
+ virtual void OnViewDestroying(View* view) override;
virtual void OnViewBoundsChanged(View* view,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override;
@@ -132,17 +134,22 @@
// GetWindowForViewId().
// TODO(beng): perhaps View should have a property bag.
void RegisterSubtree(View* view, aura::Window* parent);
+ // Recursively invokes Unregister() for |view| and all its descendants.
+ void UnregisterSubtree(View* view);
// Deletes the aura::Windows associated with the hierarchy beneath |id|,
// and removes from the registry.
- void UnregisterSubtree(View* view);
+ void Unregister(View* view);
Shell* shell_;
+ InterfaceFactoryImplWithContext<WindowManagerService2Impl, WindowManagerApp>
+ window_manager_service2_factory_;
+
InterfaceFactoryImplWithContext<WindowManagerServiceImpl, WindowManagerApp>
window_manager_service_factory_;
ViewManagerDelegate* wrapped_view_manager_delegate_;
- WindowManagerDelegate* wrapped_window_manager_delegate_;
+ WindowManagerDelegate* window_manager_delegate_;
ViewManager* view_manager_;
scoped_ptr<ViewManagerClientFactory> view_manager_client_factory_;
@@ -160,6 +167,8 @@
scoped_ptr<DummyDelegate> dummy_delegate_;
+ WindowManagerClient* window_manager_client_;
+
DISALLOW_COPY_AND_ASSIGN(WindowManagerApp);
};
diff --git a/mojo/services/window_manager/window_manager_delegate.h b/mojo/services/window_manager/window_manager_delegate.h
new file mode 100644
index 0000000..72d7d92
--- /dev/null
+++ b/mojo/services/window_manager/window_manager_delegate.h
@@ -0,0 +1,25 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_DELEGATE_H_
+#define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_DELEGATE_H_
+
+#include "mojo/public/cpp/bindings/string.h"
+#include "mojo/public/interfaces/application/service_provider.mojom.h"
+
+namespace mojo {
+
+class WindowManagerDelegate {
+ public:
+ // See WindowManager::Embed() for details.
+ virtual void Embed(const String& url,
+ InterfaceRequest<ServiceProvider> service_provider) = 0;
+
+ protected:
+ virtual ~WindowManagerDelegate() {}
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_DELEGATE_H_
diff --git a/mojo/services/window_manager/window_manager_service2_impl.cc b/mojo/services/window_manager/window_manager_service2_impl.cc
new file mode 100644
index 0000000..e00c987
--- /dev/null
+++ b/mojo/services/window_manager/window_manager_service2_impl.cc
@@ -0,0 +1,80 @@
+
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/window_manager/window_manager_service2_impl.h"
+
+#include "mojo/services/window_manager/window_manager_app.h"
+
+namespace mojo {
+
+////////////////////////////////////////////////////////////////////////////////
+// WindowManagerService2Impl, public:
+
+WindowManagerService2Impl::WindowManagerService2Impl(
+ WindowManagerApp* window_manager)
+ : window_manager_(window_manager) {
+ window_manager_->AddConnection(this);
+}
+
+WindowManagerService2Impl::~WindowManagerService2Impl() {
+ window_manager_->RemoveConnection(this);
+}
+
+void WindowManagerService2Impl::NotifyReady() {
+ client()->OnWindowManagerReady();
+}
+
+void WindowManagerService2Impl::NotifyViewFocused(Id new_focused_id,
+ Id old_focused_id) {
+ client()->OnFocusChanged(old_focused_id, new_focused_id);
+}
+
+void WindowManagerService2Impl::NotifyWindowActivated(Id new_active_id,
+ Id old_active_id) {
+ client()->OnActiveWindowChanged(old_active_id, new_active_id);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// WindowManagerService2Impl, WindowManager implementation:
+
+void WindowManagerService2Impl::SetCapture(
+ Id view,
+ const Callback<void(bool)>& callback) {
+ bool success = window_manager_->IsReady();
+ if (success)
+ window_manager_->SetCapture(view);
+ callback.Run(success);
+}
+
+void WindowManagerService2Impl::FocusWindow(
+ Id view,
+ const Callback<void(bool)>& callback) {
+ bool success = window_manager_->IsReady();
+ if (success)
+ window_manager_->FocusWindow(view);
+ callback.Run(success);
+}
+
+void WindowManagerService2Impl::ActivateWindow(
+ Id view,
+ const Callback<void(bool)>& callback) {
+ bool success = window_manager_->IsReady();
+ if (success)
+ window_manager_->ActivateWindow(view);
+ callback.Run(success);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// WindowManagerService2Impl, InterfaceImpl overrides:
+
+void WindowManagerService2Impl::OnConnectionEstablished() {
+ // If the connection was established prior to the window manager being
+ // embedded by the view manager, |window_manager_|'s ViewManagerDelegate
+ // impl will call NotifyReady() when it is.
+ if (window_manager_->IsReady())
+ NotifyReady();
+}
+
+} // namespace mojo
diff --git a/mojo/services/window_manager/window_manager_service2_impl.h b/mojo/services/window_manager/window_manager_service2_impl.h
new file mode 100644
index 0000000..be129b4
--- /dev/null
+++ b/mojo/services/window_manager/window_manager_service2_impl.h
@@ -0,0 +1,44 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_SERVICE2_IMPL_H_
+#define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_SERVICE2_IMPL_H_
+
+#include "base/basictypes.h"
+#include "mojo/services/public/cpp/view_manager/types.h"
+#include "mojo/services/public/interfaces/window_manager2/window_manager2.mojom.h"
+
+namespace mojo {
+
+class WindowManagerApp;
+
+class WindowManagerService2Impl : public InterfaceImpl<WindowManagerService2> {
+ public:
+ explicit WindowManagerService2Impl(WindowManagerApp* manager);
+ virtual ~WindowManagerService2Impl();
+
+ void NotifyReady();
+ void NotifyViewFocused(Id new_focused_id, Id old_focused_id);
+ void NotifyWindowActivated(Id new_active_id, Id old_active_id);
+
+ private:
+ // Overridden from WindowManagerService:
+ virtual void SetCapture(Id view,
+ const Callback<void(bool)>& callback) override;
+ virtual void FocusWindow(Id view,
+ const Callback<void(bool)>& callback) override;
+ virtual void ActivateWindow(Id view,
+ const Callback<void(bool)>& callback) override;
+
+ // Overridden from InterfaceImpl:
+ virtual void OnConnectionEstablished() override;
+
+ WindowManagerApp* window_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowManagerService2Impl);
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_SERVICE2_IMPL_H_
diff --git a/mojo/services/window_manager/window_manager_service_impl.cc b/mojo/services/window_manager/window_manager_service_impl.cc
index aa1be19..2ceee5c 100644
--- a/mojo/services/window_manager/window_manager_service_impl.cc
+++ b/mojo/services/window_manager/window_manager_service_impl.cc
@@ -1,80 +1,37 @@
-
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/services/window_manager/window_manager_service_impl.h"
+#include "mojo/aura/window_tree_host_mojo.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
#include "mojo/services/window_manager/window_manager_app.h"
+#include "mojo/services/window_manager/window_manager_delegate.h"
namespace mojo {
-////////////////////////////////////////////////////////////////////////////////
-// WindowManagerServiceImpl, public:
-
-WindowManagerServiceImpl::WindowManagerServiceImpl(
- WindowManagerApp* window_manager)
- : window_manager_(window_manager) {
- window_manager_->AddConnection(this);
+WindowManagerServiceImpl::WindowManagerServiceImpl(WindowManagerApp* app)
+ : app_(app) {
}
WindowManagerServiceImpl::~WindowManagerServiceImpl() {
- window_manager_->RemoveConnection(this);
}
-void WindowManagerServiceImpl::NotifyReady() {
- client()->OnWindowManagerReady();
+void WindowManagerServiceImpl::Embed(
+ const String& url,
+ InterfaceRequest<ServiceProvider> service_provider) {
+ app_->window_manager_delegate()->Embed(url, service_provider.Pass());
}
-void WindowManagerServiceImpl::NotifyViewFocused(Id new_focused_id,
- Id old_focused_id) {
- client()->OnFocusChanged(old_focused_id, new_focused_id);
+void WindowManagerServiceImpl::OnViewInputEvent(mojo::EventPtr event) {
+ scoped_ptr<ui::Event> ui_event = event.To<scoped_ptr<ui::Event>>();
+ if (ui_event)
+ app_->host()->SendEventToProcessor(ui_event.get());
}
-void WindowManagerServiceImpl::NotifyWindowActivated(Id new_active_id,
- Id old_active_id) {
- client()->OnActiveWindowChanged(old_active_id, new_active_id);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// WindowManagerServiceImpl, WindowManager implementation:
-
-void WindowManagerServiceImpl::SetCapture(
- Id view,
- const Callback<void(bool)>& callback) {
- bool success = window_manager_->IsReady();
- if (success)
- window_manager_->SetCapture(view);
- callback.Run(success);
-}
-
-void WindowManagerServiceImpl::FocusWindow(
- Id view,
- const Callback<void(bool)>& callback) {
- bool success = window_manager_->IsReady();
- if (success)
- window_manager_->FocusWindow(view);
- callback.Run(success);
-}
-
-void WindowManagerServiceImpl::ActivateWindow(
- Id view,
- const Callback<void(bool)>& callback) {
- bool success = window_manager_->IsReady();
- if (success)
- window_manager_->ActivateWindow(view);
- callback.Run(success);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// WindowManagerServiceImpl, InterfaceImpl overrides:
-
void WindowManagerServiceImpl::OnConnectionEstablished() {
- // If the connection was established prior to the window manager being
- // embedded by the view manager, |window_manager_|'s ViewManagerDelegate
- // impl will call NotifyReady() when it is.
- if (window_manager_->IsReady())
- NotifyReady();
+ app_->set_window_manager_client(client());
}
} // namespace mojo
diff --git a/mojo/services/window_manager/window_manager_service_impl.h b/mojo/services/window_manager/window_manager_service_impl.h
index 2d662e4..ba2d29e 100644
--- a/mojo/services/window_manager/window_manager_service_impl.h
+++ b/mojo/services/window_manager/window_manager_service_impl.h
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_SERVICE_IMPL_H_
-#define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_SERVICE_IMPL_H_
+#ifndef MOJO_SERVICES_WINDOW_MANAGER_WNDOW_MANAGER_SERVICE_IMPL_H_
+#define MOJO_SERVICES_WINDOW_MANAGER_WNDOW_MANAGER_SERVICE_IMPL_H_
#include "base/basictypes.h"
-#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/interfaces/window_manager/window_manager.mojom.h"
namespace mojo {
@@ -15,30 +14,24 @@
class WindowManagerServiceImpl : public InterfaceImpl<WindowManagerService> {
public:
- explicit WindowManagerServiceImpl(WindowManagerApp* manager);
+ explicit WindowManagerServiceImpl(WindowManagerApp* app);
virtual ~WindowManagerServiceImpl();
- void NotifyReady();
- void NotifyViewFocused(Id new_focused_id, Id old_focused_id);
- void NotifyWindowActivated(Id new_active_id, Id old_active_id);
-
private:
- // Overridden from WindowManagerService:
- virtual void SetCapture(Id view,
- const Callback<void(bool)>& callback) override;
- virtual void FocusWindow(Id view,
- const Callback<void(bool)>& callback) override;
- virtual void ActivateWindow(Id view,
- const Callback<void(bool)>& callback) override;
+ // WindowManagerServiceImpl:
+ virtual void Embed(
+ const String& url,
+ InterfaceRequest<ServiceProvider> service_provider) override;
+ virtual void OnViewInputEvent(mojo::EventPtr event) override;
- // Overridden from InterfaceImpl:
+ // InterfaceImpl:
virtual void OnConnectionEstablished() override;
- WindowManagerApp* window_manager_;
+ WindowManagerApp* app_;
DISALLOW_COPY_AND_ASSIGN(WindowManagerServiceImpl);
};
} // namespace mojo
-#endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_SERVICE_IMPL_H_
+#endif // MOJO_SERVICES_WINDOW_MANAGER_WNDOW_MANAGER_SERVICE_IMPL_H_
diff --git a/mojo/shell/BUILD.gn b/mojo/shell/BUILD.gn
index f405bc9..c435a75 100644
--- a/mojo/shell/BUILD.gn
+++ b/mojo/shell/BUILD.gn
@@ -148,6 +148,7 @@
"child_process_host_unittest.cc",
"dynamic_application_loader_unittest.cc",
"in_process_dynamic_service_runner_unittest.cc",
+ "mojo_url_resolver_unittest.cc",
"shell_test_base.cc",
"shell_test_base.h",
"shell_test_base_unittest.cc",
diff --git a/mojo/shell/context.cc b/mojo/shell/context.cc
index e1c8d53..e63a709 100644
--- a/mojo/shell/context.cc
+++ b/mojo/shell/context.cc
@@ -219,6 +219,9 @@
spy_.reset(
new mojo::Spy(&application_manager_,
command_line->GetSwitchValueASCII(switches::kSpy)));
+ // TODO(cpu): the spy can snoop, but can't tell anybody until
+ // the Spy::WebSocketDelegate is implemented. In the original repo this
+ // was implemented by src\mojo\spy\websocket_server.h and .cc.
}
#if defined(OS_ANDROID)
diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc
index 0331d3e..4738e3c 100644
--- a/mojo/shell/desktop/mojo_main.cc
+++ b/mojo/shell/desktop/mojo_main.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+#include <iostream>
+
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -12,6 +15,7 @@
#include "mojo/shell/child_process.h"
#include "mojo/shell/context.h"
#include "mojo/shell/init.h"
+#include "mojo/shell/mojo_url_resolver.h"
#include "mojo/shell/switches.h"
#if defined(COMPONENT_BUILD)
@@ -35,14 +39,21 @@
}
#endif
+bool is_empty(const std::string& s) {
+ return s.empty();
+}
+
// The value of app_url_and_args is "<mojo_app_url> [<args>...]", where args
// is a list of "configuration" arguments separated by spaces. If one or more
// arguments are specified they will be available when the Mojo application
// is initialized. See ApplicationImpl::args().
GURL GetAppURLAndSetArgs(const base::CommandLine::StringType& app_url_and_args,
mojo::shell::Context* context) {
+ // SplitString() returns empty strings for extra delimeter characters (' ').
std::vector<std::string> argv;
SplitString(app_url_and_args, &argv);
+ argv.erase(std::remove_if(argv.begin(), argv.end(), is_empty), argv.end());
+
if (argv.empty())
return GURL::EmptyGURL();
GURL app_url(argv[0]);
@@ -57,11 +68,57 @@
context->Run(GetAppURLAndSetArgs(arg, context));
}
+void Usage() {
+ std::cerr << "Launch Mojo applications.\n";
+ std::cerr
+ << "Usage: mojo_shell"
+ << " [--" << switches::kArgsFor << "=<mojo-app>]"
+ << " [--" << switches::kContentHandlers << "=<handlers>]"
+ << " [--" << switches::kEnableExternalApplications << "]"
+ << " [--" << switches::kDisableCache << "]"
+ << " [--" << switches::kEnableMultiprocess << "]"
+ << " [--" << switches::kOrigin << "=<url-lib-path>]"
+ << " [--" << switches::kURLMappings << "=from1=to1,from2=to2]"
+ << " <mojo-app> ...\n\n"
+ << "A <mojo-app> is a Mojo URL or a Mojo URL and arguments within "
+ << "quotes.\n"
+ << "Example: mojo_shell \"mojo://mojo_js_standalone test.js\".\n"
+ << "<url-lib-path> is searched for shared libraries named by mojo URLs.\n"
+ << "The value of <handlers> is a comma separated list like:\n"
+ << "text/html,mojo://mojo_html_viewer,"
+ << "application/javascript,mojo://mojo_js_content_handler\n";
+}
+
+bool ConfigureURLMappings(const std::string& mappings,
+ mojo::shell::MojoURLResolver* resolver) {
+ base::StringPairs pairs;
+ if (!base::SplitStringIntoKeyValuePairs(mappings, '=', ',', &pairs))
+ return false;
+ using StringPair = std::pair<std::string, std::string>;
+ for (const StringPair& pair : pairs) {
+ const GURL from(pair.first);
+ const GURL to(pair.second);
+ if (!from.is_valid() || !to.is_valid())
+ return false;
+ resolver->AddCustomMapping(from, to);
+ }
+ return true;
+}
+
} // namespace
int main(int argc, char** argv) {
base::AtExitManager at_exit;
base::CommandLine::Init(argc, argv);
+
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kHelp) ||
+ command_line.GetArgs().empty()){
+ Usage();
+ return 0;
+ }
+
#if defined(OS_LINUX)
// We use gfx::RenderText from multiple threads concurrently and the pango
// backend (currently the default on linux) is not close to threadsafe. Force
@@ -87,13 +144,19 @@
base::MessageLoop message_loop;
shell_context.Init();
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kOrigin)) {
shell_context.mojo_url_resolver()->SetBaseURL(
GURL(command_line.GetSwitchValueASCII(switches::kOrigin)));
}
+ if (command_line.HasSwitch(switches::kURLMappings) &&
+ !ConfigureURLMappings(
+ command_line.GetSwitchValueASCII(switches::kURLMappings),
+ shell_context.mojo_url_resolver())) {
+ Usage();
+ return 0;
+ }
+
for (const auto& kv : command_line.GetSwitches()) {
if (kv.first == switches::kArgsFor)
GetAppURLAndSetArgs(kv.second, &shell_context);
diff --git a/mojo/shell/mojo_url_resolver.cc b/mojo/shell/mojo_url_resolver.cc
index c399854..75c625c 100644
--- a/mojo/shell/mojo_url_resolver.cc
+++ b/mojo/shell/mojo_url_resolver.cc
@@ -70,14 +70,16 @@
}
GURL MojoURLResolver::Resolve(const GURL& mojo_url) const {
- std::map<GURL, GURL>::const_iterator it = url_map_.find(mojo_url);
- if (it != url_map_.end())
- return it->second;
+ const GURL mapped_url(ApplyCustomMappings(mojo_url));
- std::string lib = MakeSharedLibraryName(mojo_url.host());
+ // Continue resolving if the mapped url is a mojo: url.
+ if (mapped_url.scheme() != "mojo")
+ return mapped_url;
+
+ std::string lib = MakeSharedLibraryName(mapped_url.host());
if (!base_url_.is_valid() ||
- local_file_set_.find(mojo_url) != local_file_set_.end()) {
+ local_file_set_.find(mapped_url) != local_file_set_.end()) {
// Resolve to a local file URL.
return default_base_url_.Resolve(lib);
}
@@ -86,5 +88,16 @@
return base_url_.Resolve(lib);
}
+GURL MojoURLResolver::ApplyCustomMappings(const GURL& url) const {
+ GURL mapped_url(url);
+ for (;;) {
+ std::map<GURL, GURL>::const_iterator it = url_map_.find(mapped_url);
+ if (it == url_map_.end())
+ break;
+ mapped_url = it->second;
+ }
+ return mapped_url;
+}
+
} // namespace shell
} // namespace mojo
diff --git a/mojo/shell/mojo_url_resolver.h b/mojo/shell/mojo_url_resolver.h
index ccd9bf4..b7145dd 100644
--- a/mojo/shell/mojo_url_resolver.h
+++ b/mojo/shell/mojo_url_resolver.h
@@ -8,6 +8,7 @@
#include <map>
#include <set>
+#include "base/basictypes.h"
#include "url/gurl.h"
namespace mojo {
@@ -27,7 +28,8 @@
// inserted.
void SetBaseURL(const GURL& base_url);
- // Add a custom mapping for a particular "mojo:" URL.
+ // Add a custom mapping for a particular "mojo:" URL. If |resolved_url| is
+ // itself a mojo url normal resolution rules apply.
void AddCustomMapping(const GURL& mojo_url, const GURL& resolved_url);
// Add a local file mapping for a particular "mojo:" URL. This causes the
@@ -39,10 +41,17 @@
GURL Resolve(const GURL& mojo_url) const;
private:
+ // Applies all custom mappings for |url|, returning the last non-mapped url.
+ // For example, if 'a' maps to 'b' and 'b' maps to 'c' calling this with 'a'
+ // returns 'c'.
+ GURL ApplyCustomMappings(const GURL& url) const;
+
std::map<GURL, GURL> url_map_;
std::set<GURL> local_file_set_;
GURL default_base_url_;
GURL base_url_;
+
+ DISALLOW_COPY_AND_ASSIGN(MojoURLResolver);
};
} // namespace shell
diff --git a/mojo/shell/mojo_url_resolver_unittest.cc b/mojo/shell/mojo_url_resolver_unittest.cc
new file mode 100644
index 0000000..e4deffa
--- /dev/null
+++ b/mojo/shell/mojo_url_resolver_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/shell/mojo_url_resolver.h"
+
+#include "base/logging.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mojo {
+namespace shell {
+namespace test {
+namespace {
+
+typedef testing::Test MojoURLResolverTest;
+
+TEST_F(MojoURLResolverTest, MojoURLsFallThrough) {
+ MojoURLResolver resolver;
+ resolver.AddCustomMapping(GURL("mojo:test"), GURL("mojo:foo"));
+ const GURL base_url("file:/base");
+ resolver.SetBaseURL(base_url);
+ const std::string resolved(resolver.Resolve(GURL("mojo:test")).spec());
+ // Resolved must start with |base_url|.
+ EXPECT_EQ(base_url.spec(), resolved.substr(0, base_url.spec().size()));
+ // And must contain foo (which is what test mapped to.
+ EXPECT_NE(std::string::npos, resolved.find("foo"));
+}
+
+} // namespace
+} // namespace test
+} // namespace shell
+} // namespace mojo
diff --git a/mojo/shell/switches.cc b/mojo/shell/switches.cc
index 61a93e2..ee3ee51 100644
--- a/mojo/shell/switches.cc
+++ b/mojo/shell/switches.cc
@@ -32,6 +32,9 @@
// change it to "single-process") when it works.
const char kEnableMultiprocess[] = "enable-multiprocess";
+// Print the usage message and exit.
+const char kHelp[] = "help";
+
// Map mojo: URLs to a shared library of similar name at this origin. See
// mojo_url_resolver.cc for details.
const char kOrigin[] = "origin";
@@ -40,4 +43,10 @@
// message pipes and other activities. This is work in progress.
const char kSpy[] = "spy";
+// Specifies a set of mappings to apply when resolving urls. The value is set of
+// ',' separated mappings, where each mapping consists of a pair of urls giving
+// the to/from url to map. For example, 'a=b,c=d' contains two mappings, the
+// first maps 'a' to 'b' and the second 'c' to 'd'.
+const char kURLMappings[] = "url-mappings";
+
} // namespace switches
diff --git a/mojo/shell/switches.h b/mojo/shell/switches.h
index 33f5946..3381eeb 100644
--- a/mojo/shell/switches.h
+++ b/mojo/shell/switches.h
@@ -8,8 +8,10 @@
namespace switches {
// All switches in alphabetical order. The switches should be documented
-// alongside the definition of their values in the .cc file.
+// alongside the definition of their values in the .cc file and, as needed,
+// in mojo_main's Usage() function.
extern const char kArgsFor[];
+extern const char kHelp[];
extern const char kChildProcessType[];
extern const char kContentHandlers[];
extern const char kDisableCache[];
@@ -17,6 +19,8 @@
extern const char kEnableMultiprocess[];
extern const char kOrigin[];
extern const char kSpy[];
+extern const char kURLMappings[];
+
} // namespace switches
#endif // MOJO_SHELL_SWITCHES_H_
diff --git a/mojo/spy/spy.cc b/mojo/spy/spy.cc
index 67ae56a..4049fd6 100644
--- a/mojo/spy/spy.cc
+++ b/mojo/spy/spy.cc
@@ -22,13 +22,10 @@
#include "mojo/spy/common.h"
#include "mojo/spy/public/spy.mojom.h"
#include "mojo/spy/spy_server_impl.h"
-#include "mojo/spy/websocket_server.h"
#include "url/gurl.h"
namespace {
-mojo::WebSocketServer* ws_server = NULL;
-
const size_t kMessageBufSize = 2 * 1024;
const size_t kHandleBufSize = 64;
const int kDefaultWebSocketPort = 42424;
@@ -43,9 +40,11 @@
class MessageProcessor :
public base::RefCountedThreadSafe<MessageProcessor> {
public:
- MessageProcessor(base::MessageLoopProxy* control_loop_proxy)
+ MessageProcessor(mojo::Spy::WebSocketDelegate* websocket_delegate,
+ base::MessageLoopProxy* control_loop_proxy)
: last_result_(MOJO_RESULT_OK),
bytes_transfered_(0),
+ websocket_delegate_(websocket_delegate),
control_loop_proxy_(control_loop_proxy) {
message_count_[0] = 0;
message_count_[1] = 0;
@@ -115,10 +114,10 @@
base::WorkerPool::PostTask(
FROM_HERE,
base::Bind(&MessageProcessor::Start,
- this,
- base::Passed(&message_pipe_handle),
- base::Passed(&interceptor),
- url),
+ this,
+ base::Passed(&message_pipe_handle),
+ base::Passed(&interceptor),
+ url),
true);
hbuf.get()[i] = faux_client.release().value();
}
@@ -203,14 +202,19 @@
}
void LogMessageInfo(void* data, const GURL& url) {
+ if (!websocket_delegate_)
+ return;
+
mojo::MojoMessageData* message_data =
reinterpret_cast<mojo::MojoMessageData*>(data);
if (IsValidMessage(message_data->header)) {
control_loop_proxy_->PostTask(
FROM_HERE,
- base::Bind(&mojo::WebSocketServer::LogMessageInfo,
- base::Unretained(ws_server),
- message_data->header, url, base::Time::Now()));
+ base::Bind(&mojo::Spy::WebSocketDelegate::OnMessage,
+ base::Unretained(websocket_delegate_),
+ message_data,
+ url,
+ base::Time::Now()));
}
}
@@ -218,6 +222,7 @@
uint32_t bytes_transfered_;
uint32_t message_count_[2];
uint32_t handle_count_[2];
+ mojo::Spy::WebSocketDelegate* websocket_delegate_;
scoped_refptr<base::MessageLoopProxy> control_loop_proxy_;
};
@@ -226,10 +231,12 @@
public:
explicit SpyInterceptor(
scoped_refptr<mojo::SpyServerImpl> spy_server,
- const scoped_refptr<base::MessageLoopProxy>& control_loop_proxy)
+ const scoped_refptr<base::MessageLoopProxy>& control_loop_proxy,
+ mojo::Spy::WebSocketDelegate* websocket_delegate)
: spy_server_(spy_server),
proxy_(base::MessageLoopProxy::current()),
- control_loop_proxy_(control_loop_proxy) {}
+ control_loop_proxy_(control_loop_proxy),
+ websocket_delegate_(websocket_delegate) {}
private:
virtual mojo::ServiceProviderPtr OnConnectToClient(
@@ -247,7 +254,7 @@
CreateMessagePipe(NULL, &faux_client, &interceptor);
scoped_refptr<MessageProcessor> processor =
- new MessageProcessor(control_loop_proxy_.get());
+ new MessageProcessor(websocket_delegate_, control_loop_proxy_.get());
mojo::ScopedMessagePipeHandle real_handle = real_client.PassMessagePipe();
base::WorkerPool::PostTask(
FROM_HERE,
@@ -273,13 +280,12 @@
scoped_refptr<mojo::SpyServerImpl> spy_server_;
scoped_refptr<base::MessageLoopProxy> proxy_;
scoped_refptr<base::MessageLoopProxy> control_loop_proxy_;
+ mojo::Spy::WebSocketDelegate* websocket_delegate_;
};
-void StartWebServer(int port, mojo::ScopedMessagePipeHandle pipe) {
- // TODO(cpu) figure out lifetime of the server. See Spy() dtor.
- ws_server = new mojo::WebSocketServer(port, pipe.Pass());
- ws_server->Start();
-}
+} // namespace
+
+namespace mojo {
struct SpyOptions {
int websocket_port;
@@ -306,28 +312,18 @@
return spy_options;
}
-} // namespace
-
-namespace mojo {
-
Spy::Spy(mojo::ApplicationManager* application_manager,
- const std::string& options) {
- SpyOptions spy_options = ProcessOptions(options);
-
+ const std::string& options)
+ : websocket_delegate_(NULL),
+ application_manager_(application_manager),
+ spy_options_(NULL) {
+ spy_options_ = new SpyOptions(ProcessOptions(options));
spy_server_ = new SpyServerImpl();
// Start the tread what will accept commands from the frontend.
control_thread_.reset(new base::Thread("mojo_spy_control_thread"));
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
control_thread_->StartWithOptions(thread_options);
- control_thread_->message_loop_proxy()->PostTask(
- FROM_HERE, base::Bind(&StartWebServer,
- spy_options.websocket_port,
- base::Passed(spy_server_->ServerPipe())));
-
- // Start intercepting mojo services.
- application_manager->SetInterceptor(
- new SpyInterceptor(spy_server_, control_thread_->message_loop_proxy()));
}
Spy::~Spy() {
@@ -335,4 +331,19 @@
// application_manager and the spy is still unclear hence the leak.
}
+void Spy::SetWebSocketDelegate(WebSocketDelegate* websocket_delegate) {
+ DCHECK(websocket_delegate_ == NULL);
+ websocket_delegate_ = websocket_delegate;
+
+ control_thread_->message_loop_proxy()->PostTask(
+ FROM_HERE,
+ base::Bind(&WebSocketDelegate::Start,
+ base::Unretained(websocket_delegate_),
+ spy_options_->websocket_port,
+ base::Passed(spy_server_->ServerPipe())));
+ // Start intercepting mojo services.
+ application_manager_->SetInterceptor(new SpyInterceptor(
+ spy_server_, control_thread_->message_loop_proxy(), websocket_delegate_));
+}
+
} // namespace mojo
diff --git a/mojo/spy/spy.h b/mojo/spy/spy.h
index f2b6be9..8626308 100644
--- a/mojo/spy/spy.h
+++ b/mojo/spy/spy.h
@@ -8,8 +8,12 @@
#include <string>
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "mojo/public/cpp/system/message_pipe.h"
+#include "mojo/spy/common.h"
+#include "url/gurl.h"
namespace base {
+class Time;
class Thread;
}
@@ -17,6 +21,7 @@
class ApplicationManager;
class SpyServerImpl;
+struct SpyOptions;
// mojo::Spy is a troubleshooting and debugging aid. It helps tracking
// the mojo system core activities like messages, service creation, etc.
@@ -29,14 +34,30 @@
//
class Spy {
public:
+ // Interface for the shell-provided websocket server.
+ class WebSocketDelegate {
+ public:
+ virtual void Start(int port, mojo::ScopedMessagePipeHandle server_pipe) = 0;
+ virtual void OnMessage(mojo::MojoMessageData* data,
+ const GURL& url,
+ const base::Time& time) = 0;
+ };
+
Spy(mojo::ApplicationManager* application_manager,
const std::string& options);
~Spy();
+ // non-owning reference to the websocket server.
+ void SetWebSocketDelegate(WebSocketDelegate* websocket_delegate);
+
private:
scoped_refptr<SpyServerImpl> spy_server_;
// This thread runs the code that talks to the frontend.
scoped_ptr<base::Thread> control_thread_;
+ // The delegate is in charge of talking to the html frontend.
+ WebSocketDelegate* websocket_delegate_;
+ ApplicationManager* application_manager_;
+ SpyOptions* spy_options_;
};
} // namespace mojo
diff --git a/mojo/tools/mojob.sh b/mojo/tools/mojob.sh
index e0804d1..2b82d08 100755
--- a/mojo/tools/mojob.sh
+++ b/mojo/tools/mojob.sh
@@ -19,7 +19,7 @@
build - Build.
test - Run unit tests (does not build).
perftest - Run perf tests (does not build).
- pytest - Run Python unit tests.
+ pytest - Run Python unit tests (does not build).
gyp - Run gyp for mojo (does not sync).
gypall - Run gyp for all of chromium (does not sync).
sync - Sync using gclient (does not run gyp).
@@ -66,7 +66,14 @@
}
do_pytests() {
+ echo "Running python tests in out/$1 ..."
python mojo/tools/run_mojo_python_tests.py || exit 1
+ # TODO(qsr) Remove this test when the component build is not supported
+ # anymore.
+ if [ -f "out/$1/python/mojo/system.so" ]; then
+ python mojo/tools/run_mojo_python_bindings_tests.py \
+ "--build-dir=out/$1" || exit 1
+ fi
}
do_gyp() {
@@ -180,7 +187,8 @@
should_do_Release && do_perftests Release
;;
pytest)
- do_pytests
+ should_do_Debug && do_pytests Debug
+ should_do_Release && do_pytests Release
;;
gyp)
set_goma_dir_if_necessary
@@ -236,3 +244,5 @@
;;
esac
done
+
+exit 0
diff --git a/mojo/views/native_widget_view_manager.cc b/mojo/views/native_widget_view_manager.cc
index 9927c89..a9bd40b 100644
--- a/mojo/views/native_widget_view_manager.cc
+++ b/mojo/views/native_widget_view_manager.cc
@@ -5,7 +5,7 @@
#include "mojo/views/native_widget_view_manager.h"
#include "mojo/aura/window_tree_host_mojo.h"
-#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/default_capture_client.h"
#include "ui/aura/window.h"
diff --git a/net/BUILD.gn b/net/BUILD.gn
index 81d59c8..3dcfa6b 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -551,8 +551,6 @@
]
}
-if (false) {
-
static_library("extras") {
sources = gypi_values.net_extras_sources
configs += [ "//build/config/compiler:wexit_time_destructors" ]
@@ -562,8 +560,6 @@
]
}
-} # if (false)
-
static_library("http_server") {
sources = [
"server/http_connection.cc",
@@ -1107,14 +1103,11 @@
test("net_unittests") {
sources = gypi_values.net_test_sources
- sources -= [
- "extras/sqlite/sqlite_channel_id_store_unittest.cc",
- ]
-
configs += [ ":net_win_size_truncation" ]
defines = []
deps = [
+ ":extras",
":http_server",
":net",
":quic_tools",
diff --git a/net/android/java/src/org/chromium/net/DefaultAndroidKeyStore.java b/net/android/java/src/org/chromium/net/DefaultAndroidKeyStore.java
index 167837c..3ee1029 100644
--- a/net/android/java/src/org/chromium/net/DefaultAndroidKeyStore.java
+++ b/net/android/java/src/org/chromium/net/DefaultAndroidKeyStore.java
@@ -109,7 +109,7 @@
signature = Signature.getInstance("NONEwithECDSA");
}
} catch (NoSuchAlgorithmException e) {
- ;
+ // Intentionally do nothing.
}
if (signature == null) {
diff --git a/net/android/java/src/org/chromium/net/ProxyChangeListener.java b/net/android/java/src/org/chromium/net/ProxyChangeListener.java
index 51b6714..be09be4 100644
--- a/net/android/java/src/org/chromium/net/ProxyChangeListener.java
+++ b/net/android/java/src/org/chromium/net/ProxyChangeListener.java
@@ -36,16 +36,21 @@
private Delegate mDelegate;
private static class ProxyConfig {
- public ProxyConfig(String host, int port, String pacUrl) {
+ public ProxyConfig(String host, int port, String pacUrl, String[] exclusionList) {
mHost = host;
mPort = port;
mPacUrl = pacUrl;
+ mExclusionList = exclusionList;
}
public final String mHost;
public final int mPort;
public final String mPacUrl;
+ public final String[] mExclusionList;
}
+ /**
+ * The delegate for ProxyChangeListener. Use for testing.
+ */
public interface Delegate {
public void proxySettingsChanged();
}
@@ -104,6 +109,7 @@
final String getHostName = "getHost";
final String getPortName = "getPort";
final String getPacFileUrl = "getPacFileUrl";
+ final String getExclusionList = "getExclusionList";
String className;
String proxyInfo;
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
@@ -122,27 +128,35 @@
Class<?> cls = Class.forName(className);
Method getHostMethod = cls.getDeclaredMethod(getHostName);
Method getPortMethod = cls.getDeclaredMethod(getPortName);
+ Method getExclusionListMethod = cls.getDeclaredMethod(getExclusionList);
String host = (String) getHostMethod.invoke(props);
int port = (Integer) getPortMethod.invoke(props);
+ String[] exclusionList;
+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
+ String s = (String) getExclusionListMethod.invoke(props);
+ exclusionList = s.split(",");
+ } else {
+ exclusionList = (String[]) getExclusionListMethod.invoke(props);
+ }
// TODO(xunjieli): rewrite this once the API is public.
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
Method getPacFileUrlMethod =
cls.getDeclaredMethod(getPacFileUrl);
String pacFileUrl = (String) getPacFileUrlMethod.invoke(props);
if (!TextUtils.isEmpty(pacFileUrl)) {
- return new ProxyConfig(host, port, pacFileUrl);
+ return new ProxyConfig(host, port, pacFileUrl, exclusionList);
}
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
Method getPacFileUrlMethod =
cls.getDeclaredMethod(getPacFileUrl);
Uri pacFileUrl = (Uri) getPacFileUrlMethod.invoke(props);
if (!Uri.EMPTY.equals(pacFileUrl)) {
- return new ProxyConfig(host, port, pacFileUrl.toString());
+ return new ProxyConfig(host, port, pacFileUrl.toString(), exclusionList);
}
}
- return new ProxyConfig(host, port, null);
+ return new ProxyConfig(host, port, null, exclusionList);
} catch (ClassNotFoundException ex) {
Log.e(TAG, "Using no proxy configuration due to exception:" + ex);
return null;
@@ -175,7 +189,8 @@
// Note that this code currently runs on a MESSAGE_LOOP_UI thread, but
// the C++ code must run the callbacks on the network thread.
if (cfg != null) {
- nativeProxySettingsChangedTo(mNativePtr, cfg.mHost, cfg.mPort, cfg.mPacUrl);
+ nativeProxySettingsChangedTo(mNativePtr, cfg.mHost, cfg.mPort, cfg.mPacUrl,
+ cfg.mExclusionList);
} else {
nativeProxySettingsChanged(mNativePtr);
}
@@ -206,8 +221,8 @@
private native void nativeProxySettingsChangedTo(long nativePtr,
String host,
int port,
- String pacUrl);
-
+ String pacUrl,
+ String[] exclusionList);
@NativeClassQualifiedName("ProxyConfigServiceAndroid::JNIDelegate")
private native void nativeProxySettingsChanged(long nativePtr);
}
diff --git a/net/android/keystore_openssl.cc b/net/android/keystore_openssl.cc
index 1ca9bc1..c0f308d 100644
--- a/net/android/keystore_openssl.cc
+++ b/net/android/keystore_openssl.cc
@@ -95,7 +95,7 @@
return 0;
}
-// ExDataFree is called when one of the RSA, DSA or EC_KEY object is freed.
+// ExDataFree is called when one of the RSA, DSA or EC_KEY objects is freed.
void ExDataFree(void* parent,
void* ptr,
CRYPTO_EX_DATA* ad,
@@ -204,7 +204,7 @@
// Retrieve private key JNI reference.
const KeyExData *ex_data = RsaGetExData(rsa);
if (!ex_data || !ex_data->private_key) {
- LOG(WARNING) << "Null JNI reference passed to RsaMethodPrivEnc!";
+ LOG(WARNING) << "Null JNI reference passed to RsaMethodSignRaw!";
OPENSSL_PUT_ERROR(RSA, sign_raw, ERR_R_INTERNAL_ERROR);
return 0;
}
@@ -214,7 +214,7 @@
int ret = ex_data->legacy_rsa->meth->rsa_priv_enc(
in_len, in, out, ex_data->legacy_rsa, ANDROID_RSA_PKCS1_PADDING);
if (ret < 0) {
- LOG(WARNING) << "Could not sign message in RsaMethodPrivEnc!";
+ LOG(WARNING) << "Could not sign message in RsaMethodSignRaw!";
// System OpenSSL will use a separate error queue, so it is still
// necessary to push a new error.
//
@@ -234,7 +234,7 @@
// For RSA keys, this function behaves as RSA_private_encrypt with
// PKCS#1 padding.
if (!RawSignDigestWithPrivateKey(ex_data->private_key, from_piece, &result)) {
- LOG(WARNING) << "Could not sign message in RsaMethodPrivEnc!";
+ LOG(WARNING) << "Could not sign message in RsaMethodSignRaw!";
OPENSSL_PUT_ERROR(RSA, sign_raw, ERR_R_INTERNAL_ERROR);
return 0;
}
diff --git a/net/android/network_change_notifier_android.cc b/net/android/network_change_notifier_android.cc
index 2461d64..410d1fb 100644
--- a/net/android/network_change_notifier_android.cc
+++ b/net/android/network_change_notifier_android.cc
@@ -81,14 +81,14 @@
Stop();
}
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
address_tracker_.Init();
dns_config_service_ = DnsConfigService::CreateSystemService();
dns_config_service_->WatchConfig(
base::Bind(&NetworkChangeNotifier::SetDnsConfig));
}
- virtual void CleanUp() OVERRIDE {
+ virtual void CleanUp() override {
dns_config_service_.reset();
}
diff --git a/net/android/network_change_notifier_android.h b/net/android/network_change_notifier_android.h
index e82b852..57d29b8 100644
--- a/net/android/network_change_notifier_android.h
+++ b/net/android/network_change_notifier_android.h
@@ -45,10 +45,10 @@
virtual ~NetworkChangeNotifierAndroid();
// NetworkChangeNotifier:
- virtual ConnectionType GetCurrentConnectionType() const OVERRIDE;
+ virtual ConnectionType GetCurrentConnectionType() const override;
// NetworkChangeNotifierDelegateAndroid::Observer:
- virtual void OnConnectionTypeChanged() OVERRIDE;
+ virtual void OnConnectionTypeChanged() override;
static bool Register(JNIEnv* env);
diff --git a/net/android/network_change_notifier_android_unittest.cc b/net/android/network_change_notifier_android_unittest.cc
index 6ab894c..6aadb54 100644
--- a/net/android/network_change_notifier_android_unittest.cc
+++ b/net/android/network_change_notifier_android_unittest.cc
@@ -24,7 +24,7 @@
NetworkChangeNotifierDelegateAndroidObserver() : notifications_count_(0) {}
// NetworkChangeNotifierDelegateAndroid::Observer:
- virtual void OnConnectionTypeChanged() OVERRIDE {
+ virtual void OnConnectionTypeChanged() override {
notifications_count_++;
}
@@ -43,7 +43,7 @@
// NetworkChangeNotifier::Observer:
virtual void OnConnectionTypeChanged(
- NetworkChangeNotifier::ConnectionType connection_type) OVERRIDE {
+ NetworkChangeNotifier::ConnectionType connection_type) override {
notifications_count_++;
}
diff --git a/net/android/network_change_notifier_factory_android.h b/net/android/network_change_notifier_factory_android.h
index e71ec27..d443fcd 100644
--- a/net/android/network_change_notifier_factory_android.h
+++ b/net/android/network_change_notifier_factory_android.h
@@ -29,7 +29,7 @@
virtual ~NetworkChangeNotifierFactoryAndroid();
// NetworkChangeNotifierFactory:
- virtual NetworkChangeNotifier* CreateInstance() OVERRIDE;
+ virtual NetworkChangeNotifier* CreateInstance() override;
private:
// Delegate passed to the instances created by this class.
diff --git a/net/base/address_tracker_linux.h b/net/base/address_tracker_linux.h
index ec52b60..2574fc7 100644
--- a/net/base/address_tracker_linux.h
+++ b/net/base/address_tracker_linux.h
@@ -108,8 +108,8 @@
void AbortAndForceOnline();
// MessageLoopForIO::Watcher:
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override;
// Close |netlink_fd_|
void CloseSocket();
diff --git a/net/base/backoff_entry_unittest.cc b/net/base/backoff_entry_unittest.cc
index 560b213..f5393e8 100644
--- a/net/base/backoff_entry_unittest.cc
+++ b/net/base/backoff_entry_unittest.cc
@@ -25,7 +25,7 @@
virtual ~TestBackoffEntry() {}
- virtual TimeTicks ImplGetTimeNow() const OVERRIDE {
+ virtual TimeTicks ImplGetTimeNow() const override {
return now_;
}
diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h
index 06bc976..a58b6ff 100644
--- a/net/base/capturing_net_log.h
+++ b/net/base/capturing_net_log.h
@@ -105,7 +105,7 @@
private:
// ThreadSafeObserver implementation:
- virtual void OnAddEntry(const Entry& entry) OVERRIDE;
+ virtual void OnAddEntry(const Entry& entry) override;
// Needs to be "mutable" so can use it in GetEntries().
mutable base::Lock lock_;
diff --git a/net/base/chunked_upload_data_stream.cc b/net/base/chunked_upload_data_stream.cc
new file mode 100644
index 0000000..f1fbf08
--- /dev/null
+++ b/net/base/chunked_upload_data_stream.cc
@@ -0,0 +1,103 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/chunked_upload_data_stream.h"
+
+#include "base/logging.h"
+#include "base/stl_util.h"
+#include "net/base/io_buffer.h"
+#include "net/base/net_errors.h"
+
+namespace net {
+
+ChunkedUploadDataStream::ChunkedUploadDataStream(int64 identifier)
+ : UploadDataStream(true, identifier),
+ read_index_(0),
+ read_offset_(0),
+ all_data_appended_(false),
+ read_buffer_len_(0) {
+}
+
+ChunkedUploadDataStream::~ChunkedUploadDataStream() {
+}
+
+void ChunkedUploadDataStream::AppendData(
+ const char* data, int data_len, bool is_done) {
+ DCHECK(!all_data_appended_);
+ DCHECK(data_len > 0 || is_done);
+ if (data_len > 0) {
+ DCHECK(data);
+ upload_data_.push_back(new std::vector<char>(data, data + data_len));
+ }
+ all_data_appended_ = is_done;
+
+ if (!read_buffer_.get())
+ return;
+
+ int result = ReadChunk(read_buffer_.get(), read_buffer_len_);
+ // Shouldn't get an error or ERR_IO_PENDING.
+ DCHECK_GE(result, 0);
+ read_buffer_ = NULL;
+ read_buffer_len_ = 0;
+ OnReadCompleted(result);
+}
+
+int ChunkedUploadDataStream::InitInternal() {
+ // ResetInternal should already have been called.
+ DCHECK(!read_buffer_.get());
+ DCHECK_EQ(0u, read_index_);
+ DCHECK_EQ(0u, read_offset_);
+ return OK;
+}
+
+int ChunkedUploadDataStream::ReadInternal(IOBuffer* buf, int buf_len) {
+ DCHECK_LT(0, buf_len);
+ DCHECK(!read_buffer_.get());
+
+ int result = ReadChunk(buf, buf_len);
+ if (result == ERR_IO_PENDING) {
+ read_buffer_ = buf;
+ read_buffer_len_ = buf_len;
+ }
+ return result;
+}
+
+void ChunkedUploadDataStream::ResetInternal() {
+ read_buffer_ = NULL;
+ read_buffer_len_ = 0;
+ read_index_ = 0;
+ read_offset_ = 0;
+}
+
+int ChunkedUploadDataStream::ReadChunk(IOBuffer* buf, int buf_len) {
+ // Copy as much data as possible from |upload_data_| to |buf|.
+ int bytes_read = 0;
+ while (read_index_ < upload_data_.size() && bytes_read < buf_len) {
+ std::vector<char>* data = upload_data_[read_index_];
+ size_t bytes_to_read =
+ std::min(static_cast<size_t>(buf_len - bytes_read),
+ data->size() - read_offset_);
+ memcpy(buf->data() + bytes_read,
+ vector_as_array(data) + read_offset_,
+ bytes_to_read);
+ bytes_read += bytes_to_read;
+ read_offset_ += bytes_to_read;
+ if (read_offset_ == data->size()) {
+ read_index_++;
+ read_offset_ = 0;
+ }
+ }
+ DCHECK_LE(bytes_read, buf_len);
+
+ // If no data was written, and not all data has been appended, return
+ // ERR_IO_PENDING. The read will be completed in the next call to AppendData.
+ if (bytes_read == 0 && !all_data_appended_)
+ return ERR_IO_PENDING;
+
+ if (read_index_ == upload_data_.size() && all_data_appended_)
+ SetIsFinalChunk();
+ return bytes_read;
+}
+
+} // namespace net
diff --git a/net/base/chunked_upload_data_stream.h b/net/base/chunked_upload_data_stream.h
new file mode 100644
index 0000000..71b1e5c
--- /dev/null
+++ b/net/base/chunked_upload_data_stream.h
@@ -0,0 +1,63 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_
+#define NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_vector.h"
+#include "net/base/completion_callback.h"
+#include "net/base/net_export.h"
+#include "net/base/upload_data_stream.h"
+
+namespace net {
+
+class IOBuffer;
+
+// Class with a push-based interface for uploading data. Buffers all data until
+// the request is completed. Not recommended for uploading large amounts of
+// seekable data, due to this buffering behavior.
+class NET_EXPORT ChunkedUploadDataStream : public UploadDataStream {
+ public:
+ ChunkedUploadDataStream(int64 identifier);
+
+ virtual ~ChunkedUploadDataStream();
+
+ // Adds data to the stream. |is_done| should be true if this is the last
+ // data to be appended. |data_len| must not be 0 unless |is_done| is true.
+ // Once called with |is_done| being true, must never be called again.
+ // TODO(mmenke): Consider using IOBuffers instead, to reduce data copies.
+ void AppendData(const char* data, int data_len, bool is_done);
+
+ private:
+ // UploadDataStream implementation.
+ virtual int InitInternal() override;
+ virtual int ReadInternal(IOBuffer* buf, int buf_len) override;
+ virtual void ResetInternal() override;
+
+ int ReadChunk(IOBuffer* buf, int buf_len);
+
+ // Index and offset of next element of |upload_data_| to be read.
+ size_t read_index_;
+ size_t read_offset_;
+
+ // True once all data has been appended to the stream.
+ bool all_data_appended_;
+
+ ScopedVector<std::vector<char>> upload_data_;
+
+ // Buffer to write the next read's data to. Only set when a call to
+ // ReadInternal reads no data.
+ scoped_refptr<IOBuffer> read_buffer_;
+ int read_buffer_len_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChunkedUploadDataStream);
+};
+
+} // namespace net
+
+#endif // NET_BASE_CHUNKED_UPLOAD_DATA_STREAM_H_
diff --git a/net/base/chunked_upload_data_stream_unittest.cc b/net/base/chunked_upload_data_stream_unittest.cc
new file mode 100644
index 0000000..334e9a3
--- /dev/null
+++ b/net/base/chunked_upload_data_stream_unittest.cc
@@ -0,0 +1,308 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/chunked_upload_data_stream.h"
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "net/base/io_buffer.h"
+#include "net/base/net_errors.h"
+#include "net/base/test_completion_callback.h"
+#include "net/base/upload_data_stream.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+
+namespace {
+
+const char kTestData[] = "0123456789";
+const size_t kTestDataSize = arraysize(kTestData) - 1;
+const size_t kTestBufferSize = 1 << 14; // 16KB.
+
+} // namespace
+
+// Reads data once from the upload data stream, and returns the data as string.
+// Expects the read to succeed synchronously.
+std::string ReadSync(UploadDataStream* stream, int buffer_size) {
+ scoped_refptr<IOBuffer> buf = new IOBuffer(buffer_size);
+ int result = stream->Read(buf.get(),
+ buffer_size,
+ TestCompletionCallback().callback());
+ EXPECT_GE(result, 0);
+ return std::string(buf->data(), result);
+}
+
+// Check the case data is added after the first read attempt.
+TEST(ChunkedUploadDataStreamTest, AppendOnce) {
+ ChunkedUploadDataStream stream(0);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ TestCompletionCallback callback;
+ scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
+ int result = stream.Read(buf.get(), kTestBufferSize, callback.callback());
+ ASSERT_EQ(ERR_IO_PENDING, result);
+
+ stream.AppendData(kTestData, kTestDataSize, true);
+ int read = callback.WaitForResult();
+ ASSERT_GE(read, 0);
+ EXPECT_EQ(kTestData, std::string(buf->data(), read));
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(kTestDataSize, stream.position());
+ EXPECT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, AppendOnceBeforeRead) {
+ ChunkedUploadDataStream stream(0);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ stream.AppendData(kTestData, kTestDataSize, true);
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ std::string data = ReadSync(&stream, kTestBufferSize);
+ EXPECT_EQ(kTestData, data);
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(kTestDataSize, stream.position());
+ EXPECT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, AppendOnceBeforeInit) {
+ ChunkedUploadDataStream stream(0);
+
+ stream.AppendData(kTestData, kTestDataSize, true);
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ std::string data = ReadSync(&stream, kTestBufferSize);
+ EXPECT_EQ(kTestData, data);
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(kTestDataSize, stream.position());
+ EXPECT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, MultipleAppends) {
+ ChunkedUploadDataStream stream(0);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size());
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ TestCompletionCallback callback;
+ scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
+ for (size_t i = 0; i < kTestDataSize; ++i) {
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(i, stream.position());
+ ASSERT_FALSE(stream.IsEOF());
+ int bytes_read = stream.Read(buf.get(),
+ kTestBufferSize,
+ callback.callback());
+ ASSERT_EQ(ERR_IO_PENDING, bytes_read);
+ stream.AppendData(&kTestData[i], 1, i == kTestDataSize - 1);
+ ASSERT_EQ(1, callback.WaitForResult());
+ EXPECT_EQ(kTestData[i], buf->data()[0]);
+ }
+
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(kTestDataSize, stream.position());
+ ASSERT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, MultipleAppendsBetweenReads) {
+ ChunkedUploadDataStream stream(0);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
+ for (size_t i = 0; i < kTestDataSize; ++i) {
+ EXPECT_EQ(i, stream.position());
+ ASSERT_FALSE(stream.IsEOF());
+ stream.AppendData(&kTestData[i], 1, i == kTestDataSize - 1);
+ int bytes_read = stream.Read(buf.get(),
+ kTestBufferSize,
+ TestCompletionCallback().callback());
+ ASSERT_EQ(1, bytes_read);
+ EXPECT_EQ(kTestData[i], buf->data()[0]);
+ }
+
+ EXPECT_EQ(kTestDataSize, stream.position());
+ ASSERT_TRUE(stream.IsEOF());
+}
+
+// Checks that multiple reads can be merged.
+TEST(ChunkedUploadDataStreamTest, MultipleAppendsBeforeInit) {
+ ChunkedUploadDataStream stream(0);
+ stream.AppendData(kTestData, 1, false);
+ stream.AppendData(kTestData + 1, 1, false);
+ stream.AppendData(kTestData + 2, kTestDataSize - 2, true);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ std::string data = ReadSync(&stream, kTestBufferSize);
+ EXPECT_EQ(kTestData, data);
+ EXPECT_EQ(kTestDataSize, stream.position());
+ ASSERT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, MultipleReads) {
+ // Use a read size different from the write size to test bounds checking.
+ const size_t kReadSize = kTestDataSize + 3;
+
+ ChunkedUploadDataStream stream(0);
+ stream.AppendData(kTestData, kTestDataSize, false);
+ stream.AppendData(kTestData, kTestDataSize, false);
+ stream.AppendData(kTestData, kTestDataSize, false);
+ stream.AppendData(kTestData, kTestDataSize, true);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ std::string data = ReadSync(&stream, kReadSize);
+ EXPECT_EQ("0123456789012", data);
+ EXPECT_EQ(kReadSize, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ data = ReadSync(&stream, kReadSize);
+ EXPECT_EQ("3456789012345", data);
+ EXPECT_EQ(2 * kReadSize, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ data = ReadSync(&stream, kReadSize);
+ EXPECT_EQ("6789012345678", data);
+ EXPECT_EQ(3 * kReadSize, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ data = ReadSync(&stream, kReadSize);
+ EXPECT_EQ("9", data);
+ EXPECT_EQ(4 * kTestDataSize, stream.position());
+ EXPECT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, EmptyUpload) {
+ ChunkedUploadDataStream stream(0);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ TestCompletionCallback callback;
+ scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
+ int result = stream.Read(buf.get(), kTestBufferSize, callback.callback());
+ ASSERT_EQ(ERR_IO_PENDING, result);
+
+ stream.AppendData(NULL, 0, true);
+ int read = callback.WaitForResult();
+ EXPECT_EQ(0, read);
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, EmptyUploadEndedBeforeInit) {
+ ChunkedUploadDataStream stream(0);
+ stream.AppendData(NULL, 0, true);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ std::string data = ReadSync(&stream, kTestBufferSize);
+ ASSERT_EQ("", data);
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, RewindAfterComplete) {
+ ChunkedUploadDataStream stream(0);
+ stream.AppendData(kTestData, 1, false);
+ stream.AppendData(kTestData + 1, kTestDataSize - 1, true);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ std::string data = ReadSync(&stream, kTestBufferSize);
+ EXPECT_EQ(kTestData, data);
+ EXPECT_EQ(kTestDataSize, stream.position());
+ ASSERT_TRUE(stream.IsEOF());
+
+ // Rewind stream and repeat.
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ data = ReadSync(&stream, kTestBufferSize);
+ EXPECT_EQ(kTestData, data);
+ EXPECT_EQ(kTestDataSize, stream.position());
+ ASSERT_TRUE(stream.IsEOF());
+}
+
+TEST(ChunkedUploadDataStreamTest, RewindWhileReading) {
+ ChunkedUploadDataStream stream(0);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ TestCompletionCallback callback;
+ scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
+ int result = stream.Read(buf.get(), kTestBufferSize, callback.callback());
+ ASSERT_EQ(ERR_IO_PENDING, result);
+
+ ASSERT_EQ(OK, stream.Init(TestCompletionCallback().callback()));
+ EXPECT_FALSE(stream.IsInMemory());
+ EXPECT_EQ(0u, stream.size()); // Content-Length is 0 for chunked data.
+ EXPECT_EQ(0u, stream.position());
+ EXPECT_FALSE(stream.IsEOF());
+
+ // Adding data now should not result in calling the original read callback,
+ // since the stream was re-initialized for reuse, which cancels all pending
+ // reads.
+ stream.AppendData(kTestData, kTestDataSize, true);
+ EXPECT_FALSE(callback.have_result());
+
+ std::string data = ReadSync(&stream, kTestBufferSize);
+ EXPECT_EQ(kTestData, data);
+ EXPECT_EQ(kTestDataSize, stream.position());
+ ASSERT_TRUE(stream.IsEOF());
+ EXPECT_FALSE(callback.have_result());
+}
+
+} // namespace net
diff --git a/net/base/directory_lister_unittest.cc b/net/base/directory_lister_unittest.cc
index 970f0d7..f52e23e 100644
--- a/net/base/directory_lister_unittest.cc
+++ b/net/base/directory_lister_unittest.cc
@@ -28,14 +28,14 @@
}
virtual void OnListFile(
- const DirectoryLister::DirectoryListerData& data) OVERRIDE {
+ const DirectoryLister::DirectoryListerData& data) override {
file_list_.push_back(data.info);
paths_.push_back(data.path);
if (quit_loop_after_each_file_)
base::MessageLoop::current()->Quit();
}
- virtual void OnListDone(int error) OVERRIDE {
+ virtual void OnListDone(int error) override {
error_ = error;
base::MessageLoop::current()->Quit();
if (recursive_)
@@ -93,7 +93,7 @@
class DirectoryListerTest : public PlatformTest {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
const int kMaxDepth = 3;
const int kBranchingFactor = 4;
const int kFilesPerDirectory = 5;
diff --git a/net/base/dns_reloader.cc b/net/base/dns_reloader.cc
index 04abcb1..3a92418 100644
--- a/net/base/dns_reloader.cc
+++ b/net/base/dns_reloader.cc
@@ -46,7 +46,7 @@
};
// NetworkChangeNotifier::DNSObserver:
- virtual void OnDNSChanged() OVERRIDE {
+ virtual void OnDNSChanged() override {
DCHECK(base::MessageLoopForIO::IsCurrent());
base::AutoLock l(lock_);
resolver_generation_++;
@@ -110,7 +110,7 @@
namespace net {
void EnsureDnsReloaderInit() {
- DnsReloader* t ALLOW_UNUSED = g_dns_reloader.Pointer();
+ g_dns_reloader.Pointer();
}
void DnsReloaderMaybeReload() {
diff --git a/net/base/elements_upload_data_stream.cc b/net/base/elements_upload_data_stream.cc
new file mode 100644
index 0000000..86ea28c
--- /dev/null
+++ b/net/base/elements_upload_data_stream.cc
@@ -0,0 +1,166 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/elements_upload_data_stream.h"
+
+#include "base/bind.h"
+#include "base/logging.h"
+#include "net/base/completion_callback.h"
+#include "net/base/io_buffer.h"
+#include "net/base/net_errors.h"
+#include "net/base/upload_bytes_element_reader.h"
+#include "net/base/upload_element_reader.h"
+
+namespace net {
+
+ElementsUploadDataStream::ElementsUploadDataStream(
+ ScopedVector<UploadElementReader> element_readers,
+ int64 identifier)
+ : UploadDataStream(false, identifier),
+ element_readers_(element_readers.Pass()),
+ element_index_(0),
+ read_failed_(false),
+ weak_ptr_factory_(this) {
+}
+
+ElementsUploadDataStream::~ElementsUploadDataStream() {
+}
+
+scoped_ptr<UploadDataStream> ElementsUploadDataStream::CreateWithReader(
+ scoped_ptr<UploadElementReader> reader,
+ int64 identifier) {
+ ScopedVector<UploadElementReader> readers;
+ readers.push_back(reader.release());
+ return scoped_ptr<UploadDataStream>(
+ new ElementsUploadDataStream(readers.Pass(), identifier));
+}
+
+int ElementsUploadDataStream::InitInternal() {
+ return InitElements(0);
+}
+
+int ElementsUploadDataStream::ReadInternal(
+ IOBuffer* buf,
+ int buf_len) {
+ DCHECK_GT(buf_len, 0);
+ return ReadElements(new DrainableIOBuffer(buf, buf_len));
+}
+
+bool ElementsUploadDataStream::IsInMemory() const {
+ for (size_t i = 0; i < element_readers_.size(); ++i) {
+ if (!element_readers_[i]->IsInMemory())
+ return false;
+ }
+ return true;
+}
+
+const ScopedVector<UploadElementReader>*
+ElementsUploadDataStream::GetElementReaders() const {
+ return &element_readers_;
+}
+
+void ElementsUploadDataStream::ResetInternal() {
+ weak_ptr_factory_.InvalidateWeakPtrs();
+ read_failed_ = false;
+ element_index_ = 0;
+}
+
+int ElementsUploadDataStream::InitElements(size_t start_index) {
+ // Call Init() for all elements.
+ for (size_t i = start_index; i < element_readers_.size(); ++i) {
+ UploadElementReader* reader = element_readers_[i];
+ // When new_result is ERR_IO_PENDING, InitInternal() will be called
+ // with start_index == i + 1 when reader->Init() finishes.
+ int result = reader->Init(
+ base::Bind(&ElementsUploadDataStream::OnInitElementCompleted,
+ weak_ptr_factory_.GetWeakPtr(),
+ i));
+ DCHECK(result != ERR_IO_PENDING || !reader->IsInMemory());
+ DCHECK_LE(result, OK);
+ if (result != OK)
+ return result;
+ }
+
+ uint64 total_size = 0;
+ for (size_t i = 0; i < element_readers_.size(); ++i) {
+ total_size += element_readers_[i]->GetContentLength();
+ }
+ SetSize(total_size);
+ return OK;
+}
+
+void ElementsUploadDataStream::OnInitElementCompleted(size_t index,
+ int result) {
+ DCHECK_NE(ERR_IO_PENDING, result);
+
+ // Check the last result.
+ if (result == OK)
+ result = InitElements(index + 1);
+
+ if (result != ERR_IO_PENDING)
+ OnInitCompleted(result);
+}
+
+int ElementsUploadDataStream::ReadElements(
+ const scoped_refptr<DrainableIOBuffer>& buf) {
+ while (!read_failed_ && element_index_ < element_readers_.size()) {
+ UploadElementReader* reader = element_readers_[element_index_];
+
+ if (reader->BytesRemaining() == 0) {
+ ++element_index_;
+ continue;
+ }
+
+ if (buf->BytesRemaining() == 0)
+ break;
+
+ int result = reader->Read(
+ buf.get(),
+ buf->BytesRemaining(),
+ base::Bind(&ElementsUploadDataStream::OnReadElementCompleted,
+ weak_ptr_factory_.GetWeakPtr(),
+ buf));
+ if (result == ERR_IO_PENDING)
+ return ERR_IO_PENDING;
+ ProcessReadResult(buf, result);
+ }
+
+ if (read_failed_) {
+ // If an error occured during read operation, then pad with zero.
+ // Otherwise the server will hang waiting for the rest of the data.
+ int num_bytes_to_fill = std::min(
+ static_cast<uint64>(buf->BytesRemaining()),
+ size() - position() - buf->BytesConsumed());
+ DCHECK_LE(0, num_bytes_to_fill);
+ memset(buf->data(), 0, num_bytes_to_fill);
+ buf->DidConsume(num_bytes_to_fill);
+ }
+
+ return buf->BytesConsumed();
+}
+
+void ElementsUploadDataStream::OnReadElementCompleted(
+ const scoped_refptr<DrainableIOBuffer>& buf,
+ int result) {
+ ProcessReadResult(buf, result);
+
+ result = ReadElements(buf);
+ if (result != ERR_IO_PENDING)
+ OnReadCompleted(result);
+}
+
+void ElementsUploadDataStream::ProcessReadResult(
+ const scoped_refptr<DrainableIOBuffer>& buf,
+ int result) {
+ DCHECK_NE(ERR_IO_PENDING, result);
+ DCHECK(!read_failed_);
+
+ if (result >= 0) {
+ buf->DidConsume(result);
+ } else {
+ read_failed_ = true;
+ }
+}
+
+} // namespace net
diff --git a/net/base/elements_upload_data_stream.h b/net/base/elements_upload_data_stream.h
new file mode 100644
index 0000000..1a008fc
--- /dev/null
+++ b/net/base/elements_upload_data_stream.h
@@ -0,0 +1,86 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_ELEMENTS_UPLOAD_DATA_STREAM_H_
+#define NET_BASE_ELEMENTS_UPLOAD_DATA_STREAM_H_
+
+#include "base/basictypes.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "base/memory/weak_ptr.h"
+#include "net/base/net_export.h"
+#include "net/base/upload_data_stream.h"
+
+namespace net {
+
+class DrainableIOBuffer;
+class IOBuffer;
+class UploadElementReader;
+
+// A non-chunked UploadDataStream consisting of one or more UploadElements.
+class NET_EXPORT ElementsUploadDataStream : public UploadDataStream {
+ public:
+ ElementsUploadDataStream(ScopedVector<UploadElementReader> element_readers,
+ int64 identifier);
+
+ virtual ~ElementsUploadDataStream();
+
+ // Creates an ElementsUploadDataStream with a single reader. Returns a
+ // scoped_ptr<UploadDataStream> for ease of use.
+ static scoped_ptr<UploadDataStream> CreateWithReader(
+ scoped_ptr<UploadElementReader> reader,
+ int64 identifier);
+
+ private:
+ // UploadDataStream implementation.
+ virtual bool IsInMemory() const override;
+ virtual const ScopedVector<UploadElementReader>*
+ GetElementReaders() const override;
+ virtual int InitInternal() override;
+ virtual int ReadInternal(IOBuffer* buf, int buf_len) override;
+ virtual void ResetInternal() override;
+
+ // Runs Init() for all element readers.
+ // This method is used to implement InitInternal().
+ int InitElements(size_t start_index);
+
+ // Called when the |index| element finishes initialization. If it succeeded,
+ // continues with the |index + 1| element. Calls OnInitCompleted on error or
+ // when all elements have been initialized.
+ void OnInitElementCompleted(size_t index, int result);
+
+ // Reads data from the element readers.
+ // This method is used to implement Read().
+ int ReadElements(const scoped_refptr<DrainableIOBuffer>& buf);
+
+ // Resumes pending read and calls OnReadCompleted with a result when
+ // necessary.
+ void OnReadElementCompleted(const scoped_refptr<DrainableIOBuffer>& buf,
+ int result);
+
+ // Processes result of UploadElementReader::Read(). If |result| indicates
+ // success, updates |buf|'s offset. Otherwise, sets |read_failed_| to true.
+ void ProcessReadResult(const scoped_refptr<DrainableIOBuffer>& buf,
+ int result);
+
+ ScopedVector<UploadElementReader> element_readers_;
+
+ // Index of the current upload element (i.e. the element currently being
+ // read). The index is used as a cursor to iterate over elements in
+ // |upload_data_|.
+ size_t element_index_;
+
+ // True if an error occcured during read operation.
+ bool read_failed_;
+
+ base::WeakPtrFactory<ElementsUploadDataStream> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ElementsUploadDataStream);
+};
+
+} // namespace net
+
+#endif // NET_BASE_ELEMENTS_UPLOAD_DATA_STREAM_H_
diff --git a/net/base/upload_data_stream_unittest.cc b/net/base/elements_upload_data_stream_unittest.cc
similarity index 71%
rename from net/base/upload_data_stream_unittest.cc
rename to net/base/elements_upload_data_stream_unittest.cc
index 2df38cd..91c390c 100644
--- a/net/base/upload_data_stream_unittest.cc
+++ b/net/base/elements_upload_data_stream_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/base/upload_data_stream.h"
+#include "net/base/elements_upload_data_stream.h"
#include <algorithm>
#include <vector>
@@ -20,6 +20,7 @@
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/base/upload_bytes_element_reader.h"
+#include "net/base/upload_data_stream.h"
#include "net/base/upload_file_element_reader.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -67,9 +68,9 @@
// UploadElementReader overrides.
MOCK_METHOD1(Init, int(const CompletionCallback& callback));
- virtual uint64 GetContentLength() const OVERRIDE { return content_length_; }
- virtual uint64 BytesRemaining() const OVERRIDE { return bytes_remaining_; }
- virtual bool IsInMemory() const OVERRIDE { return is_in_memory_; }
+ virtual uint64 GetContentLength() const override { return content_length_; }
+ virtual uint64 BytesRemaining() const override { return bytes_remaining_; }
+ virtual bool IsInMemory() const override { return is_in_memory_; }
MOCK_METHOD3(Read, int(IOBuffer* buf,
int buf_length,
const CompletionCallback& callback));
@@ -122,13 +123,13 @@
} // namespace
-class UploadDataStreamTest : public PlatformTest {
+class ElementsUploadDataStreamTest : public PlatformTest {
public:
virtual void SetUp() {
PlatformTest::SetUp();
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
}
- virtual ~UploadDataStreamTest() {
+ virtual ~ElementsUploadDataStreamTest() {
element_readers_.clear();
base::RunLoop().RunUntilIdle();
}
@@ -141,35 +142,37 @@
ScopedVector<UploadElementReader> element_readers_;
};
-TEST_F(UploadDataStreamTest, EmptyUploadData) {
- UploadDataStream stream(element_readers_.Pass(), 0);
- ASSERT_EQ(OK, stream.Init(CompletionCallback()));
- EXPECT_TRUE(stream.IsInMemory());
- EXPECT_EQ(0U, stream.size());
- EXPECT_EQ(0U, stream.position());
- EXPECT_TRUE(stream.IsEOF());
+TEST_F(ElementsUploadDataStreamTest, EmptyUploadData) {
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
+ ASSERT_EQ(OK, stream->Init(CompletionCallback()));
+ EXPECT_TRUE(stream->IsInMemory());
+ EXPECT_EQ(0U, stream->size());
+ EXPECT_EQ(0U, stream->position());
+ EXPECT_TRUE(stream->IsEOF());
}
-TEST_F(UploadDataStreamTest, ConsumeAllBytes) {
+TEST_F(ElementsUploadDataStreamTest, ConsumeAllBytes) {
element_readers_.push_back(new UploadBytesElementReader(
kTestData, kTestDataSize));
- UploadDataStream stream(element_readers_.Pass(), 0);
- ASSERT_EQ(OK, stream.Init(CompletionCallback()));
- EXPECT_TRUE(stream.IsInMemory());
- EXPECT_EQ(kTestDataSize, stream.size());
- EXPECT_EQ(0U, stream.position());
- EXPECT_FALSE(stream.IsEOF());
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
+ ASSERT_EQ(OK, stream->Init(CompletionCallback()));
+ EXPECT_TRUE(stream->IsInMemory());
+ EXPECT_EQ(kTestDataSize, stream->size());
+ EXPECT_EQ(0U, stream->position());
+ EXPECT_FALSE(stream->IsEOF());
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
- while (!stream.IsEOF()) {
+ while (!stream->IsEOF()) {
int bytes_read =
- stream.Read(buf.get(), kTestBufferSize, CompletionCallback());
+ stream->Read(buf.get(), kTestBufferSize, CompletionCallback());
ASSERT_LE(0, bytes_read); // Not an error.
}
- EXPECT_EQ(kTestDataSize, stream.position());
- ASSERT_TRUE(stream.IsEOF());
+ EXPECT_EQ(kTestDataSize, stream->position());
+ ASSERT_TRUE(stream->IsEOF());
}
-TEST_F(UploadDataStreamTest, File) {
+TEST_F(ElementsUploadDataStreamTest, File) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -184,26 +187,27 @@
base::Time()));
TestCompletionCallback init_callback;
- UploadDataStream stream(element_readers_.Pass(), 0);
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback.callback()));
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback.callback()));
ASSERT_EQ(OK, init_callback.WaitForResult());
- EXPECT_FALSE(stream.IsInMemory());
- EXPECT_EQ(kTestDataSize, stream.size());
- EXPECT_EQ(0U, stream.position());
- EXPECT_FALSE(stream.IsEOF());
+ EXPECT_FALSE(stream->IsInMemory());
+ EXPECT_EQ(kTestDataSize, stream->size());
+ EXPECT_EQ(0U, stream->position());
+ EXPECT_FALSE(stream->IsEOF());
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
- while (!stream.IsEOF()) {
+ while (!stream->IsEOF()) {
TestCompletionCallback read_callback;
ASSERT_EQ(
ERR_IO_PENDING,
- stream.Read(buf.get(), kTestBufferSize, read_callback.callback()));
+ stream->Read(buf.get(), kTestBufferSize, read_callback.callback()));
ASSERT_LE(0, read_callback.WaitForResult()); // Not an error.
}
- EXPECT_EQ(kTestDataSize, stream.position());
- ASSERT_TRUE(stream.IsEOF());
+ EXPECT_EQ(kTestDataSize, stream->position());
+ ASSERT_TRUE(stream->IsEOF());
}
-TEST_F(UploadDataStreamTest, FileSmallerThanLength) {
+TEST_F(ElementsUploadDataStreamTest, FileSmallerThanLength) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -222,32 +226,33 @@
base::Time()));
TestCompletionCallback init_callback;
- UploadDataStream stream(element_readers_.Pass(), 0);
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback.callback()));
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback.callback()));
ASSERT_EQ(OK, init_callback.WaitForResult());
- EXPECT_FALSE(stream.IsInMemory());
- EXPECT_EQ(kFakeSize, stream.size());
- EXPECT_EQ(0U, stream.position());
- EXPECT_FALSE(stream.IsEOF());
+ EXPECT_FALSE(stream->IsInMemory());
+ EXPECT_EQ(kFakeSize, stream->size());
+ EXPECT_EQ(0U, stream->position());
+ EXPECT_FALSE(stream->IsEOF());
uint64 read_counter = 0;
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
- while (!stream.IsEOF()) {
+ while (!stream->IsEOF()) {
TestCompletionCallback read_callback;
ASSERT_EQ(
ERR_IO_PENDING,
- stream.Read(buf.get(), kTestBufferSize, read_callback.callback()));
+ stream->Read(buf.get(), kTestBufferSize, read_callback.callback()));
int bytes_read = read_callback.WaitForResult();
ASSERT_LE(0, bytes_read); // Not an error.
read_counter += bytes_read;
- EXPECT_EQ(read_counter, stream.position());
+ EXPECT_EQ(read_counter, stream->position());
}
// UpdateDataStream will pad out the file with 0 bytes so that the HTTP
// transaction doesn't hang. Therefore we expected the full size.
EXPECT_EQ(kFakeSize, read_counter);
- EXPECT_EQ(read_counter, stream.position());
+ EXPECT_EQ(read_counter, stream->position());
}
-TEST_F(UploadDataStreamTest, ReadErrorSync) {
+TEST_F(ElementsUploadDataStreamTest, ReadErrorSync) {
// This element cannot be read.
MockUploadElementReader* reader =
new MockUploadElementReader(kTestDataSize, true);
@@ -259,13 +264,14 @@
element_readers_.push_back(new UploadBytesElementReader(
kTestData, kTestDataSize));
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
// Run Init().
- ASSERT_EQ(OK, stream.Init(CompletionCallback()));
- EXPECT_EQ(kTestDataSize*2, stream.size());
- EXPECT_EQ(0U, stream.position());
- EXPECT_FALSE(stream.IsEOF());
+ ASSERT_EQ(OK, stream->Init(CompletionCallback()));
+ EXPECT_EQ(kTestDataSize*2, stream->size());
+ EXPECT_EQ(0U, stream->position());
+ EXPECT_FALSE(stream->IsEOF());
// Prepare a buffer filled with non-zero data.
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
@@ -273,16 +279,16 @@
// Read() results in success even when the reader returns error.
EXPECT_EQ(static_cast<int>(kTestDataSize * 2),
- stream.Read(buf.get(), kTestBufferSize, CompletionCallback()));
- EXPECT_EQ(kTestDataSize * 2, stream.position());
- EXPECT_TRUE(stream.IsEOF());
+ stream->Read(buf.get(), kTestBufferSize, CompletionCallback()));
+ EXPECT_EQ(kTestDataSize * 2, stream->position());
+ EXPECT_TRUE(stream->IsEOF());
// The buffer is filled with zero.
EXPECT_EQ(static_cast<int>(kTestDataSize*2),
std::count(buf->data(), buf->data() + kTestBufferSize, 0));
}
-TEST_F(UploadDataStreamTest, ReadErrorAsync) {
+TEST_F(ElementsUploadDataStreamTest, ReadErrorAsync) {
// This element cannot be read.
MockUploadElementReader* reader =
new MockUploadElementReader(kTestDataSize, false);
@@ -294,15 +300,16 @@
element_readers_.push_back(new UploadBytesElementReader(
kTestData, kTestDataSize));
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
// Run Init().
TestCompletionCallback init_callback;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback.callback()));
EXPECT_EQ(OK, init_callback.WaitForResult());
- EXPECT_EQ(kTestDataSize*2, stream.size());
- EXPECT_EQ(0U, stream.position());
- EXPECT_FALSE(stream.IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
+ EXPECT_EQ(0U, stream->position());
+ EXPECT_FALSE(stream->IsEOF());
// Prepare a buffer filled with non-zero data.
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
@@ -311,17 +318,17 @@
// Read() results in success even when the reader returns error.
TestCompletionCallback read_callback;
ASSERT_EQ(ERR_IO_PENDING,
- stream.Read(buf.get(), kTestBufferSize, read_callback.callback()));
+ stream->Read(buf.get(), kTestBufferSize, read_callback.callback()));
EXPECT_EQ(static_cast<int>(kTestDataSize * 2), read_callback.WaitForResult());
- EXPECT_EQ(kTestDataSize*2, stream.position());
- EXPECT_TRUE(stream.IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->position());
+ EXPECT_TRUE(stream->IsEOF());
// The buffer is filled with zero.
EXPECT_EQ(static_cast<int>(kTestDataSize*2),
std::count(buf->data(), buf->data() + kTestBufferSize, 0));
}
-TEST_F(UploadDataStreamTest, FileAndBytes) {
+TEST_F(ElementsUploadDataStreamTest, FileAndBytes) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -342,49 +349,29 @@
const uint64 kStreamSize = kTestDataSize + kFileRangeLength;
TestCompletionCallback init_callback;
- UploadDataStream stream(element_readers_.Pass(), 0);
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback.callback()));
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback.callback()));
ASSERT_EQ(OK, init_callback.WaitForResult());
- EXPECT_FALSE(stream.IsInMemory());
- EXPECT_EQ(kStreamSize, stream.size());
- EXPECT_EQ(0U, stream.position());
- EXPECT_FALSE(stream.IsEOF());
+ EXPECT_FALSE(stream->IsInMemory());
+ EXPECT_EQ(kStreamSize, stream->size());
+ EXPECT_EQ(0U, stream->position());
+ EXPECT_FALSE(stream->IsEOF());
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
- while (!stream.IsEOF()) {
+ while (!stream->IsEOF()) {
TestCompletionCallback read_callback;
const int result =
- stream.Read(buf.get(), kTestBufferSize, read_callback.callback());
+ stream->Read(buf.get(), kTestBufferSize, read_callback.callback());
const int bytes_read =
result != ERR_IO_PENDING ? result : read_callback.WaitForResult();
ASSERT_LE(0, bytes_read); // Not an error.
}
- EXPECT_EQ(kStreamSize, stream.position());
- ASSERT_TRUE(stream.IsEOF());
-}
-
-TEST_F(UploadDataStreamTest, Chunk) {
- const uint64 kStreamSize = kTestDataSize*2;
- UploadDataStream stream(UploadDataStream::CHUNKED, 0);
- stream.AppendChunk(kTestData, kTestDataSize, false);
- stream.AppendChunk(kTestData, kTestDataSize, true);
-
- ASSERT_EQ(OK, stream.Init(CompletionCallback()));
- EXPECT_FALSE(stream.IsInMemory());
- EXPECT_EQ(0U, stream.size()); // Content-Length is 0 for chunked data.
- EXPECT_EQ(0U, stream.position());
- EXPECT_FALSE(stream.IsEOF());
- scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
- while (!stream.IsEOF()) {
- int bytes_read =
- stream.Read(buf.get(), kTestBufferSize, CompletionCallback());
- ASSERT_LE(0, bytes_read); // Not an error.
- }
- EXPECT_EQ(kStreamSize, stream.position());
- ASSERT_TRUE(stream.IsEOF());
+ EXPECT_EQ(kStreamSize, stream->position());
+ ASSERT_TRUE(stream->IsEOF());
}
// Init() with on-memory and not-on-memory readers.
-TEST_F(UploadDataStreamTest, InitAsync) {
+TEST_F(ElementsUploadDataStreamTest, InitAsync) {
// Create UploadDataStream with mock readers.
MockUploadElementReader* reader = NULL;
@@ -408,16 +395,17 @@
EXPECT_CALL(*reader, Init(_)).WillOnce(Return(OK));
element_readers_.push_back(reader);
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
// Run Init().
TestCompletionCallback callback;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(callback.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(callback.callback()));
EXPECT_EQ(OK, callback.WaitForResult());
}
// Init() of a reader fails asynchronously.
-TEST_F(UploadDataStreamTest, InitAsyncFailureAsync) {
+TEST_F(ElementsUploadDataStreamTest, InitAsyncFailureAsync) {
// Create UploadDataStream with a mock reader.
MockUploadElementReader* reader = NULL;
@@ -425,16 +413,17 @@
reader->SetAsyncInitExpectation(ERR_FAILED);
element_readers_.push_back(reader);
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
// Run Init().
TestCompletionCallback callback;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(callback.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(callback.callback()));
EXPECT_EQ(ERR_FAILED, callback.WaitForResult());
}
// Init() of a reader fails synchronously.
-TEST_F(UploadDataStreamTest, InitAsyncFailureSync) {
+TEST_F(ElementsUploadDataStreamTest, InitAsyncFailureSync) {
// Create UploadDataStream with mock readers.
MockUploadElementReader* reader = NULL;
@@ -446,34 +435,36 @@
EXPECT_CALL(*reader, Init(_)).WillOnce(Return(ERR_FAILED));
element_readers_.push_back(reader);
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
// Run Init().
TestCompletionCallback callback;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(callback.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(callback.callback()));
EXPECT_EQ(ERR_FAILED, callback.WaitForResult());
}
// Read with a buffer whose size is same as the data.
-TEST_F(UploadDataStreamTest, ReadAsyncWithExactSizeBuffer) {
+TEST_F(ElementsUploadDataStreamTest, ReadAsyncWithExactSizeBuffer) {
element_readers_.push_back(new UploadBytesElementReader(
kTestData, kTestDataSize));
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
- ASSERT_EQ(OK, stream.Init(CompletionCallback()));
- EXPECT_TRUE(stream.IsInMemory());
- EXPECT_EQ(kTestDataSize, stream.size());
- EXPECT_EQ(0U, stream.position());
- EXPECT_FALSE(stream.IsEOF());
+ ASSERT_EQ(OK, stream->Init(CompletionCallback()));
+ EXPECT_TRUE(stream->IsInMemory());
+ EXPECT_EQ(kTestDataSize, stream->size());
+ EXPECT_EQ(0U, stream->position());
+ EXPECT_FALSE(stream->IsEOF());
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestDataSize);
- int bytes_read = stream.Read(buf.get(), kTestDataSize, CompletionCallback());
+ int bytes_read = stream->Read(buf.get(), kTestDataSize, CompletionCallback());
ASSERT_EQ(static_cast<int>(kTestDataSize), bytes_read); // Not an error.
- EXPECT_EQ(kTestDataSize, stream.position());
- ASSERT_TRUE(stream.IsEOF());
+ EXPECT_EQ(kTestDataSize, stream->position());
+ ASSERT_TRUE(stream->IsEOF());
}
// Async Read() with on-memory and not-on-memory readers.
-TEST_F(UploadDataStreamTest, ReadAsync) {
+TEST_F(ElementsUploadDataStreamTest, ReadAsync) {
// Create UploadDataStream with mock readers.
MockUploadElementReader* reader = NULL;
@@ -497,11 +488,12 @@
reader->SetReadExpectation(kTestDataSize);
element_readers_.push_back(reader);
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
// Run Init().
TestCompletionCallback init_callback;
- EXPECT_EQ(ERR_IO_PENDING, stream.Init(init_callback.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream->Init(init_callback.callback()));
EXPECT_EQ(OK, init_callback.WaitForResult());
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
@@ -509,28 +501,29 @@
// Consume the first element.
TestCompletionCallback read_callback1;
EXPECT_EQ(static_cast<int>(kTestDataSize),
- stream.Read(buf.get(), kTestDataSize, read_callback1.callback()));
+ stream->Read(buf.get(), kTestDataSize, read_callback1.callback()));
base::MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(read_callback1.have_result());
// Consume the second element.
TestCompletionCallback read_callback2;
ASSERT_EQ(ERR_IO_PENDING,
- stream.Read(buf.get(), kTestDataSize, read_callback2.callback()));
+ stream->Read(buf.get(), kTestDataSize, read_callback2.callback()));
EXPECT_EQ(static_cast<int>(kTestDataSize), read_callback2.WaitForResult());
// Consume the third and the fourth elements.
TestCompletionCallback read_callback3;
ASSERT_EQ(
ERR_IO_PENDING,
- stream.Read(buf.get(), kTestDataSize * 2, read_callback3.callback()));
+ stream->Read(buf.get(), kTestDataSize * 2, read_callback3.callback()));
EXPECT_EQ(static_cast<int>(kTestDataSize * 2),
read_callback3.WaitForResult());
}
-void UploadDataStreamTest::FileChangedHelper(const base::FilePath& file_path,
- const base::Time& time,
- bool error_expected) {
+void ElementsUploadDataStreamTest::FileChangedHelper(
+ const base::FilePath& file_path,
+ const base::Time& time,
+ bool error_expected) {
// Don't use element_readers_ here, as this function is called twice, and
// reusing element_readers_ is wrong.
ScopedVector<UploadElementReader> element_readers;
@@ -538,8 +531,9 @@
base::MessageLoopProxy::current().get(), file_path, 1, 2, time));
TestCompletionCallback init_callback;
- UploadDataStream stream(element_readers.Pass(), 0);
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback.callback()));
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback.callback()));
int error_code = init_callback.WaitForResult();
if (error_expected)
ASSERT_EQ(ERR_UPLOAD_FILE_CHANGED, error_code);
@@ -547,7 +541,7 @@
ASSERT_EQ(OK, error_code);
}
-TEST_F(UploadDataStreamTest, FileChanged) {
+TEST_F(ElementsUploadDataStreamTest, FileChanged) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -566,7 +560,7 @@
true);
}
-TEST_F(UploadDataStreamTest, MultipleInit) {
+TEST_F(ElementsUploadDataStreamTest, MultipleInit) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -582,35 +576,36 @@
0,
kuint64max,
base::Time()));
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
std::string expected_data(kTestData, kTestData + kTestDataSize);
expected_data += expected_data;
// Call Init().
TestCompletionCallback init_callback1;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback1.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback1.callback()));
ASSERT_EQ(OK, init_callback1.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Read.
- EXPECT_EQ(expected_data, ReadFromUploadDataStream(&stream));
- EXPECT_TRUE(stream.IsEOF());
+ EXPECT_EQ(expected_data, ReadFromUploadDataStream(stream.get()));
+ EXPECT_TRUE(stream->IsEOF());
// Call Init() again to reset.
TestCompletionCallback init_callback2;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback2.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback2.callback()));
ASSERT_EQ(OK, init_callback2.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Read again.
- EXPECT_EQ(expected_data, ReadFromUploadDataStream(&stream));
- EXPECT_TRUE(stream.IsEOF());
+ EXPECT_EQ(expected_data, ReadFromUploadDataStream(stream.get()));
+ EXPECT_TRUE(stream->IsEOF());
}
-TEST_F(UploadDataStreamTest, MultipleInitAsync) {
+TEST_F(ElementsUploadDataStreamTest, MultipleInitAsync) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -627,33 +622,34 @@
0,
kuint64max,
base::Time()));
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
std::string expected_data(kTestData, kTestData + kTestDataSize);
expected_data += expected_data;
// Call Init().
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(test_callback.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(test_callback.callback()));
EXPECT_EQ(OK, test_callback.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Read.
- EXPECT_EQ(expected_data, ReadFromUploadDataStream(&stream));
- EXPECT_TRUE(stream.IsEOF());
+ EXPECT_EQ(expected_data, ReadFromUploadDataStream(stream.get()));
+ EXPECT_TRUE(stream->IsEOF());
// Call Init() again to reset.
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(test_callback.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(test_callback.callback()));
EXPECT_EQ(OK, test_callback.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Read again.
- EXPECT_EQ(expected_data, ReadFromUploadDataStream(&stream));
- EXPECT_TRUE(stream.IsEOF());
+ EXPECT_EQ(expected_data, ReadFromUploadDataStream(stream.get()));
+ EXPECT_TRUE(stream->IsEOF());
}
-TEST_F(UploadDataStreamTest, InitToReset) {
+TEST_F(ElementsUploadDataStreamTest, InitToReset) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -669,7 +665,8 @@
0,
kuint64max,
base::Time()));
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
std::vector<char> expected_data(kTestData, kTestData + kTestDataSize);
expected_data.insert(expected_data.end(), expected_data.begin(),
@@ -677,10 +674,10 @@
// Call Init().
TestCompletionCallback init_callback1;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback1.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback1.callback()));
EXPECT_EQ(OK, init_callback1.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Read some.
TestCompletionCallback read_callback1;
@@ -688,29 +685,30 @@
scoped_refptr<IOBuffer> wrapped_buffer = new WrappedIOBuffer(&buf[0]);
EXPECT_EQ(
ERR_IO_PENDING,
- stream.Read(wrapped_buffer.get(), buf.size(), read_callback1.callback()));
+ stream->Read(wrapped_buffer.get(), buf.size(),
+ read_callback1.callback()));
EXPECT_EQ(static_cast<int>(buf.size()), read_callback1.WaitForResult());
- EXPECT_EQ(buf.size(), stream.position());
+ EXPECT_EQ(buf.size(), stream->position());
// Call Init to reset the state.
TestCompletionCallback init_callback2;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback2.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback2.callback()));
EXPECT_EQ(OK, init_callback2.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Read.
TestCompletionCallback read_callback2;
std::vector<char> buf2(kTestDataSize*2);
scoped_refptr<IOBuffer> wrapped_buffer2 = new WrappedIOBuffer(&buf2[0]);
EXPECT_EQ(ERR_IO_PENDING,
- stream.Read(
+ stream->Read(
wrapped_buffer2.get(), buf2.size(), read_callback2.callback()));
EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult());
EXPECT_EQ(expected_data, buf2);
}
-TEST_F(UploadDataStreamTest, InitDuringAsyncInit) {
+TEST_F(ElementsUploadDataStreamTest, InitDuringAsyncInit) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -726,7 +724,8 @@
0,
kuint64max,
base::Time()));
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
std::vector<char> expected_data(kTestData, kTestData + kTestDataSize);
expected_data.insert(expected_data.end(), expected_data.begin(),
@@ -734,31 +733,31 @@
// Start Init.
TestCompletionCallback init_callback1;
- EXPECT_EQ(ERR_IO_PENDING, stream.Init(init_callback1.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream->Init(init_callback1.callback()));
// Call Init again to cancel the previous init.
TestCompletionCallback init_callback2;
- EXPECT_EQ(ERR_IO_PENDING, stream.Init(init_callback2.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream->Init(init_callback2.callback()));
EXPECT_EQ(OK, init_callback2.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Read.
TestCompletionCallback read_callback2;
std::vector<char> buf2(kTestDataSize*2);
scoped_refptr<IOBuffer> wrapped_buffer2 = new WrappedIOBuffer(&buf2[0]);
EXPECT_EQ(ERR_IO_PENDING,
- stream.Read(
+ stream->Read(
wrapped_buffer2.get(), buf2.size(), read_callback2.callback()));
EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult());
EXPECT_EQ(expected_data, buf2);
- EXPECT_TRUE(stream.IsEOF());
+ EXPECT_TRUE(stream->IsEOF());
// Make sure callbacks are not called for cancelled operations.
EXPECT_FALSE(init_callback1.have_result());
}
-TEST_F(UploadDataStreamTest, InitDuringAsyncRead) {
+TEST_F(ElementsUploadDataStreamTest, InitDuringAsyncRead) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
&temp_file_path));
@@ -774,7 +773,8 @@
0,
kuint64max,
base::Time()));
- UploadDataStream stream(element_readers_.Pass(), 0);
+ scoped_ptr<UploadDataStream> stream(
+ new ElementsUploadDataStream(element_readers_.Pass(), 0));
std::vector<char> expected_data(kTestData, kTestData + kTestDataSize);
expected_data.insert(expected_data.end(), expected_data.begin(),
@@ -782,10 +782,10 @@
// Call Init().
TestCompletionCallback init_callback1;
- ASSERT_EQ(ERR_IO_PENDING, stream.Init(init_callback1.callback()));
+ ASSERT_EQ(ERR_IO_PENDING, stream->Init(init_callback1.callback()));
EXPECT_EQ(OK, init_callback1.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Start reading.
TestCompletionCallback read_callback1;
@@ -793,25 +793,26 @@
scoped_refptr<IOBuffer> wrapped_buffer = new WrappedIOBuffer(&buf[0]);
EXPECT_EQ(
ERR_IO_PENDING,
- stream.Read(wrapped_buffer.get(), buf.size(), read_callback1.callback()));
+ stream->Read(wrapped_buffer.get(), buf.size(),
+ read_callback1.callback()));
// Call Init to cancel the previous read.
TestCompletionCallback init_callback2;
- EXPECT_EQ(ERR_IO_PENDING, stream.Init(init_callback2.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream->Init(init_callback2.callback()));
EXPECT_EQ(OK, init_callback2.WaitForResult());
- EXPECT_FALSE(stream.IsEOF());
- EXPECT_EQ(kTestDataSize*2, stream.size());
+ EXPECT_FALSE(stream->IsEOF());
+ EXPECT_EQ(kTestDataSize*2, stream->size());
// Read.
TestCompletionCallback read_callback2;
std::vector<char> buf2(kTestDataSize*2);
scoped_refptr<IOBuffer> wrapped_buffer2 = new WrappedIOBuffer(&buf2[0]);
EXPECT_EQ(ERR_IO_PENDING,
- stream.Read(
+ stream->Read(
wrapped_buffer2.get(), buf2.size(), read_callback2.callback()));
EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult());
EXPECT_EQ(expected_data, buf2);
- EXPECT_TRUE(stream.IsEOF());
+ EXPECT_TRUE(stream->IsEOF());
// Make sure callbacks are not called for cancelled operations.
EXPECT_FALSE(read_callback1.have_result());
diff --git a/net/base/escape.cc b/net/base/escape.cc
index ab70f1d..7ce21a1 100644
--- a/net/base/escape.cc
+++ b/net/base/escape.cc
@@ -114,7 +114,7 @@
static_cast<typename STR::value_type>(escaped_text[index + 2]));
if (IsHexDigit(most_sig_digit) && IsHexDigit(least_sig_digit)) {
*value = HexDigitToInt(most_sig_digit) * 16 +
- HexDigitToInt(least_sig_digit);
+ HexDigitToInt(least_sig_digit);
return true;
}
return false;
diff --git a/net/base/file_stream_context.h b/net/base/file_stream_context.h
index 74f47c4..5493e25 100644
--- a/net/base/file_stream_context.h
+++ b/net/base/file_stream_context.h
@@ -158,7 +158,7 @@
// Implementation of MessageLoopForIO::IOHandler.
virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context,
DWORD bytes_read,
- DWORD error) OVERRIDE;
+ DWORD error) override;
#elif defined(OS_POSIX)
// ReadFileImpl() is a simple wrapper around read() that handles EINTR
// signals and calls RecordAndMapError() to map errno to net error codes.
diff --git a/net/base/keygen_handler_unittest.cc b/net/base/keygen_handler_unittest.cc
index 2962330..af4e01d 100644
--- a/net/base/keygen_handler_unittest.cc
+++ b/net/base/keygen_handler_unittest.cc
@@ -34,11 +34,11 @@
virtual std::string RequestPassword(const std::string& slot_name,
bool retry,
- bool* cancelled) OVERRIDE{
+ bool* cancelled) override{
return std::string();
}
- virtual crypto::ScopedPK11Slot RequestSlot() OVERRIDE {
+ virtual crypto::ScopedPK11Slot RequestSlot() override {
return crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot_.get()));
}
diff --git a/net/base/mock_file_stream.h b/net/base/mock_file_stream.h
index 55261b4..abceb1b 100644
--- a/net/base/mock_file_stream.h
+++ b/net/base/mock_file_stream.h
@@ -29,14 +29,14 @@
// FileStream methods.
virtual int Seek(base::File::Whence whence, int64 offset,
- const Int64CompletionCallback& callback) OVERRIDE;
+ const Int64CompletionCallback& callback) override;
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int Flush(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int Flush(const CompletionCallback& callback) override;
void set_forced_error_async(int error) {
forced_error_ = error;
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h
index b805dd6..ae2ff13 100644
--- a/net/base/net_error_list.h
+++ b/net/base/net_error_list.h
@@ -336,6 +336,10 @@
// library.
NET_ERROR(SSL_CLIENT_AUTH_CERT_BAD_FORMAT, -164)
+// The SSL server requires falling back to a version older than the configured
+// minimum fallback version, and thus fallback failed.
+NET_ERROR(SSL_FALLBACK_BEYOND_MINIMUM_VERSION, -165)
+
// Certificate error codes
//
// The values of certificate error codes must be consecutive.
diff --git a/net/base/net_log_logger.h b/net/base/net_log_logger.h
index fde820b..6604b82 100644
--- a/net/base/net_log_logger.h
+++ b/net/base/net_log_logger.h
@@ -41,7 +41,7 @@
void StopObserving();
// net::NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE;
+ virtual void OnAddEntry(const NetLog::Entry& entry) override;
// Create a dictionary containing legend for net/ constants. Caller takes
// ownership of returned value.
diff --git a/net/base/net_log_unittest.cc b/net/base/net_log_unittest.cc
index 8f15e9c..d1e7dde 100644
--- a/net/base/net_log_unittest.cc
+++ b/net/base/net_log_unittest.cc
@@ -80,7 +80,7 @@
net_log()->RemoveThreadSafeObserver(this);
}
- virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE {
+ virtual void OnAddEntry(const NetLog::Entry& entry) override {
++count_;
}
@@ -99,7 +99,7 @@
net_log()->RemoveThreadSafeObserver(this);
}
- virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE {
+ virtual void OnAddEntry(const NetLog::Entry& entry) override {
base::Value* value = entry.ToValue();
base::DictionaryValue* dict = NULL;
ASSERT_TRUE(value->GetAsDictionary(&dict));
@@ -138,7 +138,7 @@
net_log_ = net_log;
}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
start_event_->Wait();
RunTestThread();
}
@@ -165,7 +165,7 @@
virtual ~AddEventsTestThread() {}
private:
- virtual void RunTestThread() OVERRIDE {
+ virtual void RunTestThread() override {
for (int i = 0; i < kEvents; ++i)
AddEvent(net_log_);
}
@@ -183,7 +183,7 @@
}
private:
- virtual void RunTestThread() OVERRIDE {
+ virtual void RunTestThread() override {
for (int i = 0; i < kEvents; ++i) {
ASSERT_FALSE(observer_.net_log());
diff --git a/net/base/net_util_icu.cc b/net/base/net_util_icu.cc
index 4094fee..bd5625b 100644
--- a/net/base/net_util_icu.cc
+++ b/net/base/net_util_icu.cc
@@ -493,7 +493,7 @@
private:
virtual base::string16 Execute(
const std::string& component_text,
- base::OffsetAdjuster::Adjustments* adjustments) const OVERRIDE {
+ base::OffsetAdjuster::Adjustments* adjustments) const override {
return IDNToUnicodeWithAdjustments(component_text, languages_,
adjustments);
}
@@ -510,7 +510,7 @@
private:
virtual base::string16 Execute(
const std::string& component_text,
- base::OffsetAdjuster::Adjustments* adjustments) const OVERRIDE {
+ base::OffsetAdjuster::Adjustments* adjustments) const override {
return (unescape_rules_ == UnescapeRule::NONE) ?
base::UTF8ToUTF16WithAdjustments(component_text, adjustments) :
UnescapeAndDecodeUTF8URLComponentWithAdjustments(component_text,
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index ef9e252..bea6759 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -45,7 +45,7 @@
class MockNetworkChangeNotifier : public NetworkChangeNotifier {
public:
- virtual ConnectionType GetCurrentConnectionType() const OVERRIDE {
+ virtual ConnectionType GetCurrentConnectionType() const override {
return CONNECTION_UNKNOWN;
}
};
@@ -93,7 +93,7 @@
}
// NetworkChangeNotifier::IPAddressObserver implementation.
- virtual void OnIPAddressChanged() OVERRIDE {
+ virtual void OnIPAddressChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.IPAddressChange",
SinceLast(&last_ip_address_change_));
@@ -104,7 +104,7 @@
// NetworkChangeNotifier::ConnectionTypeObserver implementation.
virtual void OnConnectionTypeChanged(
- NetworkChangeNotifier::ConnectionType type) OVERRIDE {
+ NetworkChangeNotifier::ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
base::TimeTicks now = base::TimeTicks::Now();
int32 kilobytes_read = bytes_read_since_last_connection_change_ / 1000;
@@ -264,7 +264,7 @@
}
// NetworkChangeNotifier::DNSObserver implementation.
- virtual void OnDNSChanged() OVERRIDE {
+ virtual void OnDNSChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.DNSConfigChange",
SinceLast(&last_dns_change_));
@@ -272,7 +272,7 @@
// NetworkChangeNotifier::NetworkChangeObserver implementation.
virtual void OnNetworkChanged(
- NetworkChangeNotifier::ConnectionType type) OVERRIDE {
+ NetworkChangeNotifier::ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
if (type != NetworkChangeNotifier::CONNECTION_NONE) {
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.NetworkOnlineChange",
@@ -432,7 +432,7 @@
}
// NetworkChangeNotifier::IPAddressObserver implementation.
- virtual void OnIPAddressChanged() OVERRIDE {
+ virtual void OnIPAddressChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
base::TimeDelta delay = last_announced_connection_type_ == CONNECTION_NONE
? params_.ip_address_offline_delay_ : params_.ip_address_online_delay_;
@@ -441,7 +441,7 @@
}
// NetworkChangeNotifier::ConnectionTypeObserver implementation.
- virtual void OnConnectionTypeChanged(ConnectionType type) OVERRIDE {
+ virtual void OnConnectionTypeChanged(ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
pending_connection_type_ = type;
base::TimeDelta delay = last_announced_connection_type_ == CONNECTION_NONE
diff --git a/net/base/network_change_notifier_linux.cc b/net/base/network_change_notifier_linux.cc
index 3fe9656..b10f8a8 100644
--- a/net/base/network_change_notifier_linux.cc
+++ b/net/base/network_change_notifier_linux.cc
@@ -29,8 +29,8 @@
protected:
// base::Thread
- virtual void Init() OVERRIDE;
- virtual void CleanUp() OVERRIDE;
+ virtual void Init() override;
+ virtual void CleanUp() override;
private:
scoped_ptr<DnsConfigService> dns_config_service_;
diff --git a/net/base/network_change_notifier_linux.h b/net/base/network_change_notifier_linux.h
index a7080d9..1e8a7eb 100644
--- a/net/base/network_change_notifier_linux.h
+++ b/net/base/network_change_notifier_linux.h
@@ -26,10 +26,10 @@
static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsLinux();
// NetworkChangeNotifier:
- virtual ConnectionType GetCurrentConnectionType() const OVERRIDE;
+ virtual ConnectionType GetCurrentConnectionType() const override;
virtual const internal::AddressTrackerLinux*
- GetAddressTrackerInternal() const OVERRIDE;
+ GetAddressTrackerInternal() const override;
// The thread used to listen for notifications. This relays the notification
// to the registered observers without posting back to the thread the object
diff --git a/net/base/network_change_notifier_mac.cc b/net/base/network_change_notifier_mac.cc
index 7fa97b4..e378418 100644
--- a/net/base/network_change_notifier_mac.cc
+++ b/net/base/network_change_notifier_mac.cc
@@ -47,12 +47,12 @@
Stop();
}
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
service_ = DnsConfigService::CreateSystemService();
service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig));
}
- virtual void CleanUp() OVERRIDE {
+ virtual void CleanUp() override {
service_.reset();
}
diff --git a/net/base/network_change_notifier_mac.h b/net/base/network_change_notifier_mac.h
index 168ea14..1598c4c 100644
--- a/net/base/network_change_notifier_mac.h
+++ b/net/base/network_change_notifier_mac.h
@@ -24,7 +24,7 @@
virtual ~NetworkChangeNotifierMac();
// NetworkChangeNotifier implementation:
- virtual ConnectionType GetCurrentConnectionType() const OVERRIDE;
+ virtual ConnectionType GetCurrentConnectionType() const override;
// Forwarder just exists to keep the NetworkConfigWatcherMac API out of
// NetworkChangeNotifierMac's public API.
@@ -34,11 +34,11 @@
: net_config_watcher_(net_config_watcher) {}
// NetworkConfigWatcherMac::Delegate implementation:
- virtual void Init() OVERRIDE;
- virtual void StartReachabilityNotifications() OVERRIDE;
+ virtual void Init() override;
+ virtual void StartReachabilityNotifications() override;
virtual void SetDynamicStoreNotificationKeys(
- SCDynamicStoreRef store) OVERRIDE;
- virtual void OnNetworkConfigChange(CFArrayRef changed_keys) OVERRIDE;
+ SCDynamicStoreRef store) override;
+ virtual void OnNetworkConfigChange(CFArrayRef changed_keys) override;
private:
NetworkChangeNotifierMac* const net_config_watcher_;
diff --git a/net/base/network_change_notifier_win.cc b/net/base/network_change_notifier_win.cc
index 4580fa8..2255681 100644
--- a/net/base/network_change_notifier_win.cc
+++ b/net/base/network_change_notifier_win.cc
@@ -37,12 +37,12 @@
Stop();
}
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
service_ = DnsConfigService::CreateSystemService();
service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig));
}
- virtual void CleanUp() OVERRIDE {
+ virtual void CleanUp() override {
service_.reset();
}
diff --git a/net/base/network_change_notifier_win.h b/net/base/network_change_notifier_win.h
index 4ded749..9de1789 100644
--- a/net/base/network_change_notifier_win.h
+++ b/net/base/network_change_notifier_win.h
@@ -51,11 +51,11 @@
friend class NetworkChangeNotifierWinTest;
// NetworkChangeNotifier methods:
- virtual ConnectionType GetCurrentConnectionType() const OVERRIDE;
+ virtual ConnectionType GetCurrentConnectionType() const override;
// ObjectWatcher::Delegate methods:
// Must only be called on the thread |this| was created on.
- virtual void OnObjectSignaled(HANDLE object) OVERRIDE;
+ virtual void OnObjectSignaled(HANDLE object) override;
// Does the actual work to determine the current connection type.
// It is not thread safe, see crbug.com/324913.
diff --git a/net/base/network_change_notifier_win_unittest.cc b/net/base/network_change_notifier_win_unittest.cc
index 979105f..25873c3 100644
--- a/net/base/network_change_notifier_win_unittest.cc
+++ b/net/base/network_change_notifier_win_unittest.cc
@@ -32,7 +32,7 @@
// From NetworkChangeNotifierWin.
virtual NetworkChangeNotifier::ConnectionType
- RecomputeCurrentConnectionType() const OVERRIDE {
+ RecomputeCurrentConnectionType() const override {
return NetworkChangeNotifier::CONNECTION_UNKNOWN;
}
diff --git a/net/base/network_config_watcher_mac.cc b/net/base/network_config_watcher_mac.cc
index 8579a35..7d2377c 100644
--- a/net/base/network_config_watcher_mac.cc
+++ b/net/base/network_config_watcher_mac.cc
@@ -35,8 +35,8 @@
protected:
// base::Thread
- virtual void Init() OVERRIDE;
- virtual void CleanUp() OVERRIDE;
+ virtual void Init() override;
+ virtual void CleanUp() override;
private:
// The SystemConfiguration calls in this function can lead to contention early
diff --git a/net/base/prioritized_dispatcher_unittest.cc b/net/base/prioritized_dispatcher_unittest.cc
index 3036038..4cdf53b 100644
--- a/net/base/prioritized_dispatcher_unittest.cc
+++ b/net/base/prioritized_dispatcher_unittest.cc
@@ -117,7 +117,7 @@
}
// PriorityDispatch::Job interface
- virtual void Start() OVERRIDE {
+ virtual void Start() override {
EXPECT_FALSE(running_);
handle_ = PrioritizedDispatcher::Handle();
running_ = true;
diff --git a/net/base/priority_queue_unittest.cc b/net/base/priority_queue_unittest.cc
index 8093319..87a8299 100644
--- a/net/base/priority_queue_unittest.cc
+++ b/net/base/priority_queue_unittest.cc
@@ -25,7 +25,7 @@
protected:
PriorityQueueTest() : queue_(kNumPriorities) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
CheckEmpty();
for (size_t i = 0; i < kNumElements; ++i) {
EXPECT_EQ(i, queue_.size());
diff --git a/net/base/sdch_dictionary_fetcher.h b/net/base/sdch_dictionary_fetcher.h
index f70d56a..86aaf48 100644
--- a/net/base/sdch_dictionary_fetcher.h
+++ b/net/base/sdch_dictionary_fetcher.h
@@ -44,12 +44,12 @@
virtual ~SdchDictionaryFetcher();
// Implementation of SdchFetcher methods.
- virtual void Schedule(const GURL& dictionary_url) OVERRIDE;
- virtual void Cancel() OVERRIDE;
+ virtual void Schedule(const GURL& dictionary_url) override;
+ virtual void Cancel() override;
// Implementation of URLRequest::Delegate methods.
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE;
- virtual void OnReadCompleted(URLRequest* request, int bytes_read) OVERRIDE;
+ virtual void OnResponseStarted(URLRequest* request) override;
+ virtual void OnReadCompleted(URLRequest* request, int bytes_read) override;
private:
enum State {
diff --git a/net/base/sdch_dictionary_fetcher_unittest.cc b/net/base/sdch_dictionary_fetcher_unittest.cc
index 09155b8..a8b3040 100644
--- a/net/base/sdch_dictionary_fetcher_unittest.cc
+++ b/net/base/sdch_dictionary_fetcher_unittest.cc
@@ -62,7 +62,7 @@
virtual int GetData(std::string* mime_type,
std::string* charset,
std::string* data,
- const CompletionCallback& callback) const OVERRIDE {
+ const CompletionCallback& callback) const override {
GURL url(request_->url());
*data = ExpectedResponseForURL(url);
return OK;
@@ -87,7 +87,7 @@
};
virtual void AddSdchDictionary(const std::string& dictionary_text,
- const GURL& dictionary_url) OVERRIDE {
+ const GURL& dictionary_url) override {
dictionary_additions.push_back(
DictionaryAdditions(dictionary_text, dictionary_url));
}
@@ -105,7 +105,7 @@
public:
SdchDictionaryFetcherTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
DCHECK(!fetcher_.get());
URLRequestSpecifiedResponseJob::AddUrlHandler();
@@ -115,7 +115,7 @@
fetcher_delegate_.get(), context_.get()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
URLRequestSpecifiedResponseJob::RemoveUrlHandler();
fetcher_.reset();
context_.reset();
diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h
index 7d2c103..18f6749 100644
--- a/net/base/sdch_manager.h
+++ b/net/base/sdch_manager.h
@@ -356,7 +356,7 @@
// (data in the dictionary is not acceptable from the
// dictionary_url; dictionary already added, etc.).
virtual void AddSdchDictionary(const std::string& dictionary_text,
- const GURL& dictionary_url) OVERRIDE;
+ const GURL& dictionary_url) override;
private:
struct BlacklistInfo {
diff --git a/net/base/test_completion_callback.h b/net/base/test_completion_callback.h
index 4a0afe1..469d12f 100644
--- a/net/base/test_completion_callback.h
+++ b/net/base/test_completion_callback.h
@@ -117,7 +117,7 @@
virtual ~ReleaseBufferCompletionCallback();
private:
- virtual void SetResult(int result) OVERRIDE;
+ virtual void SetResult(int result) override;
IOBuffer* buffer_;
DISALLOW_COPY_AND_ASSIGN(ReleaseBufferCompletionCallback);
diff --git a/net/base/trace_net_log_observer.cc b/net/base/trace_net_log_observer.cc
index fb4f054..77945fb 100644
--- a/net/base/trace_net_log_observer.cc
+++ b/net/base/trace_net_log_observer.cc
@@ -26,7 +26,7 @@
private:
virtual ~TracedValue() {}
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+ virtual void AppendAsTraceFormat(std::string* out) const override {
if (value_) {
std::string tmp;
base::JSONWriter::Write(value_.get(), &tmp);
diff --git a/net/base/trace_net_log_observer.h b/net/base/trace_net_log_observer.h
index ed46fdb..567ba3f 100644
--- a/net/base/trace_net_log_observer.h
+++ b/net/base/trace_net_log_observer.h
@@ -22,7 +22,7 @@
virtual ~TraceNetLogObserver();
// net::NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE;
+ virtual void OnAddEntry(const NetLog::Entry& entry) override;
// Start to watch for TraceLog enable and disable events.
// This can't be called if already watching for events.
@@ -35,8 +35,8 @@
void StopWatchForTraceStart();
// base::debug::TraceLog::EnabledStateChangedObserver implementation:
- virtual void OnTraceLogEnabled() OVERRIDE;
- virtual void OnTraceLogDisabled() OVERRIDE;
+ virtual void OnTraceLogEnabled() override;
+ virtual void OnTraceLogDisabled() override;
private:
NetLog* net_log_to_watch_;
diff --git a/net/base/upload_bytes_element_reader.h b/net/base/upload_bytes_element_reader.h
index 9c7daf3..589e287 100644
--- a/net/base/upload_bytes_element_reader.h
+++ b/net/base/upload_bytes_element_reader.h
@@ -26,14 +26,14 @@
uint64 length() const { return length_; }
// UploadElementReader overrides:
- virtual const UploadBytesElementReader* AsBytesReader() const OVERRIDE;
- virtual int Init(const CompletionCallback& callback) OVERRIDE;
- virtual uint64 GetContentLength() const OVERRIDE;
- virtual uint64 BytesRemaining() const OVERRIDE;
- virtual bool IsInMemory() const OVERRIDE;
+ virtual const UploadBytesElementReader* AsBytesReader() const override;
+ virtual int Init(const CompletionCallback& callback) override;
+ virtual uint64 GetContentLength() const override;
+ virtual uint64 BytesRemaining() const override;
+ virtual bool IsInMemory() const override;
virtual int Read(IOBuffer* buf,
int buf_length,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
private:
const char* const bytes_;
diff --git a/net/base/upload_bytes_element_reader_unittest.cc b/net/base/upload_bytes_element_reader_unittest.cc
index 1aad55e..e15bbcf 100644
--- a/net/base/upload_bytes_element_reader_unittest.cc
+++ b/net/base/upload_bytes_element_reader_unittest.cc
@@ -15,7 +15,7 @@
class UploadBytesElementReaderTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
const char kData[] = "123abc";
bytes_.assign(kData, kData + arraysize(kData));
reader_.reset(new UploadBytesElementReader(&bytes_[0], bytes_.size()));
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc
index 785d5e9..936c912 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -4,261 +4,125 @@
#include "net/base/upload_data_stream.h"
+#include "base/callback_helpers.h"
#include "base/logging.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
-#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_element_reader.h"
namespace net {
-UploadDataStream::UploadDataStream(
- ScopedVector<UploadElementReader> element_readers,
- int64 identifier)
- : element_readers_(element_readers.Pass()),
- element_index_(0),
- total_size_(0),
+UploadDataStream::UploadDataStream(bool is_chunked, int64 identifier)
+ : total_size_(0),
current_position_(0),
identifier_(identifier),
- is_chunked_(false),
- last_chunk_appended_(false),
- read_failed_(false),
+ is_chunked_(is_chunked),
initialized_successfully_(false),
- weak_ptr_factory_(this) {
-}
-
-UploadDataStream::UploadDataStream(Chunked /*chunked*/, int64 identifier)
- : element_index_(0),
- total_size_(0),
- current_position_(0),
- identifier_(identifier),
- is_chunked_(true),
- last_chunk_appended_(false),
- read_failed_(false),
- initialized_successfully_(false),
- weak_ptr_factory_(this) {
+ is_eof_(false) {
}
UploadDataStream::~UploadDataStream() {
}
-UploadDataStream* UploadDataStream::CreateWithReader(
- scoped_ptr<UploadElementReader> reader,
- int64 identifier) {
- ScopedVector<UploadElementReader> readers;
- readers.push_back(reader.release());
- return new UploadDataStream(readers.Pass(), identifier);
-}
-
int UploadDataStream::Init(const CompletionCallback& callback) {
Reset();
- return InitInternal(0, callback);
+ DCHECK(!initialized_successfully_);
+ DCHECK(callback_.is_null());
+ DCHECK(!callback.is_null() || IsInMemory());
+ int result = InitInternal();
+ if (result == ERR_IO_PENDING) {
+ DCHECK(!IsInMemory());
+ callback_ = callback;
+ } else {
+ OnInitCompleted(result);
+ }
+ return result;
}
int UploadDataStream::Read(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) {
+ DCHECK(!callback.is_null() || IsInMemory());
DCHECK(initialized_successfully_);
DCHECK_GT(buf_len, 0);
- return ReadInternal(new DrainableIOBuffer(buf, buf_len), callback);
+ if (is_eof_)
+ return 0;
+ int result = ReadInternal(buf, buf_len);
+ if (result == ERR_IO_PENDING) {
+ DCHECK(!IsInMemory());
+ callback_ = callback;
+ } else {
+ OnReadCompleted(result);
+ }
+ return result;
}
bool UploadDataStream::IsEOF() const {
DCHECK(initialized_successfully_);
- if (!is_chunked_)
- return current_position_ == total_size_;
-
- // If the upload data is chunked, check if the last chunk is appended and all
- // elements are consumed.
- return element_index_ == element_readers_.size() && last_chunk_appended_;
-}
-
-bool UploadDataStream::IsInMemory() const {
- // Chunks are in memory, but UploadData does not have all the chunks at
- // once. Chunks are provided progressively with AppendChunk() as chunks
- // are ready. Check is_chunked_ here, rather than relying on the loop
- // below, as there is a case that is_chunked_ is set to true, but the
- // first chunk is not yet delivered.
- if (is_chunked_)
- return false;
-
- for (size_t i = 0; i < element_readers_.size(); ++i) {
- if (!element_readers_[i]->IsInMemory())
- return false;
- }
- return true;
-}
-
-void UploadDataStream::AppendChunk(const char* bytes,
- int bytes_len,
- bool is_last_chunk) {
- DCHECK(is_chunked_);
- DCHECK(!last_chunk_appended_);
- last_chunk_appended_ = is_last_chunk;
-
- // Initialize a reader for the newly appended chunk. We leave |total_size_| at
- // zero, since for chunked uploads, we may not know the total size.
- std::vector<char> data(bytes, bytes + bytes_len);
- UploadElementReader* reader = new UploadOwnedBytesElementReader(&data);
- const int rv = reader->Init(net::CompletionCallback());
- DCHECK_EQ(OK, rv);
- element_readers_.push_back(reader);
-
- // Resume pending read.
- if (!pending_chunked_read_callback_.is_null()) {
- base::Closure callback = pending_chunked_read_callback_;
- pending_chunked_read_callback_.Reset();
- callback.Run();
- }
+ DCHECK(is_chunked_ || is_eof_ == (current_position_ == total_size_));
+ return is_eof_;
}
void UploadDataStream::Reset() {
- weak_ptr_factory_.InvalidateWeakPtrs();
- pending_chunked_read_callback_.Reset();
- initialized_successfully_ = false;
- read_failed_ = false;
current_position_ = 0;
+ initialized_successfully_ = false;
+ is_eof_ = false;
total_size_ = 0;
- element_index_ = 0;
+ callback_.Reset();
+ ResetInternal();
}
-int UploadDataStream::InitInternal(int start_index,
- const CompletionCallback& callback) {
+void UploadDataStream::SetSize(uint64 size) {
DCHECK(!initialized_successfully_);
-
- // Call Init() for all elements.
- for (size_t i = start_index; i < element_readers_.size(); ++i) {
- UploadElementReader* reader = element_readers_[i];
- // When new_result is ERR_IO_PENDING, InitInternal() will be called
- // with start_index == i + 1 when reader->Init() finishes.
- const int result = reader->Init(
- base::Bind(&UploadDataStream::ResumePendingInit,
- weak_ptr_factory_.GetWeakPtr(),
- i + 1,
- callback));
- if (result != OK) {
- DCHECK(result != ERR_IO_PENDING || !callback.is_null());
- return result;
- }
- }
-
- // Finalize initialization.
- if (!is_chunked_) {
- uint64 total_size = 0;
- for (size_t i = 0; i < element_readers_.size(); ++i) {
- UploadElementReader* reader = element_readers_[i];
- total_size += reader->GetContentLength();
- }
- total_size_ = total_size;
- }
- initialized_successfully_ = true;
- return OK;
+ DCHECK(!is_chunked_);
+ total_size_ = size;
}
-void UploadDataStream::ResumePendingInit(int start_index,
- const CompletionCallback& callback,
- int previous_result) {
+void UploadDataStream::SetIsFinalChunk() {
+ DCHECK(initialized_successfully_);
+ DCHECK(is_chunked_);
+ DCHECK(!is_eof_);
+ is_eof_ = true;
+}
+
+bool UploadDataStream::IsInMemory() const {
+ return false;
+}
+
+const ScopedVector<UploadElementReader>*
+UploadDataStream::GetElementReaders() const {
+ return NULL;
+}
+
+void UploadDataStream::OnInitCompleted(int result) {
+ DCHECK_NE(ERR_IO_PENDING, result);
DCHECK(!initialized_successfully_);
- DCHECK(!callback.is_null());
- DCHECK_NE(ERR_IO_PENDING, previous_result);
+ DCHECK_EQ(0u, current_position_);
+ DCHECK(!is_eof_);
- // Check the last result.
- if (previous_result != OK) {
- callback.Run(previous_result);
- return;
+ if (result == OK) {
+ initialized_successfully_ = true;
+ if (!is_chunked_ && total_size_ == 0)
+ is_eof_ = true;
}
-
- const int result = InitInternal(start_index, callback);
- if (result != ERR_IO_PENDING)
- callback.Run(result);
+ if (!callback_.is_null())
+ base::ResetAndReturn(&callback_).Run(result);
}
-int UploadDataStream::ReadInternal(scoped_refptr<DrainableIOBuffer> buf,
- const CompletionCallback& callback) {
+void UploadDataStream::OnReadCompleted(int result) {
+ DCHECK_GE(result, 0);
DCHECK(initialized_successfully_);
- while (!read_failed_ && element_index_ < element_readers_.size()) {
- UploadElementReader* reader = element_readers_[element_index_];
-
- if (reader->BytesRemaining() == 0) {
- ++element_index_;
- continue;
- }
-
- if (buf->BytesRemaining() == 0)
- break;
-
- int result = reader->Read(
- buf.get(),
- buf->BytesRemaining(),
- base::Bind(base::IgnoreResult(&UploadDataStream::ResumePendingRead),
- weak_ptr_factory_.GetWeakPtr(),
- buf,
- callback));
- if (result == ERR_IO_PENDING) {
- DCHECK(!callback.is_null());
- return ERR_IO_PENDING;
- }
- ProcessReadResult(buf, result);
+ current_position_ += result;
+ if (!is_chunked_) {
+ DCHECK_LE(current_position_, total_size_);
+ if (current_position_ == total_size_)
+ is_eof_ = true;
}
- if (read_failed_) {
- // Chunked transfers may only contain byte readers, so cannot have read
- // failures.
- DCHECK(!is_chunked_);
+ DCHECK(result > 0 || is_eof_);
- // If an error occured during read operation, then pad with zero.
- // Otherwise the server will hang waiting for the rest of the data.
- const int num_bytes_to_fill =
- std::min(static_cast<uint64>(buf->BytesRemaining()),
- size() - position() - buf->BytesConsumed());
- DCHECK_LE(0, num_bytes_to_fill);
- memset(buf->data(), 0, num_bytes_to_fill);
- buf->DidConsume(num_bytes_to_fill);
- }
-
- const int bytes_copied = buf->BytesConsumed();
- current_position_ += bytes_copied;
- DCHECK(is_chunked_ || total_size_ >= current_position_);
-
- if (is_chunked_ && !IsEOF() && bytes_copied == 0) {
- DCHECK(!callback.is_null());
- DCHECK(pending_chunked_read_callback_.is_null());
- pending_chunked_read_callback_ =
- base::Bind(&UploadDataStream::ResumePendingRead,
- weak_ptr_factory_.GetWeakPtr(),
- buf,
- callback,
- OK);
- return ERR_IO_PENDING;
- }
-
- // Returning 0 is allowed only when IsEOF() == true.
- DCHECK(bytes_copied != 0 || IsEOF());
- return bytes_copied;
-}
-
-void UploadDataStream::ResumePendingRead(scoped_refptr<DrainableIOBuffer> buf,
- const CompletionCallback& callback,
- int previous_result) {
- DCHECK(!callback.is_null());
-
- ProcessReadResult(buf, previous_result);
-
- const int result = ReadInternal(buf, callback);
- if (result != ERR_IO_PENDING)
- callback.Run(result);
-}
-
-void UploadDataStream::ProcessReadResult(scoped_refptr<DrainableIOBuffer> buf,
- int result) {
- DCHECK_NE(ERR_IO_PENDING, result);
- DCHECK(!read_failed_);
-
- if (result >= 0)
- buf->DidConsume(result);
- else
- read_failed_ = true;
+ if (!callback_.is_null())
+ base::ResetAndReturn(&callback_).Run(result);
}
} // namespace net
diff --git a/net/base/upload_data_stream.h b/net/base/upload_data_stream.h
index ac14e38..d7df8c9 100644
--- a/net/base/upload_data_stream.h
+++ b/net/base/upload_data_stream.h
@@ -5,10 +5,9 @@
#ifndef NET_BASE_UPLOAD_DATA_STREAM_H_
#define NET_BASE_UPLOAD_DATA_STREAM_H_
-#include "base/gtest_prod_util.h"
-#include "base/memory/ref_counted.h"
+#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_vector.h"
-#include "base/memory/weak_ptr.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
@@ -18,31 +17,22 @@
class IOBuffer;
class UploadElementReader;
-// A class to read all elements from an UploadData object.
+// A class for retrieving all data to be sent as a request body. Supports both
+// chunked and non-chunked uploads.
class NET_EXPORT UploadDataStream {
public:
- // An enum used to construct chunked data stream.
- enum Chunked { CHUNKED };
+ // |identifier| identifies a particular upload instance, which is used by the
+ // cache to formulate a cache key. This value should be unique across browser
+ // sessions. A value of 0 is used to indicate an unspecified identifier.
+ UploadDataStream(bool is_chunked, int64 identifier);
- // Constructs a non-chunked data stream.
- UploadDataStream(ScopedVector<UploadElementReader> element_readers,
- int64 identifier);
-
- // Constructs a chunked data stream.
- UploadDataStream(Chunked chunked, int64 identifier);
-
- ~UploadDataStream();
-
- // Creates UploadDataStream with a reader.
- static UploadDataStream* CreateWithReader(
- scoped_ptr<UploadElementReader> reader,
- int64 identifier);
+ virtual ~UploadDataStream();
// Initializes the stream. This function must be called before calling any
// other method. It is not valid to call any method (other than the
- // destructor) if Init() returns a failure. This method can be called multiple
- // times. Calling this method after a Init() success results in resetting the
- // state.
+ // destructor) if Init() fails. This method can be called multiple times.
+ // Calling this method after an Init() success results in resetting the
+ // state (i.e. the stream is rewound).
//
// Does the initialization synchronously and returns the result if possible,
// otherwise returns ERR_IO_PENDING and runs the callback with the result.
@@ -62,93 +52,88 @@
// If there's less data to read than we initially observed (i.e. the actual
// upload data is smaller than size()), zeros are padded to ensure that
// size() bytes can be read, which can happen for TYPE_FILE payloads.
+ //
+ // Reads are currently not allowed to fail - they must either return
+ // a value >= 0 or ERR_IO_PENDING, and call OnReadCompleted with a
+ // value >= 0.
+ // TODO(mmenke): Investigate letting reads fail.
int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback);
- // Identifies a particular upload instance, which is used by the cache to
- // formulate a cache key. This value should be unique across browser
- // sessions. A value of 0 is used to indicate an unspecified identifier.
- int64 identifier() const { return identifier_; }
-
// Returns the total size of the data stream and the current position.
- // size() is not to be used to determine whether the stream has ended
- // because it is possible for the stream to end before its size is reached,
- // for example, if the file is truncated. When the data is chunked, size()
- // always returns zero.
+ // When the data is chunked, always returns zero. Must always return the same
+ // value after each call to Initialize().
uint64 size() const { return total_size_; }
uint64 position() const { return current_position_; }
- bool is_chunked() const { return is_chunked_; }
- bool last_chunk_appended() const { return last_chunk_appended_; }
+ // See constructor for description.
+ int64 identifier() const { return identifier_; }
- const ScopedVector<UploadElementReader>& element_readers() const {
- return element_readers_;
- }
+ bool is_chunked() const { return is_chunked_; }
// Returns true if all data has been consumed from this upload data
- // stream.
+ // stream. For chunked uploads, returns false until the first read attempt.
+ // This makes some state machines a little simpler.
bool IsEOF() const;
- // Returns true if the upload data in the stream is entirely in memory.
- bool IsInMemory() const;
-
- // Adds the given chunk of bytes to be sent with chunked transfer encoding.
- void AppendChunk(const char* bytes, int bytes_len, bool is_last_chunk);
-
- // Resets this instance to the uninitialized state.
+ // Cancels all pending callbacks, and resets state. Any IOBuffer currently
+ // being read to is not safe for future use, as it may be in use on another
+ // thread.
void Reset();
+ // Returns true if the upload data in the stream is entirely in memory, and
+ // all read requests will succeed synchronously. Expected to return false for
+ // chunked requests.
+ virtual bool IsInMemory() const;
+
+ // Returns a list of element readers owned by |this|, if it has any.
+ virtual const ScopedVector<UploadElementReader>*
+ GetElementReaders() const;
+
+ protected:
+ // Must be called by subclasses when InitInternal and ReadInternal complete
+ // asynchronously.
+ void OnInitCompleted(int result);
+ void OnReadCompleted(int result);
+
+ // Must be called before InitInternal completes, for non-chunked uploads.
+ // Must not be called for chunked uploads.
+ void SetSize(uint64 size);
+
+ // Must be called for chunked uploads before the final ReadInternal call
+ // completes. Must not be called for non-chunked uploads.
+ void SetIsFinalChunk();
+
private:
- // Runs Init() for all element readers.
- // This method is used to implement Init().
- int InitInternal(int start_index, const CompletionCallback& callback);
+ // See Init(). If it returns ERR_IO_PENDING, OnInitCompleted must be called
+ // once it completes. If the upload is not chunked, SetSize must be called
+ // before it completes.
+ virtual int InitInternal() = 0;
- // Resumes initialization and runs callback with the result when necessary.
- void ResumePendingInit(int start_index,
- const CompletionCallback& callback,
- int previous_result);
+ // See Read(). For chunked uploads, must call SetIsFinalChunk if this is the
+ // final chunk. For non-chunked uploads, the UploadDataStream determins which
+ // read is the last based on size. Must read 1 or more bytes on every call,
+ // though the final chunk may be 0 bytes, for chunked requests. If it returns
+ // ERR_IO_PENDING, OnInitCompleted must be called once it completes. Must not
+ // return any error, other than ERR_IO_PENDING.
+ virtual int ReadInternal(IOBuffer* buf, int buf_len) = 0;
- // Reads data from the element readers.
- // This method is used to implement Read().
- int ReadInternal(scoped_refptr<DrainableIOBuffer> buf,
- const CompletionCallback& callback);
+ // Resets state and cancels any pending callbacks. Guaranteed to be called
+ // before all but the first call to InitInternal.
+ virtual void ResetInternal() = 0;
- // Resumes pending read and calls callback with the result when necessary.
- void ResumePendingRead(scoped_refptr<DrainableIOBuffer> buf,
- const CompletionCallback& callback,
- int previous_result);
-
- // Processes result of UploadElementReader::Read(). If |result| indicates
- // success, updates |buf|'s offset. Otherwise, sets |read_failed_| to true.
- void ProcessReadResult(scoped_refptr<DrainableIOBuffer> buf,
- int result);
-
- ScopedVector<UploadElementReader> element_readers_;
-
- // Index of the current upload element (i.e. the element currently being
- // read). The index is used as a cursor to iterate over elements in
- // |upload_data_|.
- size_t element_index_;
-
- // Size and current read position within the upload data stream.
- // |total_size_| is set to zero when the data is chunked.
uint64 total_size_;
uint64 current_position_;
const int64 identifier_;
const bool is_chunked_;
- bool last_chunk_appended_;
-
- // True if an error occcured during read operation.
- bool read_failed_;
// True if the initialization was successful.
bool initialized_successfully_;
- // Callback to resume reading chunked data.
- base::Closure pending_chunked_read_callback_;
+ bool is_eof_;
- base::WeakPtrFactory<UploadDataStream> weak_ptr_factory_;
+ CompletionCallback callback_;
DISALLOW_COPY_AND_ASSIGN(UploadDataStream);
};
diff --git a/net/base/upload_element_reader.h b/net/base/upload_element_reader.h
index d71f57c..a46b970 100644
--- a/net/base/upload_element_reader.h
+++ b/net/base/upload_element_reader.h
@@ -35,8 +35,8 @@
// state.
virtual int Init(const CompletionCallback& callback) = 0;
- // Returns the byte-length of the element. For files that do not exist, 0
- // is returned. This is done for consistency with Mozilla.
+ // Returns the byte-length of the element. For files that do not exist, 0
+ // is returned. This is done for consistency with Mozilla.
virtual uint64 GetContentLength() const = 0;
// Returns the number of bytes remaining to read.
diff --git a/net/base/upload_file_element_reader.h b/net/base/upload_file_element_reader.h
index 88e95bf..dc27585 100644
--- a/net/base/upload_file_element_reader.h
+++ b/net/base/upload_file_element_reader.h
@@ -42,16 +42,16 @@
}
// UploadElementReader overrides:
- virtual const UploadFileElementReader* AsFileReader() const OVERRIDE;
- virtual int Init(const CompletionCallback& callback) OVERRIDE;
- virtual uint64 GetContentLength() const OVERRIDE;
- virtual uint64 BytesRemaining() const OVERRIDE;
+ virtual const UploadFileElementReader* AsFileReader() const override;
+ virtual int Init(const CompletionCallback& callback) override;
+ virtual uint64 GetContentLength() const override;
+ virtual uint64 BytesRemaining() const override;
virtual int Read(IOBuffer* buf,
int buf_length,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
private:
- FRIEND_TEST_ALL_PREFIXES(UploadDataStreamTest, FileSmallerThanLength);
+ FRIEND_TEST_ALL_PREFIXES(ElementsUploadDataStreamTest, FileSmallerThanLength);
FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
UploadFileSmallerThanLength);
diff --git a/net/cert/cert_verify_proc_android.h b/net/cert/cert_verify_proc_android.h
index ca8746b..7002718 100644
--- a/net/cert/cert_verify_proc_android.h
+++ b/net/cert/cert_verify_proc_android.h
@@ -15,7 +15,7 @@
public:
CertVerifyProcAndroid();
- virtual bool SupportsAdditionalTrustAnchors() const OVERRIDE;
+ virtual bool SupportsAdditionalTrustAnchors() const override;
protected:
virtual ~CertVerifyProcAndroid();
@@ -26,7 +26,7 @@
int flags,
CRLSet* crl_set,
const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) OVERRIDE;
+ CertVerifyResult* verify_result) override;
};
} // namespace net
diff --git a/net/cert/cert_verify_proc_mac.h b/net/cert/cert_verify_proc_mac.h
index cb55767..f26768f 100644
--- a/net/cert/cert_verify_proc_mac.h
+++ b/net/cert/cert_verify_proc_mac.h
@@ -15,7 +15,7 @@
public:
CertVerifyProcMac();
- virtual bool SupportsAdditionalTrustAnchors() const OVERRIDE;
+ virtual bool SupportsAdditionalTrustAnchors() const override;
protected:
virtual ~CertVerifyProcMac();
@@ -26,7 +26,7 @@
int flags,
CRLSet* crl_set,
const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) OVERRIDE;
+ CertVerifyResult* verify_result) override;
};
} // namespace net
diff --git a/net/cert/cert_verify_proc_nss.h b/net/cert/cert_verify_proc_nss.h
index d9971cf..e3eb11f 100644
--- a/net/cert/cert_verify_proc_nss.h
+++ b/net/cert/cert_verify_proc_nss.h
@@ -17,7 +17,7 @@
public:
CertVerifyProcNSS();
- virtual bool SupportsAdditionalTrustAnchors() const OVERRIDE;
+ virtual bool SupportsAdditionalTrustAnchors() const override;
protected:
virtual ~CertVerifyProcNSS();
@@ -39,7 +39,7 @@
int flags,
CRLSet* crl_set,
const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) OVERRIDE;
+ CertVerifyResult* verify_result) override;
};
} // namespace net
diff --git a/net/cert/cert_verify_proc_openssl.h b/net/cert/cert_verify_proc_openssl.h
index d0d2574..ab1d0a3 100644
--- a/net/cert/cert_verify_proc_openssl.h
+++ b/net/cert/cert_verify_proc_openssl.h
@@ -14,7 +14,7 @@
public:
CertVerifyProcOpenSSL();
- virtual bool SupportsAdditionalTrustAnchors() const OVERRIDE;
+ virtual bool SupportsAdditionalTrustAnchors() const override;
protected:
virtual ~CertVerifyProcOpenSSL();
@@ -25,7 +25,7 @@
int flags,
CRLSet* crl_set,
const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) OVERRIDE;
+ CertVerifyResult* verify_result) override;
};
} // namespace net
diff --git a/net/cert/cert_verify_proc_unittest.cc b/net/cert/cert_verify_proc_unittest.cc
index 6890052..a71aa9a 100644
--- a/net/cert/cert_verify_proc_unittest.cc
+++ b/net/cert/cert_verify_proc_unittest.cc
@@ -58,7 +58,7 @@
: is_well_known_(is_well_known) {}
// CertVerifyProc implementation:
- virtual bool SupportsAdditionalTrustAnchors() const OVERRIDE { return false; }
+ virtual bool SupportsAdditionalTrustAnchors() const override { return false; }
protected:
virtual ~WellKnownCaCertVerifyProc() {}
@@ -69,7 +69,7 @@
int flags,
CRLSet* crl_set,
const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) OVERRIDE;
+ CertVerifyResult* verify_result) override;
const bool is_well_known_;
diff --git a/net/cert/cert_verify_proc_win.h b/net/cert/cert_verify_proc_win.h
index 147f47a..afcb838 100644
--- a/net/cert/cert_verify_proc_win.h
+++ b/net/cert/cert_verify_proc_win.h
@@ -15,7 +15,7 @@
public:
CertVerifyProcWin();
- virtual bool SupportsAdditionalTrustAnchors() const OVERRIDE;
+ virtual bool SupportsAdditionalTrustAnchors() const override;
protected:
virtual ~CertVerifyProcWin();
@@ -26,7 +26,7 @@
int flags,
CRLSet* crl_set,
const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) OVERRIDE;
+ CertVerifyResult* verify_result) override;
};
} // namespace net
diff --git a/net/cert/ct_log_verifier_unittest.cc b/net/cert/ct_log_verifier_unittest.cc
index 23cbf51..e2918c9 100644
--- a/net/cert/ct_log_verifier_unittest.cc
+++ b/net/cert/ct_log_verifier_unittest.cc
@@ -18,7 +18,7 @@
public:
CTLogVerifierTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
log_ = CTLogVerifier::Create(ct::GetTestPublicKey(), "testlog").Pass();
ASSERT_TRUE(log_);
diff --git a/net/cert/ct_objects_extractor_unittest.cc b/net/cert/ct_objects_extractor_unittest.cc
index 5feff3e..ac46755 100644
--- a/net/cert/ct_objects_extractor_unittest.cc
+++ b/net/cert/ct_objects_extractor_unittest.cc
@@ -20,7 +20,7 @@
class CTObjectsExtractorTest : public ::testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
precert_chain_ =
CreateCertificateListFromFile(GetTestCertsDirectory(),
"ct-test-embedded-cert.pem",
diff --git a/net/cert/ct_serialization_unittest.cc b/net/cert/ct_serialization_unittest.cc
index 866f961..ccf2d20 100644
--- a/net/cert/ct_serialization_unittest.cc
+++ b/net/cert/ct_serialization_unittest.cc
@@ -20,7 +20,7 @@
class CtSerializationTest : public ::testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
test_digitally_signed_ = ct::GetTestDigitallySigned();
}
diff --git a/net/cert/ev_root_ca_metadata_unittest.cc b/net/cert/ev_root_ca_metadata_unittest.cc
index 1bb5475..90f4fa1 100644
--- a/net/cert/ev_root_ca_metadata_unittest.cc
+++ b/net/cert/ev_root_ca_metadata_unittest.cc
@@ -94,7 +94,7 @@
class EVRootCAMetadataTest : public testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(ev_oid_data.Init());
}
diff --git a/net/cert/mock_cert_verifier.h b/net/cert/mock_cert_verifier.h
index 5af7b7e..e76f78f 100644
--- a/net/cert/mock_cert_verifier.h
+++ b/net/cert/mock_cert_verifier.h
@@ -32,8 +32,8 @@
CertVerifyResult* verify_result,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle req) OVERRIDE;
+ const BoundNetLog& net_log) override;
+ virtual void CancelRequest(RequestHandle req) override;
// Sets the default return value for Verify() for certificates/hosts that do
// not have explicit results added via the AddResult*() methods.
diff --git a/net/cert/multi_log_ct_verifier.h b/net/cert/multi_log_ct_verifier.h
index 29fbdca..70adf52 100644
--- a/net/cert/multi_log_ct_verifier.h
+++ b/net/cert/multi_log_ct_verifier.h
@@ -41,7 +41,7 @@
const std::string& stapled_ocsp_response,
const std::string& sct_list_from_tls_extension,
ct::CTVerifyResult* result,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
private:
// Mapping from a log's ID to the verifier for this log.
diff --git a/net/cert/multi_log_ct_verifier_unittest.cc b/net/cert/multi_log_ct_verifier_unittest.cc
index 8edf4eb..17a670c 100644
--- a/net/cert/multi_log_ct_verifier_unittest.cc
+++ b/net/cert/multi_log_ct_verifier_unittest.cc
@@ -37,7 +37,7 @@
class MultiLogCTVerifierTest : public ::testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
scoped_ptr<CTLogVerifier> log(
CTLogVerifier::Create(ct::GetTestPublicKey(), kLogDescription));
ASSERT_TRUE(log);
diff --git a/net/cert/multi_threaded_cert_verifier.h b/net/cert/multi_threaded_cert_verifier.h
index cdd3235..2ca10f1 100644
--- a/net/cert/multi_threaded_cert_verifier.h
+++ b/net/cert/multi_threaded_cert_verifier.h
@@ -61,9 +61,9 @@
CertVerifyResult* verify_result,
const CompletionCallback& callback,
CertVerifier::RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(CertVerifier::RequestHandle req) OVERRIDE;
+ virtual void CancelRequest(CertVerifier::RequestHandle req) override;
private:
friend class CertVerifierWorker; // Calls HandleResult.
@@ -137,7 +137,7 @@
const CertVerifyResult& verify_result);
// CertDatabase::Observer methods:
- virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE;
+ virtual void OnCACertChanged(const X509Certificate* cert) override;
// For unit testing.
void ClearCache() { cache_.Clear(); }
diff --git a/net/cert/multi_threaded_cert_verifier_unittest.cc b/net/cert/multi_threaded_cert_verifier_unittest.cc
index bf7de6d..651f78e 100644
--- a/net/cert/multi_threaded_cert_verifier_unittest.cc
+++ b/net/cert/multi_threaded_cert_verifier_unittest.cc
@@ -39,7 +39,7 @@
virtual ~MockCertVerifyProc() {}
// CertVerifyProc implementation
- virtual bool SupportsAdditionalTrustAnchors() const OVERRIDE {
+ virtual bool SupportsAdditionalTrustAnchors() const override {
return false;
}
@@ -48,7 +48,7 @@
int flags,
CRLSet* crl_set,
const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) OVERRIDE {
+ CertVerifyResult* verify_result) override {
verify_result->Reset();
verify_result->verified_cert = cert;
verify_result->cert_status = CERT_STATUS_COMMON_NAME_INVALID;
diff --git a/net/cert/nss_cert_database.cc b/net/cert/nss_cert_database.cc
index 9707973..2c40e15 100644
--- a/net/cert/nss_cert_database.cc
+++ b/net/cert/nss_cert_database.cc
@@ -51,15 +51,15 @@
virtual ~CertNotificationForwarder() {}
// NSSCertDatabase::Observer implementation:
- virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE {
+ virtual void OnCertAdded(const X509Certificate* cert) override {
cert_db_->NotifyObserversOfCertAdded(cert);
}
- virtual void OnCertRemoved(const X509Certificate* cert) OVERRIDE {
+ virtual void OnCertRemoved(const X509Certificate* cert) override {
cert_db_->NotifyObserversOfCertRemoved(cert);
}
- virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE {
+ virtual void OnCACertChanged(const X509Certificate* cert) override {
cert_db_->NotifyObserversOfCACertChanged(cert);
}
diff --git a/net/cert/nss_cert_database_chromeos.h b/net/cert/nss_cert_database_chromeos.h
index dfcefec..171ce28 100644
--- a/net/cert/nss_cert_database_chromeos.h
+++ b/net/cert/nss_cert_database_chromeos.h
@@ -25,12 +25,12 @@
void SetSystemSlot(crypto::ScopedPK11Slot system_slot);
// NSSCertDatabase implementation.
- virtual void ListCertsSync(CertificateList* certs) OVERRIDE;
+ virtual void ListCertsSync(CertificateList* certs) override;
virtual void ListCerts(const NSSCertDatabase::ListCertsCallback& callback)
- OVERRIDE;
+ override;
virtual void ListModules(CryptoModuleList* modules, bool need_rw) const
- OVERRIDE;
- virtual crypto::ScopedPK11Slot GetSystemSlot() const OVERRIDE;
+ override;
+ virtual crypto::ScopedPK11Slot GetSystemSlot() const override;
// TODO(mattm): handle trust setting, deletion, etc correctly when certs exist
// in multiple slots.
diff --git a/net/cert/nss_cert_database_chromeos_unittest.cc b/net/cert/nss_cert_database_chromeos_unittest.cc
index 5f790c9..caf5ea9 100644
--- a/net/cert/nss_cert_database_chromeos_unittest.cc
+++ b/net/cert/nss_cert_database_chromeos_unittest.cc
@@ -48,7 +48,7 @@
NSSCertDatabaseChromeOSTest()
: observer_added_(false), user_1_("user1"), user_2_("user2") {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Initialize nss_util slots.
ASSERT_TRUE(user_1_.constructed_successfully());
ASSERT_TRUE(user_2_.constructed_successfully());
@@ -77,19 +77,19 @@
observer_added_ = true;
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (observer_added_)
CertDatabase::GetInstance()->RemoveObserver(this);
}
// CertDatabase::Observer:
- virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE {
+ virtual void OnCertAdded(const X509Certificate* cert) override {
added_.push_back(cert ? cert->os_cert_handle() : NULL);
}
- virtual void OnCertRemoved(const X509Certificate* cert) OVERRIDE {}
+ virtual void OnCertRemoved(const X509Certificate* cert) override {}
- virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE {
+ virtual void OnCACertChanged(const X509Certificate* cert) override {
added_ca_.push_back(cert ? cert->os_cert_handle() : NULL);
}
diff --git a/net/cert/nss_profile_filter_chromeos_unittest.cc b/net/cert/nss_profile_filter_chromeos_unittest.cc
index b48a527..1ebf399 100644
--- a/net/cert/nss_profile_filter_chromeos_unittest.cc
+++ b/net/cert/nss_profile_filter_chromeos_unittest.cc
@@ -58,7 +58,7 @@
public:
NSSProfileFilterChromeOSTest() : user_1_("user1"), user_2_("user2") {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(system_slot_user_.is_open());
ASSERT_TRUE(user_1_.constructed_successfully());
ASSERT_TRUE(user_2_.constructed_successfully());
diff --git a/net/cert/signed_certificate_timestamp_unittest.cc b/net/cert/signed_certificate_timestamp_unittest.cc
index c758d65..dc60a27 100644
--- a/net/cert/signed_certificate_timestamp_unittest.cc
+++ b/net/cert/signed_certificate_timestamp_unittest.cc
@@ -20,7 +20,7 @@
class SignedCertificateTimestampTest : public ::testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
GetX509CertSCT(&sample_sct_);
sample_sct_->origin = SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE;
sample_sct_->log_description = kLogDescription;
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index 4244f76..10a6f6b 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -428,7 +428,7 @@
}
// CookieMonsterTask:
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
protected:
virtual ~SetCookieWithDetailsTask() {}
@@ -468,7 +468,7 @@
}
// CookieMonsterTask
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
protected:
virtual ~GetAllCookiesTask() {}
@@ -503,7 +503,7 @@
}
// CookieMonsterTask:
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
protected:
virtual ~GetAllCookiesForURLWithOptionsTask() {}
@@ -544,7 +544,7 @@
}
// CookieMonsterTask:
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
private:
// Runs the delete task and returns a result.
@@ -596,7 +596,7 @@
}
// DeleteTask:
- virtual int RunDeleteTask() OVERRIDE;
+ virtual int RunDeleteTask() override;
protected:
virtual ~DeleteAllTask() {}
@@ -622,7 +622,7 @@
}
// DeleteTask:
- virtual int RunDeleteTask() OVERRIDE;
+ virtual int RunDeleteTask() override;
protected:
virtual ~DeleteAllCreatedBetweenTask() {}
@@ -650,7 +650,7 @@
}
// DeleteTask:
- virtual int RunDeleteTask() OVERRIDE;
+ virtual int RunDeleteTask() override;
protected:
virtual ~DeleteAllForHostTask() {}
@@ -682,7 +682,7 @@
}
// DeleteTask:
- virtual int RunDeleteTask() OVERRIDE;
+ virtual int RunDeleteTask() override;
protected:
virtual ~DeleteAllCreatedBetweenForHostTask() {}
@@ -711,7 +711,7 @@
}
// DeleteTask:
- virtual bool RunDeleteTask() OVERRIDE;
+ virtual bool RunDeleteTask() override;
protected:
virtual ~DeleteCanonicalCookieTask() {}
@@ -742,7 +742,7 @@
}
// CookieMonsterTask:
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
protected:
virtual ~SetCookieWithOptionsTask() {}
@@ -779,7 +779,7 @@
}
// CookieMonsterTask:
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
protected:
virtual ~GetCookiesWithOptionsTask() {}
@@ -814,7 +814,7 @@
}
// DeleteTask:
- virtual void RunDeleteTask() OVERRIDE;
+ virtual void RunDeleteTask() override;
protected:
virtual ~DeleteCookieTask() {}
@@ -839,7 +839,7 @@
}
// DeleteTask:
- virtual int RunDeleteTask() OVERRIDE;
+ virtual int RunDeleteTask() override;
protected:
virtual ~DeleteSessionCookiesTask() {}
@@ -865,7 +865,7 @@
}
// CookieMonsterTask:
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
protected:
virtual ~HasCookiesForETLDP1Task() {}
diff --git a/net/cookies/cookie_monster.h b/net/cookies/cookie_monster.h
index ea448c5..746f2a4 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -243,7 +243,7 @@
const GURL& url,
const std::string& cookie_line,
const CookieOptions& options,
- const SetCookiesCallback& callback) OVERRIDE;
+ const SetCookiesCallback& callback) override;
// Gets all cookies that apply to |url| given |options|.
// The returned cookies are ordered by longest path, then earliest
@@ -251,18 +251,18 @@
virtual void GetCookiesWithOptionsAsync(
const GURL& url,
const CookieOptions& options,
- const GetCookiesCallback& callback) OVERRIDE;
+ const GetCookiesCallback& callback) override;
// Invokes GetAllCookiesForURLWithOptions with options set to include HTTP
// only cookies.
virtual void GetAllCookiesForURLAsync(
const GURL& url,
- const GetCookieListCallback& callback) OVERRIDE;
+ const GetCookieListCallback& callback) override;
// Deletes all cookies with that might apply to |url| that has |cookie_name|.
virtual void DeleteCookieAsync(
const GURL& url, const std::string& cookie_name,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
// Deletes all of the cookies that have a creation_date greater than or equal
// to |delete_begin| and less than |delete_end|.
@@ -270,7 +270,7 @@
virtual void DeleteAllCreatedBetweenAsync(
const base::Time& delete_begin,
const base::Time& delete_end,
- const DeleteCallback& callback) OVERRIDE;
+ const DeleteCallback& callback) override;
// Deletes all of the cookies that match the host of the given URL
// regardless of path and that have a creation_date greater than or
@@ -282,11 +282,11 @@
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
- const DeleteCallback& callback) OVERRIDE;
+ const DeleteCallback& callback) override;
- virtual void DeleteSessionCookiesAsync(const DeleteCallback&) OVERRIDE;
+ virtual void DeleteSessionCookiesAsync(const DeleteCallback&) override;
- virtual CookieMonster* GetCookieMonster() OVERRIDE;
+ virtual CookieMonster* GetCookieMonster() override;
// Enables writing session cookies into the cookie database. If this this
// method is called, it must be called before first use of the instance
diff --git a/net/cookies/cookie_monster_store_test.h b/net/cookies/cookie_monster_store_test.h
index efbcbe5..c3a2827 100644
--- a/net/cookies/cookie_monster_store_test.h
+++ b/net/cookies/cookie_monster_store_test.h
@@ -82,22 +82,22 @@
return commands_;
}
- virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
+ virtual void Load(const LoadedCallback& loaded_callback) override;
virtual void LoadCookiesForKey(const std::string& key,
- const LoadedCallback& loaded_callback) OVERRIDE;
+ const LoadedCallback& loaded_callback) override;
- virtual void AddCookie(const CanonicalCookie& cookie) OVERRIDE;
+ virtual void AddCookie(const CanonicalCookie& cookie) override;
virtual void UpdateCookieAccessTime(
- const CanonicalCookie& cookie) OVERRIDE;
+ const CanonicalCookie& cookie) override;
virtual void DeleteCookie(
- const CanonicalCookie& cookie) OVERRIDE;
+ const CanonicalCookie& cookie) override;
- virtual void Flush(const base::Closure& callback) OVERRIDE;
+ virtual void Flush(const base::Closure& callback) override;
- virtual void SetForceKeepSessionState() OVERRIDE;
+ virtual void SetForceKeepSessionState() override;
protected:
virtual ~MockPersistentCookieStore();
@@ -130,9 +130,9 @@
virtual void OnCookieChanged(
const CanonicalCookie& cookie,
bool removed,
- CookieMonsterDelegate::ChangeCause cause) OVERRIDE;
+ CookieMonsterDelegate::ChangeCause cause) override;
- virtual void OnLoaded() OVERRIDE;
+ virtual void OnLoaded() override;
private:
virtual ~MockCookieMonsterDelegate();
@@ -161,20 +161,20 @@
public:
MockSimplePersistentCookieStore();
- virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
+ virtual void Load(const LoadedCallback& loaded_callback) override;
virtual void LoadCookiesForKey(const std::string& key,
- const LoadedCallback& loaded_callback) OVERRIDE;
+ const LoadedCallback& loaded_callback) override;
- virtual void AddCookie(const CanonicalCookie& cookie) OVERRIDE;
+ virtual void AddCookie(const CanonicalCookie& cookie) override;
- virtual void UpdateCookieAccessTime(const CanonicalCookie& cookie) OVERRIDE;
+ virtual void UpdateCookieAccessTime(const CanonicalCookie& cookie) override;
- virtual void DeleteCookie(const CanonicalCookie& cookie) OVERRIDE;
+ virtual void DeleteCookie(const CanonicalCookie& cookie) override;
- virtual void Flush(const base::Closure& callback) OVERRIDE;
+ virtual void Flush(const base::Closure& callback) override;
- virtual void SetForceKeepSessionState() OVERRIDE;
+ virtual void SetForceKeepSessionState() override;
protected:
virtual ~MockSimplePersistentCookieStore();
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index 0610612..a328487 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -2165,7 +2165,7 @@
public:
FlushablePersistentStore() : flush_count_(0) {}
- virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE {
+ virtual void Load(const LoadedCallback& loaded_callback) override {
std::vector<CanonicalCookie*> out_cookies;
base::MessageLoop::current()->PostTask(
FROM_HERE,
@@ -2175,16 +2175,16 @@
virtual void LoadCookiesForKey(
const std::string& key,
- const LoadedCallback& loaded_callback) OVERRIDE {
+ const LoadedCallback& loaded_callback) override {
Load(loaded_callback);
}
- virtual void AddCookie(const CanonicalCookie&) OVERRIDE {}
- virtual void UpdateCookieAccessTime(const CanonicalCookie&) OVERRIDE {}
- virtual void DeleteCookie(const CanonicalCookie&) OVERRIDE {}
- virtual void SetForceKeepSessionState() OVERRIDE {}
+ virtual void AddCookie(const CanonicalCookie&) override {}
+ virtual void UpdateCookieAccessTime(const CanonicalCookie&) override {}
+ virtual void DeleteCookie(const CanonicalCookie&) override {}
+ virtual void SetForceKeepSessionState() override {}
- virtual void Flush(const base::Closure& callback) OVERRIDE {
+ virtual void Flush(const base::Closure& callback) override {
++flush_count_;
if (!callback.is_null())
callback.Run();
diff --git a/net/cookies/cookie_store_test_helpers.h b/net/cookies/cookie_store_test_helpers.h
index 84b83bc..e4e7156 100644
--- a/net/cookies/cookie_store_test_helpers.h
+++ b/net/cookies/cookie_store_test_helpers.h
@@ -27,16 +27,16 @@
const GURL& url,
const std::string& cookie_line,
const CookieOptions& options,
- const CookieMonster::SetCookiesCallback& callback) OVERRIDE;
+ const CookieMonster::SetCookiesCallback& callback) override;
virtual void GetCookiesWithOptionsAsync(
const GURL& url,
const CookieOptions& options,
- const CookieMonster::GetCookiesCallback& callback) OVERRIDE;
+ const CookieMonster::GetCookiesCallback& callback) override;
virtual void GetAllCookiesForURLAsync(
const GURL& url,
- const GetCookieListCallback& callback) OVERRIDE;
+ const GetCookieListCallback& callback) override;
virtual bool SetCookieWithOptions(const GURL& url,
const std::string& cookie_line,
@@ -50,22 +50,22 @@
virtual void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void DeleteAllCreatedBetweenAsync(
const base::Time& delete_begin,
const base::Time& delete_end,
- const DeleteCallback& callback) OVERRIDE;
+ const DeleteCallback& callback) override;
virtual void DeleteAllCreatedBetweenForHostAsync(
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
- const DeleteCallback& callback) OVERRIDE;
+ const DeleteCallback& callback) override;
- virtual void DeleteSessionCookiesAsync(const DeleteCallback&) OVERRIDE;
+ virtual void DeleteSessionCookiesAsync(const DeleteCallback&) override;
- virtual CookieMonster* GetCookieMonster() OVERRIDE;
+ virtual CookieMonster* GetCookieMonster() override;
private:
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index 572691c..b3b80b4 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -1843,7 +1843,7 @@
virtual ~BadEntropyProvider() {}
virtual double GetEntropyForTrial(const std::string& trial_name,
- uint32 randomization_seed) const OVERRIDE {
+ uint32 randomization_seed) const override {
return 0.5;
}
};
diff --git a/net/disk_cache/blockfile/backend_impl.cc b/net/disk_cache/blockfile/backend_impl.cc
index 4082743..bcac374 100644
--- a/net/disk_cache/blockfile/backend_impl.cc
+++ b/net/disk_cache/blockfile/backend_impl.cc
@@ -1260,7 +1260,7 @@
}
virtual int OpenNextEntry(Entry** next_entry,
- const net::CompletionCallback& callback) OVERRIDE {
+ const net::CompletionCallback& callback) override {
if (!background_queue_)
return net::ERR_FAILED;
background_queue_->OpenNextEntry(iterator_.get(), next_entry, callback);
diff --git a/net/disk_cache/blockfile/backend_impl.h b/net/disk_cache/blockfile/backend_impl.h
index 1abc66d..e81b928 100644
--- a/net/disk_cache/blockfile/backend_impl.h
+++ b/net/disk_cache/blockfile/backend_impl.h
@@ -259,20 +259,20 @@
void FlushIndex();
// Backend implementation.
- virtual net::CacheType GetCacheType() const OVERRIDE;
- virtual int32 GetEntryCount() const OVERRIDE;
+ virtual net::CacheType GetCacheType() const override;
+ virtual int32 GetEntryCount() const override;
virtual int OpenEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int CreateEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int DoomEntry(const std::string& key,
- const CompletionCallback& callback) OVERRIDE;
- virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int DoomAllEntries(const CompletionCallback& callback) override;
virtual int DoomEntriesBetween(base::Time initial_time,
base::Time end_time,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int DoomEntriesSince(base::Time initial_time,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// NOTE: The blockfile Backend::Iterator::OpenNextEntry method does not modify
// the last_used field of the entry, and therefore it does not impact the
// eviction ranking of the entry. However, an enumeration will go through all
@@ -281,9 +281,9 @@
// the iterator (for example, deleting the entry) will invalidate the
// iterator. Performing operations on an entry that modify the entry may
// result in loops in the iteration, skipped entries or similar.
- virtual scoped_ptr<Iterator> CreateIterator() OVERRIDE;
- virtual void GetStats(StatsItems* stats) OVERRIDE;
- virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
+ virtual scoped_ptr<Iterator> CreateIterator() override;
+ virtual void GetStats(StatsItems* stats) override;
+ virtual void OnExternalCacheHit(const std::string& key) override;
private:
typedef base::hash_map<CacheAddr, EntryImpl*> EntriesMap;
diff --git a/net/disk_cache/blockfile/backend_impl_v3.cc b/net/disk_cache/blockfile/backend_impl_v3.cc
index b44b195..09794d3 100644
--- a/net/disk_cache/blockfile/backend_impl_v3.cc
+++ b/net/disk_cache/blockfile/backend_impl_v3.cc
@@ -667,7 +667,7 @@
}
virtual int OpenNextEntry(Entry** next_entry,
- const net::CompletionCallback& callback) OVERRIDE {
+ const net::CompletionCallback& callback) override {
if (!background_queue_)
return net::ERR_FAILED;
background_queue_->OpenNextEntry(&data_, next_entry, callback);
@@ -1511,7 +1511,7 @@
class BackendImplV3::NotImplementedIterator : public Backend::Iterator {
public:
virtual int OpenNextEntry(disk_cache::Entry** next_entry,
- const net::CompletionCallback& callback) OVERRIDE {
+ const net::CompletionCallback& callback) override {
return net::ERR_NOT_IMPLEMENTED;
}
};
diff --git a/net/disk_cache/blockfile/backend_impl_v3.h b/net/disk_cache/blockfile/backend_impl_v3.h
index ca64997..6f4f882 100644
--- a/net/disk_cache/blockfile/backend_impl_v3.h
+++ b/net/disk_cache/blockfile/backend_impl_v3.h
@@ -172,23 +172,23 @@
int SelfCheck();
// Backend implementation.
- virtual net::CacheType GetCacheType() const OVERRIDE;
- virtual int32 GetEntryCount() const OVERRIDE;
+ virtual net::CacheType GetCacheType() const override;
+ virtual int32 GetEntryCount() const override;
virtual int OpenEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int CreateEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int DoomEntry(const std::string& key,
- const CompletionCallback& callback) OVERRIDE;
- virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int DoomAllEntries(const CompletionCallback& callback) override;
virtual int DoomEntriesBetween(base::Time initial_time,
base::Time end_time,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int DoomEntriesSince(base::Time initial_time,
- const CompletionCallback& callback) OVERRIDE;
- virtual scoped_ptr<Iterator> CreateIterator() OVERRIDE;
- virtual void GetStats(StatsItems* stats) OVERRIDE;
- virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual scoped_ptr<Iterator> CreateIterator() override;
+ virtual void GetStats(StatsItems* stats) override;
+ virtual void OnExternalCacheHit(const std::string& key) override;
private:
friend class EvictionV3;
diff --git a/net/disk_cache/blockfile/entry_impl.cc b/net/disk_cache/blockfile/entry_impl.cc
index 3c3b218..2b98470 100644
--- a/net/disk_cache/blockfile/entry_impl.cc
+++ b/net/disk_cache/blockfile/entry_impl.cc
@@ -46,7 +46,7 @@
}
virtual ~SyncCallback() {}
- virtual void OnFileIOComplete(int bytes_copied) OVERRIDE;
+ virtual void OnFileIOComplete(int bytes_copied) override;
void Discard();
private:
diff --git a/net/disk_cache/blockfile/entry_impl.h b/net/disk_cache/blockfile/entry_impl.h
index c0b332b..fea815d 100644
--- a/net/disk_cache/blockfile/entry_impl.h
+++ b/net/disk_cache/blockfile/entry_impl.h
@@ -147,26 +147,26 @@
static int NumBlocksForEntry(int key_size);
// Entry interface.
- virtual void Doom() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual std::string GetKey() const OVERRIDE;
- virtual base::Time GetLastUsed() const OVERRIDE;
- virtual base::Time GetLastModified() const OVERRIDE;
- virtual int32 GetDataSize(int index) const OVERRIDE;
+ virtual void Doom() override;
+ virtual void Close() override;
+ virtual std::string GetKey() const override;
+ virtual base::Time GetLastUsed() const override;
+ virtual base::Time GetLastModified() const override;
+ virtual int32 GetDataSize(int index) const override;
virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len,
const CompletionCallback& callback,
- bool truncate) OVERRIDE;
+ bool truncate) override;
virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int GetAvailableRange(int64 offset, int len, int64* start,
- const CompletionCallback& callback) OVERRIDE;
- virtual bool CouldBeSparse() const OVERRIDE;
- virtual void CancelSparseIO() OVERRIDE;
- virtual int ReadyForSparseIO(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual bool CouldBeSparse() const override;
+ virtual void CancelSparseIO() override;
+ virtual int ReadyForSparseIO(const CompletionCallback& callback) override;
private:
enum {
diff --git a/net/disk_cache/blockfile/entry_impl_v3.h b/net/disk_cache/blockfile/entry_impl_v3.h
index 6be0c71..4215000 100644
--- a/net/disk_cache/blockfile/entry_impl_v3.h
+++ b/net/disk_cache/blockfile/entry_impl_v3.h
@@ -77,26 +77,26 @@
const net::BoundNetLog& net_log() const;
// Entry interface.
- virtual void Doom() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual std::string GetKey() const OVERRIDE;
- virtual base::Time GetLastUsed() const OVERRIDE;
- virtual base::Time GetLastModified() const OVERRIDE;
- virtual int32 GetDataSize(int index) const OVERRIDE;
+ virtual void Doom() override;
+ virtual void Close() override;
+ virtual std::string GetKey() const override;
+ virtual base::Time GetLastUsed() const override;
+ virtual base::Time GetLastModified() const override;
+ virtual int32 GetDataSize(int index) const override;
virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len,
const CompletionCallback& callback,
- bool truncate) OVERRIDE;
+ bool truncate) override;
virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int GetAvailableRange(int64 offset, int len, int64* start,
- const CompletionCallback& callback) OVERRIDE;
- virtual bool CouldBeSparse() const OVERRIDE;
- virtual void CancelSparseIO() OVERRIDE;
- virtual int ReadyForSparseIO(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual bool CouldBeSparse() const override;
+ virtual void CancelSparseIO() override;
+ virtual int ReadyForSparseIO(const CompletionCallback& callback) override;
private:
enum {
diff --git a/net/disk_cache/blockfile/file_ios.cc b/net/disk_cache/blockfile/file_ios.cc
index 4659e75..ef0e2fa 100644
--- a/net/disk_cache/blockfile/file_ios.cc
+++ b/net/disk_cache/blockfile/file_ios.cc
@@ -80,7 +80,7 @@
// queued (because we are inside WaitForPendingIO), and false if said task is
// the one performing the call.
virtual void OnOperationComplete(disk_cache::BackgroundIO* operation,
- bool cancel) OVERRIDE;
+ bool cancel) override;
private:
DISALLOW_COPY_AND_ASSIGN(FileInFlightIO);
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.cc b/net/disk_cache/blockfile/in_flight_backend_io.cc
index 28d7114..9bb011e 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.cc
+++ b/net/disk_cache/blockfile/in_flight_backend_io.cc
@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/profiler/scoped_profile.h"
#include "base/single_thread_task_runner.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/blockfile/backend_impl.h"
@@ -64,8 +65,14 @@
if (result() == net::OK) {
static_cast<EntryImpl*>(*entry_ptr_)->OnEntryCreated(backend_);
- if (cancel)
+ if (cancel) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is
+ // fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 BackendIO::OnDone"));
+
(*entry_ptr_)->Close();
+ }
}
}
@@ -496,8 +503,14 @@
BackendIO* op = static_cast<BackendIO*>(operation);
op->OnDone(cancel);
- if (!op->callback().is_null() && (!cancel || op->IsEntryOperation()))
+ if (!op->callback().is_null() && (!cancel || op->IsEntryOperation())) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422516 InFlightBackendIO::OnOperationComplete"));
+
op->callback().Run(op->result());
+ }
}
void InFlightBackendIO::PostOperation(BackendIO* operation) {
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.h b/net/disk_cache/blockfile/in_flight_backend_io.h
index 5d8e435..4b10405 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.h
+++ b/net/disk_cache/blockfile/in_flight_backend_io.h
@@ -205,7 +205,7 @@
protected:
virtual void OnOperationComplete(BackgroundIO* operation,
- bool cancel) OVERRIDE;
+ bool cancel) override;
private:
void PostOperation(BackendIO* operation);
diff --git a/net/disk_cache/blockfile/in_flight_io.cc b/net/disk_cache/blockfile/in_flight_io.cc
index 9ada7c5..176cf87 100644
--- a/net/disk_cache/blockfile/in_flight_io.cc
+++ b/net/disk_cache/blockfile/in_flight_io.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/profiler/scoped_profile.h"
#include "base/single_thread_task_runner.h"
#include "base/task_runner.h"
#include "base/thread_task_runner_handle.h"
@@ -87,6 +88,10 @@
// Runs on the primary thread.
void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) {
{
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 InFlightIO::InvokeCallback"));
+
// http://crbug.com/74623
base::ThreadRestrictions::ScopedAllowWait allow_wait;
operation->io_completed()->Wait();
diff --git a/net/disk_cache/blockfile/index_table_v3_unittest.cc b/net/disk_cache/blockfile/index_table_v3_unittest.cc
index b7a93a2..7f68ee3 100644
--- a/net/disk_cache/blockfile/index_table_v3_unittest.cc
+++ b/net/disk_cache/blockfile/index_table_v3_unittest.cc
@@ -35,12 +35,12 @@
bool grow_called() const { return grow_called_; }
int buffer_len() const { return buffer_len_; }
- virtual void GrowIndex() OVERRIDE { grow_called_ = true; }
- virtual void SaveIndex(net::IOBuffer* buffer, int buffer_len) OVERRIDE {
+ virtual void GrowIndex() override { grow_called_ = true; }
+ virtual void SaveIndex(net::IOBuffer* buffer, int buffer_len) override {
buffer_len_ = buffer_len;
}
- virtual void DeleteCell(EntryCell cell) OVERRIDE {}
- virtual void FixCell(EntryCell cell) OVERRIDE {}
+ virtual void DeleteCell(EntryCell cell) override {}
+ virtual void FixCell(EntryCell cell) override {}
private:
bool grow_called_;
diff --git a/net/disk_cache/blockfile/mapped_file_unittest.cc b/net/disk_cache/blockfile/mapped_file_unittest.cc
index 8b3a1d0..8093e9a 100644
--- a/net/disk_cache/blockfile/mapped_file_unittest.cc
+++ b/net/disk_cache/blockfile/mapped_file_unittest.cc
@@ -23,7 +23,7 @@
}
virtual ~FileCallbackTest() {}
- virtual void OnFileIOComplete(int bytes_copied) OVERRIDE;
+ virtual void OnFileIOComplete(int bytes_copied) override;
private:
int id_;
@@ -48,9 +48,9 @@
virtual ~TestFileBlock() {}
// FileBlock interface.
- virtual void* buffer() const OVERRIDE { return const_cast<char*>(buffer_); }
- virtual size_t size() const OVERRIDE { return sizeof(buffer_); }
- virtual int offset() const OVERRIDE { return 1024; }
+ virtual void* buffer() const override { return const_cast<char*>(buffer_); }
+ virtual size_t size() const override { return sizeof(buffer_); }
+ virtual int offset() const override { return 1024; }
private:
char buffer_[20];
diff --git a/net/disk_cache/blockfile/sparse_control.cc b/net/disk_cache/blockfile/sparse_control.cc
index e251d84..ddb57b6 100644
--- a/net/disk_cache/blockfile/sparse_control.cc
+++ b/net/disk_cache/blockfile/sparse_control.cc
@@ -56,7 +56,7 @@
ChildrenDeleter(disk_cache::BackendImpl* backend, const std::string& name)
: backend_(backend->GetWeakPtr()), name_(name), signature_(0) {}
- virtual void OnFileIOComplete(int bytes_copied) OVERRIDE;
+ virtual void OnFileIOComplete(int bytes_copied) override;
// Two ways of deleting the children: if we have the children map, use Start()
// directly, otherwise pass the data address to ReadData().
diff --git a/net/disk_cache/blockfile/sparse_control_v3.cc b/net/disk_cache/blockfile/sparse_control_v3.cc
index 66a60a2..cba0ed5 100644
--- a/net/disk_cache/blockfile/sparse_control_v3.cc
+++ b/net/disk_cache/blockfile/sparse_control_v3.cc
@@ -56,7 +56,7 @@
ChildrenDeleter(disk_cache::BackendImpl* backend, const std::string& name)
: backend_(backend->GetWeakPtr()), name_(name), signature_(0) {}
- virtual void OnFileIOComplete(int bytes_copied) OVERRIDE;
+ virtual void OnFileIOComplete(int bytes_copied) override;
// Two ways of deleting the children: if we have the children map, use Start()
// directly, otherwise pass the data address to ReadData().
diff --git a/net/disk_cache/cache_creator.cc b/net/disk_cache/cache_creator.cc
index 8c4400c..becb31c 100644
--- a/net/disk_cache/cache_creator.cc
+++ b/net/disk_cache/cache_creator.cc
@@ -4,6 +4,7 @@
#include "base/files/file_path.h"
#include "base/metrics/field_trial.h"
+#include "base/profiler/scoped_profile.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
#include "net/base/cache_type.h"
@@ -139,6 +140,10 @@
// If the initialization of the cache fails, and |force| is true, we will
// discard the whole cache and create a new one.
void CacheCreator::OnIOComplete(int result) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 CacheCreator::OnIOComplete"));
+
if (result == net::OK || !force_ || retry_)
return DoCallback(result);
diff --git a/net/disk_cache/cache_util.cc b/net/disk_cache/cache_util.cc
index ea39df0..1671138 100644
--- a/net/disk_cache/cache_util.cc
+++ b/net/disk_cache/cache_util.cc
@@ -145,15 +145,12 @@
if (available < 0)
return kDefaultCacheSize;
- int64 max_size = PreferredCacheSizeInternal(available);
-
// Limit cache size to somewhat less than kint32max to avoid potential
// integer overflows in cache backend implementations.
- DCHECK(kDefaultCacheSize * 4 < kint32max);
- if (max_size > kDefaultCacheSize * 4)
- max_size = kDefaultCacheSize * 4;
-
- return implicit_cast<int32>(max_size);
+ DCHECK_LT(kDefaultCacheSize * 4, kint32max);
+ return static_cast<int32>(std::min(
+ PreferredCacheSizeInternal(available),
+ static_cast<int64>(kDefaultCacheSize * 4)));
}
} // namespace disk_cache
diff --git a/net/disk_cache/disk_cache_test_base.h b/net/disk_cache/disk_cache_test_base.h
index 225d37f..ce36f92 100644
--- a/net/disk_cache/disk_cache_test_base.h
+++ b/net/disk_cache/disk_cache_test_base.h
@@ -46,7 +46,7 @@
// Deletes the contents of |cache_path_|.
bool CleanupCacheDir();
- virtual void TearDown() OVERRIDE;
+ virtual void TearDown() override;
base::FilePath cache_path_;
@@ -154,7 +154,7 @@
void AddDelay();
// DiskCacheTest:
- virtual void TearDown() OVERRIDE;
+ virtual void TearDown() override;
// cache_ will always have a valid object, regardless of how the cache was
// initialized. The implementation pointers can be NULL.
diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc
index afe93ac..a3a7747 100644
--- a/net/disk_cache/entry_unittest.cc
+++ b/net/disk_cache/entry_unittest.cc
@@ -2063,7 +2063,7 @@
}
private:
- virtual void SetResult(int result) OVERRIDE {
+ virtual void SetResult(int result) override {
cache_.reset();
TestCompletionCallback::SetResult(result);
}
diff --git a/net/disk_cache/memory/mem_backend_impl.cc b/net/disk_cache/memory/mem_backend_impl.cc
index 848ef98..3a90075 100644
--- a/net/disk_cache/memory/mem_backend_impl.cc
+++ b/net/disk_cache/memory/mem_backend_impl.cc
@@ -188,7 +188,7 @@
}
virtual int OpenNextEntry(Entry** next_entry,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
if (!backend_)
return net::ERR_FAILED;
diff --git a/net/disk_cache/memory/mem_backend_impl.h b/net/disk_cache/memory/mem_backend_impl.h
index 10946c5..46505ea 100644
--- a/net/disk_cache/memory/mem_backend_impl.h
+++ b/net/disk_cache/memory/mem_backend_impl.h
@@ -63,24 +63,24 @@
void RemoveFromRankingList(MemEntryImpl* entry);
// Backend interface.
- virtual net::CacheType GetCacheType() const OVERRIDE;
- virtual int32 GetEntryCount() const OVERRIDE;
+ virtual net::CacheType GetCacheType() const override;
+ virtual int32 GetEntryCount() const override;
virtual int OpenEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int CreateEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int DoomEntry(const std::string& key,
- const CompletionCallback& callback) OVERRIDE;
- virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int DoomAllEntries(const CompletionCallback& callback) override;
virtual int DoomEntriesBetween(base::Time initial_time,
base::Time end_time,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int DoomEntriesSince(base::Time initial_time,
- const CompletionCallback& callback) OVERRIDE;
- virtual scoped_ptr<Iterator> CreateIterator() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual scoped_ptr<Iterator> CreateIterator() override;
virtual void GetStats(
- std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE {}
- virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
+ std::vector<std::pair<std::string, std::string> >* stats) override {}
+ virtual void OnExternalCacheHit(const std::string& key) override;
private:
class MemIterator;
diff --git a/net/disk_cache/memory/mem_entry_impl.h b/net/disk_cache/memory/mem_entry_impl.h
index aec8d22..d31e14a 100644
--- a/net/disk_cache/memory/mem_entry_impl.h
+++ b/net/disk_cache/memory/mem_entry_impl.h
@@ -87,26 +87,26 @@
}
// Entry interface.
- virtual void Doom() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual std::string GetKey() const OVERRIDE;
- virtual base::Time GetLastUsed() const OVERRIDE;
- virtual base::Time GetLastModified() const OVERRIDE;
- virtual int32 GetDataSize(int index) const OVERRIDE;
+ virtual void Doom() override;
+ virtual void Close() override;
+ virtual std::string GetKey() const override;
+ virtual base::Time GetLastUsed() const override;
+ virtual base::Time GetLastModified() const override;
+ virtual int32 GetDataSize(int index) const override;
virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len,
const CompletionCallback& callback,
- bool truncate) OVERRIDE;
+ bool truncate) override;
virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int GetAvailableRange(int64 offset, int len, int64* start,
- const CompletionCallback& callback) OVERRIDE;
- virtual bool CouldBeSparse() const OVERRIDE;
- virtual void CancelSparseIO() OVERRIDE {}
- virtual int ReadyForSparseIO(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual bool CouldBeSparse() const override;
+ virtual void CancelSparseIO() override {}
+ virtual int ReadyForSparseIO(const CompletionCallback& callback) override;
private:
typedef base::hash_map<int, MemEntryImpl*> EntryMap;
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
index b0cbd52..32b074a 100644
--- a/net/disk_cache/simple/simple_backend_impl.cc
+++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -467,7 +467,7 @@
return DoomEntriesBetween(initial_time, Time(), callback);
}
-class SimpleBackendImpl::SimpleIterator FINAL : public Iterator {
+class SimpleBackendImpl::SimpleIterator final : public Iterator {
public:
explicit SimpleIterator(base::WeakPtr<SimpleBackendImpl> backend)
: backend_(backend),
@@ -476,7 +476,7 @@
// From Backend::Iterator:
virtual int OpenNextEntry(Entry** next_entry,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
CompletionCallback open_next_entry_impl =
base::Bind(&SimpleIterator::OpenNextEntryImpl,
weak_factory_.GetWeakPtr(), next_entry, callback);
diff --git a/net/disk_cache/simple/simple_backend_impl.h b/net/disk_cache/simple/simple_backend_impl.h
index 48c422f..e5a50da 100644
--- a/net/disk_cache/simple/simple_backend_impl.h
+++ b/net/disk_cache/simple/simple_backend_impl.h
@@ -85,27 +85,27 @@
// SimpleIndexDelegate:
virtual void DoomEntries(std::vector<uint64>* entry_hashes,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// Backend:
- virtual net::CacheType GetCacheType() const OVERRIDE;
- virtual int32 GetEntryCount() const OVERRIDE;
+ virtual net::CacheType GetCacheType() const override;
+ virtual int32 GetEntryCount() const override;
virtual int OpenEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int CreateEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int DoomEntry(const std::string& key,
- const CompletionCallback& callback) OVERRIDE;
- virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int DoomAllEntries(const CompletionCallback& callback) override;
virtual int DoomEntriesBetween(base::Time initial_time,
base::Time end_time,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int DoomEntriesSince(base::Time initial_time,
- const CompletionCallback& callback) OVERRIDE;
- virtual scoped_ptr<Iterator> CreateIterator() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual scoped_ptr<Iterator> CreateIterator() override;
virtual void GetStats(
- std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE;
- virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
+ std::vector<std::pair<std::string, std::string> >* stats) override;
+ virtual void OnExternalCacheHit(const std::string& key) override;
private:
class SimpleIterator;
diff --git a/net/disk_cache/simple/simple_entry_impl.h b/net/disk_cache/simple/simple_entry_impl.h
index 2dfb757..7c11b96 100644
--- a/net/disk_cache/simple/simple_entry_impl.h
+++ b/net/disk_cache/simple/simple_entry_impl.h
@@ -80,38 +80,38 @@
void SetKey(const std::string& key);
// From Entry:
- virtual void Doom() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual std::string GetKey() const OVERRIDE;
- virtual base::Time GetLastUsed() const OVERRIDE;
- virtual base::Time GetLastModified() const OVERRIDE;
- virtual int32 GetDataSize(int index) const OVERRIDE;
+ virtual void Doom() override;
+ virtual void Close() override;
+ virtual std::string GetKey() const override;
+ virtual base::Time GetLastUsed() const override;
+ virtual base::Time GetLastModified() const override;
+ virtual int32 GetDataSize(int index) const override;
virtual int ReadData(int stream_index,
int offset,
net::IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteData(int stream_index,
int offset,
net::IOBuffer* buf,
int buf_len,
const CompletionCallback& callback,
- bool truncate) OVERRIDE;
+ bool truncate) override;
virtual int ReadSparseData(int64 offset,
net::IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteSparseData(int64 offset,
net::IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int GetAvailableRange(int64 offset,
int len,
int64* start,
- const CompletionCallback& callback) OVERRIDE;
- virtual bool CouldBeSparse() const OVERRIDE;
- virtual void CancelSparseIO() OVERRIDE;
- virtual int ReadyForSparseIO(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual bool CouldBeSparse() const override;
+ virtual void CancelSparseIO() override;
+ virtual int ReadyForSparseIO(const CompletionCallback& callback) override;
private:
class ScopedOperationRunner;
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc
index 02afe2d..ca4d58e 100644
--- a/net/disk_cache/simple/simple_index.cc
+++ b/net/disk_cache/simple/simple_index.cc
@@ -16,6 +16,7 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/field_trial.h"
+#include "base/numerics/safe_conversions.h"
#include "base/pickle.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_tokenizer.h"
@@ -103,15 +104,8 @@
return;
}
- const base::TimeDelta since_unix_epoch =
- last_used_time - base::Time::UnixEpoch();
- const int64 seconds_since_unix_epoch = since_unix_epoch.InSeconds();
- DCHECK_LE(implicit_cast<int64>(std::numeric_limits<uint32>::min()),
- seconds_since_unix_epoch);
- DCHECK_GE(implicit_cast<int64>(std::numeric_limits<uint32>::max()),
- seconds_since_unix_epoch);
-
- last_used_time_seconds_since_epoch_ = seconds_since_unix_epoch;
+ last_used_time_seconds_since_epoch_ = base::checked_cast<uint32>(
+ (last_used_time - base::Time::UnixEpoch()).InSeconds());
// Avoid accidental nullity.
if (last_used_time_seconds_since_epoch_ == 0)
last_used_time_seconds_since_epoch_ = 1;
diff --git a/net/disk_cache/simple/simple_index.h b/net/disk_cache/simple/simple_index.h
index 7b5f543..2b7e1cd 100644
--- a/net/disk_cache/simple/simple_index.h
+++ b/net/disk_cache/simple/simple_index.h
@@ -62,11 +62,11 @@
private:
friend class SimpleIndexFileTest;
- // When adding new members here, you should update the Serialize() and
- // Deserialize() methods.
-
+ // There are tens of thousands of instances of EntryMetadata in memory, so the
+ // size of each entry matters. Even when the values used to set these members
+ // are originally calculated as >32-bit types, the actual necessary size for
+ // each shouldn't exceed 32 bits, so we use 32-bit types here.
uint32 last_used_time_seconds_since_epoch_;
-
int32 entry_size_; // Storage size in bytes.
};
COMPILE_ASSERT(sizeof(EntryMetadata) == 8, metadata_size);
diff --git a/net/disk_cache/simple/simple_index_unittest.cc b/net/disk_cache/simple/simple_index_unittest.cc
index 0afbaa2..0bb10d3 100644
--- a/net/disk_cache/simple/simple_index_unittest.cc
+++ b/net/disk_cache/simple/simple_index_unittest.cc
@@ -60,7 +60,7 @@
virtual void LoadIndexEntries(
base::Time cache_last_modified,
const base::Closure& callback,
- SimpleIndexLoadResult* out_load_result) OVERRIDE {
+ SimpleIndexLoadResult* out_load_result) override {
load_callback_ = callback;
load_result_ = out_load_result;
++load_index_entries_calls_;
@@ -69,7 +69,7 @@
virtual void WriteToDisk(const SimpleIndex::EntrySet& entry_set,
uint64 cache_size,
const base::TimeTicks& start,
- bool app_on_background) OVERRIDE {
+ bool app_on_background) override {
disk_writes_++;
disk_write_entry_set_ = entry_set;
}
@@ -102,7 +102,7 @@
base::StringPrintf("key%d", static_cast<int>(hash_index)));
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
scoped_ptr<MockSimpleIndexFile> index_file(new MockSimpleIndexFile());
index_file_ = index_file->AsWeakPtr();
index_.reset(new SimpleIndex(NULL, this, net::DISK_CACHE,
@@ -121,7 +121,7 @@
// From SimpleIndexDelegate:
virtual void DoomEntries(std::vector<uint64>* entry_hashes,
- const net::CompletionCallback& callback) OVERRIDE {
+ const net::CompletionCallback& callback) override {
std::for_each(entry_hashes->begin(), entry_hashes->end(),
std::bind1st(std::mem_fun(&SimpleIndex::Remove),
index_.get()));
diff --git a/net/disk_cache/simple/simple_net_log_parameters.cc b/net/disk_cache/simple/simple_net_log_parameters.cc
index 9acd663..4756c83 100644
--- a/net/disk_cache/simple/simple_net_log_parameters.cc
+++ b/net/disk_cache/simple/simple_net_log_parameters.cc
@@ -17,7 +17,7 @@
base::Value* NetLogSimpleEntryConstructionCallback(
const disk_cache::SimpleEntryImpl* entry,
- net::NetLog::LogLevel log_level ALLOW_UNUSED) {
+ net::NetLog::LogLevel log_level) {
base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetString("entry_hash",
base::StringPrintf("%#016" PRIx64, entry->entry_hash()));
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index 1e7b9aa..c50c9a3 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -14,6 +14,7 @@
#include "base/files/file_util.h"
#include "base/hash.h"
#include "base/location.h"
+#include "base/numerics/safe_conversions.h"
#include "base/sha1.h"
#include "base/strings/stringprintf.h"
#include "net/base/io_buffer.h"
@@ -73,7 +74,7 @@
void RecordSyncOpenResult(net::CacheType cache_type,
OpenEntryResult result,
bool had_index) {
- DCHECK_GT(OPEN_ENTRY_MAX, result);
+ DCHECK_LT(result, OPEN_ENTRY_MAX);
SIMPLE_CACHE_UMA(ENUMERATION,
"SyncOpenResult", cache_type, result, OPEN_ENTRY_MAX);
if (had_index) {
@@ -104,8 +105,8 @@
}
bool CanOmitEmptyFile(int file_index) {
- DCHECK_LE(0, file_index);
- DCHECK_GT(disk_cache::kSimpleEntryFileCount, file_index);
+ DCHECK_GE(file_index, 0);
+ DCHECK_LT(file_index, disk_cache::kSimpleEntryFileCount);
return file_index == disk_cache::simple_util::GetFileIndexFromStreamIndex(2);
}
@@ -284,7 +285,7 @@
int file_index = GetFileIndexFromStreamIndex(in_entry_op.index);
// Zero-length reads and reads to the empty streams of omitted files should
// be handled in the SimpleEntryImpl.
- DCHECK_LT(0, in_entry_op.buf_len);
+ DCHECK_GT(in_entry_op.buf_len, 0);
DCHECK(!empty_file_omitted_[file_index]);
File* file = const_cast<File*>(&files_[file_index]);
int bytes_read =
@@ -408,19 +409,17 @@
SparseRange* found_range = &it->second;
DCHECK_EQ(it->first, found_range->offset);
if (found_range->offset + found_range->length > offset) {
- DCHECK_LE(0, found_range->length);
- DCHECK_GE(kint32max, found_range->length);
- DCHECK_LE(0, offset - found_range->offset);
- DCHECK_GE(kint32max, offset - found_range->offset);
- int range_len_after_offset = found_range->length -
- (offset - found_range->offset);
- DCHECK_LE(0, range_len_after_offset);
+ DCHECK_GE(found_range->length, 0);
+ DCHECK_LE(found_range->length, kint32max);
+ DCHECK_GE(offset - found_range->offset, 0);
+ DCHECK_LE(offset - found_range->offset, kint32max);
+ int net_offset = static_cast<int>(offset - found_range->offset);
+ int range_len_after_offset =
+ static_cast<int>(found_range->length - net_offset);
+ DCHECK_GE(range_len_after_offset, 0);
int len_to_read = std::min(buf_len, range_len_after_offset);
- if (!ReadSparseRange(found_range,
- offset - found_range->offset,
- len_to_read,
- buf)) {
+ if (!ReadSparseRange(found_range, net_offset, len_to_read, buf)) {
*out_result = net::ERR_CACHE_READ_FAILURE;
return;
}
@@ -436,8 +435,7 @@
it->second.offset == offset + read_so_far) {
SparseRange* found_range = &it->second;
DCHECK_EQ(it->first, found_range->offset);
- int range_len = (found_range->length > kint32max) ?
- kint32max : found_range->length;
+ int range_len = base::saturated_cast<int>(found_range->length);
int len_to_read = std::min(buf_len - read_so_far, range_len);
if (!ReadSparseRange(found_range, 0, len_to_read, buf + read_so_far)) {
*out_result = net::ERR_CACHE_READ_FAILURE;
@@ -484,19 +482,17 @@
--it;
SparseRange* found_range = &it->second;
if (found_range->offset + found_range->length > offset) {
- DCHECK_LE(0, found_range->length);
- DCHECK_GE(kint32max, found_range->length);
- DCHECK_LE(0, offset - found_range->offset);
- DCHECK_GE(kint32max, offset - found_range->offset);
- int range_len_after_offset = found_range->length -
- (offset - found_range->offset);
- DCHECK_LE(0, range_len_after_offset);
+ DCHECK_GE(found_range->length, 0);
+ DCHECK_LE(found_range->length, kint32max);
+ DCHECK_GE(offset - found_range->offset, 0);
+ DCHECK_LE(offset - found_range->offset, kint32max);
+ int net_offset = static_cast<int>(offset - found_range->offset);
+ int range_len_after_offset =
+ static_cast<int>(found_range->length - net_offset);
+ DCHECK_GE(range_len_after_offset, 0);
int len_to_write = std::min(buf_len, range_len_after_offset);
- if (!WriteSparseRange(found_range,
- offset - found_range->offset,
- len_to_write,
- buf)) {
+ if (!WriteSparseRange(found_range, net_offset, len_to_write, buf)) {
*out_result = net::ERR_CACHE_WRITE_FAILURE;
return;
}
@@ -510,7 +506,8 @@
it->second.offset < offset + buf_len) {
SparseRange* found_range = &it->second;
if (offset + written_so_far < found_range->offset) {
- int len_to_append = found_range->offset - (offset + written_so_far);
+ int len_to_append =
+ static_cast<int>(found_range->offset - (offset + written_so_far));
if (!AppendSparseRange(offset + written_so_far,
len_to_append,
buf + written_so_far)) {
@@ -520,8 +517,7 @@
written_so_far += len_to_append;
appended_so_far += len_to_append;
}
- int range_len = (found_range->length > kint32max) ?
- kint32max : found_range->length;
+ int range_len = base::saturated_cast<int>(found_range->length);
int len_to_write = std::min(buf_len - written_so_far, range_len);
if (!WriteSparseRange(found_range,
0,
@@ -567,7 +563,7 @@
SparseRangeIterator it = sparse_ranges_.lower_bound(offset);
int64 start = offset;
- int avail_so_far = 0;
+ int64 avail_so_far = 0;
if (it != sparse_ranges_.end() && it->second.offset < offset + len)
start = it->second.offset;
@@ -589,9 +585,9 @@
++it;
}
- int len_from_start = len - (start - offset);
+ int64 len_from_start = len - (start - offset);
*out_start = start;
- *out_result = std::min(avail_so_far, len_from_start);
+ *out_result = static_cast<int>(std::min(avail_so_far, len_from_start));
}
void SimpleSynchronousEntry::CheckEOFRecord(int index,
@@ -680,7 +676,8 @@
const int64 cluster_loss = file_size % 4096 ? 4096 - file_size % 4096 : 0;
SIMPLE_CACHE_UMA(PERCENTAGE,
"LastClusterLossPercent", cache_type_,
- cluster_loss * 100 / (cluster_loss + file_size));
+ static_cast<base::HistogramBase::Sample>(
+ cluster_loss * 100 / (cluster_loss + file_size)));
}
if (sparse_file_open())
@@ -825,7 +822,7 @@
// 0, stream 1 and one EOF record. The exact distribution of sizes between
// stream 1 and stream 0 is only determined after reading the EOF record
// for stream 0 in ReadAndValidateStream0.
- out_entry_stat->set_data_size(i + 1, file_info.size);
+ out_entry_stat->set_data_size(i + 1, static_cast<int>(file_info.size));
}
SIMPLE_CACHE_UMA(CUSTOM_COUNTS,
"SyncOpenEntryAge", cache_type_,
@@ -1159,7 +1156,7 @@
void SimpleSynchronousEntry::RecordSyncCreateResult(CreateEntryResult result,
bool had_index) {
- DCHECK_GT(CREATE_ENTRY_MAX, result);
+ DCHECK_LT(result, CREATE_ENTRY_MAX);
SIMPLE_CACHE_UMA(ENUMERATION,
"SyncCreateResult", cache_type_, result, CREATE_ENTRY_MAX);
if (had_index) {
@@ -1256,7 +1253,7 @@
bool SimpleSynchronousEntry::ScanSparseFile(int32* out_sparse_data_size) {
DCHECK(sparse_file_open());
- int32 sparse_data_size = 0;
+ int64 sparse_data_size = 0;
SimpleFileHeader header;
int header_read_result =
@@ -1307,11 +1304,11 @@
range_header_offset += sizeof(range_header) + range.length;
- DCHECK_LE(sparse_data_size, sparse_data_size + range.length);
+ DCHECK_GE(sparse_data_size + range.length, sparse_data_size);
sparse_data_size += range.length;
}
- *out_sparse_data_size = sparse_data_size;
+ *out_sparse_data_size = static_cast<int32>(sparse_data_size);
sparse_tail_offset_ = range_header_offset;
return true;
@@ -1321,8 +1318,8 @@
int offset, int len, char* buf) {
DCHECK(range);
DCHECK(buf);
- DCHECK_GE(range->length, offset);
- DCHECK_GE(range->length, offset + len);
+ DCHECK_LE(offset, range->length);
+ DCHECK_LE(offset + len, range->length);
int bytes_read = sparse_file_.Read(range->file_offset + offset, buf, len);
if (bytes_read < len) {
@@ -1350,8 +1347,8 @@
const char* buf) {
DCHECK(range);
DCHECK(buf);
- DCHECK_GE(range->length, offset);
- DCHECK_GE(range->length, offset + len);
+ DCHECK_LE(offset, range->length);
+ DCHECK_LE(offset + len, range->length);
uint32 new_crc32 = 0;
if (offset == 0 && len == range->length) {
@@ -1390,8 +1387,8 @@
bool SimpleSynchronousEntry::AppendSparseRange(int64 offset,
int len,
const char* buf) {
- DCHECK_LE(0, offset);
- DCHECK_LT(0, len);
+ DCHECK_GE(offset, 0);
+ DCHECK_GT(len, 0);
DCHECK(buf);
uint32 data_crc32 = crc32(crc32(0L, Z_NULL, 0),
diff --git a/net/disk_cache/simple/simple_util.cc b/net/disk_cache/simple/simple_util.cc
index 844b695..55f309e 100644
--- a/net/disk_cache/simple/simple_util.cc
+++ b/net/disk_cache/simple/simple_util.cc
@@ -9,6 +9,7 @@
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -97,8 +98,7 @@
int32 GetDataSizeFromKeyAndFileSize(const std::string& key, int64 file_size) {
int64 data_size = file_size - key.size() - sizeof(SimpleFileHeader) -
sizeof(SimpleFileEOF);
- DCHECK_GE(implicit_cast<int64>(std::numeric_limits<int32>::max()), data_size);
- return data_size;
+ return base::checked_cast<int32>(data_size);
}
int64 GetFileSizeFromKeyAndDataSize(const std::string& key, int32 data_size) {
diff --git a/net/dns/address_sorter_posix.h b/net/dns/address_sorter_posix.h
index 1c88ad2..ce3ffdb 100644
--- a/net/dns/address_sorter_posix.h
+++ b/net/dns/address_sorter_posix.h
@@ -65,13 +65,13 @@
// AddressSorter:
virtual void Sort(const AddressList& list,
- const CallbackType& callback) const OVERRIDE;
+ const CallbackType& callback) const override;
private:
friend class AddressSorterPosixTest;
// NetworkChangeNotifier::IPAddressObserver:
- virtual void OnIPAddressChanged() OVERRIDE;
+ virtual void OnIPAddressChanged() override;
// Fills |info| with values for |address| from policy tables.
void FillPolicy(const IPAddressNumber& address,
diff --git a/net/dns/address_sorter_posix_unittest.cc b/net/dns/address_sorter_posix_unittest.cc
index dea7ade..9039850 100644
--- a/net/dns/address_sorter_posix_unittest.cc
+++ b/net/dns/address_sorter_posix_unittest.cc
@@ -35,34 +35,34 @@
virtual ~TestUDPClientSocket() {}
- virtual int Read(IOBuffer*, int, const CompletionCallback&) OVERRIDE {
+ virtual int Read(IOBuffer*, int, const CompletionCallback&) override {
NOTIMPLEMENTED();
return OK;
}
- virtual int Write(IOBuffer*, int, const CompletionCallback&) OVERRIDE {
+ virtual int Write(IOBuffer*, int, const CompletionCallback&) override {
NOTIMPLEMENTED();
return OK;
}
- virtual int SetReceiveBufferSize(int32) OVERRIDE {
+ virtual int SetReceiveBufferSize(int32) override {
return OK;
}
- virtual int SetSendBufferSize(int32) OVERRIDE {
+ virtual int SetSendBufferSize(int32) override {
return OK;
}
- virtual void Close() OVERRIDE {}
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE {
+ virtual void Close() override {}
+ virtual int GetPeerAddress(IPEndPoint* address) const override {
NOTIMPLEMENTED();
return OK;
}
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* address) const override {
if (!connected_)
return ERR_UNEXPECTED;
*address = local_endpoint_;
return OK;
}
- virtual int Connect(const IPEndPoint& remote) OVERRIDE {
+ virtual int Connect(const IPEndPoint& remote) override {
if (connected_)
return ERR_UNEXPECTED;
AddressMapping::const_iterator it = mapping_->find(remote.address());
@@ -73,7 +73,7 @@
return OK;
}
- virtual const BoundNetLog& NetLog() const OVERRIDE {
+ virtual const BoundNetLog& NetLog() const override {
return net_log_;
}
@@ -96,13 +96,13 @@
DatagramSocket::BindType,
const RandIntCallback&,
NetLog*,
- const NetLog::Source&) OVERRIDE {
+ const NetLog::Source&) override {
return scoped_ptr<DatagramClientSocket>(new TestUDPClientSocket(&mapping_));
}
virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList&,
NetLog*,
- const NetLog::Source&) OVERRIDE {
+ const NetLog::Source&) override {
NOTIMPLEMENTED();
return scoped_ptr<StreamSocket>();
}
@@ -110,11 +110,11 @@
scoped_ptr<ClientSocketHandle>,
const HostPortPair&,
const SSLConfig&,
- const SSLClientSocketContext&) OVERRIDE {
+ const SSLClientSocketContext&) override {
NOTIMPLEMENTED();
return scoped_ptr<SSLClientSocket>();
}
- virtual void ClearSSLSessionCache() OVERRIDE {
+ virtual void ClearSSLSessionCache() override {
NOTIMPLEMENTED();
}
diff --git a/net/dns/address_sorter_win.cc b/net/dns/address_sorter_win.cc
index 813bd93..079ba6a 100644
--- a/net/dns/address_sorter_win.cc
+++ b/net/dns/address_sorter_win.cc
@@ -31,7 +31,7 @@
// AddressSorter:
virtual void Sort(const AddressList& list,
- const CallbackType& callback) const OVERRIDE {
+ const CallbackType& callback) const override {
DCHECK(!list.empty());
scoped_refptr<Job> job = new Job(list, callback);
}
@@ -160,7 +160,7 @@
// AddressSorter:
virtual void Sort(const AddressList& list,
- const CallbackType& callback) const OVERRIDE {
+ const CallbackType& callback) const override {
AddressList list_ipv4;
AddressList list_ipv6;
for (size_t i = 0; i < list.size(); ++i) {
diff --git a/net/dns/dns_client.cc b/net/dns/dns_client.cc
index 9e29ca4..de96c02 100644
--- a/net/dns/dns_client.cc
+++ b/net/dns/dns_client.cc
@@ -24,7 +24,7 @@
: address_sorter_(AddressSorter::CreateAddressSorter()),
net_log_(net_log) {}
- virtual void SetConfig(const DnsConfig& config) OVERRIDE {
+ virtual void SetConfig(const DnsConfig& config) override {
factory_.reset();
session_ = NULL;
if (config.IsValid() && !config.unhandled_options) {
@@ -40,15 +40,15 @@
}
}
- virtual const DnsConfig* GetConfig() const OVERRIDE {
+ virtual const DnsConfig* GetConfig() const override {
return session_.get() ? &session_->config() : NULL;
}
- virtual DnsTransactionFactory* GetTransactionFactory() OVERRIDE {
+ virtual DnsTransactionFactory* GetTransactionFactory() override {
return session_.get() ? factory_.get() : NULL;
}
- virtual AddressSorter* GetAddressSorter() OVERRIDE {
+ virtual AddressSorter* GetAddressSorter() override {
return address_sorter_.get();
}
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
index 2c298dd..c0664eb 100644
--- a/net/dns/dns_config_service_posix.cc
+++ b/net/dns/dns_config_service_posix.cc
@@ -74,7 +74,7 @@
}
virtual void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type)
- OVERRIDE {
+ override {
if (!callback_.is_null() && type != NetworkChangeNotifier::CONNECTION_NONE)
callback_.Run(true);
}
@@ -263,7 +263,7 @@
explicit ConfigReader(DnsConfigServicePosix* service)
: service_(service), success_(false) {}
- virtual void DoWork() OVERRIDE {
+ virtual void DoWork() override {
base::TimeTicks start_time = base::TimeTicks::Now();
ConfigParsePosixResult result = ReadDnsConfig(&dns_config_);
switch (result) {
@@ -285,7 +285,7 @@
base::TimeTicks::Now() - start_time);
}
- virtual void OnWorkFinished() OVERRIDE {
+ virtual void OnWorkFinished() override {
DCHECK(!IsCancelled());
if (success_) {
service_->OnConfigRead(dns_config_);
@@ -314,7 +314,7 @@
private:
virtual ~HostsReader() {}
- virtual void DoWork() OVERRIDE {
+ virtual void DoWork() override {
base::TimeTicks start_time = base::TimeTicks::Now();
success_ = ParseHostsFile(path_, &hosts_);
UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HostParseResult", success_);
@@ -322,7 +322,7 @@
base::TimeTicks::Now() - start_time);
}
- virtual void OnWorkFinished() OVERRIDE {
+ virtual void OnWorkFinished() override {
if (success_) {
service_->OnHostsRead(hosts_);
} else {
diff --git a/net/dns/dns_config_service_posix.h b/net/dns/dns_config_service_posix.h
index ef28154..598d6ad 100644
--- a/net/dns/dns_config_service_posix.h
+++ b/net/dns/dns_config_service_posix.h
@@ -27,8 +27,8 @@
protected:
// DnsConfigService:
- virtual void ReadNow() OVERRIDE;
- virtual bool StartWatching() OVERRIDE;
+ virtual void ReadNow() override;
+ virtual bool StartWatching() override;
private:
class Watcher;
diff --git a/net/dns/dns_config_service_unittest.cc b/net/dns/dns_config_service_unittest.cc
index e71baef..0239f80 100644
--- a/net/dns/dns_config_service_unittest.cc
+++ b/net/dns/dns_config_service_unittest.cc
@@ -121,8 +121,8 @@
protected:
class TestDnsConfigService : public DnsConfigService {
public:
- virtual void ReadNow() OVERRIDE {}
- virtual bool StartWatching() OVERRIDE { return true; }
+ virtual void ReadNow() override {}
+ virtual bool StartWatching() override { return true; }
// Expose the protected methods to this test suite.
void InvalidateConfig() {
@@ -176,7 +176,7 @@
return hosts;
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
quit_on_config_ = false;
service_.reset(new TestDnsConfigService());
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc
index ec7e6f2..dd3ee3d 100644
--- a/net/dns/dns_config_service_win.cc
+++ b/net/dns/dns_config_service_win.cc
@@ -312,7 +312,7 @@
return true;
}
- virtual void OnObjectSignaled(HANDLE object) OVERRIDE {
+ virtual void OnObjectSignaled(HANDLE object) override {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
@@ -609,7 +609,7 @@
}
// NetworkChangeNotifier::IPAddressObserver:
- virtual void OnIPAddressChanged() OVERRIDE {
+ virtual void OnIPAddressChanged() override {
// Need to update non-loopback IP of local host.
service_->OnHostsChanged(true);
}
@@ -635,7 +635,7 @@
private:
virtual ~ConfigReader() {}
- virtual void DoWork() OVERRIDE {
+ virtual void DoWork() override {
// Should be called on WorkerPool.
base::TimeTicks start_time = base::TimeTicks::Now();
DnsSystemSettings settings = {};
@@ -651,7 +651,7 @@
base::TimeTicks::Now() - start_time);
}
- virtual void OnWorkFinished() OVERRIDE {
+ virtual void OnWorkFinished() override {
DCHECK(loop()->BelongsToCurrentThread());
DCHECK(!IsCancelled());
if (success_) {
@@ -685,7 +685,7 @@
private:
virtual ~HostsReader() {}
- virtual void DoWork() OVERRIDE {
+ virtual void DoWork() override {
base::TimeTicks start_time = base::TimeTicks::Now();
HostsParseWinResult result = HOSTS_PARSE_WIN_UNREADABLE_HOSTS_FILE;
if (ParseHostsFile(path_, &hosts_))
@@ -698,7 +698,7 @@
base::TimeTicks::Now() - start_time);
}
- virtual void OnWorkFinished() OVERRIDE {
+ virtual void OnWorkFinished() override {
DCHECK(loop()->BelongsToCurrentThread());
if (success_) {
service_->OnHostsRead(hosts_);
diff --git a/net/dns/dns_config_service_win.h b/net/dns/dns_config_service_win.h
index d26aed5..c28d863 100644
--- a/net/dns/dns_config_service_win.h
+++ b/net/dns/dns_config_service_win.h
@@ -125,8 +125,8 @@
class HostsReader;
// DnsConfigService:
- virtual void ReadNow() OVERRIDE;
- virtual bool StartWatching() OVERRIDE;
+ virtual void ReadNow() override;
+ virtual bool StartWatching() override;
void OnConfigChanged(bool succeeded);
void OnHostsChanged(bool succeeded);
diff --git a/net/dns/dns_session_unittest.cc b/net/dns/dns_session_unittest.cc
index ed726f2..e6f1230 100644
--- a/net/dns/dns_session_unittest.cc
+++ b/net/dns/dns_session_unittest.cc
@@ -30,11 +30,11 @@
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
net::NetLog* net_log,
- const net::NetLog::Source& source) OVERRIDE;
+ const net::NetLog::Source& source) override;
virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
- NetLog*, const NetLog::Source&) OVERRIDE {
+ NetLog*, const NetLog::Source&) override {
NOTIMPLEMENTED();
return scoped_ptr<StreamSocket>();
}
@@ -43,12 +43,12 @@
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
- const SSLClientSocketContext& context) OVERRIDE {
+ const SSLClientSocketContext& context) override {
NOTIMPLEMENTED();
return scoped_ptr<SSLClientSocket>();
}
- virtual void ClearSSLSessionCache() OVERRIDE {
+ virtual void ClearSSLSessionCache() override {
NOTIMPLEMENTED();
}
@@ -92,19 +92,19 @@
virtual void Initialize(
const std::vector<IPEndPoint>* nameservers,
- NetLog* net_log) OVERRIDE {
+ NetLog* net_log) override {
InitializeInternal(nameservers, net_log);
}
virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
- unsigned server_index) OVERRIDE {
+ unsigned server_index) override {
test_->OnSocketAllocated(server_index);
return CreateConnectedSocket(server_index);
}
virtual void FreeSocket(
unsigned server_index,
- scoped_ptr<DatagramClientSocket> socket) OVERRIDE {
+ scoped_ptr<DatagramClientSocket> socket) override {
test_->OnSocketFreed(server_index);
}
diff --git a/net/dns/dns_socket_pool.cc b/net/dns/dns_socket_pool.cc
index b446fa0..09aca5a 100644
--- a/net/dns/dns_socket_pool.cc
+++ b/net/dns/dns_socket_pool.cc
@@ -97,18 +97,18 @@
virtual void Initialize(
const std::vector<IPEndPoint>* nameservers,
- NetLog* net_log) OVERRIDE {
+ NetLog* net_log) override {
InitializeInternal(nameservers, net_log);
}
virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
- unsigned server_index) OVERRIDE {
+ unsigned server_index) override {
return CreateConnectedSocket(server_index);
}
virtual void FreeSocket(
unsigned server_index,
- scoped_ptr<DatagramClientSocket> socket) OVERRIDE {
+ scoped_ptr<DatagramClientSocket> socket) override {
}
private:
@@ -131,14 +131,14 @@
virtual void Initialize(
const std::vector<IPEndPoint>* nameservers,
- NetLog* net_log) OVERRIDE;
+ NetLog* net_log) override;
virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
- unsigned server_index) OVERRIDE;
+ unsigned server_index) override;
virtual void FreeSocket(
unsigned server_index,
- scoped_ptr<DatagramClientSocket> socket) OVERRIDE;
+ scoped_ptr<DatagramClientSocket> socket) override;
private:
void FillPool(unsigned server_index, unsigned size);
diff --git a/net/dns/dns_test_util.cc b/net/dns/dns_test_util.cc
index 01acb34..6327ed2 100644
--- a/net/dns/dns_test_util.cc
+++ b/net/dns/dns_test_util.cc
@@ -27,7 +27,7 @@
public:
virtual ~MockAddressSorter() {}
virtual void Sort(const AddressList& list,
- const CallbackType& callback) const OVERRIDE {
+ const CallbackType& callback) const override {
// Do nothing.
callback.Run(true, list);
}
@@ -60,15 +60,15 @@
}
}
- virtual const std::string& GetHostname() const OVERRIDE {
+ virtual const std::string& GetHostname() const override {
return hostname_;
}
- virtual uint16 GetType() const OVERRIDE {
+ virtual uint16 GetType() const override {
return qtype_;
}
- virtual void Start() OVERRIDE {
+ virtual void Start() override {
EXPECT_FALSE(started_);
started_ = true;
if (delayed_)
@@ -172,7 +172,7 @@
const std::string& hostname,
uint16 qtype,
const DnsTransactionFactory::CallbackType& callback,
- const BoundNetLog&) OVERRIDE {
+ const BoundNetLog&) override {
MockTransaction* transaction =
new MockTransaction(rules_, hostname, qtype, callback);
if (transaction->delayed())
diff --git a/net/dns/dns_test_util.h b/net/dns/dns_test_util.h
index d0b8e81..5b363c7 100644
--- a/net/dns/dns_test_util.h
+++ b/net/dns/dns_test_util.h
@@ -211,10 +211,10 @@
virtual ~MockDnsClient();
// DnsClient interface:
- virtual void SetConfig(const DnsConfig& config) OVERRIDE;
- virtual const DnsConfig* GetConfig() const OVERRIDE;
- virtual DnsTransactionFactory* GetTransactionFactory() OVERRIDE;
- virtual AddressSorter* GetAddressSorter() OVERRIDE;
+ virtual void SetConfig(const DnsConfig& config) override;
+ virtual const DnsConfig* GetConfig() const override;
+ virtual DnsTransactionFactory* GetTransactionFactory() override;
+ virtual AddressSorter* GetAddressSorter() override;
// Completes all DnsTransactions that were delayed by a rule.
void CompleteDelayedTransactions();
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index 0424d48..32b5602 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -141,7 +141,7 @@
query_(query.Pass()) {}
// DnsAttempt:
- virtual int Start(const CompletionCallback& callback) OVERRIDE {
+ virtual int Start(const CompletionCallback& callback) override {
DCHECK_EQ(STATE_NONE, next_state_);
callback_ = callback;
start_time_ = base::TimeTicks::Now();
@@ -149,16 +149,16 @@
return DoLoop(OK);
}
- virtual const DnsQuery* GetQuery() const OVERRIDE {
+ virtual const DnsQuery* GetQuery() const override {
return query_.get();
}
- virtual const DnsResponse* GetResponse() const OVERRIDE {
+ virtual const DnsResponse* GetResponse() const override {
const DnsResponse* resp = response_.get();
return (resp != NULL && resp->IsValid()) ? resp : NULL;
}
- virtual const BoundNetLog& GetSocketNetLog() const OVERRIDE {
+ virtual const BoundNetLog& GetSocketNetLog() const override {
return socket_lease_->socket()->NetLog();
}
@@ -306,7 +306,7 @@
response_length_(0) {}
// DnsAttempt:
- virtual int Start(const CompletionCallback& callback) OVERRIDE {
+ virtual int Start(const CompletionCallback& callback) override {
DCHECK_EQ(STATE_NONE, next_state_);
callback_ = callback;
start_time_ = base::TimeTicks::Now();
@@ -320,16 +320,16 @@
return DoLoop(rv);
}
- virtual const DnsQuery* GetQuery() const OVERRIDE {
+ virtual const DnsQuery* GetQuery() const override {
return query_.get();
}
- virtual const DnsResponse* GetResponse() const OVERRIDE {
+ virtual const DnsResponse* GetResponse() const override {
const DnsResponse* resp = response_.get();
return (resp != NULL && resp->IsValid()) ? resp : NULL;
}
- virtual const BoundNetLog& GetSocketNetLog() const OVERRIDE {
+ virtual const BoundNetLog& GetSocketNetLog() const override {
return socket_->NetLog();
}
@@ -574,17 +574,17 @@
} // otherwise logged in DoCallback or Start
}
- virtual const std::string& GetHostname() const OVERRIDE {
+ virtual const std::string& GetHostname() const override {
DCHECK(CalledOnValidThread());
return hostname_;
}
- virtual uint16 GetType() const OVERRIDE {
+ virtual uint16 GetType() const override {
DCHECK(CalledOnValidThread());
return qtype_;
}
- virtual void Start() OVERRIDE {
+ virtual void Start() override {
DCHECK(!callback_.is_null());
DCHECK(attempts_.empty());
net_log_.BeginEvent(NetLog::TYPE_DNS_TRANSACTION,
@@ -972,7 +972,7 @@
const std::string& hostname,
uint16 qtype,
const CallbackType& callback,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
return scoped_ptr<DnsTransaction>(new DnsTransactionImpl(
session_.get(), hostname, qtype, callback, net_log));
}
diff --git a/net/dns/dns_transaction_unittest.cc b/net/dns/dns_transaction_unittest.cc
index af073ac..908f915 100644
--- a/net/dns/dns_transaction_unittest.cc
+++ b/net/dns/dns_transaction_unittest.cc
@@ -153,7 +153,7 @@
: MockUDPClientSocket(data, net_log) {
}
virtual ~FailingUDPClientSocket() {}
- virtual int Connect(const IPEndPoint& endpoint) OVERRIDE {
+ virtual int Connect(const IPEndPoint& endpoint) override {
return ERR_CONNECTION_REFUSED;
}
@@ -170,7 +170,7 @@
: MockUDPClientSocket(data, net_log), factory_(factory) {
}
virtual ~TestUDPClientSocket() {}
- virtual int Connect(const IPEndPoint& endpoint) OVERRIDE;
+ virtual int Connect(const IPEndPoint& endpoint) override;
private:
TestSocketFactory* factory_;
@@ -188,7 +188,7 @@
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
net::NetLog* net_log,
- const net::NetLog::Source& source) OVERRIDE {
+ const net::NetLog::Source& source) override {
if (fail_next_socket_) {
fail_next_socket_ = false;
return scoped_ptr<DatagramClientSocket>(
@@ -441,7 +441,7 @@
}
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// By default set one server,
ConfigureNumServers(1);
// and no retransmissions,
@@ -451,7 +451,7 @@
ConfigureFactory();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Check that all socket data was at least written to.
for (size_t i = 0; i < socket_data_.size(); ++i) {
EXPECT_TRUE(socket_data_[i]->was_written()) << i;
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index 201bba4..5632ef9 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -1424,7 +1424,7 @@
}
// PriorityDispatch::Job:
- virtual void Start() OVERRIDE {
+ virtual void Start() override {
DCHECK_LE(num_occupied_job_slots_, 1u);
handle_.Reset();
@@ -1590,7 +1590,7 @@
virtual void OnDnsTaskComplete(base::TimeTicks start_time,
int net_error,
const AddressList& addr_list,
- base::TimeDelta ttl) OVERRIDE {
+ base::TimeDelta ttl) override {
DCHECK(is_dns_running());
base::TimeDelta duration = base::TimeTicks::Now() - start_time;
@@ -1625,7 +1625,7 @@
bounded_ttl);
}
- virtual void OnFirstDnsTransactionComplete() OVERRIDE {
+ virtual void OnFirstDnsTransactionComplete() override {
DCHECK(dns_task_->needs_two_transactions());
DCHECK_EQ(dns_task_->needs_another_transaction(), is_queued());
// No longer need to occupy two dispatcher slots.
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h
index 7a0fb57..edd64fc 100644
--- a/net/dns/host_resolver_impl.h
+++ b/net/dns/host_resolver_impl.h
@@ -129,16 +129,16 @@
AddressList* addresses,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& source_net_log) OVERRIDE;
+ const BoundNetLog& source_net_log) override;
virtual int ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
- const BoundNetLog& source_net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle req) OVERRIDE;
- virtual void SetDefaultAddressFamily(AddressFamily address_family) OVERRIDE;
- virtual AddressFamily GetDefaultAddressFamily() const OVERRIDE;
- virtual void SetDnsClientEnabled(bool enabled) OVERRIDE;
- virtual HostCache* GetHostCache() OVERRIDE;
- virtual base::Value* GetDnsConfigAsValue() const OVERRIDE;
+ const BoundNetLog& source_net_log) override;
+ virtual void CancelRequest(RequestHandle req) override;
+ virtual void SetDefaultAddressFamily(AddressFamily address_family) override;
+ virtual AddressFamily GetDefaultAddressFamily() const override;
+ virtual void SetDnsClientEnabled(bool enabled) override;
+ virtual HostCache* GetHostCache() override;
+ virtual base::Value* GetDnsConfigAsValue() const override;
void set_proc_params_for_test(const ProcTaskParams& proc_params) {
proc_params_ = proc_params;
@@ -220,10 +220,10 @@
void TryServingAllJobsFromHosts();
// NetworkChangeNotifier::IPAddressObserver:
- virtual void OnIPAddressChanged() OVERRIDE;
+ virtual void OnIPAddressChanged() override;
// NetworkChangeNotifier::DNSObserver:
- virtual void OnDNSChanged() OVERRIDE;
+ virtual void OnDNSChanged() override;
// True if have a DnsClient with a valid DnsConfig.
bool HaveDnsConfig() const;
diff --git a/net/dns/host_resolver_impl_unittest.cc b/net/dns/host_resolver_impl_unittest.cc
index 89112de..dadc03d 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -129,7 +129,7 @@
AddressFamily address_family,
HostResolverFlags host_resolver_flags,
AddressList* addrlist,
- int* os_error) OVERRIDE {
+ int* os_error) override {
base::AutoLock lock(lock_);
capture_list_.push_back(ResolveKey(hostname, address_family));
++num_requests_waiting_;
@@ -365,7 +365,7 @@
AddressFamily address_family,
HostResolverFlags host_resolver_flags,
AddressList* addrlist,
- int* os_error) OVERRIDE {
+ int* os_error) override {
bool wait_for_right_attempt_to_complete = true;
{
base::AutoLock auto_lock(lock_);
@@ -460,11 +460,11 @@
};
// testing::Test implementation:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
CreateResolver();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (resolver_.get())
EXPECT_EQ(0u, resolver_->num_running_dispatcher_jobs_for_tests());
EXPECT_FALSE(proc_->HasBlockedRequests());
@@ -732,7 +732,7 @@
TEST_F(HostResolverImplTest, CancelWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ virtual void Handle(Request* req) override {
// Port 80 is the first request that the callback will be invoked for.
// While we are executing within that callback, cancel the other requests
// in the job and start another request.
@@ -761,7 +761,7 @@
TEST_F(HostResolverImplTest, DeleteWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ virtual void Handle(Request* req) override {
EXPECT_EQ("a", req->info().hostname());
EXPECT_EQ(80, req->info().port());
@@ -787,7 +787,7 @@
TEST_F(HostResolverImplTest, DeleteWithinAbortedCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ virtual void Handle(Request* req) override {
EXPECT_EQ("a", req->info().hostname());
EXPECT_EQ(80, req->info().port());
@@ -827,7 +827,7 @@
TEST_F(HostResolverImplTest, StartWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ virtual void Handle(Request* req) override {
if (req->index() == 0) {
// On completing the first request, start another request for "a".
// Since caching is disabled, this will result in another async request.
@@ -858,7 +858,7 @@
TEST_F(HostResolverImplTest, BypassCache) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ virtual void Handle(Request* req) override {
if (req->index() == 0) {
// On completing the first request, start another request for "a".
// Since caching is enabled, this should complete synchronously.
@@ -956,7 +956,7 @@
// will not be aborted.
TEST_F(HostResolverImplTest, AbortOnlyExistingRequestsOnIPAddressChange) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) OVERRIDE {
+ virtual void Handle(Request* req) override {
// Start new request for a different hostname to ensure that the order
// of jobs in HostResolverImpl is not stable.
std::string hostname;
@@ -1339,7 +1339,7 @@
protected:
// testing::Test implementation:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AddDnsRule("nx", dns_protocol::kTypeA, MockDnsClientRule::FAIL, false);
AddDnsRule("nx", dns_protocol::kTypeAAAA, MockDnsClientRule::FAIL, false);
AddDnsRule("ok", dns_protocol::kTypeA, MockDnsClientRule::OK, false);
@@ -1381,7 +1381,7 @@
// HostResolverImplTest implementation:
virtual void CreateResolverWithLimitsAndParams(
size_t max_concurrent_resolves,
- const HostResolverImpl::ProcTaskParams& params) OVERRIDE {
+ const HostResolverImpl::ProcTaskParams& params) override {
HostResolverImpl::Options options = DefaultOptions();
options.max_concurrent_resolves = max_concurrent_resolves;
resolver_.reset(new HostResolverImpl(options, NULL));
diff --git a/net/dns/host_resolver_proc.h b/net/dns/host_resolver_proc.h
index 014a720..695e3bc 100644
--- a/net/dns/host_resolver_proc.h
+++ b/net/dns/host_resolver_proc.h
@@ -99,7 +99,7 @@
AddressFamily address_family,
HostResolverFlags host_resolver_flags,
AddressList* addr_list,
- int* os_error) OVERRIDE;
+ int* os_error) override;
protected:
virtual ~SystemHostResolverProc();
diff --git a/net/dns/mapped_host_resolver.h b/net/dns/mapped_host_resolver.h
index c03a2a6..6d4ab92 100644
--- a/net/dns/mapped_host_resolver.h
+++ b/net/dns/mapped_host_resolver.h
@@ -50,14 +50,14 @@
AddressList* addresses,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual int ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
- const BoundNetLog& net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle req) OVERRIDE;
- virtual void SetDnsClientEnabled(bool enabled) OVERRIDE;
- virtual HostCache* GetHostCache() OVERRIDE;
- virtual base::Value* GetDnsConfigAsValue() const OVERRIDE;
+ const BoundNetLog& net_log) override;
+ virtual void CancelRequest(RequestHandle req) override;
+ virtual void SetDnsClientEnabled(bool enabled) override;
+ virtual HostCache* GetHostCache() override;
+ virtual base::Value* GetDnsConfigAsValue() const override;
private:
// Modify the request |info| according to |rules_|. Returns either OK or
diff --git a/net/dns/mdns_client_impl.h b/net/dns/mdns_client_impl.h
index 6051511..b6f8b93 100644
--- a/net/dns/mdns_client_impl.h
+++ b/net/dns/mdns_client_impl.h
@@ -29,7 +29,7 @@
virtual ~MDnsSocketFactoryImpl() {};
virtual void CreateSockets(
- ScopedVector<DatagramServerSocket>* sockets) OVERRIDE;
+ ScopedVector<DatagramServerSocket>* sockets) override;
private:
DISALLOW_COPY_AND_ASSIGN(MDnsSocketFactoryImpl);
@@ -128,9 +128,9 @@
std::vector<const RecordParsed*>* records) const;
// Parse the response and alert relevant listeners.
- virtual void HandlePacket(DnsResponse* response, int bytes_read) OVERRIDE;
+ virtual void HandlePacket(DnsResponse* response, int bytes_read) override;
- virtual void OnConnectionError(int error) OVERRIDE;
+ virtual void OnConnectionError(int error) override;
private:
typedef std::pair<std::string, uint16> ListenerKey;
@@ -176,17 +176,17 @@
virtual scoped_ptr<MDnsListener> CreateListener(
uint16 rrtype,
const std::string& name,
- MDnsListener::Delegate* delegate) OVERRIDE;
+ MDnsListener::Delegate* delegate) override;
virtual scoped_ptr<MDnsTransaction> CreateTransaction(
uint16 rrtype,
const std::string& name,
int flags,
- const MDnsTransaction::ResultCallback& callback) OVERRIDE;
+ const MDnsTransaction::ResultCallback& callback) override;
- virtual bool StartListening(MDnsSocketFactory* socket_factory) OVERRIDE;
- virtual void StopListening() OVERRIDE;
- virtual bool IsListening() const OVERRIDE;
+ virtual bool StartListening(MDnsSocketFactory* socket_factory) override;
+ virtual void StopListening() override;
+ virtual bool IsListening() const override;
Core* core() { return core_.get(); }
@@ -207,14 +207,14 @@
virtual ~MDnsListenerImpl();
// MDnsListener implementation:
- virtual bool Start() OVERRIDE;
+ virtual bool Start() override;
// Actively refresh any received records.
- virtual void SetActiveRefresh(bool active_refresh) OVERRIDE;
+ virtual void SetActiveRefresh(bool active_refresh) override;
- virtual const std::string& GetName() const OVERRIDE;
+ virtual const std::string& GetName() const override;
- virtual uint16 GetType() const OVERRIDE;
+ virtual uint16 GetType() const override;
MDnsListener::Delegate* delegate() { return delegate_; }
@@ -255,17 +255,17 @@
virtual ~MDnsTransactionImpl();
// MDnsTransaction implementation:
- virtual bool Start() OVERRIDE;
+ virtual bool Start() override;
- virtual const std::string& GetName() const OVERRIDE;
- virtual uint16 GetType() const OVERRIDE;
+ virtual const std::string& GetName() const override;
+ virtual uint16 GetType() const override;
// MDnsListener::Delegate implementation:
virtual void OnRecordUpdate(MDnsListener::UpdateType update,
- const RecordParsed* record) OVERRIDE;
- virtual void OnNsecRecord(const std::string& name, unsigned type) OVERRIDE;
+ const RecordParsed* record) override;
+ virtual void OnNsecRecord(const std::string& name, unsigned type) override;
- virtual void OnCachePurged() OVERRIDE;
+ virtual void OnCachePurged() override;
private:
bool is_active() { return !callback_.is_null(); }
diff --git a/net/dns/mdns_client_unittest.cc b/net/dns/mdns_client_unittest.cc
index a7a3c03..4b2e7d5 100644
--- a/net/dns/mdns_client_unittest.cc
+++ b/net/dns/mdns_client_unittest.cc
@@ -391,7 +391,7 @@
class MDnsTest : public ::testing::Test {
public:
- virtual void SetUp() OVERRIDE;
+ virtual void SetUp() override;
void DeleteTransaction();
void DeleteBothListeners();
void RunFor(base::TimeDelta time_period);
@@ -1057,7 +1057,7 @@
class SimpleMockSocketFactory : public MDnsSocketFactory {
public:
virtual void CreateSockets(
- ScopedVector<DatagramServerSocket>* sockets) OVERRIDE {
+ ScopedVector<DatagramServerSocket>* sockets) override {
sockets->clear();
sockets->swap(sockets_);
}
@@ -1088,7 +1088,7 @@
protected:
// Follow successful connection initialization.
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
socket_ipv4_ = new MockMDnsDatagramServerSocket(ADDRESS_FAMILY_IPV4);
socket_ipv6_ = new MockMDnsDatagramServerSocket(ADDRESS_FAMILY_IPV6);
factory_.PushSocket(socket_ipv6_);
@@ -1160,7 +1160,7 @@
class MDnsConnectionSendTest : public MDnsConnectionTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
MDnsConnectionTest::SetUp();
EXPECT_CALL(*socket_ipv4_, RecvFrom(_, _, _, _))
.WillOnce(Return(ERR_IO_PENDING));
diff --git a/net/dns/mock_host_resolver.h b/net/dns/mock_host_resolver.h
index 3593fbd..9d5339f 100644
--- a/net/dns/mock_host_resolver.h
+++ b/net/dns/mock_host_resolver.h
@@ -79,12 +79,12 @@
AddressList* addresses,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual int ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
- const BoundNetLog& net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle req) OVERRIDE;
- virtual HostCache* GetHostCache() OVERRIDE;
+ const BoundNetLog& net_log) override;
+ virtual void CancelRequest(RequestHandle req) override;
+ virtual HostCache* GetHostCache() override;
// Resolves all pending requests. It is only valid to invoke this if
// set_ondemand_mode was set before. The requests are resolved asynchronously,
@@ -206,7 +206,7 @@
AddressFamily address_family,
HostResolverFlags host_resolver_flags,
AddressList* addrlist,
- int* os_error) OVERRIDE;
+ int* os_error) override;
private:
struct Rule;
@@ -228,11 +228,11 @@
AddressList* addresses,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual int ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
- const BoundNetLog& net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle req) OVERRIDE {}
+ const BoundNetLog& net_log) override;
+ virtual void CancelRequest(RequestHandle req) override {}
};
// This class sets the default HostResolverProc for a particular scope. The
diff --git a/net/dns/mock_mdns_socket_factory.h b/net/dns/mock_mdns_socket_factory.h
index 1ecc4be..6278661 100644
--- a/net/dns/mock_mdns_socket_factory.h
+++ b/net/dns/mock_mdns_socket_factory.h
@@ -27,7 +27,7 @@
const CompletionCallback& callback));
virtual int SendTo(IOBuffer* buf, int buf_len, const IPEndPoint& address,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
MOCK_METHOD3(SendToInternal, int(const std::string& packet,
const std::string address,
@@ -39,7 +39,7 @@
MOCK_METHOD0(Close, void());
MOCK_CONST_METHOD1(GetPeerAddress, int(IPEndPoint* address));
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
MOCK_CONST_METHOD0(NetLog, const BoundNetLog&());
MOCK_METHOD0(AllowAddressReuse, void());
@@ -75,7 +75,7 @@
virtual ~MockMDnsSocketFactory();
virtual void CreateSockets(
- ScopedVector<DatagramServerSocket>* sockets) OVERRIDE;
+ ScopedVector<DatagramServerSocket>* sockets) override;
void SimulateReceive(const uint8* packet, int size);
diff --git a/net/dns/notify_watcher_mac.h b/net/dns/notify_watcher_mac.h
index 01375d5..0951c2f 100644
--- a/net/dns/notify_watcher_mac.h
+++ b/net/dns/notify_watcher_mac.h
@@ -31,8 +31,8 @@
private:
// MessageLoopForIO::Watcher:
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {}
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override {}
int notify_fd_;
int notify_token_;
diff --git a/net/dns/record_rdata.h b/net/dns/record_rdata.h
index def8e33..09a082f 100644
--- a/net/dns/record_rdata.h
+++ b/net/dns/record_rdata.h
@@ -48,8 +48,8 @@
static scoped_ptr<SrvRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
- virtual bool IsEqual(const RecordRdata* other) const OVERRIDE;
- virtual uint16 Type() const OVERRIDE;
+ virtual bool IsEqual(const RecordRdata* other) const override;
+ virtual uint16 Type() const override;
uint16 priority() const { return priority_; }
uint16 weight() const { return weight_; }
@@ -78,8 +78,8 @@
virtual ~ARecordRdata();
static scoped_ptr<ARecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
- virtual bool IsEqual(const RecordRdata* other) const OVERRIDE;
- virtual uint16 Type() const OVERRIDE;
+ virtual bool IsEqual(const RecordRdata* other) const override;
+ virtual uint16 Type() const override;
const IPAddressNumber& address() const { return address_; }
@@ -100,8 +100,8 @@
virtual ~AAAARecordRdata();
static scoped_ptr<AAAARecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
- virtual bool IsEqual(const RecordRdata* other) const OVERRIDE;
- virtual uint16 Type() const OVERRIDE;
+ virtual bool IsEqual(const RecordRdata* other) const override;
+ virtual uint16 Type() const override;
const IPAddressNumber& address() const { return address_; }
@@ -122,8 +122,8 @@
virtual ~CnameRecordRdata();
static scoped_ptr<CnameRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
- virtual bool IsEqual(const RecordRdata* other) const OVERRIDE;
- virtual uint16 Type() const OVERRIDE;
+ virtual bool IsEqual(const RecordRdata* other) const override;
+ virtual uint16 Type() const override;
std::string cname() const { return cname_; }
@@ -144,8 +144,8 @@
virtual ~PtrRecordRdata();
static scoped_ptr<PtrRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
- virtual bool IsEqual(const RecordRdata* other) const OVERRIDE;
- virtual uint16 Type() const OVERRIDE;
+ virtual bool IsEqual(const RecordRdata* other) const override;
+ virtual uint16 Type() const override;
std::string ptrdomain() const { return ptrdomain_; }
@@ -167,8 +167,8 @@
virtual ~TxtRecordRdata();
static scoped_ptr<TxtRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
- virtual bool IsEqual(const RecordRdata* other) const OVERRIDE;
- virtual uint16 Type() const OVERRIDE;
+ virtual bool IsEqual(const RecordRdata* other) const override;
+ virtual uint16 Type() const override;
const std::vector<std::string>& texts() const { return texts_; }
@@ -191,8 +191,8 @@
virtual ~NsecRecordRdata();
static scoped_ptr<NsecRecordRdata> Create(const base::StringPiece& data,
const DnsRecordParser& parser);
- virtual bool IsEqual(const RecordRdata* other) const OVERRIDE;
- virtual uint16 Type() const OVERRIDE;
+ virtual bool IsEqual(const RecordRdata* other) const override;
+ virtual uint16 Type() const override;
// Length of the bitmap in bits.
unsigned bitmap_length() const { return bitmap_.size() * 8; }
diff --git a/net/dns/serial_worker_unittest.cc b/net/dns/serial_worker_unittest.cc
index 442526f..c670a75 100644
--- a/net/dns/serial_worker_unittest.cc
+++ b/net/dns/serial_worker_unittest.cc
@@ -21,11 +21,11 @@
public:
explicit TestSerialWorker(SerialWorkerTest* t)
: test_(t) {}
- virtual void DoWork() OVERRIDE {
+ virtual void DoWork() override {
ASSERT_TRUE(test_);
test_->OnWork();
}
- virtual void OnWorkFinished() OVERRIDE {
+ virtual void OnWorkFinished() override {
ASSERT_TRUE(test_);
test_->OnWorkFinished();
}
@@ -96,12 +96,12 @@
}
// test::Test methods
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
message_loop_ = base::MessageLoop::current();
worker_ = new TestSerialWorker(this);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Cancel the worker to catch if it makes a late DoWork call.
worker_->Cancel();
// Check if OnWork is stalled.
diff --git a/net/dns/single_request_host_resolver_unittest.cc b/net/dns/single_request_host_resolver_unittest.cc
index cc20bf3..7b09193 100644
--- a/net/dns/single_request_host_resolver_unittest.cc
+++ b/net/dns/single_request_host_resolver_unittest.cc
@@ -35,7 +35,7 @@
AddressList* addresses,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
EXPECT_FALSE(has_outstanding_request());
outstanding_request_ = reinterpret_cast<RequestHandle>(0x1234);
*out_req = outstanding_request_;
@@ -47,12 +47,12 @@
virtual int ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
NOTIMPLEMENTED();
return ERR_UNEXPECTED;
}
- virtual void CancelRequest(RequestHandle req) OVERRIDE {
+ virtual void CancelRequest(RequestHandle req) override {
EXPECT_TRUE(has_outstanding_request());
EXPECT_EQ(req, outstanding_request_);
outstanding_request_ = NULL;
diff --git a/net/extras/sqlite/sqlite_channel_id_store.h b/net/extras/sqlite/sqlite_channel_id_store.h
index 9d032a3..e743ba6 100644
--- a/net/extras/sqlite/sqlite_channel_id_store.h
+++ b/net/extras/sqlite/sqlite_channel_id_store.h
@@ -36,12 +36,12 @@
const scoped_refptr<base::SequencedTaskRunner>& background_task_runner);
// DefaultChannelIDStore::PersistentStore:
- virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
+ virtual void Load(const LoadedCallback& loaded_callback) override;
virtual void AddChannelID(
- const DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE;
+ const DefaultChannelIDStore::ChannelID& channel_id) override;
virtual void DeleteChannelID(
- const DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE;
- virtual void SetForceKeepSessionState() OVERRIDE;
+ const DefaultChannelIDStore::ChannelID& channel_id) override;
+ virtual void SetForceKeepSessionState() override;
// Delete channel ids from servers in |server_identifiers|.
void DeleteAllInList(const std::list<std::string>& server_identifiers);
diff --git a/net/filter/gzip_filter.h b/net/filter/gzip_filter.h
index 0ae284a..07b7821 100644
--- a/net/filter/gzip_filter.h
+++ b/net/filter/gzip_filter.h
@@ -49,7 +49,7 @@
// return. For example, the internal zlib may process some pre-filter data
// but not produce output yet.
virtual FilterStatus ReadFilteredData(char* dest_buffer,
- int* dest_len) OVERRIDE;
+ int* dest_len) override;
private:
enum DecodingStatus {
diff --git a/net/filter/mock_filter_context.h b/net/filter/mock_filter_context.h
index a68f456..bdef812 100644
--- a/net/filter/mock_filter_context.h
+++ b/net/filter/mock_filter_context.h
@@ -41,37 +41,37 @@
// of those interfaces as coding errors.
void NukeUnstableInterfaces();
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
+ virtual bool GetMimeType(std::string* mime_type) const override;
// What URL was used to access this data?
// Return false if gurl is not present.
- virtual bool GetURL(GURL* gurl) const OVERRIDE;
+ virtual bool GetURL(GURL* gurl) const override;
// What Content-Disposition did the server supply for this data?
// Return false if Content-Disposition was not present.
- virtual bool GetContentDisposition(std::string* disposition) const OVERRIDE;
+ virtual bool GetContentDisposition(std::string* disposition) const override;
// What was this data requested from a server?
- virtual base::Time GetRequestTime() const OVERRIDE;
+ virtual base::Time GetRequestTime() const override;
// Is data supplied from cache, or fresh across the net?
- virtual bool IsCachedContent() const OVERRIDE;
+ virtual bool IsCachedContent() const override;
// Is this a download?
- virtual bool IsDownload() const OVERRIDE;
+ virtual bool IsDownload() const override;
// Was this data flagged as a response to a request with an SDCH dictionary?
- virtual bool SdchResponseExpected() const OVERRIDE;
+ virtual bool SdchResponseExpected() const override;
// How many bytes were fed to filter(s) so far?
- virtual int64 GetByteReadCount() const OVERRIDE;
+ virtual int64 GetByteReadCount() const override;
- virtual int GetResponseCode() const OVERRIDE;
+ virtual int GetResponseCode() const override;
// The URLRequestContext associated with the request.
- virtual const URLRequestContext* GetURLRequestContext() const OVERRIDE;
+ virtual const URLRequestContext* GetURLRequestContext() const override;
- virtual void RecordPacketStats(StatisticSelector statistic) const OVERRIDE {}
+ virtual void RecordPacketStats(StatisticSelector statistic) const override {}
private:
int buffer_size_;
diff --git a/net/filter/sdch_filter.h b/net/filter/sdch_filter.h
index 3cea340..861a9ae 100644
--- a/net/filter/sdch_filter.h
+++ b/net/filter/sdch_filter.h
@@ -41,7 +41,7 @@
// destination buffer. Upon exit, *dest_len is the actual number of chars
// written into the destination buffer.
virtual FilterStatus ReadFilteredData(char* dest_buffer,
- int* dest_len) OVERRIDE;
+ int* dest_len) override;
private:
// Internal status. Once we enter an error state, we stop processing data.
diff --git a/net/ftp/ftp_network_layer.h b/net/ftp/ftp_network_layer.h
index 6040d02..6242f74 100644
--- a/net/ftp/ftp_network_layer.h
+++ b/net/ftp/ftp_network_layer.h
@@ -24,8 +24,8 @@
static FtpTransactionFactory* CreateFactory(HostResolver* host_resolver);
// FtpTransactionFactory methods:
- virtual FtpTransaction* CreateTransaction() OVERRIDE;
- virtual void Suspend(bool suspend) OVERRIDE;
+ virtual FtpTransaction* CreateTransaction() override;
+ virtual void Suspend(bool suspend) override;
private:
scoped_refptr<FtpNetworkSession> session_;
diff --git a/net/ftp/ftp_network_transaction.h b/net/ftp/ftp_network_transaction.h
index 5eb6aae..ee0f28a 100644
--- a/net/ftp/ftp_network_transaction.h
+++ b/net/ftp/ftp_network_transaction.h
@@ -38,14 +38,14 @@
// FtpTransaction methods:
virtual int Start(const FtpRequestInfo* request_info,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual int RestartWithAuth(const AuthCredentials& credentials,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual const FtpResponseInfo* GetResponseInfo() const OVERRIDE;
- virtual LoadState GetLoadState() const OVERRIDE;
- virtual uint64 GetUploadProgress() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual const FtpResponseInfo* GetResponseInfo() const override;
+ virtual LoadState GetLoadState() const override;
+ virtual uint64 GetUploadProgress() const override;
private:
FRIEND_TEST_ALL_PREFIXES(FtpNetworkTransactionTest,
diff --git a/net/ftp/ftp_network_transaction_unittest.cc b/net/ftp/ftp_network_transaction_unittest.cc
index c058d38..de407d5 100644
--- a/net/ftp/ftp_network_transaction_unittest.cc
+++ b/net/ftp/ftp_network_transaction_unittest.cc
@@ -63,7 +63,7 @@
Init();
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -131,7 +131,7 @@
return state_;
}
- virtual void Reset() OVERRIDE {
+ virtual void Reset() override {
DynamicSocketDataProvider::Reset();
Init();
}
@@ -205,7 +205,7 @@
FtpSocketDataProviderDirectoryListing() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -232,7 +232,7 @@
FtpSocketDataProviderDirectoryListingWithPasvFallback() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -258,7 +258,7 @@
FtpSocketDataProviderDirectoryListingZeroSize() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -278,7 +278,7 @@
FtpSocketDataProviderVMSDirectoryListing() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -312,7 +312,7 @@
FtpSocketDataProviderVMSDirectoryListingRootDirectory() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -348,7 +348,7 @@
FtpSocketDataProviderFileDownloadWithFileTypecode() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -371,7 +371,7 @@
FtpSocketDataProviderFileDownload() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -398,7 +398,7 @@
FtpSocketDataProviderFileNotFound() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -428,7 +428,7 @@
FtpSocketDataProviderFileDownloadWithPasvFallback() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -453,7 +453,7 @@
FtpSocketDataProviderFileDownloadZeroSize() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -479,7 +479,7 @@
FtpSocketDataProviderFileDownloadCWD451() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -501,7 +501,7 @@
FtpSocketDataProviderVMSFileDownload() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -536,7 +536,7 @@
FtpSocketDataProviderEscaping() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -565,7 +565,7 @@
FtpSocketDataProviderFileDownloadTransferStarting() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -589,7 +589,7 @@
FtpSocketDataProviderDirectoryListingTransferStarting() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -614,7 +614,7 @@
FtpSocketDataProviderFileDownloadInvalidResponse() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -648,7 +648,7 @@
epsv_response_length_(epsv_response_length),
expected_state_(expected_state) {}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -676,7 +676,7 @@
expected_state_(expected_state) {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -701,7 +701,7 @@
expected_state_(expected_state) {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -728,7 +728,7 @@
expected_password_(expected_password) {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -755,7 +755,7 @@
FtpSocketDataProviderCloseConnection() {
}
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
+ virtual MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
diff --git a/net/http/disk_cache_based_quic_server_info.h b/net/http/disk_cache_based_quic_server_info.h
index b0bb15c..7707037 100644
--- a/net/http/disk_cache_based_quic_server_info.h
+++ b/net/http/disk_cache_based_quic_server_info.h
@@ -31,11 +31,11 @@
HttpCache* http_cache);
// QuicServerInfo implementation.
- virtual void Start() OVERRIDE;
- virtual int WaitForDataReady(const CompletionCallback& callback) OVERRIDE;
- virtual bool IsDataReady() OVERRIDE;
- virtual bool IsReadyToPersist() OVERRIDE;
- virtual void Persist() OVERRIDE;
+ virtual void Start() override;
+ virtual int WaitForDataReady(const CompletionCallback& callback) override;
+ virtual bool IsDataReady() override;
+ virtual bool IsReadyToPersist() override;
+ virtual void Persist() override;
private:
struct CacheOperationDataShim;
diff --git a/net/http/failing_http_transaction_factory.cc b/net/http/failing_http_transaction_factory.cc
index 23a184f..0b97aa2 100644
--- a/net/http/failing_http_transaction_factory.cc
+++ b/net/http/failing_http_transaction_factory.cc
@@ -34,38 +34,38 @@
// HttpTransaction
virtual int Start(const HttpRequestInfo* request_info,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual int RestartIgnoringLastError(
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int RestartWithCertificate(
X509Certificate* client_cert,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int RestartWithAuth(
const AuthCredentials& credentials,
- const CompletionCallback& callback) OVERRIDE;
- virtual bool IsReadyToRestartForAuth() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual bool IsReadyToRestartForAuth() override;
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual void StopCaching() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void StopCaching() override;
virtual bool GetFullRequestHeaders(
- HttpRequestHeaders* headers) const OVERRIDE;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
- virtual void DoneReading() OVERRIDE;
- virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE;
- virtual LoadState GetLoadState() const OVERRIDE;
- virtual UploadProgress GetUploadProgress() const OVERRIDE;
+ HttpRequestHeaders* headers) const override;
+ virtual int64 GetTotalReceivedBytes() const override;
+ virtual void DoneReading() override;
+ virtual const HttpResponseInfo* GetResponseInfo() const override;
+ virtual LoadState GetLoadState() const override;
+ virtual UploadProgress GetUploadProgress() const override;
virtual void SetQuicServerInfo(
- net::QuicServerInfo* quic_server_info) OVERRIDE;
+ net::QuicServerInfo* quic_server_info) override;
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
+ virtual void SetPriority(RequestPriority priority) override;
virtual void SetWebSocketHandshakeStreamCreateHelper(
- WebSocketHandshakeStreamBase::CreateHelper* create_helper) OVERRIDE;
+ WebSocketHandshakeStreamBase::CreateHelper* create_helper) override;
virtual void SetBeforeNetworkStartCallback(
- const BeforeNetworkStartCallback& callback) OVERRIDE;
+ const BeforeNetworkStartCallback& callback) override;
virtual void SetBeforeProxyHeadersSentCallback(
- const BeforeProxyHeadersSentCallback& callback) OVERRIDE;
- virtual int ResumeNetworkStart() OVERRIDE;
+ const BeforeProxyHeadersSentCallback& callback) override;
+ virtual int ResumeNetworkStart() override;
private:
Error error_;
diff --git a/net/http/failing_http_transaction_factory.h b/net/http/failing_http_transaction_factory.h
index 84d87a7..8a785f5 100644
--- a/net/http/failing_http_transaction_factory.h
+++ b/net/http/failing_http_transaction_factory.h
@@ -28,9 +28,9 @@
// HttpTransactionFactory:
virtual int CreateTransaction(
RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) OVERRIDE;
- virtual HttpCache* GetCache() OVERRIDE;
- virtual HttpNetworkSession* GetSession() OVERRIDE;
+ scoped_ptr<HttpTransaction>* trans) override;
+ virtual HttpCache* GetCache() override;
+ virtual HttpNetworkSession* GetSession() override;
private:
HttpNetworkSession* session_;
diff --git a/net/http/http_auth_cache_unittest.cc b/net/http/http_auth_cache_unittest.cc
index e925c71..4002bab 100644
--- a/net/http/http_auth_cache_unittest.cc
+++ b/net/http/http_auth_cache_unittest.cc
@@ -33,19 +33,19 @@
}
virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
- HttpAuthChallengeTokenizer* challenge) OVERRIDE {
+ HttpAuthChallengeTokenizer* challenge) override {
return HttpAuth::AUTHORIZATION_RESULT_REJECT;
}
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE {
+ virtual bool Init(HttpAuthChallengeTokenizer* challenge) override {
return false; // Unused.
}
virtual int GenerateAuthTokenImpl(const AuthCredentials*,
const HttpRequestInfo*,
const CompletionCallback& callback,
- std::string* auth_token) OVERRIDE {
+ std::string* auth_token) override {
*auth_token = "mock-credentials";
return OK;
}
diff --git a/net/http/http_auth_controller_unittest.cc b/net/http/http_auth_controller_unittest.cc
index 1a59b8d..306cabd 100644
--- a/net/http/http_auth_controller_unittest.cc
+++ b/net/http/http_auth_controller_unittest.cc
@@ -128,7 +128,7 @@
}
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE {
+ virtual bool Init(HttpAuthChallengeTokenizer* challenge) override {
HttpAuthHandlerMock::Init(challenge);
set_allows_default_credentials(true);
set_allows_explicit_credentials(false);
@@ -146,7 +146,7 @@
virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
const HttpRequestInfo* request,
const CompletionCallback& callback,
- std::string* auth_token) OVERRIDE {
+ std::string* auth_token) override {
int result =
HttpAuthHandlerMock::GenerateAuthTokenImpl(credentials,
request, callback,
diff --git a/net/http/http_auth_filter.h b/net/http/http_auth_filter.h
index 9f09ac1..419b8af 100644
--- a/net/http/http_auth_filter.h
+++ b/net/http/http_auth_filter.h
@@ -46,7 +46,7 @@
const ProxyBypassRules& rules() const { return rules_; }
// HttpAuthFilter methods:
- virtual bool IsValid(const GURL& url, HttpAuth::Target target) const OVERRIDE;
+ virtual bool IsValid(const GURL& url, HttpAuth::Target target) const override;
private:
// Installs the whitelist.
diff --git a/net/http/http_auth_gssapi_posix.h b/net/http/http_auth_gssapi_posix.h
index 2e7b99b..41a1805 100644
--- a/net/http/http_auth_gssapi_posix.h
+++ b/net/http/http_auth_gssapi_posix.h
@@ -112,30 +112,30 @@
virtual ~GSSAPISharedLibrary();
// GSSAPILibrary methods:
- virtual bool Init() OVERRIDE;
+ virtual bool Init() override;
virtual OM_uint32 import_name(
OM_uint32* minor_status,
const gss_buffer_t input_name_buffer,
const gss_OID input_name_type,
- gss_name_t* output_name) OVERRIDE;
+ gss_name_t* output_name) override;
virtual OM_uint32 release_name(
OM_uint32* minor_status,
- gss_name_t* input_name) OVERRIDE;
+ gss_name_t* input_name) override;
virtual OM_uint32 release_buffer(
OM_uint32* minor_status,
- gss_buffer_t buffer) OVERRIDE;
+ gss_buffer_t buffer) override;
virtual OM_uint32 display_name(
OM_uint32* minor_status,
const gss_name_t input_name,
gss_buffer_t output_name_buffer,
- gss_OID* output_name_type) OVERRIDE;
+ gss_OID* output_name_type) override;
virtual OM_uint32 display_status(
OM_uint32* minor_status,
OM_uint32 status_value,
int status_type,
const gss_OID mech_type,
OM_uint32* message_contex,
- gss_buffer_t status_string) OVERRIDE;
+ gss_buffer_t status_string) override;
virtual OM_uint32 init_sec_context(
OM_uint32* minor_status,
const gss_cred_id_t initiator_cred_handle,
@@ -149,18 +149,18 @@
gss_OID* actual_mech_type,
gss_buffer_t output_token,
OM_uint32* ret_flags,
- OM_uint32* time_rec) OVERRIDE;
+ OM_uint32* time_rec) override;
virtual OM_uint32 wrap_size_limit(
OM_uint32* minor_status,
const gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req,
OM_uint32 req_output_size,
- OM_uint32* max_input_size) OVERRIDE;
+ OM_uint32* max_input_size) override;
virtual OM_uint32 delete_sec_context(
OM_uint32* minor_status,
gss_ctx_id_t* context_handle,
- gss_buffer_t output_token) OVERRIDE;
+ gss_buffer_t output_token) override;
virtual OM_uint32 inquire_context(
OM_uint32* minor_status,
const gss_ctx_id_t context_handle,
@@ -170,7 +170,7 @@
gss_OID* mech_type,
OM_uint32* ctx_flags,
int* locally_initiated,
- int* open) OVERRIDE;
+ int* open) override;
private:
typedef typeof(&gss_import_name) gss_import_name_type;
diff --git a/net/http/http_auth_handler_basic.h b/net/http/http_auth_handler_basic.h
index 5d786f9..f718786 100644
--- a/net/http/http_auth_handler_basic.h
+++ b/net/http/http_auth_handler_basic.h
@@ -28,19 +28,19 @@
CreateReason reason,
int digest_nonce_count,
const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) OVERRIDE;
+ scoped_ptr<HttpAuthHandler>* handler) override;
};
virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
- HttpAuthChallengeTokenizer* challenge) OVERRIDE;
+ HttpAuthChallengeTokenizer* challenge) override;
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE;
+ virtual bool Init(HttpAuthChallengeTokenizer* challenge) override;
virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
const HttpRequestInfo* request,
const CompletionCallback& callback,
- std::string* auth_token) OVERRIDE;
+ std::string* auth_token) override;
private:
virtual ~HttpAuthHandlerBasic() {}
diff --git a/net/http/http_auth_handler_digest.h b/net/http/http_auth_handler_digest.h
index 6a960d9..ca148fe 100644
--- a/net/http/http_auth_handler_digest.h
+++ b/net/http/http_auth_handler_digest.h
@@ -38,7 +38,7 @@
class DynamicNonceGenerator : public NonceGenerator {
public:
DynamicNonceGenerator();
- virtual std::string GenerateNonce() const OVERRIDE;
+ virtual std::string GenerateNonce() const override;
private:
DISALLOW_COPY_AND_ASSIGN(DynamicNonceGenerator);
};
@@ -49,7 +49,7 @@
public:
explicit FixedNonceGenerator(const std::string& nonce);
- virtual std::string GenerateNonce() const OVERRIDE;
+ virtual std::string GenerateNonce() const override;
private:
const std::string nonce_;
@@ -71,22 +71,22 @@
CreateReason reason,
int digest_nonce_count,
const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) OVERRIDE;
+ scoped_ptr<HttpAuthHandler>* handler) override;
private:
scoped_ptr<const NonceGenerator> nonce_generator_;
};
virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
- HttpAuthChallengeTokenizer* challenge) OVERRIDE;
+ HttpAuthChallengeTokenizer* challenge) override;
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE;
+ virtual bool Init(HttpAuthChallengeTokenizer* challenge) override;
virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
const HttpRequestInfo* request,
const CompletionCallback& callback,
- std::string* auth_token) OVERRIDE;
+ std::string* auth_token) override;
private:
FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, ParseChallenge);
diff --git a/net/http/http_auth_handler_factory.h b/net/http/http_auth_handler_factory.h
index e712aaf..efb432a 100644
--- a/net/http/http_auth_handler_factory.h
+++ b/net/http/http_auth_handler_factory.h
@@ -189,7 +189,7 @@
CreateReason reason,
int digest_nonce_count,
const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) OVERRIDE;
+ scoped_ptr<HttpAuthHandler>* handler) override;
private:
typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap;
diff --git a/net/http/http_auth_handler_factory_unittest.cc b/net/http/http_auth_handler_factory_unittest.cc
index 06e8933..9860623 100644
--- a/net/http/http_auth_handler_factory_unittest.cc
+++ b/net/http/http_auth_handler_factory_unittest.cc
@@ -27,7 +27,7 @@
CreateReason reason,
int nonce_count,
const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) OVERRIDE {
+ scoped_ptr<HttpAuthHandler>* handler) override {
handler->reset();
return return_code_;
}
diff --git a/net/http/http_auth_handler_mock.h b/net/http/http_auth_handler_mock.h
index fd9885b..b903e8c 100644
--- a/net/http/http_auth_handler_mock.h
+++ b/net/http/http_auth_handler_mock.h
@@ -49,7 +49,7 @@
CreateReason reason,
int nonce_count,
const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) OVERRIDE;
+ scoped_ptr<HttpAuthHandler>* handler) override;
private:
ScopedVector<HttpAuthHandler> handlers_[HttpAuth::AUTH_NUM_TARGETS];
@@ -88,18 +88,18 @@
// HttpAuthHandler:
virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
- HttpAuthChallengeTokenizer* challenge) OVERRIDE;
- virtual bool NeedsIdentity() OVERRIDE;
- virtual bool AllowsDefaultCredentials() OVERRIDE;
- virtual bool AllowsExplicitCredentials() OVERRIDE;
+ HttpAuthChallengeTokenizer* challenge) override;
+ virtual bool NeedsIdentity() override;
+ virtual bool AllowsDefaultCredentials() override;
+ virtual bool AllowsExplicitCredentials() override;
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE;
+ virtual bool Init(HttpAuthChallengeTokenizer* challenge) override;
virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
const HttpRequestInfo* request,
const CompletionCallback& callback,
- std::string* auth_token) OVERRIDE;
+ std::string* auth_token) override;
private:
void OnResolveCanonicalName();
diff --git a/net/http/http_auth_handler_negotiate.h b/net/http/http_auth_handler_negotiate.h
index 90bd16c..8ff9244 100644
--- a/net/http/http_auth_handler_negotiate.h
+++ b/net/http/http_auth_handler_negotiate.h
@@ -76,7 +76,7 @@
CreateReason reason,
int digest_nonce_count,
const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) OVERRIDE;
+ scoped_ptr<HttpAuthHandler>* handler) override;
private:
bool disable_cname_lookup_;
@@ -107,18 +107,18 @@
// HttpAuthHandler:
virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
- HttpAuthChallengeTokenizer* challenge) OVERRIDE;
- virtual bool NeedsIdentity() OVERRIDE;
- virtual bool AllowsDefaultCredentials() OVERRIDE;
- virtual bool AllowsExplicitCredentials() OVERRIDE;
+ HttpAuthChallengeTokenizer* challenge) override;
+ virtual bool NeedsIdentity() override;
+ virtual bool AllowsDefaultCredentials() override;
+ virtual bool AllowsExplicitCredentials() override;
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE;
+ virtual bool Init(HttpAuthChallengeTokenizer* challenge) override;
virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
const HttpRequestInfo* request,
const CompletionCallback& callback,
- std::string* auth_token) OVERRIDE;
+ std::string* auth_token) override;
private:
enum State {
diff --git a/net/http/http_auth_handler_ntlm.h b/net/http/http_auth_handler_ntlm.h
index 9e2abc6..5a998ac 100644
--- a/net/http/http_auth_handler_ntlm.h
+++ b/net/http/http_auth_handler_ntlm.h
@@ -48,7 +48,7 @@
CreateReason reason,
int digest_nonce_count,
const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) OVERRIDE;
+ scoped_ptr<HttpAuthHandler>* handler) override;
#if defined(NTLM_SSPI)
// Set the SSPILibrary to use. Typically the only callers which need to use
// this are unit tests which pass in a mocked-out version of the SSPI
@@ -104,24 +104,24 @@
URLSecurityManager* url_security_manager);
#endif
- virtual bool NeedsIdentity() OVERRIDE;
+ virtual bool NeedsIdentity() override;
- virtual bool AllowsDefaultCredentials() OVERRIDE;
+ virtual bool AllowsDefaultCredentials() override;
virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
- HttpAuthChallengeTokenizer* challenge) OVERRIDE;
+ HttpAuthChallengeTokenizer* challenge) override;
protected:
// This function acquires a credentials handle in the SSPI implementation.
// It does nothing in the portable implementation.
int InitializeBeforeFirstChallenge();
- virtual bool Init(HttpAuthChallengeTokenizer* tok) OVERRIDE;
+ virtual bool Init(HttpAuthChallengeTokenizer* tok) override;
virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
const HttpRequestInfo* request,
const CompletionCallback& callback,
- std::string* auth_token) OVERRIDE;
+ std::string* auth_token) override;
private:
virtual ~HttpAuthHandlerNTLM();
diff --git a/net/http/http_basic_stream.h b/net/http/http_basic_stream.h
index 00253c3..541994d 100644
--- a/net/http/http_basic_stream.h
+++ b/net/http/http_basic_stream.h
@@ -36,49 +36,49 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int SendRequest(const HttpRequestHeaders& headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
- virtual UploadProgress GetUploadProgress() const OVERRIDE;
+ virtual UploadProgress GetUploadProgress() const override;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE;
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
virtual int ReadResponseBody(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
- virtual void Close(bool not_reusable) OVERRIDE;
+ virtual void Close(bool not_reusable) override;
- virtual HttpStream* RenewStreamForAuth() OVERRIDE;
+ virtual HttpStream* RenewStreamForAuth() override;
- virtual bool IsResponseBodyComplete() const OVERRIDE;
+ virtual bool IsResponseBodyComplete() const override;
- virtual bool CanFindEndOfResponse() const OVERRIDE;
+ virtual bool CanFindEndOfResponse() const override;
- virtual bool IsConnectionReused() const OVERRIDE;
+ virtual bool IsConnectionReused() const override;
- virtual void SetConnectionReused() OVERRIDE;
+ virtual void SetConnectionReused() override;
- virtual bool IsConnectionReusable() const OVERRIDE;
+ virtual bool IsConnectionReusable() const override;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
+ virtual int64 GetTotalReceivedBytes() const override;
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override;
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE;
+ SSLCertRequestInfo* cert_request_info) override;
- virtual bool IsSpdyHttpStream() const OVERRIDE;
+ virtual bool IsSpdyHttpStream() const override;
- virtual void Drain(HttpNetworkSession* session) OVERRIDE;
+ virtual void Drain(HttpNetworkSession* session) override;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
+ virtual void SetPriority(RequestPriority priority) override;
private:
HttpStreamParser* parser() const { return state_.parser(); }
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index cbf2615..1c8e62a 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -23,6 +23,7 @@
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/pickle.h"
+#include "base/profiler/scoped_profile.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -286,7 +287,7 @@
}
virtual QuicServerInfo* GetForServer(
- const QuicServerId& server_id) OVERRIDE {
+ const QuicServerId& server_id) override {
return new DiskCacheBasedQuicServerInfo(server_id, http_cache_);
}
@@ -1355,6 +1356,11 @@
void HttpCache::OnPendingOpComplete(const base::WeakPtr<HttpCache>& cache,
PendingOp* pending_op,
int rv) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422516 HttpCache::OnPendingOpComplete"));
+
if (cache.get()) {
cache->OnIOComplete(rv, pending_op);
} else {
diff --git a/net/http/http_cache.h b/net/http/http_cache.h
index 3f59839..5e6851f 100644
--- a/net/http/http_cache.h
+++ b/net/http/http_cache.h
@@ -116,7 +116,7 @@
// BackendFactory implementation.
virtual int CreateBackend(NetLog* net_log,
scoped_ptr<disk_cache::Backend>* backend,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
private:
CacheType type_;
@@ -214,9 +214,9 @@
// HttpTransactionFactory implementation:
virtual int CreateTransaction(RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) OVERRIDE;
- virtual HttpCache* GetCache() OVERRIDE;
- virtual HttpNetworkSession* GetSession() OVERRIDE;
+ scoped_ptr<HttpTransaction>* trans) override;
+ virtual HttpCache* GetCache() override;
+ virtual HttpNetworkSession* GetSession() override;
base::WeakPtr<HttpCache> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 5e90131..ddd0481 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -21,6 +21,7 @@
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
+#include "base/profiler/scoped_profile.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
@@ -2944,6 +2945,10 @@
}
void HttpCache::Transaction::OnIOComplete(int result) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 Transaction::OnIOComplete"));
+
DoLoop(result);
}
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index b63e859..cc1f467 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -112,37 +112,37 @@
// HttpTransaction methods:
virtual int Start(const HttpRequestInfo* request_info,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual int RestartIgnoringLastError(
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int RestartWithCertificate(
X509Certificate* client_cert,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int RestartWithAuth(const AuthCredentials& credentials,
- const CompletionCallback& callback) OVERRIDE;
- virtual bool IsReadyToRestartForAuth() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual bool IsReadyToRestartForAuth() override;
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual void StopCaching() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void StopCaching() override;
virtual bool GetFullRequestHeaders(
- HttpRequestHeaders* headers) const OVERRIDE;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
- virtual void DoneReading() OVERRIDE;
- virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE;
- virtual LoadState GetLoadState() const OVERRIDE;
- virtual UploadProgress GetUploadProgress(void) const OVERRIDE;
- virtual void SetQuicServerInfo(QuicServerInfo* quic_server_info) OVERRIDE;
+ HttpRequestHeaders* headers) const override;
+ virtual int64 GetTotalReceivedBytes() const override;
+ virtual void DoneReading() override;
+ virtual const HttpResponseInfo* GetResponseInfo() const override;
+ virtual LoadState GetLoadState() const override;
+ virtual UploadProgress GetUploadProgress(void) const override;
+ virtual void SetQuicServerInfo(QuicServerInfo* quic_server_info) override;
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
+ virtual void SetPriority(RequestPriority priority) override;
virtual void SetWebSocketHandshakeStreamCreateHelper(
- net::WebSocketHandshakeStreamBase::CreateHelper* create_helper) OVERRIDE;
+ net::WebSocketHandshakeStreamBase::CreateHelper* create_helper) override;
virtual void SetBeforeNetworkStartCallback(
- const BeforeNetworkStartCallback& callback) OVERRIDE;
+ const BeforeNetworkStartCallback& callback) override;
virtual void SetBeforeProxyHeadersSentCallback(
- const BeforeProxyHeadersSentCallback& callback) OVERRIDE;
- virtual int ResumeNetworkStart() OVERRIDE;
+ const BeforeProxyHeadersSentCallback& callback) override;
+ virtual int ResumeNetworkStart() override;
private:
static const size_t kNumValidationHeaders = 2;
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index a7a04f1..0b05057 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -14,6 +14,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/base/cache_type.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_flags.h"
#include "net/base/load_timing_info.h"
@@ -21,7 +22,6 @@
#include "net/base/net_errors.h"
#include "net/base/net_log_unittest.h"
#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_data_stream.h"
#include "net/cert/cert_status_flags.h"
#include "net/disk_cache/disk_cache.h"
#include "net/http/http_byte_range.h"
@@ -498,12 +498,12 @@
public:
virtual ~FakeWebSocketHandshakeStreamCreateHelper() {}
virtual net::WebSocketHandshakeStreamBase* CreateBasicStream(
- scoped_ptr<net::ClientSocketHandle> connect, bool using_proxy) OVERRIDE {
+ scoped_ptr<net::ClientSocketHandle> connect, bool using_proxy) override {
return NULL;
}
virtual net::WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<net::SpdySession>& session,
- bool use_relative_url) OVERRIDE {
+ bool use_relative_url) override {
return NULL;
}
};
@@ -2774,7 +2774,8 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), kUploadId);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(),
+ kUploadId);
MockHttpRequest request(transaction);
request.upload_data_stream = &upload_data_stream;
@@ -2805,7 +2806,8 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), kUploadId);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(),
+ kUploadId);
MockHttpRequest request(transaction);
request.upload_data_stream = &upload_data_stream;
@@ -2824,7 +2826,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 1);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 1);
MockTransaction transaction(kSimplePOST_Transaction);
MockHttpRequest req1(transaction);
@@ -2863,7 +2865,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 1);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 1);
transaction.method = "POST";
transaction.status = "HTTP/1.1 205 No Content";
@@ -2902,7 +2904,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
transaction.method = "POST";
transaction.status = "HTTP/1.1 205 No Content";
@@ -2933,7 +2935,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
MockTransaction transaction(kSimplePOST_Transaction);
AddMockTransaction(&transaction);
@@ -2962,7 +2964,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 1);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 1);
transaction.method = "POST";
transaction.status = "HTTP/1.1 100 Continue";
@@ -3273,7 +3275,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
MockHttpRequest request(transaction);
request.upload_data_stream = &upload_data_stream;
@@ -3302,7 +3304,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
transaction.method = "PUT";
MockHttpRequest req2(transaction);
@@ -3338,7 +3340,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
transaction.method = "PUT";
transaction.status = "HTTP/1.1 305 Use Proxy";
@@ -3376,7 +3378,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
transaction.method = "PUT";
transaction.status = "HTTP/1.1 404 Not Found";
@@ -3406,7 +3408,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
MockHttpRequest request(transaction);
request.upload_data_stream = &upload_data_stream;
@@ -3435,7 +3437,7 @@
ScopedVector<net::UploadElementReader> element_readers;
element_readers.push_back(new net::UploadBytesElementReader("hello", 5));
- net::UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ net::ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
transaction.method = "DELETE";
MockHttpRequest req2(transaction);
@@ -7290,3 +7292,46 @@
RemoveMockTransaction(&transaction);
}
+
+// Makes sure that a request stops using the cache when the response headers
+// with "Cache-Control: no-store" arrives. That means that another request for
+// the same URL can be processed before the response body of the original
+// request arrives.
+TEST(HttpCache, NoStoreResponseShouldNotBlockFollowingRequests) {
+ MockHttpCache cache;
+ ScopedMockTransaction mock_transaction(kSimpleGET_Transaction);
+ mock_transaction.response_headers = "Cache-Control: no-store\n";
+ MockHttpRequest request(mock_transaction);
+
+ scoped_ptr<Context> first(new Context);
+ first->result = cache.CreateTransaction(&first->trans);
+ ASSERT_EQ(net::OK, first->result);
+ EXPECT_EQ(net::LOAD_STATE_IDLE, first->trans->GetLoadState());
+ first->result = first->trans->Start(
+ &request, first->callback.callback(), net::BoundNetLog());
+ EXPECT_EQ(net::LOAD_STATE_WAITING_FOR_CACHE, first->trans->GetLoadState());
+
+ base::MessageLoop::current()->RunUntilIdle();
+ EXPECT_EQ(net::LOAD_STATE_IDLE, first->trans->GetLoadState());
+ ASSERT_TRUE(first->trans->GetResponseInfo());
+ EXPECT_TRUE(first->trans->GetResponseInfo()->headers->HasHeaderValue(
+ "Cache-Control", "no-store"));
+ // Here we have read the response header but not read the response body yet.
+
+ // Let us create the second (read) transaction.
+ scoped_ptr<Context> second(new Context);
+ second->result = cache.CreateTransaction(&second->trans);
+ ASSERT_EQ(net::OK, second->result);
+ EXPECT_EQ(net::LOAD_STATE_IDLE, second->trans->GetLoadState());
+ second->result = second->trans->Start(
+ &request, second->callback.callback(), net::BoundNetLog());
+
+ // Here the second transaction proceeds without reading the first body.
+ EXPECT_EQ(net::LOAD_STATE_WAITING_FOR_CACHE, second->trans->GetLoadState());
+ base::MessageLoop::current()->RunUntilIdle();
+ EXPECT_EQ(net::LOAD_STATE_IDLE, second->trans->GetLoadState());
+ ASSERT_TRUE(second->trans->GetResponseInfo());
+ EXPECT_TRUE(second->trans->GetResponseInfo()->headers->HasHeaderValue(
+ "Cache-Control", "no-store"));
+ ReadAndVerifyTransaction(second->trans.get(), kSimpleGET_Transaction);
+}
diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h
index fc94d0a..58b02f2 100644
--- a/net/http/http_network_layer.h
+++ b/net/http/http_network_layer.h
@@ -44,13 +44,13 @@
// HttpTransactionFactory methods:
virtual int CreateTransaction(RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) OVERRIDE;
- virtual HttpCache* GetCache() OVERRIDE;
- virtual HttpNetworkSession* GetSession() OVERRIDE;
+ scoped_ptr<HttpTransaction>* trans) override;
+ virtual HttpCache* GetCache() override;
+ virtual HttpNetworkSession* GetSession() override;
// base::PowerObserver methods:
- virtual void OnSuspend() OVERRIDE;
- virtual void OnResume() OVERRIDE;
+ virtual void OnSuspend() override;
+ virtual void OnResume() override;
private:
const scoped_refptr<HttpNetworkSession> session_;
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h
index 895ecc3..57ebdf7 100644
--- a/net/http/http_network_transaction.h
+++ b/net/http/http_network_transaction.h
@@ -47,63 +47,63 @@
// HttpTransaction methods:
virtual int Start(const HttpRequestInfo* request_info,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual int RestartIgnoringLastError(
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int RestartWithCertificate(
X509Certificate* client_cert,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int RestartWithAuth(const AuthCredentials& credentials,
- const CompletionCallback& callback) OVERRIDE;
- virtual bool IsReadyToRestartForAuth() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual bool IsReadyToRestartForAuth() override;
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual void StopCaching() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void StopCaching() override;
virtual bool GetFullRequestHeaders(
- HttpRequestHeaders* headers) const OVERRIDE;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
- virtual void DoneReading() OVERRIDE;
- virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE;
- virtual LoadState GetLoadState() const OVERRIDE;
- virtual UploadProgress GetUploadProgress() const OVERRIDE;
- virtual void SetQuicServerInfo(QuicServerInfo* quic_server_info) OVERRIDE;
+ HttpRequestHeaders* headers) const override;
+ virtual int64 GetTotalReceivedBytes() const override;
+ virtual void DoneReading() override;
+ virtual const HttpResponseInfo* GetResponseInfo() const override;
+ virtual LoadState GetLoadState() const override;
+ virtual UploadProgress GetUploadProgress() const override;
+ virtual void SetQuicServerInfo(QuicServerInfo* quic_server_info) override;
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
+ virtual void SetPriority(RequestPriority priority) override;
virtual void SetWebSocketHandshakeStreamCreateHelper(
- WebSocketHandshakeStreamBase::CreateHelper* create_helper) OVERRIDE;
+ WebSocketHandshakeStreamBase::CreateHelper* create_helper) override;
virtual void SetBeforeNetworkStartCallback(
- const BeforeNetworkStartCallback& callback) OVERRIDE;
+ const BeforeNetworkStartCallback& callback) override;
virtual void SetBeforeProxyHeadersSentCallback(
- const BeforeProxyHeadersSentCallback& callback) OVERRIDE;
- virtual int ResumeNetworkStart() OVERRIDE;
+ const BeforeProxyHeadersSentCallback& callback) override;
+ virtual int ResumeNetworkStart() override;
// HttpStreamRequest::Delegate methods:
virtual void OnStreamReady(const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) OVERRIDE;
+ HttpStreamBase* stream) override;
virtual void OnWebSocketHandshakeStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- WebSocketHandshakeStreamBase* stream) OVERRIDE;
+ WebSocketHandshakeStreamBase* stream) override;
virtual void OnStreamFailed(int status,
- const SSLConfig& used_ssl_config) OVERRIDE;
+ const SSLConfig& used_ssl_config) override;
virtual void OnCertificateError(int status,
const SSLConfig& used_ssl_config,
- const SSLInfo& ssl_info) OVERRIDE;
+ const SSLInfo& ssl_info) override;
virtual void OnNeedsProxyAuth(
const HttpResponseInfo& response_info,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpAuthController* auth_controller) OVERRIDE;
+ HttpAuthController* auth_controller) override;
virtual void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
- SSLCertRequestInfo* cert_info) OVERRIDE;
+ SSLCertRequestInfo* cert_info) override;
virtual void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) OVERRIDE;
+ HttpStreamBase* stream) override;
private:
friend class HttpNetworkTransactionSSLTest;
diff --git a/net/http/http_network_transaction_ssl_unittest.cc b/net/http/http_network_transaction_ssl_unittest.cc
index ab7eadf..7b95f79 100644
--- a/net/http/http_network_transaction_ssl_unittest.cc
+++ b/net/http/http_network_transaction_ssl_unittest.cc
@@ -31,7 +31,7 @@
ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1;
}
- virtual void GetSSLConfig(SSLConfig* config) OVERRIDE {
+ virtual void GetSSLConfig(SSLConfig* config) override {
*config = ssl_config_;
}
@@ -48,7 +48,7 @@
ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1_1;
}
- virtual void GetSSLConfig(SSLConfig* config) OVERRIDE {
+ virtual void GetSSLConfig(SSLConfig* config) override {
*config = ssl_config_;
}
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index ce61d6e..7531c91 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -22,7 +22,9 @@
#include "base/test/test_file_util.h"
#include "net/base/auth.h"
#include "net/base/capturing_net_log.h"
+#include "net/base/chunked_upload_data_stream.h"
#include "net/base/completion_callback.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/load_timing_info.h"
#include "net/base/load_timing_info_test_util.h"
#include "net/base/net_log.h"
@@ -31,7 +33,6 @@
#include "net/base/test_completion_callback.h"
#include "net/base/test_data_directory.h"
#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_data_stream.h"
#include "net/base/upload_file_element_reader.h"
#include "net/cert/mock_cert_verifier.h"
#include "net/dns/host_cache.h"
@@ -1111,7 +1112,7 @@
TEST_P(HttpNetworkTransactionTest, Ignores100) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -5016,7 +5017,7 @@
TEST_P(HttpNetworkTransactionTest, ResendRequestOnWriteBodyError) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request[2];
// Transaction 1: a GET request that succeeds. The socket is recycled
@@ -8102,7 +8103,7 @@
0,
kuint64max,
base::Time()));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -8159,7 +8160,7 @@
0,
kuint64max,
base::Time()));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -8198,15 +8199,15 @@
const CompletionCallback& callback() const { return callback_; }
// UploadElementReader overrides:
- virtual int Init(const CompletionCallback& callback) OVERRIDE {
+ virtual int Init(const CompletionCallback& callback) override {
callback_ = callback;
return ERR_IO_PENDING;
}
- virtual uint64 GetContentLength() const OVERRIDE { return 0; }
- virtual uint64 BytesRemaining() const OVERRIDE { return 0; }
+ virtual uint64 GetContentLength() const override { return 0; }
+ virtual uint64 BytesRemaining() const override { return 0; }
virtual int Read(IOBuffer* buf,
int buf_length,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
@@ -8217,7 +8218,7 @@
FakeUploadElementReader* fake_reader = new FakeUploadElementReader;
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(fake_reader);
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -9105,7 +9106,7 @@
ProxyInfo* results,
const CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
ProxyServer proxy_server(ProxyServer::SCHEME_HTTP,
HostPortPair("myproxy", 80));
results->UseProxyServer(proxy_server);
@@ -9113,21 +9114,21 @@
return OK;
}
- virtual void CancelRequest(RequestHandle request) OVERRIDE {
+ virtual void CancelRequest(RequestHandle request) override {
NOTREACHED();
}
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE {
+ virtual LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() OVERRIDE {
+ virtual void CancelSetPacScript() override {
NOTREACHED();
}
virtual int SetPacScript(const scoped_refptr<ProxyResolverScriptData>&,
- const CompletionCallback& /*callback*/) OVERRIDE {
+ const CompletionCallback& /*callback*/) override {
return OK;
}
@@ -10069,7 +10070,7 @@
virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
const HttpRequestInfo* request,
const CompletionCallback& callback,
- std::string* auth_token) OVERRIDE {
+ std::string* auth_token) override {
*url_ = request->url;
return HttpAuthHandlerMock::GenerateAuthTokenImpl(
credentials, request, callback, auth_token);
@@ -11166,21 +11167,21 @@
AddressList* addresses,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
return host_resolver_.Resolve(
info, priority, addresses, callback, out_req, net_log);
}
virtual int ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
int rv = host_resolver_.ResolveFromCache(info, addresses, net_log);
if (rv == OK && info.host_port_pair().Equals(host_port_))
host_resolver_.GetHostCache()->clear();
return rv;
}
- virtual void CancelRequest(RequestHandle req) OVERRIDE {
+ virtual void CancelRequest(RequestHandle req) override {
host_resolver_.CancelRequest(req);
}
@@ -12212,83 +12213,83 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
virtual int SendRequest(const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE {
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
virtual int ReadResponseBody(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual void Close(bool not_reusable) OVERRIDE {}
+ virtual void Close(bool not_reusable) override {}
- virtual bool IsResponseBodyComplete() const OVERRIDE {
+ virtual bool IsResponseBodyComplete() const override {
ADD_FAILURE();
return false;
}
- virtual bool CanFindEndOfResponse() const OVERRIDE {
+ virtual bool CanFindEndOfResponse() const override {
return false;
}
- virtual bool IsConnectionReused() const OVERRIDE {
+ virtual bool IsConnectionReused() const override {
ADD_FAILURE();
return false;
}
- virtual void SetConnectionReused() OVERRIDE {
+ virtual void SetConnectionReused() override {
ADD_FAILURE();
}
- virtual bool IsConnectionReusable() const OVERRIDE {
+ virtual bool IsConnectionReusable() const override {
ADD_FAILURE();
return false;
}
- virtual int64 GetTotalReceivedBytes() const OVERRIDE {
+ virtual int64 GetTotalReceivedBytes() const override {
ADD_FAILURE();
return 0;
}
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE {
+ LoadTimingInfo* load_timing_info) const override {
ADD_FAILURE();
return false;
}
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override {
ADD_FAILURE();
}
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE {
+ SSLCertRequestInfo* cert_request_info) override {
ADD_FAILURE();
}
- virtual bool IsSpdyHttpStream() const OVERRIDE {
+ virtual bool IsSpdyHttpStream() const override {
ADD_FAILURE();
return false;
}
- virtual void Drain(HttpNetworkSession* session) OVERRIDE {
+ virtual void Drain(HttpNetworkSession* session) override {
ADD_FAILURE();
}
- virtual void SetPriority(RequestPriority priority) OVERRIDE {
+ virtual void SetPriority(RequestPriority priority) override {
priority_ = priority;
}
@@ -12337,29 +12338,29 @@
}
virtual int RestartTunnelWithProxyAuth(
- const AuthCredentials& credentials) OVERRIDE {
+ const AuthCredentials& credentials) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual LoadState GetLoadState() const OVERRIDE {
+ virtual LoadState GetLoadState() const override {
ADD_FAILURE();
return LoadState();
}
- virtual void SetPriority(RequestPriority priority) OVERRIDE {
+ virtual void SetPriority(RequestPriority priority) override {
priority_ = priority;
}
- virtual bool was_npn_negotiated() const OVERRIDE {
+ virtual bool was_npn_negotiated() const override {
return false;
}
- virtual NextProto protocol_negotiated() const OVERRIDE {
+ virtual NextProto protocol_negotiated() const override {
return kProtoUnknown;
}
- virtual bool using_spdy() const OVERRIDE {
+ virtual bool using_spdy() const override {
return false;
}
@@ -12389,7 +12390,7 @@
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HttpStreamRequest::Delegate* delegate,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
FakeStreamRequest* fake_request = new FakeStreamRequest(priority, delegate);
last_stream_request_ = fake_request->AsWeakPtr();
return fake_request;
@@ -12402,7 +12403,7 @@
const SSLConfig& proxy_ssl_config,
HttpStreamRequest::Delegate* delegate,
WebSocketHandshakeStreamBase::CreateHelper* create_helper,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
FakeStreamRequest* fake_request =
new FakeStreamRequest(priority, delegate, create_helper);
last_stream_request_ = fake_request->AsWeakPtr();
@@ -12413,11 +12414,11 @@
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config) OVERRIDE {
+ const SSLConfig& proxy_ssl_config) override {
ADD_FAILURE();
}
- virtual const HostMappingRules* GetHostMappingRules() const OVERRIDE {
+ virtual const HostMappingRules* GetHostMappingRules() const override {
ADD_FAILURE();
return NULL;
}
@@ -12435,14 +12436,14 @@
public:
virtual WebSocketHandshakeStreamBase* CreateBasicStream(
scoped_ptr<ClientSocketHandle> connection,
- bool using_proxy) OVERRIDE {
+ bool using_proxy) override {
NOTREACHED();
return NULL;
}
virtual WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<SpdySession>& session,
- bool use_relative_url) OVERRIDE {
+ bool use_relative_url) override {
NOTREACHED();
return NULL;
};
@@ -12731,7 +12732,7 @@
TEST_P(HttpNetworkTransactionTest, PostReadsErrorResponseAfterReset) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -12838,7 +12839,7 @@
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request2;
request2.method = "POST";
@@ -12870,7 +12871,7 @@
PostReadsErrorResponseAfterResetPartialBodySent) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -12925,7 +12926,7 @@
TEST_P(HttpNetworkTransactionTest, ChunkedPostReadsErrorResponseAfterReset) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(UploadDataStream::CHUNKED, 0);
+ ChunkedUploadDataStream upload_data_stream(0);
HttpRequestInfo request;
request.method = "POST";
@@ -12964,7 +12965,7 @@
// the test more future proof.
base::RunLoop().RunUntilIdle();
- upload_data_stream.AppendChunk("last chunk", 10, true);
+ upload_data_stream.AppendData("last chunk", 10, true);
rv = callback.WaitForResult();
EXPECT_EQ(OK, rv);
@@ -12984,7 +12985,7 @@
TEST_P(HttpNetworkTransactionTest, PostReadsErrorResponseAfterResetAnd100) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -13037,7 +13038,7 @@
TEST_P(HttpNetworkTransactionTest, PostIgnoresNonErrorResponseAfterReset) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -13082,7 +13083,7 @@
PostIgnoresNonErrorResponseAfterResetAnd100) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -13128,7 +13129,7 @@
TEST_P(HttpNetworkTransactionTest, PostIgnoresHttp09ResponseAfterReset) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -13171,7 +13172,7 @@
TEST_P(HttpNetworkTransactionTest, PostIgnoresPartial400HeadersAfterReset) {
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(new UploadBytesElementReader("foo", 3));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h
index 6761621..87eeda4 100644
--- a/net/http/http_proxy_client_socket.h
+++ b/net/http/http_proxy_client_socket.h
@@ -55,39 +55,39 @@
virtual ~HttpProxyClientSocket();
// ProxyClientSocket implementation.
- virtual const HttpResponseInfo* GetConnectResponseInfo() const OVERRIDE;
- virtual HttpStream* CreateConnectResponseStream() OVERRIDE;
- virtual int RestartWithAuth(const CompletionCallback& callback) OVERRIDE;
+ virtual const HttpResponseInfo* GetConnectResponseInfo() const override;
+ virtual HttpStream* CreateConnectResponseStream() override;
+ virtual int RestartWithAuth(const CompletionCallback& callback) override;
virtual const scoped_refptr<HttpAuthController>& GetAuthController() const
- OVERRIDE;
- virtual bool IsUsingSpdy() const OVERRIDE;
- virtual NextProto GetProtocolNegotiated() const OVERRIDE;
+ override;
+ virtual bool IsUsingSpdy() const override;
+ virtual NextProto GetProtocolNegotiated() const override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
private:
enum State {
diff --git a/net/http/http_proxy_client_socket_pool.h b/net/http/http_proxy_client_socket_pool.h
index 7ce0f37..9dac090 100644
--- a/net/http/http_proxy_client_socket_pool.h
+++ b/net/http/http_proxy_client_socket_pool.h
@@ -114,9 +114,9 @@
virtual ~HttpProxyConnectJob();
// ConnectJob methods.
- virtual LoadState GetLoadState() const OVERRIDE;
+ virtual LoadState GetLoadState() const override;
- virtual void GetAdditionalErrorState(ClientSocketHandle* handle) OVERRIDE;
+ virtual void GetAdditionalErrorState(ClientSocketHandle* handle) override;
private:
enum State {
@@ -157,7 +157,7 @@
// that the tunnel needs authentication credentials, the socket will be
// returned in this case, and must be release back to the pool; or
// a standard net error code will be returned.
- virtual int ConnectInternal() OVERRIDE;
+ virtual int ConnectInternal() override;
scoped_refptr<HttpProxySocketParams> params_;
TransportClientSocketPool* const transport_pool_;
@@ -205,51 +205,51 @@
RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void RequestSockets(const std::string& group_name,
const void* params,
int num_sockets,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE;
+ ClientSocketHandle* handle) override;
virtual void ReleaseSocket(const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE;
+ int id) override;
- virtual void FlushWithError(int error) OVERRIDE;
+ virtual void FlushWithError(int error) override;
- virtual void CloseIdleSockets() OVERRIDE;
+ virtual void CloseIdleSockets() override;
- virtual int IdleSocketCount() const OVERRIDE;
+ virtual int IdleSocketCount() const override;
virtual int IdleSocketCountInGroup(
- const std::string& group_name) const OVERRIDE;
+ const std::string& group_name) const override;
virtual LoadState GetLoadState(
const std::string& group_name,
- const ClientSocketHandle* handle) const OVERRIDE;
+ const ClientSocketHandle* handle) const override;
virtual base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
- bool include_nested_pools) const OVERRIDE;
+ bool include_nested_pools) const override;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
+ virtual base::TimeDelta ConnectionTimeout() const override;
- virtual ClientSocketPoolHistograms* histograms() const OVERRIDE;
+ virtual ClientSocketPoolHistograms* histograms() const override;
// LowerLayeredPool implementation.
- virtual bool IsStalled() const OVERRIDE;
+ virtual bool IsStalled() const override;
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
+ virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
- virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
+ virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
// HigherLayeredPool implementation.
- virtual bool CloseOneIdleConnection() OVERRIDE;
+ virtual bool CloseOneIdleConnection() override;
private:
typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase;
@@ -267,9 +267,9 @@
virtual scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
- ConnectJob::Delegate* delegate) const OVERRIDE;
+ ConnectJob::Delegate* delegate) const override;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
+ virtual base::TimeDelta ConnectionTimeout() const override;
private:
TransportClientSocketPool* const transport_pool_;
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc
index c6433af..98b7322 100644
--- a/net/http/http_proxy_client_socket_pool_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_unittest.cc
@@ -66,7 +66,7 @@
on_tunnel_headers_received_called_(false) {
}
- virtual ~TestProxyDelegate() OVERRIDE {
+ virtual ~TestProxyDelegate() override {
}
bool on_before_tunnel_request_called() const {
@@ -92,21 +92,21 @@
virtual void OnResolveProxy(const GURL& url,
int load_flags,
const ProxyService& proxy_service,
- ProxyInfo* result) OVERRIDE {
+ ProxyInfo* result) override {
}
virtual void OnFallback(const ProxyServer& bad_proxy,
- int net_error) OVERRIDE {
+ int net_error) override {
}
virtual void OnBeforeSendHeaders(URLRequest* request,
const ProxyInfo& proxy_info,
- HttpRequestHeaders* headers) OVERRIDE {
+ HttpRequestHeaders* headers) override {
}
virtual void OnBeforeTunnelRequest(
const net::HostPortPair& proxy_server,
- net::HttpRequestHeaders* extra_headers) OVERRIDE {
+ net::HttpRequestHeaders* extra_headers) override {
on_before_tunnel_request_called_ = true;
if (extra_headers) {
extra_headers->SetHeader("Foo", proxy_server.ToString());
@@ -116,7 +116,7 @@
virtual void OnTunnelHeadersReceived(
const net::HostPortPair& origin,
const net::HostPortPair& proxy_server,
- const net::HttpResponseHeaders& response_headers) OVERRIDE {
+ const net::HttpResponseHeaders& response_headers) override {
on_tunnel_headers_received_called_ = true;
on_tunnel_headers_received_origin_ = origin;
on_tunnel_headers_received_proxy_server_ = proxy_server;
diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc
index 5aa0bff..5a8713c 100644
--- a/net/http/http_response_body_drainer_unittest.cc
+++ b/net/http/http_response_body_drainer_unittest.cc
@@ -80,53 +80,53 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_UNEXPECTED;
}
virtual int SendRequest(const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_UNEXPECTED;
}
- virtual UploadProgress GetUploadProgress() const OVERRIDE {
+ virtual UploadProgress GetUploadProgress() const override {
return UploadProgress();
}
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE {
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
return ERR_UNEXPECTED;
}
- virtual bool CanFindEndOfResponse() const OVERRIDE { return true; }
- virtual bool IsConnectionReused() const OVERRIDE { return false; }
- virtual void SetConnectionReused() OVERRIDE {}
- virtual bool IsConnectionReusable() const OVERRIDE { return false; }
- virtual int64 GetTotalReceivedBytes() const OVERRIDE { return 0; }
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {}
+ virtual bool CanFindEndOfResponse() const override { return true; }
+ virtual bool IsConnectionReused() const override { return false; }
+ virtual void SetConnectionReused() override {}
+ virtual bool IsConnectionReusable() const override { return false; }
+ virtual int64 GetTotalReceivedBytes() const override { return 0; }
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override {}
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE {}
+ SSLCertRequestInfo* cert_request_info) override {}
// Mocked API
virtual int ReadResponseBody(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Close(bool not_reusable) OVERRIDE {
+ const CompletionCallback& callback) override;
+ virtual void Close(bool not_reusable) override {
CHECK(!closed_);
closed_ = true;
result_waiter_->set_result(not_reusable);
}
- virtual HttpStream* RenewStreamForAuth() OVERRIDE {
+ virtual HttpStream* RenewStreamForAuth() override {
return NULL;
}
- virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; }
+ virtual bool IsResponseBodyComplete() const override { return is_complete_; }
- virtual bool IsSpdyHttpStream() const OVERRIDE { return false; }
+ virtual bool IsSpdyHttpStream() const override { return false; }
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE { return false; }
+ LoadTimingInfo* load_timing_info) const override { return false; }
- virtual void Drain(HttpNetworkSession*) OVERRIDE {}
+ virtual void Drain(HttpNetworkSession*) override {}
- virtual void SetPriority(RequestPriority priority) OVERRIDE {}
+ virtual void SetPriority(RequestPriority priority) override {}
// Methods to tweak/observer mock behavior:
void set_stall_reads_forever() { stall_reads_forever_ = true; }
diff --git a/net/http/http_server_properties_impl.h b/net/http/http_server_properties_impl.h
index 03bb75f..b68db36 100644
--- a/net/http/http_server_properties_impl.h
+++ b/net/http/http_server_properties_impl.h
@@ -69,95 +69,95 @@
// -----------------------------
// Gets a weak pointer for this object.
- virtual base::WeakPtr<HttpServerProperties> GetWeakPtr() OVERRIDE;
+ virtual base::WeakPtr<HttpServerProperties> GetWeakPtr() override;
// Deletes all data.
- virtual void Clear() OVERRIDE;
+ virtual void Clear() override;
// Returns true if |server| supports SPDY.
- virtual bool SupportsSpdy(const HostPortPair& server) OVERRIDE;
+ virtual bool SupportsSpdy(const HostPortPair& server) override;
// Add |server| into the persistent store.
virtual void SetSupportsSpdy(const HostPortPair& server,
- bool support_spdy) OVERRIDE;
+ bool support_spdy) override;
// Returns true if |server| has an Alternate-Protocol header.
- virtual bool HasAlternateProtocol(const HostPortPair& server) OVERRIDE;
+ virtual bool HasAlternateProtocol(const HostPortPair& server) override;
// Returns the Alternate-Protocol and port for |server|.
// HasAlternateProtocol(server) must be true.
virtual AlternateProtocolInfo GetAlternateProtocol(
- const HostPortPair& server) OVERRIDE;
+ const HostPortPair& server) override;
// Sets the Alternate-Protocol for |server|.
virtual void SetAlternateProtocol(
const HostPortPair& server,
uint16 alternate_port,
AlternateProtocol alternate_protocol,
- double probability) OVERRIDE;
+ double probability) override;
// Sets the Alternate-Protocol for |server| to be BROKEN.
- virtual void SetBrokenAlternateProtocol(const HostPortPair& server) OVERRIDE;
+ virtual void SetBrokenAlternateProtocol(const HostPortPair& server) override;
// Returns true if Alternate-Protocol for |server| was recently BROKEN.
virtual bool WasAlternateProtocolRecentlyBroken(
- const HostPortPair& server) OVERRIDE;
+ const HostPortPair& server) override;
// Confirms that Alternate-Protocol for |server| is working.
- virtual void ConfirmAlternateProtocol(const HostPortPair& server) OVERRIDE;
+ virtual void ConfirmAlternateProtocol(const HostPortPair& server) override;
// Clears the Alternate-Protocol for |server|.
- virtual void ClearAlternateProtocol(const HostPortPair& server) OVERRIDE;
+ virtual void ClearAlternateProtocol(const HostPortPair& server) override;
// Returns all Alternate-Protocol mappings.
- virtual const AlternateProtocolMap& alternate_protocol_map() const OVERRIDE;
+ virtual const AlternateProtocolMap& alternate_protocol_map() const override;
virtual void SetAlternateProtocolExperiment(
- AlternateProtocolExperiment experiment) OVERRIDE;
+ AlternateProtocolExperiment experiment) override;
virtual void SetAlternateProtocolProbabilityThreshold(
- double threshold) OVERRIDE;
+ double threshold) override;
virtual AlternateProtocolExperiment GetAlternateProtocolExperiment()
- const OVERRIDE;
+ const override;
// Gets a reference to the SettingsMap stored for a host.
// If no settings are stored, returns an empty SettingsMap.
virtual const SettingsMap& GetSpdySettings(
- const HostPortPair& host_port_pair) OVERRIDE;
+ const HostPortPair& host_port_pair) override;
// Saves an individual SPDY setting for a host. Returns true if SPDY setting
// is to be persisted.
virtual bool SetSpdySetting(const HostPortPair& host_port_pair,
SpdySettingsIds id,
SpdySettingsFlags flags,
- uint32 value) OVERRIDE;
+ uint32 value) override;
// Clears all entries in |spdy_settings_map_| for a host.
- virtual void ClearSpdySettings(const HostPortPair& host_port_pair) OVERRIDE;
+ virtual void ClearSpdySettings(const HostPortPair& host_port_pair) override;
// Clears all entries in |spdy_settings_map_|.
- virtual void ClearAllSpdySettings() OVERRIDE;
+ virtual void ClearAllSpdySettings() override;
// Returns all persistent SPDY settings.
- virtual const SpdySettingsMap& spdy_settings_map() const OVERRIDE;
+ virtual const SpdySettingsMap& spdy_settings_map() const override;
// Methods for SupportsQuic.
virtual SupportsQuic GetSupportsQuic(
- const HostPortPair& host_port_pair) const OVERRIDE;
+ const HostPortPair& host_port_pair) const override;
virtual void SetSupportsQuic(const HostPortPair& host_port_pair,
bool used_quic,
- const std::string& address) OVERRIDE;
+ const std::string& address) override;
- virtual const SupportsQuicMap& supports_quic_map() const OVERRIDE;
+ virtual const SupportsQuicMap& supports_quic_map() const override;
// Methods for NetworkStats.
virtual void SetServerNetworkStats(const HostPortPair& host_port_pair,
- NetworkStats stats) OVERRIDE;
+ NetworkStats stats) override;
virtual const NetworkStats* GetServerNetworkStats(
- const HostPortPair& host_port_pair) const OVERRIDE;
+ const HostPortPair& host_port_pair) const override;
private:
// |spdy_servers_map_| has flattened representation of servers (host, port)
diff --git a/net/http/http_server_properties_manager.h b/net/http/http_server_properties_manager.h
index 6c2a8f8..bcfe320 100644
--- a/net/http/http_server_properties_manager.h
+++ b/net/http/http_server_properties_manager.h
@@ -78,96 +78,96 @@
// ----------------------------------
// Gets a weak pointer for this object.
- virtual base::WeakPtr<HttpServerProperties> GetWeakPtr() OVERRIDE;
+ virtual base::WeakPtr<HttpServerProperties> GetWeakPtr() override;
// Deletes all data. Works asynchronously.
- virtual void Clear() OVERRIDE;
+ virtual void Clear() override;
// Returns true if |server| supports SPDY. Should only be called from IO
// thread.
- virtual bool SupportsSpdy(const HostPortPair& server) OVERRIDE;
+ virtual bool SupportsSpdy(const HostPortPair& server) override;
// Add |server| as the SPDY server which supports SPDY protocol into the
// persisitent store. Should only be called from IO thread.
virtual void SetSupportsSpdy(const HostPortPair& server,
- bool support_spdy) OVERRIDE;
+ bool support_spdy) override;
// Returns true if |server| has an Alternate-Protocol header.
- virtual bool HasAlternateProtocol(const HostPortPair& server) OVERRIDE;
+ virtual bool HasAlternateProtocol(const HostPortPair& server) override;
// Returns the Alternate-Protocol and port for |server|.
// HasAlternateProtocol(server) must be true.
virtual AlternateProtocolInfo GetAlternateProtocol(
- const HostPortPair& server) OVERRIDE;
+ const HostPortPair& server) override;
// Sets the Alternate-Protocol for |server|.
virtual void SetAlternateProtocol(
const HostPortPair& server,
uint16 alternate_port,
AlternateProtocol alternate_protocol,
- double alternate_probability) OVERRIDE;
+ double alternate_probability) override;
// Sets the Alternate-Protocol for |server| to be BROKEN.
- virtual void SetBrokenAlternateProtocol(const HostPortPair& server) OVERRIDE;
+ virtual void SetBrokenAlternateProtocol(const HostPortPair& server) override;
// Returns true if Alternate-Protocol for |server| was recently BROKEN.
virtual bool WasAlternateProtocolRecentlyBroken(
- const HostPortPair& server) OVERRIDE;
+ const HostPortPair& server) override;
// Confirms that Alternate-Protocol for |server| is working.
- virtual void ConfirmAlternateProtocol(const HostPortPair& server) OVERRIDE;
+ virtual void ConfirmAlternateProtocol(const HostPortPair& server) override;
// Clears the Alternate-Protocol for |server|.
- virtual void ClearAlternateProtocol(const HostPortPair& server) OVERRIDE;
+ virtual void ClearAlternateProtocol(const HostPortPair& server) override;
// Returns all Alternate-Protocol mappings.
- virtual const AlternateProtocolMap& alternate_protocol_map() const OVERRIDE;
+ virtual const AlternateProtocolMap& alternate_protocol_map() const override;
virtual void SetAlternateProtocolExperiment(
- AlternateProtocolExperiment experiment) OVERRIDE;
+ AlternateProtocolExperiment experiment) override;
virtual void SetAlternateProtocolProbabilityThreshold(
- double threshold) OVERRIDE;
+ double threshold) override;
virtual AlternateProtocolExperiment GetAlternateProtocolExperiment()
- const OVERRIDE;
+ const override;
// Gets a reference to the SettingsMap stored for a host.
// If no settings are stored, returns an empty SettingsMap.
virtual const SettingsMap& GetSpdySettings(
- const HostPortPair& host_port_pair) OVERRIDE;
+ const HostPortPair& host_port_pair) override;
// Saves an individual SPDY setting for a host. Returns true if SPDY setting
// is to be persisted.
virtual bool SetSpdySetting(const HostPortPair& host_port_pair,
SpdySettingsIds id,
SpdySettingsFlags flags,
- uint32 value) OVERRIDE;
+ uint32 value) override;
// Clears all SPDY settings for a host.
- virtual void ClearSpdySettings(const HostPortPair& host_port_pair) OVERRIDE;
+ virtual void ClearSpdySettings(const HostPortPair& host_port_pair) override;
// Clears all SPDY settings for all hosts.
- virtual void ClearAllSpdySettings() OVERRIDE;
+ virtual void ClearAllSpdySettings() override;
// Returns all SPDY persistent settings.
- virtual const SpdySettingsMap& spdy_settings_map() const OVERRIDE;
+ virtual const SpdySettingsMap& spdy_settings_map() const override;
// Methods for SupportsQuic.
virtual SupportsQuic GetSupportsQuic(
- const HostPortPair& host_port_pair) const OVERRIDE;
+ const HostPortPair& host_port_pair) const override;
virtual void SetSupportsQuic(const HostPortPair& host_port_pair,
bool used_quic,
- const std::string& address) OVERRIDE;
+ const std::string& address) override;
- virtual const SupportsQuicMap& supports_quic_map() const OVERRIDE;
+ virtual const SupportsQuicMap& supports_quic_map() const override;
virtual void SetServerNetworkStats(const HostPortPair& host_port_pair,
- NetworkStats stats) OVERRIDE;
+ NetworkStats stats) override;
virtual const NetworkStats* GetServerNetworkStats(
- const HostPortPair& host_port_pair) const OVERRIDE;
+ const HostPortPair& host_port_pair) const override;
protected:
// --------------------
diff --git a/net/http/http_server_properties_manager_unittest.cc b/net/http/http_server_properties_manager_unittest.cc
index 012a46d..dbbfc2d 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -44,7 +44,7 @@
// Post tasks without a delay during tests.
virtual void StartPrefsUpdateTimerOnNetworkThread(
- base::TimeDelta delay) OVERRIDE {
+ base::TimeDelta delay) override {
HttpServerPropertiesManager::StartPrefsUpdateTimerOnNetworkThread(
base::TimeDelta());
}
@@ -55,7 +55,7 @@
// Post tasks without a delay during tests.
virtual void StartCacheUpdateTimerOnPrefThread(
- base::TimeDelta delay) OVERRIDE {
+ base::TimeDelta delay) override {
HttpServerPropertiesManager::StartCacheUpdateTimerOnPrefThread(
base::TimeDelta());
}
@@ -88,7 +88,7 @@
protected:
HttpServerPropertiesManagerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
pref_service_.registry()->RegisterDictionaryPref(kTestHttpServerProperties);
http_server_props_manager_.reset(
new StrictMock<TestingHttpServerPropertiesManager>(
@@ -99,7 +99,7 @@
base::RunLoop().RunUntilIdle();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (http_server_props_manager_.get())
http_server_props_manager_->ShutdownOnPrefThread();
base::RunLoop().RunUntilIdle();
diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h
index 7df0a67..91a59c2 100644
--- a/net/http/http_stream_factory_impl.h
+++ b/net/http/http_stream_factory_impl.h
@@ -38,7 +38,7 @@
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HttpStreamRequest::Delegate* delegate,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual HttpStreamRequest* RequestWebSocketHandshakeStream(
const HttpRequestInfo& info,
@@ -47,14 +47,14 @@
const SSLConfig& proxy_ssl_config,
HttpStreamRequest::Delegate* delegate,
WebSocketHandshakeStreamBase::CreateHelper* create_helper,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void PreconnectStreams(int num_streams,
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config) OVERRIDE;
- virtual const HostMappingRules* GetHostMappingRules() const OVERRIDE;
+ const SSLConfig& proxy_ssl_config) override;
+ virtual const HostMappingRules* GetHostMappingRules() const override;
size_t num_orphaned_jobs() const { return orphaned_job_set_.size(); }
diff --git a/net/http/http_stream_factory_impl_request.h b/net/http/http_stream_factory_impl_request.h
index eafc138..3ab7d95 100644
--- a/net/http/http_stream_factory_impl_request.h
+++ b/net/http/http_stream_factory_impl_request.h
@@ -99,12 +99,12 @@
// HttpStreamRequest methods.
virtual int RestartTunnelWithProxyAuth(
- const AuthCredentials& credentials) OVERRIDE;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
- virtual LoadState GetLoadState() const OVERRIDE;
- virtual bool was_npn_negotiated() const OVERRIDE;
- virtual NextProto protocol_negotiated() const OVERRIDE;
- virtual bool using_spdy() const OVERRIDE;
+ const AuthCredentials& credentials) override;
+ virtual void SetPriority(RequestPriority priority) override;
+ virtual LoadState GetLoadState() const override;
+ virtual bool was_npn_negotiated() const override;
+ virtual NextProto protocol_negotiated() const override;
+ virtual bool using_spdy() const override;
private:
// Used to orphan all jobs in |jobs_| other than |job| which becomes "bound"
diff --git a/net/http/http_stream_factory_impl_request_unittest.cc b/net/http/http_stream_factory_impl_request_unittest.cc
index eea2a1b..422abd0 100644
--- a/net/http/http_stream_factory_impl_request_unittest.cc
+++ b/net/http/http_stream_factory_impl_request_unittest.cc
@@ -34,28 +34,28 @@
virtual void OnStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) OVERRIDE {}
+ HttpStreamBase* stream) override {}
virtual void OnWebSocketHandshakeStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- WebSocketHandshakeStreamBase* stream) OVERRIDE {}
+ WebSocketHandshakeStreamBase* stream) override {}
virtual void OnStreamFailed(
int status,
- const SSLConfig& used_ssl_config) OVERRIDE {}
+ const SSLConfig& used_ssl_config) override {}
virtual void OnCertificateError(
int status,
const SSLConfig& used_ssl_config,
- const SSLInfo& ssl_info) OVERRIDE {}
+ const SSLInfo& ssl_info) override {}
virtual void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpAuthController* auth_controller) OVERRIDE {}
+ HttpAuthController* auth_controller) override {}
virtual void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
- SSLCertRequestInfo* cert_info) OVERRIDE {}
+ SSLCertRequestInfo* cert_info) override {}
virtual void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) OVERRIDE {}
+ HttpStreamBase* stream) override {}
};
} // namespace
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc
index c56abfd..a93e9b0 100644
--- a/net/http/http_stream_factory_impl_unittest.cc
+++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -62,41 +62,41 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
virtual int SendRequest(const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE {
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
virtual int ReadResponseBody(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual void Close(bool not_reusable) OVERRIDE {}
- virtual bool IsResponseBodyComplete() const OVERRIDE { return false; }
- virtual bool CanFindEndOfResponse() const OVERRIDE { return false; }
- virtual bool IsConnectionReused() const OVERRIDE { return false; }
- virtual void SetConnectionReused() OVERRIDE {}
- virtual bool IsConnectionReusable() const OVERRIDE { return false; }
- virtual int64 GetTotalReceivedBytes() const OVERRIDE { return 0; }
+ virtual void Close(bool not_reusable) override {}
+ virtual bool IsResponseBodyComplete() const override { return false; }
+ virtual bool CanFindEndOfResponse() const override { return false; }
+ virtual bool IsConnectionReused() const override { return false; }
+ virtual void SetConnectionReused() override {}
+ virtual bool IsConnectionReusable() const override { return false; }
+ virtual int64 GetTotalReceivedBytes() const override { return 0; }
virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const
- OVERRIDE {
+ override {
return false;
}
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {}
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override {}
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE {}
- virtual bool IsSpdyHttpStream() const OVERRIDE { return false; }
- virtual void Drain(HttpNetworkSession* session) OVERRIDE {}
- virtual void SetPriority(RequestPriority priority) OVERRIDE {}
+ SSLCertRequestInfo* cert_request_info) override {}
+ virtual bool IsSpdyHttpStream() const override { return false; }
+ virtual void Drain(HttpNetworkSession* session) override {}
+ virtual void SetPriority(RequestPriority priority) override {}
- virtual scoped_ptr<WebSocketStream> Upgrade() OVERRIDE {
+ virtual scoped_ptr<WebSocketStream> Upgrade() override {
return scoped_ptr<WebSocketStream>();
}
@@ -124,7 +124,7 @@
private:
// HttpStreamFactoryImpl methods.
- virtual void OnPreconnectsCompleteInternal() OVERRIDE {
+ virtual void OnPreconnectsCompleteInternal() override {
preconnect_done_ = true;
if (waiting_for_preconnect_)
base::MessageLoop::current()->Quit();
@@ -145,7 +145,7 @@
virtual void OnStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) OVERRIDE {
+ HttpStreamBase* stream) override {
stream_done_ = true;
if (waiting_for_stream_)
base::MessageLoop::current()->Quit();
@@ -157,7 +157,7 @@
virtual void OnWebSocketHandshakeStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- WebSocketHandshakeStreamBase* stream) OVERRIDE {
+ WebSocketHandshakeStreamBase* stream) override {
stream_done_ = true;
if (waiting_for_stream_)
base::MessageLoop::current()->Quit();
@@ -168,25 +168,25 @@
virtual void OnStreamFailed(
int status,
- const SSLConfig& used_ssl_config) OVERRIDE {}
+ const SSLConfig& used_ssl_config) override {}
virtual void OnCertificateError(
int status,
const SSLConfig& used_ssl_config,
- const SSLInfo& ssl_info) OVERRIDE {}
+ const SSLInfo& ssl_info) override {}
virtual void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpAuthController* auth_controller) OVERRIDE {}
+ HttpAuthController* auth_controller) override {}
virtual void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
- SSLCertRequestInfo* cert_info) OVERRIDE {}
+ SSLCertRequestInfo* cert_info) override {}
virtual void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) OVERRIDE {}
+ HttpStreamBase* stream) override {}
void WaitForStream() {
while (!stream_done_) {
@@ -264,13 +264,13 @@
virtual WebSocketHandshakeStreamBase* CreateBasicStream(
scoped_ptr<ClientSocketHandle> connection,
- bool using_proxy) OVERRIDE {
+ bool using_proxy) override {
return new WebSocketBasicHandshakeStream(connection.Pass());
}
virtual WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<SpdySession>& spdy_session,
- bool use_relative_url) OVERRIDE {
+ bool use_relative_url) override {
return new WebSocketSpdyHandshakeStream(spdy_session);
}
};
@@ -329,7 +329,7 @@
RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
@@ -337,38 +337,38 @@
virtual void RequestSockets(const std::string& group_name,
const void* socket_params,
int num_sockets,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
last_num_streams_ = num_sockets;
}
virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE {
+ ClientSocketHandle* handle) override {
ADD_FAILURE();
}
virtual void ReleaseSocket(const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE {
+ int id) override {
ADD_FAILURE();
}
- virtual void CloseIdleSockets() OVERRIDE {
+ virtual void CloseIdleSockets() override {
ADD_FAILURE();
}
- virtual int IdleSocketCount() const OVERRIDE {
+ virtual int IdleSocketCount() const override {
ADD_FAILURE();
return 0;
}
virtual int IdleSocketCountInGroup(
- const std::string& group_name) const OVERRIDE {
+ const std::string& group_name) const override {
ADD_FAILURE();
return 0;
}
virtual LoadState GetLoadState(
const std::string& group_name,
- const ClientSocketHandle* handle) const OVERRIDE {
+ const ClientSocketHandle* handle) const override {
ADD_FAILURE();
return LOAD_STATE_IDLE;
}
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE {
+ virtual base::TimeDelta ConnectionTimeout() const override {
return base::TimeDelta();
}
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 86b188b..4a60a6b 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/profiler/scoped_profile.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "net/base/io_buffer.h"
@@ -357,6 +358,11 @@
}
void HttpStreamParser::OnIOComplete(int result) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "418183 DidCompleteReadWrite => HttpStreamParser::OnIOComplete"));
+
result = DoLoop(result);
// The client callback can do anything, including destroying this class,
diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc
index 38279a4..ef83638 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -15,11 +15,12 @@
#include "base/run_loop.h"
#include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h"
+#include "net/base/chunked_upload_data_stream.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_data_stream.h"
#include "net/base/upload_file_element_reader.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_request_info.h"
@@ -106,7 +107,7 @@
TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_EmptyBody) {
ScopedVector<UploadElementReader> element_readers;
scoped_ptr<UploadDataStream> body(
- new UploadDataStream(element_readers.Pass(), 0));
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
ASSERT_EQ(OK, body->Init(CompletionCallback()));
// Shouldn't be merged if upload data is empty.
ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
@@ -115,10 +116,9 @@
TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_ChunkedBody) {
const std::string payload = "123";
- scoped_ptr<UploadDataStream> body(
- new UploadDataStream(UploadDataStream::CHUNKED, 0));
- body->AppendChunk(payload.data(), payload.size(), true);
- ASSERT_EQ(OK, body->Init(CompletionCallback()));
+ scoped_ptr<ChunkedUploadDataStream> body(new ChunkedUploadDataStream(0));
+ body->AppendData(payload.data(), payload.size(), true);
+ ASSERT_EQ(OK, body->Init(TestCompletionCallback().callback()));
// Shouldn't be merged if upload data carries chunked data.
ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
"some header", body.get()));
@@ -143,7 +143,7 @@
base::Time()));
scoped_ptr<UploadDataStream> body(
- new UploadDataStream(element_readers.Pass(), 0));
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
TestCompletionCallback callback;
ASSERT_EQ(ERR_IO_PENDING, body->Init(callback.callback()));
ASSERT_EQ(OK, callback.WaitForResult());
@@ -162,7 +162,7 @@
payload.data(), payload.size()));
scoped_ptr<UploadDataStream> body(
- new UploadDataStream(element_readers.Pass(), 0));
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
ASSERT_EQ(OK, body->Init(CompletionCallback()));
// Yes, should be merged if the in-memory body is small here.
ASSERT_TRUE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
@@ -176,7 +176,7 @@
payload.data(), payload.size()));
scoped_ptr<UploadDataStream> body(
- new UploadDataStream(element_readers.Pass(), 0));
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
ASSERT_EQ(OK, body->Init(CompletionCallback()));
// Shouldn't be merged if the in-memory body is large here.
ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
@@ -218,9 +218,9 @@
MockRead(SYNCHRONOUS, 0, 8), // EOF
};
- UploadDataStream upload_stream(UploadDataStream::CHUNKED, 0);
- upload_stream.AppendChunk(kChunk1, arraysize(kChunk1) - 1, false);
- ASSERT_EQ(OK, upload_stream.Init(CompletionCallback()));
+ ChunkedUploadDataStream upload_stream(0);
+ upload_stream.AppendData(kChunk1, arraysize(kChunk1) - 1, false);
+ ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback()));
DeterministicSocketData data(reads, arraysize(reads),
writes, arraysize(writes));
@@ -267,7 +267,7 @@
// Now append another chunk (while the first write is still pending), which
// should not confuse the state machine.
- upload_stream.AppendChunk(kChunk2, arraysize(kChunk2) - 1, false);
+ upload_stream.AppendData(kChunk2, arraysize(kChunk2) - 1, false);
ASSERT_FALSE(callback.have_result());
// Complete writing the first chunk, which should then enqueue the second
@@ -284,7 +284,7 @@
// Add the final chunk. This will enqueue another write, but it will not
// complete due to the async nature.
- upload_stream.AppendChunk(kChunk3, arraysize(kChunk3) - 1, true);
+ upload_stream.AppendData(kChunk3, arraysize(kChunk3) - 1, true);
ASSERT_FALSE(callback.have_result());
// Finalize writing the last chunk, which will enqueue the trailer.
diff --git a/net/http/http_transaction_test_util.h b/net/http/http_transaction_test_util.h
index b8663c6..e0f5bda 100644
--- a/net/http/http_transaction_test_util.h
+++ b/net/http/http_transaction_test_util.h
@@ -172,57 +172,57 @@
virtual int Start(const net::HttpRequestInfo* request,
const net::CompletionCallback& callback,
- const net::BoundNetLog& net_log) OVERRIDE;
+ const net::BoundNetLog& net_log) override;
virtual int RestartIgnoringLastError(
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int RestartWithCertificate(
net::X509Certificate* client_cert,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int RestartWithAuth(
const net::AuthCredentials& credentials,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
- virtual bool IsReadyToRestartForAuth() OVERRIDE;
+ virtual bool IsReadyToRestartForAuth() override;
virtual int Read(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
- virtual void StopCaching() OVERRIDE;
+ virtual void StopCaching() override;
virtual bool GetFullRequestHeaders(
- net::HttpRequestHeaders* headers) const OVERRIDE;
+ net::HttpRequestHeaders* headers) const override;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
+ virtual int64 GetTotalReceivedBytes() const override;
- virtual void DoneReading() OVERRIDE;
+ virtual void DoneReading() override;
- virtual const net::HttpResponseInfo* GetResponseInfo() const OVERRIDE;
+ virtual const net::HttpResponseInfo* GetResponseInfo() const override;
- virtual net::LoadState GetLoadState() const OVERRIDE;
+ virtual net::LoadState GetLoadState() const override;
- virtual net::UploadProgress GetUploadProgress() const OVERRIDE;
+ virtual net::UploadProgress GetUploadProgress() const override;
virtual void SetQuicServerInfo(
- net::QuicServerInfo* quic_server_info) OVERRIDE;
+ net::QuicServerInfo* quic_server_info) override;
virtual bool GetLoadTimingInfo(
- net::LoadTimingInfo* load_timing_info) const OVERRIDE;
+ net::LoadTimingInfo* load_timing_info) const override;
- virtual void SetPriority(net::RequestPriority priority) OVERRIDE;
+ virtual void SetPriority(net::RequestPriority priority) override;
virtual void SetWebSocketHandshakeStreamCreateHelper(
- CreateHelper* create_helper) OVERRIDE;
+ CreateHelper* create_helper) override;
virtual void SetBeforeNetworkStartCallback(
- const BeforeNetworkStartCallback& callback) OVERRIDE;
+ const BeforeNetworkStartCallback& callback) override;
virtual void SetBeforeProxyHeadersSentCallback(
- const BeforeProxyHeadersSentCallback& callback) OVERRIDE;
+ const BeforeProxyHeadersSentCallback& callback) override;
- virtual int ResumeNetworkStart() OVERRIDE;
+ virtual int ResumeNetworkStart() override;
CreateHelper* websocket_handshake_stream_create_helper() {
return websocket_handshake_stream_create_helper_;
@@ -292,9 +292,9 @@
// net::HttpTransactionFactory:
virtual int CreateTransaction(
net::RequestPriority priority,
- scoped_ptr<net::HttpTransaction>* trans) OVERRIDE;
- virtual net::HttpCache* GetCache() OVERRIDE;
- virtual net::HttpNetworkSession* GetSession() OVERRIDE;
+ scoped_ptr<net::HttpTransaction>* trans) override;
+ virtual net::HttpCache* GetCache() override;
+ virtual net::HttpNetworkSession* GetSession() override;
private:
int transaction_count_;
diff --git a/net/http/mock_allow_url_security_manager.h b/net/http/mock_allow_url_security_manager.h
index 8fbe2c5..3e19f9b 100644
--- a/net/http/mock_allow_url_security_manager.h
+++ b/net/http/mock_allow_url_security_manager.h
@@ -16,8 +16,8 @@
MockAllowURLSecurityManager();
virtual ~MockAllowURLSecurityManager();
- virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const OVERRIDE;
- virtual bool CanDelegate(const GURL& auth_origin) const OVERRIDE;
+ virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
+ virtual bool CanDelegate(const GURL& auth_origin) const override;
private:
DISALLOW_COPY_AND_ASSIGN(MockAllowURLSecurityManager);
diff --git a/net/http/mock_gssapi_library_posix.h b/net/http/mock_gssapi_library_posix.h
index faecdd4..cbd35e5 100644
--- a/net/http/mock_gssapi_library_posix.h
+++ b/net/http/mock_gssapi_library_posix.h
@@ -122,32 +122,32 @@
// Initializes the library, including any necessary dynamic libraries.
// This is done separately from construction (which happens at startup time)
// in order to delay work until the class is actually needed.
- virtual bool Init() OVERRIDE;
+ virtual bool Init() override;
// These methods match the ones in the GSSAPI library.
virtual OM_uint32 import_name(
OM_uint32* minor_status,
const gss_buffer_t input_name_buffer,
const gss_OID input_name_type,
- gss_name_t* output_name) OVERRIDE;
+ gss_name_t* output_name) override;
virtual OM_uint32 release_name(
OM_uint32* minor_status,
- gss_name_t* input_name) OVERRIDE;
+ gss_name_t* input_name) override;
virtual OM_uint32 release_buffer(
OM_uint32* minor_status,
- gss_buffer_t buffer) OVERRIDE;
+ gss_buffer_t buffer) override;
virtual OM_uint32 display_name(
OM_uint32* minor_status,
const gss_name_t input_name,
gss_buffer_t output_name_buffer,
- gss_OID* output_name_type) OVERRIDE;
+ gss_OID* output_name_type) override;
virtual OM_uint32 display_status(
OM_uint32* minor_status,
OM_uint32 status_value,
int status_type,
const gss_OID mech_type,
OM_uint32* message_contex,
- gss_buffer_t status_string) OVERRIDE;
+ gss_buffer_t status_string) override;
virtual OM_uint32 init_sec_context(
OM_uint32* minor_status,
const gss_cred_id_t initiator_cred_handle,
@@ -161,18 +161,18 @@
gss_OID* actual_mech_type,
gss_buffer_t output_token,
OM_uint32* ret_flags,
- OM_uint32* time_rec) OVERRIDE;
+ OM_uint32* time_rec) override;
virtual OM_uint32 wrap_size_limit(
OM_uint32* minor_status,
const gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req,
OM_uint32 req_output_size,
- OM_uint32* max_input_size) OVERRIDE;
+ OM_uint32* max_input_size) override;
virtual OM_uint32 delete_sec_context(
OM_uint32* minor_status,
gss_ctx_id_t* context_handle,
- gss_buffer_t output_token) OVERRIDE;
+ gss_buffer_t output_token) override;
virtual OM_uint32 inquire_context(
OM_uint32* minor_status,
const gss_ctx_id_t context_handle,
@@ -182,7 +182,7 @@
gss_OID* mech_type,
OM_uint32* ctx_flags,
int* locally_initiated,
- int* open) OVERRIDE;
+ int* open) override;
private:
FRIEND_TEST_ALL_PREFIXES(HttpAuthGSSAPIPOSIXTest, GSSAPICycle);
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index cbae9b8..325454e 100644
--- a/net/http/mock_http_cache.cc
+++ b/net/http/mock_http_cache.cc
@@ -460,7 +460,7 @@
class MockDiskCache::NotImplementedIterator : public Iterator {
public:
virtual int OpenNextEntry(disk_cache::Entry** next_entry,
- const net::CompletionCallback& callback) OVERRIDE {
+ const net::CompletionCallback& callback) override {
return net::ERR_NOT_IMPLEMENTED;
}
};
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h
index ab63b11..9b2caf5 100644
--- a/net/http/mock_http_cache.h
+++ b/net/http/mock_http_cache.h
@@ -25,29 +25,29 @@
bool is_doomed() const { return doomed_; }
- virtual void Doom() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual std::string GetKey() const OVERRIDE;
- virtual base::Time GetLastUsed() const OVERRIDE;
- virtual base::Time GetLastModified() const OVERRIDE;
- virtual int32 GetDataSize(int index) const OVERRIDE;
+ virtual void Doom() override;
+ virtual void Close() override;
+ virtual std::string GetKey() const override;
+ virtual base::Time GetLastUsed() const override;
+ virtual base::Time GetLastModified() const override;
+ virtual int32 GetDataSize(int index) const override;
virtual int ReadData(int index, int offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback,
- bool truncate) OVERRIDE;
+ bool truncate) override;
virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int WriteSparseData(
int64 offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int GetAvailableRange(
int64 offset, int len, int64* start,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual bool CouldBeSparse() const OVERRIDE;
- virtual void CancelSparseIO() OVERRIDE;
+ const net::CompletionCallback& callback) override;
+ virtual bool CouldBeSparse() const override;
+ virtual void CancelSparseIO() override;
virtual int ReadyForSparseIO(
- const net::CompletionCallback& completion_callback) OVERRIDE;
+ const net::CompletionCallback& completion_callback) override;
// Fail most subsequent requests.
void set_fail_requests() { fail_requests_ = true; }
@@ -98,26 +98,26 @@
MockDiskCache();
virtual ~MockDiskCache();
- virtual net::CacheType GetCacheType() const OVERRIDE;
- virtual int32 GetEntryCount() const OVERRIDE;
+ virtual net::CacheType GetCacheType() const override;
+ virtual int32 GetEntryCount() const override;
virtual int OpenEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int DoomEntry(const std::string& key,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual int DoomAllEntries(const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
+ virtual int DoomAllEntries(const net::CompletionCallback& callback) override;
virtual int DoomEntriesBetween(
base::Time initial_time,
base::Time end_time,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int DoomEntriesSince(
base::Time initial_time,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual scoped_ptr<Iterator> CreateIterator() OVERRIDE;
+ const net::CompletionCallback& callback) override;
+ virtual scoped_ptr<Iterator> CreateIterator() override;
virtual void GetStats(
- std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE;
- virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
+ std::vector<std::pair<std::string, std::string> >* stats) override;
+ virtual void OnExternalCacheHit(const std::string& key) override;
// Returns number of times a cache entry was successfully opened.
int open_count() const { return open_count_; }
@@ -158,7 +158,7 @@
public:
virtual int CreateBackend(net::NetLog* net_log,
scoped_ptr<disk_cache::Backend>* backend,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
};
class MockHttpCache {
@@ -211,14 +211,14 @@
// This version of the disk cache doesn't invoke CreateEntry callbacks.
class MockDiskCacheNoCB : public MockDiskCache {
virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
};
class MockBackendNoCbFactory : public net::HttpCache::BackendFactory {
public:
virtual int CreateBackend(net::NetLog* net_log,
scoped_ptr<disk_cache::Backend>* backend,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
};
// This backend factory allows us to control the backend instantiation.
@@ -229,7 +229,7 @@
virtual int CreateBackend(net::NetLog* net_log,
scoped_ptr<disk_cache::Backend>* backend,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
// Completes the backend creation. Any blocked call will be notified via the
// provided callback.
diff --git a/net/http/partial_data.cc b/net/http/partial_data.cc
index c7cde99..a453ba4 100644
--- a/net/http/partial_data.cc
+++ b/net/http/partial_data.cc
@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/profiler/scoped_profile.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -89,6 +90,11 @@
}
void PartialData::Core::OnIOComplete(int result) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422516 PartialData::Core::OnIOComplete"));
+
if (owner_)
owner_->GetAvailableRangeCompleted(result, start_);
delete this;
diff --git a/net/http/proxy_connect_redirect_http_stream.h b/net/http/proxy_connect_redirect_http_stream.h
index f848c64..ddaf9b7 100644
--- a/net/http/proxy_connect_redirect_http_stream.h
+++ b/net/http/proxy_connect_redirect_http_stream.h
@@ -28,44 +28,44 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int SendRequest(const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
virtual int ReadResponseBody(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// This function may be called.
- virtual void Close(bool not_reusable) OVERRIDE;
+ virtual void Close(bool not_reusable) override;
- virtual bool IsResponseBodyComplete() const OVERRIDE;
+ virtual bool IsResponseBodyComplete() const override;
// This function may be called.
- virtual bool CanFindEndOfResponse() const OVERRIDE;
+ virtual bool CanFindEndOfResponse() const override;
- virtual bool IsConnectionReused() const OVERRIDE;
- virtual void SetConnectionReused() OVERRIDE;
- virtual bool IsConnectionReusable() const OVERRIDE;
+ virtual bool IsConnectionReused() const override;
+ virtual void SetConnectionReused() override;
+ virtual bool IsConnectionReusable() const override;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
+ virtual int64 GetTotalReceivedBytes() const override;
// This function may be called.
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override;
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE;
- virtual bool IsSpdyHttpStream() const OVERRIDE;
- virtual void Drain(HttpNetworkSession* session) OVERRIDE;
+ SSLCertRequestInfo* cert_request_info) override;
+ virtual bool IsSpdyHttpStream() const override;
+ virtual void Drain(HttpNetworkSession* session) override;
// This function may be called.
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
+ virtual void SetPriority(RequestPriority priority) override;
- virtual UploadProgress GetUploadProgress() const OVERRIDE;
- virtual HttpStream* RenewStreamForAuth() OVERRIDE;
+ virtual UploadProgress GetUploadProgress() const override;
+ virtual HttpStream* RenewStreamForAuth() override;
private:
bool has_load_timing_info_;
diff --git a/net/http/transport_security_persister.h b/net/http/transport_security_persister.h
index 79a0d7a..5081c38 100644
--- a/net/http/transport_security_persister.h
+++ b/net/http/transport_security_persister.h
@@ -65,7 +65,7 @@
virtual ~TransportSecurityPersister();
// Called by the TransportSecurityState when it changes its state.
- virtual void StateIsDirty(TransportSecurityState*) OVERRIDE;
+ virtual void StateIsDirty(TransportSecurityState*) override;
// ImportantFileWriter::DataSerializer:
//
@@ -97,7 +97,7 @@
// The reason for hashing them is so that the stored state does not
// trivially reveal a user's browsing history to an attacker reading the
// serialized state on disk.
- virtual bool SerializeData(std::string* data) OVERRIDE;
+ virtual bool SerializeData(std::string* data) override;
// Clears any existing non-static entries, and then re-populates
// |transport_security_state_|.
diff --git a/net/http/transport_security_persister_unittest.cc b/net/http/transport_security_persister_unittest.cc
index f4d49f7..b8dad5a 100644
--- a/net/http/transport_security_persister_unittest.cc
+++ b/net/http/transport_security_persister_unittest.cc
@@ -27,7 +27,7 @@
base::MessageLoopForIO::current()->RunUntilIdle();
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
persister_.reset(new TransportSecurityPersister(
&state_,
diff --git a/net/http/transport_security_state_static.h b/net/http/transport_security_state_static.h
index f1bec20..edbe166 100644
--- a/net/http/transport_security_state_static.h
+++ b/net/http/transport_security_state_static.h
@@ -672,1327 +672,1368 @@
// value has the MSB set then it represents a literal leaf value. Otherwise
// it's a pointer to the n'th element of the array.
static const uint8 kHSTSHuffmanTree[] = {
- 0xad, 0xf9, 0x00, 0xf7, 0x01, 0xec, 0x02, 0x80,
- 0xb3, 0xb1, 0xf1, 0x04, 0xb4, 0x05, 0x06, 0xf8,
- 0xf6, 0x07, 0xeb, 0x08, 0xed, 0x09, 0xe1, 0x0a,
- 0xe2, 0xe8, 0xe3, 0x0c, 0xe7, 0x0d, 0x0b, 0x0e,
- 0x03, 0x0f, 0xee, 0xf3, 0xb9, 0xb6, 0x12, 0xb7,
- 0xb5, 0x13, 0xb0, 0x14, 0x15, 0xb2, 0x16, 0xea,
- 0xfa, 0x17, 0x18, 0xe6, 0x19, 0xf5, 0xae, 0x1a,
- 0x11, 0x1b, 0xff, 0x1c, 0xf4, 0xe9, 0xe5, 0x1e,
- 0xe4, 0xf0, 0x20, 0xf2, 0x21, 0xef, 0x1f, 0x22,
- 0x1d, 0x23, 0x10, 0x24,
+ 0xf0, 0xf7, 0x00, 0xec, 0x01, 0x80, 0xb3, 0xb0,
+ 0x03, 0xf1, 0xb4, 0x04, 0x05, 0xf8, 0xf6, 0x06,
+ 0xeb, 0x07, 0xed, 0x08, 0xe1, 0x09, 0xe2, 0xe8,
+ 0xe3, 0x0b, 0xe7, 0x0c, 0x0a, 0x0d, 0x02, 0x0e,
+ 0xf3, 0xee, 0xb9, 0xb6, 0x11, 0xb7, 0xb5, 0x12,
+ 0xb1, 0x13, 0x14, 0xb2, 0x15, 0xea, 0xfa, 0x16,
+ 0x17, 0xe6, 0xf5, 0x18, 0xae, 0x19, 0x10, 0x1a,
+ 0xff, 0x1b, 0xf4, 0xe9, 0xe5, 0x1d, 0xad, 0xf9,
+ 0xe4, 0x1f, 0x20, 0xf2, 0x21, 0xef, 0x1e, 0x22,
+ 0x1c, 0x23, 0x0f, 0x24,
};
static const uint8 kPreloadedHSTSData[] = {
0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x25, 0x9f,
0x0b, 0x7f, 0xb1, 0xa2, 0x2d, 0x9b, 0x1f, 0x2a,
- 0x48, 0x54, 0xb9, 0x13, 0x4b, 0xc8, 0xb4, 0xfe,
- 0xd6, 0x0f, 0x2a, 0xdd, 0x4a, 0xb1, 0xa8, 0x9f,
- 0x9d, 0x4d, 0xae, 0xc5, 0x8e, 0x84, 0x3f, 0x3f,
- 0x43, 0x95, 0xb1, 0x31, 0x05, 0xf8, 0x78, 0x4f,
- 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2a, 0x29, 0xf0,
- 0xb7, 0xfb, 0x1a, 0x2b, 0xd9, 0xf6, 0xee, 0x1a,
- 0xf7, 0x8e, 0x95, 0xb0, 0xf7, 0x04, 0xc2, 0x7f,
- 0xeb, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x91,
- 0xa7, 0xff, 0x59, 0x5e, 0xeb, 0x60, 0xb7, 0xfb,
- 0x1a, 0x27, 0x89, 0xff, 0xd6, 0x57, 0xba, 0xd8,
- 0x2d, 0xfe, 0xc6, 0x89, 0xfe, 0x7f, 0xf5, 0x95,
- 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x86, 0x9f,
- 0xfd, 0x65, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68,
- 0xa2, 0x27, 0xfd, 0xee, 0xb6, 0x0b, 0x7f, 0xb1,
- 0xa2, 0x91, 0x9f, 0xff, 0xb3, 0x8a, 0x20, 0x36,
- 0xd7, 0x7f, 0x9a, 0xd5, 0x39, 0x2a, 0x56, 0x52,
- 0x29, 0x17, 0xd1, 0xa7, 0xfe, 0xb7, 0xba, 0xd8,
- 0x2d, 0xfe, 0xc6, 0x89, 0x42, 0x1e, 0x5c, 0xe9,
- 0x74, 0x69, 0x6c, 0x62, 0x30, 0x97, 0x51, 0x35,
- 0x13, 0x39, 0x52, 0x5e, 0x94, 0xaa, 0xa5, 0x7c,
- 0x3d, 0xae, 0x0b, 0x27, 0xff, 0x59, 0x5e, 0xeb,
- 0x60, 0xb7, 0xfb, 0x1a, 0x27, 0x39, 0xff, 0xd6,
- 0x57, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0x26,
- 0x7f, 0xe1, 0x75, 0xa9, 0xba, 0xac, 0xed, 0xf2,
- 0x74, 0x0a, 0x3a, 0xea, 0xa5, 0x7a, 0x94, 0xfe,
- 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x1c, 0x9f, 0x0b,
- 0x7f, 0xb1, 0xa2, 0x2f, 0x9f, 0x7e, 0x9c, 0x97,
- 0x4a, 0x95, 0xb0, 0xf6, 0x3a, 0x61, 0x3f, 0xfa,
- 0xca, 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x32,
- 0x4f, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2d, 0xe9,
- 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d, 0xfe, 0xc6,
- 0x8a, 0x4e, 0x11, 0x39, 0x97, 0x42, 0x4f, 0x09,
- 0xea, 0xa4, 0xb8, 0xee, 0x7f, 0x5b, 0x05, 0xbf,
- 0xd8, 0xd1, 0x0e, 0xcf, 0xfe, 0xb2, 0xbd, 0xd6,
- 0xc1, 0x6f, 0xf6, 0x34, 0x4b, 0x13, 0xfa, 0xd8,
- 0x2d, 0xfe, 0xc6, 0x88, 0xc2, 0x7f, 0xeb, 0x7b,
- 0xad, 0x82, 0xdf, 0xec, 0x68, 0x8f, 0x67, 0xf5,
- 0xb0, 0x5b, 0xfd, 0x8d, 0x16, 0x1c, 0xfe, 0xb6,
- 0x0b, 0x7f, 0xb1, 0xa2, 0xe7, 0x84, 0x4e, 0x29,
- 0xe3, 0xb7, 0x29, 0x6c, 0xed, 0x49, 0x9a, 0x3b,
- 0x9f, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x43, 0xd3,
- 0xe1, 0x6f, 0xf6, 0x34, 0x44, 0xd3, 0x69, 0x47,
- 0x4f, 0xfe, 0xca, 0x02, 0xf5, 0x53, 0x6f, 0xe9,
- 0x14, 0x74, 0x3e, 0x7c, 0x54, 0x16, 0x9e, 0xd5,
- 0xfe, 0x09, 0xa2, 0x17, 0x95, 0xb1, 0x1c, 0xb5,
- 0x84, 0x95, 0xe4, 0x73, 0xda, 0xa6, 0xf4, 0x74,
- 0xff, 0xed, 0xac, 0xec, 0x7d, 0xc0, 0x2b, 0xff,
- 0xa7, 0x4d, 0xf7, 0x07, 0x4a, 0xe5, 0xc4, 0x43,
- 0x50, 0x8b, 0xd3, 0x27, 0xd4, 0xfd, 0x7b, 0x8e,
- 0x9e, 0xdd, 0x77, 0xc9, 0xd3, 0x82, 0x10, 0x95,
- 0x3e, 0xfe, 0xea, 0x98, 0x55, 0x8b, 0xc9, 0xf7,
- 0xe9, 0x6c, 0xd1, 0xd1, 0xc2, 0x26, 0xf9, 0x3f,
- 0xe9, 0xac, 0xff, 0xdc, 0xed, 0x60, 0x28, 0x9b,
- 0x1b, 0xee, 0x67, 0x4f, 0xfb, 0x77, 0x53, 0xa9,
- 0x54, 0xda, 0x8e, 0x9f, 0xb1, 0x75, 0xee, 0xca,
- 0x9d, 0x3d, 0x9c, 0x63, 0xc7, 0x46, 0x27, 0x9f,
- 0xb8, 0x60, 0xac, 0x65, 0x44, 0xce, 0x9f, 0xe8,
- 0xbe, 0x7e, 0xc0, 0xa6, 0x71, 0xb3, 0xa7, 0xff,
- 0xff, 0x77, 0xaf, 0xa5, 0xde, 0xe7, 0x14, 0xda,
- 0xc0, 0x57, 0x1f, 0x70, 0xe0, 0x4e, 0x9f, 0x6f,
- 0x57, 0xa3, 0xc7, 0x4f, 0xe7, 0xdd, 0x5b, 0xb7,
- 0xa3, 0xe7, 0x4f, 0xef, 0x0d, 0xeb, 0x26, 0xbc,
- 0xe8, 0xd9, 0xf5, 0xf4, 0xe2, 0x11, 0x33, 0x4c,
- 0x7e, 0x18, 0x4a, 0x4d, 0x7b, 0x8e, 0x9d, 0xfa,
- 0xa9, 0xd3, 0x5e, 0xf1, 0xd3, 0xc9, 0xdd, 0x2c,
- 0xe3, 0x66, 0x23, 0x73, 0xff, 0xeb, 0xd3, 0x40,
- 0x76, 0xfb, 0x80, 0x33, 0x4b, 0xf9, 0xa3, 0xa7,
- 0xfe, 0xa2, 0x5d, 0x03, 0x5d, 0xfd, 0x26, 0x8e,
- 0x9f, 0xc0, 0x3e, 0xed, 0xd2, 0xf5, 0x1d, 0x1c,
- 0x9f, 0xef, 0x51, 0xa7, 0xfc, 0x2b, 0x01, 0x54,
- 0xdb, 0xdf, 0xa3, 0xa1, 0x0f, 0x8e, 0xf2, 0x39,
- 0xff, 0xff, 0xeb, 0xfb, 0x51, 0xea, 0x2c, 0x00,
- 0x3a, 0xdb, 0xb1, 0xfd, 0x62, 0xee, 0xe5, 0x4e,
- 0x92, 0x1d, 0x3f, 0x9d, 0xe3, 0xba, 0xa3, 0xe7,
- 0x4f, 0xff, 0xff, 0xed, 0xf3, 0x5e, 0xe7, 0xbe,
- 0x07, 0x14, 0xbc, 0x0e, 0xe3, 0xee, 0xcb, 0xde,
- 0xee, 0x7b, 0xe7, 0x4e, 0xff, 0x63, 0x45, 0x31,
- 0x18, 0x8b, 0xe6, 0x84, 0xc4, 0xff, 0xb3, 0xaf,
- 0xba, 0xba, 0x41, 0x58, 0xe9, 0xf3, 0xfd, 0xc5,
- 0xd8, 0x74, 0x6c, 0xfa, 0x3c, 0xfe, 0x7f, 0xbd,
- 0x5c, 0x51, 0x1e, 0xc0, 0x9d, 0x3f, 0xff, 0xbb,
- 0x8d, 0xad, 0x26, 0xaa, 0xb7, 0x70, 0x20, 0x22,
- 0xf7, 0x3a, 0x7f, 0xcc, 0x8a, 0xa6, 0x57, 0x37,
- 0xd3, 0xa1, 0x11, 0x47, 0x46, 0x79, 0xf0, 0xa2,
- 0xe4, 0x13, 0xa7, 0xef, 0xe8, 0x1c, 0x27, 0x4e,
- 0x8c, 0x3f, 0x6d, 0x91, 0x5e, 0x4d, 0x0f, 0x2e,
- 0xcb, 0x70, 0x95, 0x74, 0xe1, 0xa3, 0x3f, 0x7c,
- 0x8b, 0x70, 0x84, 0x58, 0x3c, 0x61, 0xe0, 0xa8,
- 0x47, 0x74, 0x87, 0x51, 0xa9, 0x4f, 0x67, 0x6e,
- 0xdc, 0xce, 0x9f, 0xff, 0xff, 0x53, 0x7a, 0xa6,
- 0x0a, 0x2e, 0x01, 0x57, 0xdc, 0x01, 0x8f, 0xbb,
- 0x2f, 0xef, 0x35, 0x3a, 0x5a, 0xda, 0x2d, 0x6a,
- 0x4f, 0x3f, 0xfe, 0xcc, 0xa6, 0xda, 0x98, 0x05,
- 0x6f, 0xa2, 0x5c, 0xce, 0x9f, 0xfa, 0xbe, 0xf8,
- 0x0a, 0x4c, 0xee, 0x97, 0xce, 0x96, 0xfa, 0x8a,
- 0x1d, 0x2c, 0xcf, 0x9c, 0x8f, 0xba, 0xa7, 0x4f,
- 0xff, 0xff, 0xfb, 0x3b, 0x74, 0x0d, 0xd2, 0xfb,
- 0x2d, 0xbd, 0x22, 0xbb, 0xf7, 0x69, 0xbb, 0x65,
- 0x1f, 0xe5, 0x38, 0x2a, 0x7f, 0xff, 0xe6, 0xd8,
- 0x78, 0xbc, 0x40, 0xbd, 0x1e, 0xab, 0x52, 0xfa,
- 0x3f, 0xe1, 0x3a, 0x6b, 0xde, 0x7d, 0x34, 0x5d,
- 0x94, 0x56, 0x14, 0xb0, 0x8a, 0x9f, 0x69, 0x0c,
- 0xae, 0xc6, 0xdd, 0x3f, 0xf9, 0x4c, 0x05, 0x3d,
- 0xd8, 0xaf, 0xef, 0x27, 0x4f, 0xff, 0xb7, 0xdd,
- 0x53, 0x2e, 0x34, 0xb6, 0x5c, 0xff, 0xbc, 0x9d,
- 0x3f, 0xf2, 0x75, 0xee, 0xe2, 0xea, 0xde, 0x8f,
- 0x9d, 0x15, 0x45, 0x35, 0xeb, 0xd3, 0xd9, 0xac,
- 0x5e, 0x8e, 0x9c, 0xbf, 0x94, 0x3a, 0x6c, 0xe0,
- 0xe8, 0x79, 0x36, 0xd7, 0x43, 0xc2, 0xa4, 0x9a,
- 0x25, 0x5c, 0x3d, 0x3f, 0x70, 0x9d, 0xa7, 0xb8,
- 0xe9, 0xc9, 0xc2, 0x1d, 0x3f, 0x96, 0x76, 0x6a,
- 0xbe, 0xb0, 0x07, 0x90, 0xa2, 0xd9, 0xfa, 0xe2,
- 0x9f, 0x73, 0x4e, 0x4e, 0x9f, 0xc2, 0xb7, 0x72,
- 0x9f, 0xa3, 0xa3, 0x0f, 0x9b, 0x66, 0x93, 0xf2,
- 0x73, 0x9a, 0x05, 0xe3, 0xa1, 0xc7, 0xa1, 0xd2,
- 0x19, 0xff, 0xff, 0x6b, 0xbf, 0xcd, 0x5e, 0xcd,
- 0xf7, 0x5d, 0xc5, 0xc0, 0x54, 0x3d, 0x3a, 0x7f,
- 0xdb, 0xc5, 0x80, 0xaa, 0x53, 0xee, 0x67, 0x4f,
- 0xef, 0x7e, 0xb4, 0xcf, 0x13, 0xa3, 0x83, 0xf4,
- 0xd2, 0x1c, 0x94, 0x74, 0xee, 0xe7, 0x07, 0x42,
- 0x1a, 0xc7, 0xc4, 0x27, 0xe7, 0xeb, 0x99, 0xdb,
- 0xa7, 0x4f, 0x28, 0x14, 0xe4, 0xe8, 0xc3, 0xd2,
- 0xd9, 0x7c, 0x22, 0x79, 0x39, 0x0e, 0x6d, 0xa7,
- 0x8b, 0x9c, 0xfe, 0xd6, 0xde, 0xca, 0x5f, 0xa3,
- 0xa7, 0xb1, 0xf4, 0x58, 0xe9, 0xfa, 0x9e, 0xe5,
- 0x0e, 0xce, 0x9f, 0x6f, 0x91, 0xc7, 0xce, 0x8b,
- 0xa8, 0xab, 0xd9, 0xaf, 0x24, 0x57, 0x96, 0x4f,
- 0xff, 0xc2, 0xea, 0x62, 0xd4, 0x4e, 0xdd, 0xee,
- 0x6a, 0x97, 0x9d, 0x3f, 0xff, 0xb7, 0x8f, 0xba,
- 0xba, 0xa2, 0x29, 0x37, 0xc0, 0x08, 0xbd, 0xce,
- 0x9f, 0xff, 0xff, 0x5f, 0xd0, 0x03, 0xef, 0xb8,
- 0x7f, 0x90, 0x2b, 0x7a, 0x3f, 0x4c, 0xdf, 0x72,
- 0xe9, 0xd3, 0xff, 0xeb, 0xc4, 0x73, 0x55, 0xa6,
- 0xf0, 0x0a, 0x72, 0x87, 0x46, 0x23, 0x86, 0x90,
- 0x8b, 0x9f, 0xfe, 0x75, 0xc5, 0x31, 0x3a, 0xb7,
- 0x73, 0x55, 0xf3, 0xa7, 0xff, 0xdc, 0x62, 0x80,
- 0xb8, 0xd2, 0x55, 0x67, 0x78, 0xbc, 0x74, 0xff,
- 0x67, 0x5e, 0x03, 0x9f, 0xf5, 0x8e, 0x9f, 0xf5,
- 0x6f, 0xe8, 0x15, 0xbd, 0x7e, 0xf1, 0x3a, 0x7f,
- 0xf3, 0xc0, 0x56, 0x97, 0x81, 0xaa, 0xd5, 0x04,
- 0xe9, 0xff, 0xff, 0x63, 0xf5, 0xde, 0x04, 0x0a,
- 0x66, 0xab, 0x8f, 0x01, 0x9b, 0xe0, 0xe8, 0xc4,
- 0x5f, 0x6d, 0x3a, 0x1e, 0x56, 0xfe, 0xd1, 0xa5,
- 0x3e, 0x4f, 0xb5, 0x25, 0x2d, 0xd4, 0xef, 0x51,
- 0x82, 0x4f, 0xfb, 0xc6, 0x99, 0xa4, 0xee, 0xf9,
- 0x3a, 0x7f, 0xb0, 0x2f, 0xba, 0xa0, 0x6b, 0x67,
- 0x4f, 0xff, 0xf9, 0x19, 0x14, 0x02, 0xd4, 0xdf,
- 0x78, 0x00, 0x16, 0xee, 0x53, 0x0e, 0x86, 0x47,
- 0x3f, 0x4f, 0x6e, 0x0e, 0xe7, 0xb7, 0xad, 0xa1,
- 0xd3, 0xff, 0xff, 0xf6, 0x91, 0x5d, 0xdd, 0xda,
- 0x7a, 0xc0, 0x76, 0xfb, 0x80, 0x31, 0xf7, 0x65,
- 0xfd, 0xe6, 0xa7, 0x43, 0x91, 0x6f, 0xb2, 0x18,
- 0x45, 0xe4, 0x3c, 0x97, 0xbb, 0xb8, 0xd6, 0xbe,
- 0x1d, 0x33, 0xda, 0xaf, 0xf2, 0x74, 0xff, 0xd4,
- 0xd8, 0x1b, 0x1b, 0xde, 0xf1, 0x63, 0xa7, 0xed,
- 0x78, 0xf5, 0xfd, 0x9d, 0x18, 0x89, 0x4b, 0xa4,
- 0x5a, 0x45, 0x9e, 0x06, 0xff, 0xa9, 0xd3, 0xff,
- 0xf6, 0xc4, 0x0c, 0xde, 0x76, 0xed, 0x37, 0x8a,
- 0xc6, 0x3a, 0x7f, 0xff, 0xb6, 0xf0, 0xa2, 0xab,
- 0x7a, 0x00, 0x82, 0x9c, 0x51, 0x14, 0x74, 0x62,
- 0x30, 0x85, 0x6e, 0x7f, 0xff, 0xf0, 0x8e, 0xde,
- 0x02, 0x99, 0xae, 0xa2, 0xd4, 0xc7, 0x91, 0xfd,
- 0x5e, 0xc7, 0x4f, 0xff, 0xfc, 0x97, 0x68, 0x80,
- 0x77, 0x2f, 0xba, 0x03, 0xee, 0xae, 0xfa, 0x0a,
- 0x3c, 0x74, 0xf9, 0xfa, 0xef, 0x3a, 0x74, 0x62,
- 0x29, 0x2f, 0x7c, 0x8d, 0xa6, 0x85, 0x48, 0xc7,
- 0xe7, 0xfb, 0xb7, 0xad, 0xdc, 0xa7, 0xe8, 0xe9,
- 0xfe, 0xe2, 0x88, 0x1e, 0x29, 0xea, 0x3a, 0x7f,
- 0xff, 0xbc, 0x69, 0x9a, 0xde, 0x75, 0xea, 0xa6,
- 0x77, 0x8a, 0x21, 0xd3, 0xda, 0x01, 0xe1, 0x3a,
- 0x1f, 0x44, 0x47, 0xb2, 0xcf, 0xcb, 0x3e, 0xeb,
- 0xd3, 0x47, 0x4f, 0xf5, 0x3d, 0x5d, 0xca, 0x7e,
- 0x8e, 0x84, 0x3e, 0x7a, 0x98, 0x4f, 0xd9, 0xa1,
- 0x1c, 0x71, 0xd3, 0xf7, 0x72, 0x9d, 0xc6, 0x3a,
- 0x7b, 0xb9, 0x50, 0x16, 0x3d, 0x5d, 0x15, 0x47,
- 0x0a, 0xf1, 0x1a, 0x36, 0x3d, 0x95, 0x09, 0xd5,
- 0x21, 0x85, 0xa8, 0x45, 0x2e, 0x76, 0x9f, 0xfb,
- 0xbd, 0xc0, 0x07, 0x29, 0xdc, 0x58, 0xe8, 0x45,
- 0xd6, 0x4c, 0x9c, 0xa9, 0xf7, 0x79, 0xf7, 0x51,
- 0x5f, 0xc1, 0xd3, 0xfb, 0x16, 0xa6, 0x69, 0x38,
- 0x3a, 0x7f, 0xff, 0xfa, 0x99, 0xaa, 0xfa, 0xc0,
- 0x77, 0x1f, 0x76, 0x5e, 0xf7, 0x73, 0x8a, 0x6d,
- 0x63, 0xa6, 0xbe, 0xe9, 0xd0, 0x28, 0x9d, 0xd4,
- 0x21, 0x27, 0xec, 0x7b, 0xb8, 0xfd, 0x4e, 0x9f,
- 0xfc, 0x2f, 0xba, 0xb8, 0xa7, 0xd2, 0x94, 0x43,
- 0xa5, 0x53, 0xa2, 0xf3, 0xda, 0x05, 0x2a, 0x7f,
- 0x22, 0xbb, 0x94, 0xfd, 0x1d, 0x3f, 0xff, 0xed,
- 0x75, 0x39, 0x7d, 0xd5, 0xbd, 0x35, 0xdc, 0xe3,
- 0x78, 0x2b, 0x1d, 0x1b, 0x54, 0xd6, 0xb1, 0x3f,
- 0xc3, 0x43, 0xa4, 0xf5, 0x84, 0x45, 0xe4, 0x80,
- 0x98, 0xcf, 0x9d, 0xb1, 0xc7, 0xce, 0x9f, 0x65,
- 0x5e, 0xc0, 0x9d, 0x0f, 0x9e, 0x75, 0x09, 0xe7,
- 0xff, 0xdb, 0x7b, 0x1b, 0x8a, 0x6f, 0x2e, 0x81,
- 0x76, 0xf4, 0x3a, 0x7a, 0xe3, 0x59, 0x43, 0xa7,
- 0xff, 0xfe, 0xb8, 0x7d, 0xde, 0xf8, 0x1d, 0xbe,
- 0xe0, 0x0c, 0x7d, 0xd9, 0x7f, 0x79, 0xa9, 0xd0,
- 0xf2, 0x29, 0x70, 0x92, 0x7f, 0xff, 0xfc, 0x8f,
- 0xd6, 0xf4, 0x7c, 0x0a, 0x67, 0x00, 0x77, 0x2f,
- 0xba, 0x05, 0x79, 0xe7, 0x7a, 0x3a, 0x7c, 0x9d,
- 0x7f, 0xde, 0x3a, 0x7f, 0xff, 0xff, 0xf6, 0x2b,
- 0x19, 0x28, 0x8a, 0xd6, 0x56, 0xa8, 0x22, 0x9d,
- 0xc7, 0xb2, 0xfa, 0xde, 0xb7, 0x51, 0x47, 0x4f,
- 0xf7, 0x39, 0xc7, 0x72, 0x9f, 0xa3, 0xa7, 0xfe,
- 0x7d, 0x2e, 0xdc, 0x5f, 0x9d, 0x58, 0x15, 0x1d,
- 0x3f, 0xfd, 0x9a, 0xe3, 0x33, 0x9a, 0x80, 0x35,
- 0xe2, 0xa7, 0x42, 0x2b, 0x7a, 0xc2, 0x3d, 0xc6,
- 0x02, 0x24, 0x6a, 0x84, 0x85, 0x0a, 0x3e, 0x14,
- 0x7d, 0x39, 0xaa, 0x6c, 0xee, 0x00, 0x58, 0xe9,
- 0xff, 0xe7, 0xdd, 0xd4, 0x01, 0x5d, 0x4b, 0xba,
- 0xdb, 0xc7, 0x46, 0x1f, 0xa6, 0xc7, 0xe7, 0xe7,
- 0x96, 0x72, 0xf0, 0x5e, 0x3a, 0x7c, 0xad, 0xf1,
- 0x9c, 0x1d, 0x25, 0x8e, 0x99, 0x14, 0x74, 0xb4,
- 0x74, 0x09, 0xa5, 0xf1, 0x58, 0xe0, 0xf5, 0x68,
- 0x6d, 0x3d, 0xaa, 0xfb, 0xe7, 0x4c, 0xb7, 0x9d,
- 0x3f, 0xa9, 0xb1, 0x7d, 0xdd, 0x43, 0xa2, 0xe4,
- 0x26, 0x80, 0x86, 0x98, 0xfd, 0xb2, 0x35, 0x11,
- 0x5e, 0x2d, 0x3f, 0xab, 0xb7, 0xc3, 0xfd, 0xe4,
- 0xe9, 0xff, 0xf2, 0x0a, 0x36, 0x29, 0x19, 0xdb,
- 0xad, 0xea, 0x3a, 0x16, 0x44, 0x3a, 0xf9, 0xac,
- 0xee, 0xf2, 0x87, 0x4a, 0xcb, 0xc7, 0x55, 0xf0,
- 0x92, 0x82, 0x1e, 0x5d, 0xe2, 0x36, 0x0c, 0x9d,
- 0xc9, 0x69, 0x7d, 0x8f, 0xc7, 0x53, 0xb8, 0x4d,
- 0xad, 0x18, 0x18, 0xc7, 0xd6, 0xa8, 0x75, 0xd2,
- 0x7a, 0x13, 0xe1, 0xc7, 0xd9, 0xd9, 0x5a, 0xca,
- 0xa3, 0xd4, 0xe1, 0xd2, 0xe8, 0xc0, 0x17, 0xe3,
- 0x61, 0x06, 0x1c, 0x97, 0x04, 0xf3, 0xfa, 0xd8,
- 0x2d, 0xfe, 0xc6, 0x8a, 0x76, 0x7c, 0x2d, 0xfe,
- 0xc6, 0x8a, 0x8e, 0x7f, 0xde, 0xeb, 0x60, 0xb7,
- 0xfb, 0x1a, 0x26, 0x89, 0x5b, 0x0f, 0xd9, 0x46,
- 0x13, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0xbe,
- 0x7c, 0x2d, 0xfe, 0xc6, 0x8a, 0xda, 0x7f, 0x9d,
- 0x6c, 0x16, 0xff, 0x63, 0x44, 0x83, 0x2b, 0x61,
- 0xf8, 0xf9, 0x84, 0xff, 0xd6, 0xf7, 0x5b, 0x05,
- 0xbf, 0xd8, 0xd1, 0x21, 0xcf, 0x85, 0xbf, 0xd8,
- 0xd1, 0x62, 0x4f, 0xfc, 0x99, 0x5c, 0xef, 0x1b,
- 0xe5, 0x3a, 0x74, 0xee, 0xa3, 0xc7, 0x49, 0xdd,
- 0x3e, 0x0b, 0xd1, 0x27, 0x2f, 0xef, 0x93, 0xa7,
- 0xde, 0xe0, 0x68, 0x87, 0x4f, 0xd5, 0xa8, 0xec,
- 0x37, 0x33, 0xa3, 0x67, 0xb1, 0xe4, 0xf3, 0xfb,
- 0x94, 0xcd, 0x6f, 0xa1, 0x2a, 0x31, 0x38, 0x57,
- 0xe1, 0x21, 0xb2, 0x9a, 0x3c, 0x72, 0x43, 0x3f,
- 0xf5, 0x36, 0x9a, 0xa7, 0xdd, 0xce, 0xf2, 0x74,
- 0xff, 0xfe, 0xd6, 0xbd, 0xd5, 0xce, 0xa2, 0xbf,
- 0x35, 0xa4, 0x51, 0xd3, 0xff, 0xd8, 0xfb, 0xb5,
- 0x7b, 0xd6, 0xa7, 0xab, 0x75, 0x3a, 0x6a, 0x5b,
- 0x11, 0xef, 0xb4, 0x6e, 0xaf, 0x45, 0x93, 0x83,
- 0x48, 0xd2, 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d,
- 0x16, 0x6c, 0xff, 0xeb, 0x2b, 0xdd, 0x6c, 0x16,
- 0xff, 0x63, 0x45, 0x01, 0x30, 0x15, 0x3a, 0x79,
- 0xbf, 0xd8, 0xd1, 0x6f, 0xcf, 0xc0, 0xeb, 0xdb,
- 0xc4, 0xe8, 0x13, 0xd6, 0xe4, 0xae, 0x7d, 0xa7,
- 0x54, 0x1a, 0x9d, 0x3f, 0x91, 0x70, 0x3a, 0xea,
- 0x72, 0x74, 0xee, 0xe3, 0x8e, 0x95, 0x9c, 0x98,
- 0x4e, 0x36, 0x89, 0x15, 0x0a, 0x74, 0x6d, 0x3f,
- 0xef, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14, 0xa4,
- 0xff, 0x3a, 0xd8, 0x2d, 0xfe, 0xc6, 0x89, 0x3a,
- 0x56, 0x52, 0x21, 0xfd, 0x1a, 0x11, 0xdb, 0x13,
- 0x3d, 0x19, 0x07, 0x16, 0xae, 0xe7, 0x23, 0x92,
- 0x68, 0x58, 0xec, 0x9e, 0xe7, 0x0a, 0xc5, 0x89,
- 0x95, 0x2d, 0x52, 0x85, 0x3c, 0x9d, 0xd6, 0x35,
- 0xb5, 0xd0, 0xd6, 0x9f, 0x0b, 0x7f, 0xb1, 0xa2,
- 0x1f, 0x9f, 0xf7, 0xba, 0xd8, 0x2d, 0xfe, 0xc6,
- 0x89, 0x4e, 0x56, 0xc3, 0xf6, 0x51, 0x84, 0xfe,
- 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x27, 0x9f, 0xd6,
- 0xc1, 0x6f, 0xf6, 0x34, 0x46, 0x33, 0xff, 0xac,
- 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13, 0xcc,
- 0x22, 0x3b, 0xde, 0x27, 0x71, 0xdd, 0x0e, 0xe7,
- 0xc2, 0xdf, 0xec, 0x68, 0x88, 0x27, 0xfd, 0xee,
- 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x54, 0x95, 0xb0,
- 0xfd, 0x94, 0x61, 0x3f, 0xad, 0x82, 0xdf, 0xec,
- 0x68, 0x8a, 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d,
- 0x11, 0x94, 0xff, 0xeb, 0x2b, 0xdd, 0x6c, 0x16,
- 0xff, 0x63, 0x44, 0xcb, 0x3f, 0xad, 0x82, 0xdf,
- 0xec, 0x68, 0xa9, 0x27, 0xf5, 0xb0, 0x5b, 0xfd,
- 0x8d, 0x15, 0xd4, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1,
- 0xa2, 0xc5, 0x9f, 0xf9, 0x5e, 0xeb, 0x60, 0xb7,
- 0xfb, 0x1a, 0x27, 0xa9, 0xfe, 0x0d, 0xbd, 0x36,
- 0xbf, 0xbb, 0x83, 0xa2, 0xc8, 0x8a, 0x44, 0xc9,
- 0xfa, 0xe4, 0xf9, 0xad, 0xdf, 0x53, 0xa7, 0x85,
- 0x5a, 0x7c, 0xe9, 0xcd, 0x94, 0x2a, 0x7f, 0xfe,
- 0xa7, 0x7e, 0xee, 0xc5, 0x1c, 0xec, 0xaf, 0x3c,
- 0xa1, 0xd3, 0xff, 0xf0, 0xee, 0xe3, 0xd5, 0x64,
- 0x11, 0xdd, 0xc3, 0x5e, 0xf1, 0xd3, 0xe6, 0xdd,
- 0x01, 0x51, 0xd3, 0xff, 0xbe, 0xbd, 0xce, 0x6d,
- 0x4d, 0xb7, 0x89, 0xd3, 0xed, 0x51, 0x14, 0xc7,
- 0x4f, 0xfe, 0xe8, 0x08, 0x9d, 0x45, 0x00, 0x05,
- 0x17, 0xce, 0x9f, 0xeb, 0xfe, 0xbf, 0x4b, 0xfa,
- 0xf1, 0xd1, 0xb4, 0xf7, 0x45, 0x75, 0x4c, 0x14,
- 0x28, 0xea, 0x46, 0x89, 0xae, 0x13, 0xe7, 0x77,
- 0xf4, 0x6a, 0x85, 0xa7, 0x77, 0x75, 0x3a, 0x41,
- 0xb9, 0x4f, 0x11, 0x0a, 0x27, 0x85, 0x77, 0xa8,
- 0xe8, 0xc3, 0xce, 0xd9, 0x64, 0xff, 0xb7, 0x4f,
- 0xd2, 0x2d, 0x5d, 0xa8, 0xe9, 0xfb, 0x7d, 0xbb,
- 0xbc, 0xa9, 0xd3, 0xdd, 0xe0, 0x0b, 0xa7, 0x4f,
- 0xd9, 0x50, 0xff, 0x5e, 0x3a, 0x3c, 0xf4, 0xfa,
- 0x4d, 0x3e, 0xbe, 0xed, 0x78, 0x43, 0xa3, 0x11,
- 0x9d, 0xb8, 0x41, 0x50, 0x86, 0x7f, 0xff, 0xf5,
- 0x13, 0x62, 0x28, 0x0e, 0xb7, 0xdb, 0xdd, 0x95,
- 0xe2, 0xff, 0x17, 0x1d, 0x3e, 0x7b, 0x81, 0xd8,
- 0x4e, 0x9f, 0xb8, 0xf1, 0xe5, 0x7f, 0x0e, 0x9f,
- 0xf7, 0x76, 0xed, 0x53, 0x07, 0x75, 0x3a, 0x7f,
- 0xdf, 0x9c, 0xa7, 0x7f, 0x8c, 0xba, 0x74, 0x38,
- 0xff, 0x79, 0x3e, 0x9e, 0xbe, 0xb4, 0x51, 0xd3,
- 0xf5, 0xf5, 0xd5, 0x73, 0x47, 0x4e, 0x08, 0x42,
- 0x54, 0xff, 0xed, 0x6f, 0x55, 0xa6, 0xd7, 0xc1,
- 0x14, 0x71, 0x56, 0x2f, 0x23, 0x68, 0xa7, 0xbd,
- 0x2a, 0x1c, 0xa9, 0x83, 0x1e, 0x76, 0x52, 0x30,
- 0xad, 0xe9, 0x1e, 0xa1, 0x95, 0x35, 0xdc, 0x3a,
- 0x7c, 0x1d, 0x23, 0xe1, 0x3a, 0x7f, 0x27, 0x8d,
- 0x03, 0xfc, 0x15, 0x30, 0x42, 0x54, 0x70, 0x78,
- 0xe1, 0x31, 0x9e, 0xae, 0xb7, 0x73, 0x2a, 0xc6,
- 0x8e, 0x7f, 0xf5, 0xf5, 0xaf, 0x1d, 0x4e, 0x28,
- 0x9a, 0xa9, 0xd3, 0xfe, 0xd6, 0xc7, 0xf9, 0xb8,
- 0xd6, 0x50, 0xe8, 0x72, 0x23, 0xb6, 0x9b, 0x3e,
- 0xc7, 0xb3, 0x62, 0x74, 0xfd, 0xa4, 0x1e, 0x33,
- 0xa7, 0x4f, 0xee, 0x28, 0x9d, 0x0f, 0xbe, 0x74,
- 0xff, 0xff, 0xb6, 0xaf, 0xeb, 0xee, 0xb0, 0x73,
- 0x6b, 0xb3, 0xb9, 0xc7, 0xb8, 0xf1, 0x7a, 0xc2,
- 0x23, 0x73, 0xcb, 0x2f, 0x34, 0x9f, 0xfe, 0xcd,
- 0x57, 0x16, 0xa2, 0x2e, 0xca, 0x51, 0x0e, 0x9f,
- 0xff, 0xff, 0x6f, 0x1f, 0xae, 0xf0, 0x20, 0x63,
- 0xee, 0xae, 0xf5, 0x5d, 0xbf, 0xc7, 0x17, 0xbc,
- 0x74, 0x75, 0x1b, 0xba, 0x50, 0x9b, 0x61, 0x3a,
- 0x60, 0x79, 0x3a, 0x16, 0x35, 0xdc, 0x8b, 0x4e,
- 0x77, 0xf0, 0x74, 0xc1, 0x09, 0xd1, 0xb3, 0xd5,
- 0xa9, 0x18, 0x47, 0x27, 0x68, 0x1e, 0x4a, 0xb1,
- 0xaf, 0x9f, 0xff, 0xfd, 0xa4, 0xe2, 0x97, 0xfd,
- 0xd5, 0x7f, 0x19, 0x9d, 0xbb, 0x5a, 0xe7, 0x79,
- 0x3a, 0x1f, 0x45, 0x66, 0xcb, 0xa7, 0xfb, 0x35,
- 0x44, 0x1d, 0x63, 0x1d, 0x39, 0x05, 0x63, 0xa3,
- 0x13, 0xf5, 0xf8, 0xe0, 0x7a, 0x48, 0xbe, 0x6b,
- 0x3e, 0xee, 0x6b, 0xee, 0x0e, 0x9f, 0xfb, 0x04,
- 0x71, 0x6a, 0x65, 0x7f, 0xa7, 0x4f, 0xee, 0xa0,
- 0xde, 0xd4, 0x43, 0xa7, 0xdb, 0xbb, 0x4f, 0x71,
- 0xd3, 0xf6, 0xd1, 0x4f, 0x60, 0x4e, 0x98, 0x21,
- 0x3a, 0x18, 0xfb, 0x04, 0xa4, 0x25, 0xb3, 0xfd,
- 0x8b, 0x7a, 0xde, 0xfb, 0xaa, 0x55, 0x8d, 0x6c,
- 0xff, 0xec, 0xef, 0x39, 0x4d, 0xbf, 0x5a, 0x5f,
- 0x53, 0xa7, 0xee, 0xff, 0x3c, 0x67, 0x4e, 0x9c,
- 0x10, 0x84, 0xa9, 0xff, 0x90, 0x7b, 0x7f, 0x83,
- 0x8b, 0x22, 0x8e, 0xb1, 0x79, 0x17, 0x34, 0xff,
- 0x96, 0x86, 0x55, 0x52, 0xb4, 0x9a, 0x14, 0xa9,
- 0xde, 0x2f, 0x1e, 0x41, 0x29, 0xe7, 0x63, 0xee,
- 0x3c, 0x82, 0x53, 0xab, 0xbe, 0x0f, 0x20, 0x94,
- 0xc1, 0x09, 0xe4, 0x12, 0x86, 0x45, 0x22, 0xc5,
- 0x1a, 0x2f, 0x09, 0x54, 0xfd, 0xfd, 0xe7, 0xbf,
- 0xa2, 0xc8, 0x25, 0x63, 0x7b, 0x3c, 0xbf, 0x9f,
- 0x43, 0xa5, 0x97, 0x33, 0xed, 0xe5, 0x2a, 0x7f,
- 0x2c, 0xeb, 0xde, 0xd6, 0xde, 0x2a, 0x7f, 0x6d,
- 0xd7, 0xfd, 0x69, 0xb3, 0xa4, 0xe2, 0xa7, 0x78,
- 0xbc, 0x54, 0x15, 0x08, 0x6d, 0x58, 0x41, 0x43,
- 0x73, 0xdd, 0x4e, 0x58, 0xab, 0x1a, 0xc8, 0x44,
- 0x63, 0x64, 0x25, 0x67, 0xaf, 0xf1, 0x71, 0xd2,
- 0x51, 0xd3, 0x63, 0xb8, 0x36, 0x2b, 0x10, 0xcf,
- 0x83, 0x8b, 0x6d, 0x47, 0x4f, 0xcc, 0x8b, 0x39,
- 0x39, 0x2a, 0x5b, 0x3a, 0x7f, 0x9e, 0xbd, 0xdc,
- 0x52, 0xff, 0xe9, 0xd3, 0xf6, 0xd1, 0x4f, 0x60,
- 0x4e, 0x9f, 0x63, 0xca, 0xc5, 0x1d, 0x3a, 0xbb,
- 0x13, 0xa3, 0xa7, 0x85, 0xa2, 0x79, 0xfb, 0xbf,
- 0xcf, 0x37, 0xd4, 0xe9, 0xfb, 0x77, 0x41, 0x45,
- 0x5b, 0x84, 0xc3, 0xb0, 0x40, 0x4f, 0x6a, 0xdf,
- 0xa2, 0x28, 0xc4, 0xf4, 0xf6, 0x51, 0xd8, 0xce,
- 0xe7, 0xbb, 0x8f, 0x5e, 0x74, 0x39, 0x5e, 0xde,
- 0x16, 0x52, 0x1f, 0xdd, 0x57, 0xac, 0xa0, 0x1d,
- 0x1b, 0x4e, 0x08, 0x42, 0x54, 0xe1, 0x72, 0x15,
- 0x62, 0xf2, 0x7e, 0x79, 0x67, 0x2f, 0x05, 0xe3,
- 0xa7, 0xa9, 0xef, 0x84, 0xe9, 0xf3, 0xc3, 0xb4,
- 0x51, 0xd3, 0xff, 0xc8, 0x0e, 0xba, 0x9c, 0xfe,
- 0xb9, 0x07, 0xae, 0x3a, 0x2e, 0x42, 0x34, 0x36,
- 0x69, 0xe4, 0x5a, 0x27, 0x9c, 0xed, 0xf4, 0xe9,
- 0xfb, 0x48, 0xb7, 0x6f, 0xa9, 0xd0, 0xe3, 0xcb,
- 0xd0, 0xe4, 0xeb, 0xef, 0x5e, 0x8e, 0x9b, 0xec,
- 0xbd, 0x9b, 0x77, 0x4b, 0x92, 0x36, 0xb9, 0x30,
- 0x89, 0x23, 0xf7, 0x7a, 0x1f, 0x2e, 0x21, 0xe2,
- 0x30, 0xdc, 0x95, 0x29, 0x75, 0x85, 0x85, 0xf7,
- 0x09, 0x25, 0xa1, 0x88, 0x24, 0x6a, 0x8c, 0x0a,
- 0x92, 0xc0, 0x7d, 0x17, 0xa5, 0x35, 0x94, 0x7f,
- 0xa9, 0xd7, 0xeb, 0xe1, 0x00, 0xbf, 0x0f, 0x90,
- 0x61, 0x1b, 0x70, 0x45, 0x3f, 0xfa, 0xca, 0xf7,
- 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x45, 0x4f, 0xeb,
- 0x60, 0xb7, 0xfb, 0x1a, 0x2e, 0x89, 0xff, 0xad,
- 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x4b, 0x9f,
- 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x5e, 0x50, 0x8d,
- 0xe4, 0x1b, 0xc4, 0xee, 0x3b, 0xc3, 0xb6, 0x52,
- 0x58, 0xed, 0x47, 0x74, 0x86, 0x2f, 0x6b, 0x79,
- 0x6a, 0xc7, 0x5f, 0xa5, 0x2b, 0xce, 0xd7, 0x26,
- 0x4f, 0xfe, 0xb2, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6,
- 0x34, 0x4b, 0x33, 0xcd, 0xfe, 0xc6, 0x88, 0xce,
- 0x7e, 0xda, 0x29, 0xec, 0x09, 0xd3, 0x75, 0xc7,
- 0x49, 0x47, 0x4f, 0xb6, 0x34, 0xfb, 0x09, 0xe9,
- 0xa8, 0xb4, 0x11, 0x69, 0xfb, 0xdd, 0xb1, 0xf1,
- 0x3a, 0x75, 0x51, 0xf3, 0xa0, 0x53, 0x0f, 0x53,
- 0xf7, 0x52, 0xf4, 0x55, 0x3f, 0xf6, 0xb6, 0x3f,
- 0xc8, 0x0f, 0xb9, 0x14, 0x74, 0xfb, 0xa8, 0xea,
- 0xf9, 0xd1, 0xb3, 0xec, 0x5c, 0x8d, 0x3f, 0xf6,
- 0x2b, 0x5b, 0x0d, 0x52, 0x9f, 0x73, 0x3a, 0x7f,
- 0xd4, 0x4d, 0xd3, 0x69, 0xd5, 0xaf, 0x3a, 0x56,
- 0xc4, 0xd5, 0x16, 0x85, 0x4f, 0x49, 0x2a, 0x8f,
+ 0x48, 0x54, 0x80, 0x26, 0x94, 0x02, 0xd3, 0xfb,
+ 0x58, 0x20, 0x56, 0xe8, 0x55, 0x8d, 0x34, 0xfc,
+ 0xea, 0xed, 0x76, 0x2c, 0x74, 0x21, 0xf9, 0x7a,
+ 0x14, 0xad, 0x89, 0x86, 0xaf, 0xc3, 0xb6, 0x7f,
+ 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x51, 0x4f, 0x85,
+ 0xbf, 0xd8, 0xd1, 0x5e, 0xcf, 0xb7, 0x78, 0xd7,
+ 0x3c, 0x74, 0xad, 0x87, 0xb8, 0x26, 0x13, 0xff,
+ 0x5b, 0xdd, 0x6c, 0x16, 0xff, 0x63, 0x44, 0x8d,
0x3f, 0xfa, 0xca, 0xf7, 0x5b, 0x05, 0xbf, 0xd8,
- 0xd1, 0x34, 0xcf, 0xfe, 0xb2, 0xbd, 0xd6, 0xc1,
- 0x6f, 0xf6, 0x34, 0x4e, 0x33, 0xff, 0xac, 0xaf,
- 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14, 0x0c, 0xf8,
- 0x5b, 0xfd, 0x8d, 0x17, 0x04, 0xc9, 0xb3, 0xa7,
- 0xf7, 0x5c, 0x9b, 0xe3, 0x14, 0x74, 0xad, 0x87,
- 0xf1, 0x43, 0x0b, 0xc5, 0x67, 0xf6, 0xec, 0x0a,
- 0x73, 0x81, 0x3a, 0x7f, 0x9d, 0x6c, 0x16, 0xff,
- 0x63, 0x44, 0x93, 0x2b, 0x50, 0xfd, 0x7c, 0xd2,
- 0x1e, 0x5d, 0x3d, 0x74, 0xab, 0x56, 0x49, 0x59,
- 0x4b, 0x95, 0x2a, 0xc3, 0x2b, 0x50, 0xaa, 0x9f,
- 0xf5, 0xdf, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xd4,
- 0x9f, 0xf7, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x89,
- 0x56, 0x0e, 0x95, 0xae, 0xa2, 0x61, 0x49, 0x17,
- 0x08, 0xd3, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x88,
- 0xa6, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x1a,
- 0x4f, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x29, 0xf9,
- 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d, 0xfe, 0xc6,
- 0x89, 0xaa, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1,
- 0x5d, 0xcf, 0x37, 0xfb, 0x1a, 0x2b, 0xe9, 0xc1,
- 0x08, 0x4a, 0x97, 0x4a, 0xb1, 0x79, 0x02, 0x7c,
- 0xca, 0x47, 0x9c, 0xe4, 0x7c, 0xe9, 0xff, 0x65,
- 0x03, 0xfa, 0xaa, 0x63, 0xc7, 0x4f, 0xfb, 0xf6,
- 0x38, 0xf6, 0xdd, 0x9c, 0x1d, 0x2b, 0x62, 0x2e,
- 0x16, 0x21, 0xe8, 0xe5, 0x4f, 0x67, 0xff, 0x59,
- 0x5e, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x27, 0xb9,
- 0xfd, 0x6c, 0x16, 0xff, 0x63, 0x45, 0xc3, 0x3f,
- 0xf5, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x49,
- 0xf0, 0x8a, 0xec, 0xde, 0x3b, 0x71, 0xdd, 0xd3,
- 0xb6, 0x3b, 0x59, 0x48, 0x63, 0x59, 0xa2, 0x1d,
- 0x54, 0x97, 0x1d, 0xcf, 0xeb, 0x60, 0xb7, 0xfb,
- 0x1a, 0x22, 0xa9, 0xfd, 0x6c, 0x16, 0xff, 0x63,
- 0x45, 0x33, 0x3f, 0xfa, 0xca, 0xf7, 0x5b, 0x05,
- 0xbf, 0xd8, 0xd1, 0x33, 0xcf, 0xfe, 0xb2, 0xbd,
- 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x51, 0xb0, 0xf2,
- 0x63, 0x5c, 0x1d, 0xdd, 0x3b, 0xd2, 0x94, 0xff,
- 0xd6, 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x1d,
- 0x4f, 0xdb, 0xce, 0xf1, 0x8f, 0x1d, 0x3e, 0x16,
- 0xff, 0x63, 0x45, 0x35, 0x3f, 0x6d, 0x14, 0xf6,
- 0x04, 0xe9, 0xff, 0xec, 0xd5, 0x31, 0xc3, 0xfd,
- 0xd5, 0x3d, 0xc7, 0x4c, 0x9c, 0x9d, 0x3f, 0xd5,
- 0xf7, 0xd1, 0xb6, 0xd6, 0x14, 0x48, 0x74, 0xb4,
- 0x14, 0xd9, 0x5b, 0x84, 0xd2, 0xf0, 0xbb, 0x50,
- 0xc0, 0x9f, 0x0b, 0x7f, 0xb1, 0xa2, 0xaa, 0x9f,
- 0xf7, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x89, 0xb6,
- 0x56, 0xc3, 0xf6, 0x51, 0x84, 0xfe, 0xb6, 0x0b,
- 0x7f, 0xb1, 0xa2, 0xbf, 0x9f, 0xd6, 0xc1, 0x6f,
- 0xf6, 0x34, 0x58, 0xd3, 0xe1, 0x6f, 0xf6, 0x34,
- 0x5a, 0xb3, 0xfe, 0xf7, 0x5b, 0x05, 0xbf, 0xd8,
- 0xd1, 0x41, 0x4a, 0xd8, 0x7e, 0xca, 0x30, 0x9f,
- 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x5c, 0x53, 0xfa,
- 0xd8, 0x2d, 0xfe, 0xc6, 0x8b, 0xa6, 0x7f, 0xfd,
- 0xdf, 0xb6, 0x9d, 0x82, 0x3e, 0xe7, 0xb0, 0x27,
- 0x4f, 0xd7, 0x2f, 0x72, 0x9f, 0xa3, 0xa7, 0x9b,
- 0xfd, 0x8d, 0x12, 0x64, 0xff, 0x0e, 0x3f, 0xad,
- 0x7b, 0xaa, 0x74, 0x09, 0xf1, 0xa8, 0xae, 0x7e,
- 0xe3, 0x9b, 0x96, 0xbc, 0xaf, 0x9d, 0x3e, 0xcd,
- 0x6d, 0x5e, 0x74, 0xff, 0xfb, 0xd8, 0x52, 0x9d,
- 0xcd, 0x65, 0x82, 0x10, 0x95, 0x0e, 0x3f, 0x8d,
- 0x13, 0x4f, 0xfe, 0xbf, 0xbf, 0xa4, 0x1a, 0xd1,
- 0x3b, 0xa3, 0xa7, 0x04, 0x21, 0x2a, 0x7e, 0x1f,
- 0x79, 0x5b, 0xa9, 0x56, 0x2f, 0x27, 0xd8, 0xa1,
- 0xcb, 0x99, 0xd3, 0xfe, 0x52, 0x35, 0x3b, 0x7e,
- 0x92, 0xa7, 0x4f, 0xf6, 0x7f, 0x20, 0x67, 0x1e,
- 0xe3, 0xa7, 0xff, 0x7b, 0xd4, 0xda, 0x77, 0x16,
- 0xd8, 0xec, 0xe8, 0xc4, 0x60, 0xe8, 0xf8, 0x27,
- 0x33, 0xf5, 0xcf, 0xb9, 0x4f, 0xd1, 0xd3, 0xda,
- 0x7b, 0x38, 0x3a, 0x7f, 0xb7, 0x74, 0x11, 0xe5,
- 0x5b, 0xa9, 0xd0, 0xb1, 0xf0, 0x2f, 0x91, 0xce,
- 0x08, 0x42, 0x74, 0xff, 0xfb, 0x15, 0xae, 0xa7,
- 0x39, 0xc5, 0x71, 0x48, 0xc5, 0x58, 0xbc, 0x8c,
- 0x4c, 0xd7, 0x70, 0x90, 0xa2, 0x14, 0xfe, 0x11,
- 0xf1, 0xea, 0x38, 0xe9, 0x9d, 0x65, 0xe2, 0xe6,
- 0xde, 0x42, 0x52, 0xe9, 0x0b, 0xf0, 0xb1, 0x58,
- 0x8b, 0xd9, 0x7a, 0x79, 0x58, 0x75, 0x6a, 0x36,
- 0x40, 0x4d, 0x67, 0xd8, 0xa1, 0xcb, 0x99, 0xd3,
- 0xff, 0x65, 0x3a, 0x8f, 0x03, 0x4a, 0x7d, 0xcc,
- 0xe9, 0xfb, 0xda, 0xc1, 0x08, 0x4e, 0x95, 0x99,
- 0x7a, 0x0b, 0xe7, 0x4b, 0xbb, 0x0b, 0x6a, 0x94,
- 0xae, 0x49, 0x87, 0x32, 0xb6, 0xf8, 0x8e, 0x5d,
- 0xf8, 0x59, 0x09, 0x3a, 0x8e, 0xf9, 0x85, 0x8d,
- 0x49, 0xf4, 0x77, 0x7c, 0xf5, 0xec, 0xfe, 0xb6,
- 0x0b, 0x7f, 0xb1, 0xa2, 0x35, 0x9f, 0x0b, 0x7f,
- 0xb1, 0xa2, 0xa5, 0x9b, 0xd8, 0xd1, 0x0d, 0x4a,
- 0xd8, 0x7a, 0x3e, 0x61, 0x3f, 0xf5, 0xbd, 0xd6,
- 0xc1, 0x6f, 0xf6, 0x34, 0x47, 0xd3, 0xfa, 0xd8,
- 0x2d, 0xfe, 0xc6, 0x8b, 0x1e, 0x7e, 0xb9, 0x7b,
- 0x94, 0xfd, 0x1d, 0x3f, 0xdd, 0xfe, 0x6b, 0xfa,
- 0xd7, 0x9d, 0x3d, 0xca, 0xb6, 0x27, 0x4f, 0xff,
- 0xf2, 0x0f, 0x73, 0x8c, 0xa5, 0x36, 0xd4, 0xde,
- 0xab, 0xef, 0x9d, 0x1b, 0x44, 0x45, 0x08, 0xa7,
- 0xc2, 0xdf, 0xec, 0x68, 0xb4, 0x27, 0xe5, 0xc0,
- 0xeb, 0xa9, 0xc9, 0xd3, 0xe4, 0xd6, 0x51, 0x0e,
- 0x9f, 0xfe, 0xcd, 0x57, 0x16, 0xa2, 0x2e, 0xca,
- 0x51, 0x0e, 0x87, 0x8f, 0xd7, 0xa4, 0xb0, 0x88,
- 0xc9, 0xc8, 0x53, 0x4f, 0xf7, 0x73, 0x35, 0x4f,
- 0xed, 0xd3, 0xa7, 0xf6, 0x51, 0x6d, 0xd3, 0x6a,
- 0x3a, 0x7f, 0x3b, 0x06, 0xbd, 0x47, 0x8e, 0x9f,
- 0xec, 0xc0, 0xe3, 0x36, 0x04, 0xe8, 0xc4, 0x4d,
- 0x3e, 0x69, 0x53, 0x29, 0xec, 0xa7, 0xe8, 0xe9,
- 0xfd, 0x77, 0x7d, 0xbd, 0xd9, 0x53, 0xa5, 0x65,
- 0xe2, 0xb8, 0xc4, 0x31, 0xe2, 0x18, 0x18, 0x47,
- 0x48, 0x7c, 0xd4, 0x9b, 0x50, 0xd3, 0x5f, 0x30,
- 0x04, 0x82, 0x7e, 0xb8, 0xdf, 0x1d, 0x45, 0x8e,
- 0x9e, 0xca, 0x7e, 0x8e, 0x95, 0xcb, 0x87, 0xa5,
- 0xd3, 0x29, 0xf0, 0xb7, 0xfb, 0x1a, 0x2d, 0x69,
- 0xff, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0xa0,
- 0xe5, 0x65, 0xe2, 0x28, 0xb0, 0xb1, 0x46, 0x13,
- 0xff, 0xac, 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d,
- 0x14, 0x5c, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2,
- 0xea, 0x87, 0x2f, 0x8d, 0xb4, 0x23, 0x36, 0x4c,
- 0xa4, 0xca, 0x4b, 0xc7, 0xe6, 0x39, 0x0a, 0x9c,
- 0xe9, 0x4a, 0x7c, 0x2d, 0xfe, 0xc6, 0x88, 0x86,
- 0x75, 0x33, 0x83, 0xa5, 0x6c, 0x3c, 0xc7, 0xcc,
- 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x11, 0xb4,
- 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x9b, 0x9f,
- 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x54, 0x13, 0xfa,
- 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0x9a, 0x7c, 0x2d,
- 0xfe, 0xc6, 0x8a, 0xc2, 0x7d, 0xb0, 0xf1, 0x78,
- 0x9d, 0x3f, 0xce, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2,
- 0x3f, 0x9d, 0x88, 0xf1, 0xd2, 0xb6, 0x22, 0xd5,
- 0x8c, 0x3c, 0xa7, 0xa8, 0x33, 0xff, 0xac, 0xaf,
- 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13, 0x7c, 0xff,
- 0xca, 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x3f,
- 0x4f, 0xcb, 0xde, 0xe4, 0x5c, 0xab, 0xf8, 0xf9,
- 0xd3, 0xff, 0xc8, 0x88, 0x88, 0x88, 0x88, 0x8f,
- 0xd4, 0xe9, 0xf0, 0xed, 0xef, 0x51, 0x53, 0x04,
- 0x25, 0x46, 0x1b, 0xd0, 0x93, 0xca, 0xf2, 0xac,
- 0x68, 0x21, 0x11, 0x8f, 0x58, 0x53, 0x4f, 0xc3,
- 0xed, 0x4d, 0x89, 0xd3, 0xcf, 0x2b, 0x6e, 0x3a,
- 0x7f, 0x51, 0x15, 0x6e, 0x79, 0x43, 0xa4, 0x28,
- 0x7a, 0xfb, 0x23, 0x9d, 0xcd, 0x70, 0xe9, 0xea,
- 0xeb, 0x6b, 0x1d, 0x08, 0x98, 0x6e, 0xc9, 0xc6,
- 0x10, 0x3d, 0x26, 0xd0, 0xe4, 0xf7, 0xac, 0x0a,
- 0x8e, 0x9b, 0xfa, 0x74, 0x09, 0xb8, 0x51, 0x1c,
- 0xe0, 0x84, 0x27, 0x4f, 0x3d, 0xdd, 0xa1, 0x56,
- 0x2f, 0x27, 0x9f, 0xd6, 0xd8, 0xe8, 0x44, 0x47,
- 0xd0, 0xf2, 0xf3, 0x19, 0xff, 0x9e, 0xbf, 0x9c,
- 0xed, 0xeb, 0x26, 0xbc, 0xe9, 0xe4, 0xd5, 0x58,
- 0xd1, 0x07, 0x40, 0x9f, 0xae, 0x92, 0x26, 0x1e,
- 0x0e, 0x98, 0x21, 0x3a, 0x1c, 0x6b, 0x02, 0x2d,
- 0x3d, 0x54, 0xda, 0xe2, 0xac, 0x68, 0x67, 0xd5,
- 0x07, 0x8e, 0x6a, 0x74, 0x6c, 0xf7, 0x81, 0x33,
- 0x9c, 0x10, 0x84, 0xa8, 0x2a, 0xc5, 0xe4, 0xf6,
- 0xc3, 0xb5, 0x8a, 0x86, 0x37, 0x9b, 0x19, 0x8d,
- 0xa6, 0xcf, 0x48, 0x66, 0x75, 0xee, 0x7b, 0x8f,
- 0xef, 0x27, 0x4f, 0xfc, 0x9d, 0xe7, 0xa8, 0xfa,
- 0xc9, 0xde, 0x4e, 0x8e, 0x4f, 0xaa, 0xa4, 0x73,
- 0xf2, 0xc9, 0x83, 0x4d, 0x9d, 0x3f, 0x6b, 0x16,
- 0xea, 0x28, 0xf1, 0x01, 0x4f, 0xbf, 0xbc, 0x51,
- 0x0d, 0x10, 0x15, 0x8d, 0xd4, 0xf9, 0x39, 0xdb,
- 0xf5, 0x3a, 0x7f, 0x0a, 0xd5, 0xdf, 0x75, 0xb3,
- 0xa7, 0x9f, 0xe4, 0x50, 0xa9, 0x82, 0x12, 0xa1,
- 0x0d, 0xc0, 0x48, 0xa7, 0xef, 0x17, 0x3b, 0xbb,
- 0x2a, 0xc6, 0x82, 0x11, 0x3b, 0xec, 0x23, 0xdb,
- 0x37, 0x51, 0x34, 0x53, 0x7c, 0x23, 0x27, 0xd7,
- 0xea, 0xff, 0x04, 0xd1, 0x03, 0xcf, 0xfa, 0x97,
- 0xbc, 0x80, 0x26, 0x93, 0x83, 0xa7, 0x78, 0xbc,
- 0x74, 0xc1, 0x09, 0xd3, 0xf8, 0x77, 0x8b, 0x81,
- 0x75, 0x98, 0xd8, 0x84, 0x6e, 0x49, 0xc2, 0x2f,
- 0x45, 0xca, 0x7f, 0xf6, 0x29, 0x5e, 0xec, 0x16,
- 0xff, 0x63, 0x44, 0x31, 0x14, 0x3f, 0x9e, 0x94,
- 0x4f, 0xd8, 0x2d, 0xfe, 0xc6, 0x88, 0x2a, 0x7b,
- 0x55, 0x4e, 0x4a, 0x9d, 0xe2, 0xf1, 0x53, 0xd7,
- 0xf7, 0xee, 0x95, 0x3f, 0xb6, 0xf6, 0x6a, 0xa9,
- 0xc9, 0x50, 0x54, 0xfd, 0x8c, 0x94, 0x45, 0x15,
- 0x30, 0x42, 0x54, 0xfd, 0xd4, 0xeb, 0xdb, 0x12,
- 0xa3, 0x13, 0x0c, 0x62, 0x25, 0x0d, 0xd0, 0x93,
- 0x93, 0x4e, 0x85, 0x04, 0xa8, 0x11, 0x69, 0xb6,
- 0x25, 0x58, 0xfc, 0xa5, 0xee, 0x4f, 0x66, 0x91,
- 0xd9, 0xcf, 0xf9, 0x1d, 0xfd, 0xca, 0x8a, 0x54,
- 0xe9, 0xff, 0x26, 0xa8, 0x8b, 0xb8, 0x4e, 0x50,
- 0xe9, 0xff, 0xf9, 0x6f, 0xf7, 0x7d, 0x00, 0xc7,
- 0xaf, 0xd5, 0xfe, 0x09, 0xa2, 0xfb, 0x9f, 0x6f,
- 0x5d, 0xc7, 0x1d, 0x3f, 0xee, 0xed, 0xda, 0xa6,
- 0x0e, 0xea, 0x74, 0xfe, 0xd7, 0x20, 0xf5, 0xd4,
- 0xc3, 0xc4, 0x03, 0x3b, 0xc5, 0xc7, 0x88, 0x06,
- 0x30, 0xfa, 0x6f, 0x42, 0x9b, 0xdc, 0x78, 0x80,
- 0x67, 0xbf, 0xaf, 0xb8, 0xf1, 0x00, 0xcf, 0xed,
- 0xb5, 0x33, 0x9e, 0x50, 0xf1, 0x00, 0xce, 0xdf,
- 0x78, 0x3c, 0x40, 0x31, 0xc2, 0x2e, 0xd4, 0x45,
- 0x42, 0xf5, 0xc8, 0x13, 0x85, 0x34, 0x78, 0x80,
- 0x60, 0xf1, 0x00, 0xcc, 0x8a, 0x3c, 0x40, 0x31,
- 0xc1, 0xb9, 0xd8, 0xbc, 0xf6, 0xd5, 0xc2, 0x1e,
- 0x20, 0x19, 0xda, 0xf6, 0x3c, 0x40, 0x33, 0xfe,
- 0xef, 0xba, 0xd4, 0xdb, 0x78, 0x9e, 0x20, 0x19,
- 0xbf, 0x83, 0xc4, 0x03, 0x3f, 0xbb, 0xe1, 0xad,
- 0x53, 0x93, 0xc4, 0x03, 0x3e, 0xdd, 0xdf, 0xef,
- 0x27, 0x88, 0x06, 0x6d, 0xd4, 0xf1, 0x00, 0xc0,
- 0x9e, 0xd6, 0x8d, 0xe7, 0xda, 0xea, 0x3e, 0xe3,
- 0x44, 0x03, 0x37, 0x28, 0x78, 0x80, 0x6c, 0x6d,
- 0x67, 0xdb, 0x45, 0x7f, 0x07, 0x88, 0x06, 0x7a,
- 0xff, 0xeb, 0x1e, 0x20, 0x19, 0xc8, 0x2c, 0x78,
- 0x80, 0x67, 0xfd, 0x8f, 0xd7, 0x84, 0xce, 0xf3,
- 0x53, 0xc4, 0x03, 0x3e, 0xbf, 0xdc, 0xe4, 0x3c,
- 0x40, 0x31, 0x88, 0x81, 0xa2, 0x6c, 0xc3, 0xc9,
- 0xe2, 0x01, 0x87, 0x2a, 0x94, 0xe0, 0x8f, 0x21,
- 0x35, 0xb5, 0x6a, 0x19, 0xf2, 0x69, 0x52, 0xed,
- 0x42, 0x9e, 0xf2, 0x29, 0xf6, 0x6a, 0xbe, 0xf9,
- 0xe2, 0x01, 0x9f, 0xdc, 0x23, 0x2c, 0x29, 0xa3,
- 0xc4, 0x03, 0xc1, 0xb4, 0x9c, 0x28, 0x13, 0xc4,
- 0x03, 0x0c, 0x7e, 0xe2, 0xa1, 0x3d, 0xbe, 0xba,
- 0xa7, 0x88, 0x06, 0x7e, 0xf5, 0x9d, 0x8f, 0xb8,
- 0xf1, 0x00, 0xc6, 0x22, 0x2b, 0x92, 0x0b, 0xcb,
- 0xe7, 0xff, 0x7b, 0xdc, 0x51, 0x2b, 0x6a, 0xde,
- 0x3c, 0x9e, 0x20, 0x19, 0x87, 0x93, 0xc4, 0x03,
- 0x3e, 0xfd, 0x57, 0x6f, 0x9e, 0x20, 0x19, 0xfb,
- 0x7d, 0xbd, 0xd9, 0x53, 0xc4, 0x03, 0x08, 0x89,
- 0x3e, 0x91, 0xe8, 0xd6, 0x38, 0x5f, 0xe0, 0xc8,
- 0x6e, 0xac, 0x80, 0x2c, 0x14, 0x22, 0xf2, 0xfe,
- 0x49, 0xeb, 0x2b, 0x77, 0x51, 0xe0, 0xaf, 0x98,
- 0x83, 0x0e, 0xd9, 0xdf, 0xec, 0x68, 0x80, 0x6c,
- 0x8b, 0x69, 0xeb, 0xb7, 0x25, 0xc2, 0x8e, 0x9b,
- 0x94, 0x2a, 0x57, 0x4a, 0x9d, 0x44, 0x78, 0xe9,
- 0x82, 0x12, 0xa3, 0x67, 0xb5, 0x73, 0x16, 0x58,
- 0x48, 0x23, 0x93, 0x95, 0xba, 0x95, 0x63, 0xc1,
- 0x9e, 0xd5, 0x6e, 0x2f, 0x3a, 0x1e, 0x65, 0x5b,
- 0x38, 0x9d, 0xa9, 0x27, 0xbb, 0x38, 0xe6, 0x18,
- 0xe0, 0x96, 0xcf, 0xc2, 0xb3, 0x90, 0x5e, 0x3a,
- 0x7f, 0xce, 0xa8, 0x1d, 0xc5, 0x20, 0xdd, 0x3a,
- 0x7e, 0x04, 0x23, 0xbc, 0xa1, 0x53, 0xcb, 0x53,
- 0xd6, 0x3a, 0x7d, 0x8b, 0x39, 0x1f, 0x3a, 0x7b,
- 0x3a, 0x8e, 0x2a, 0x04, 0xfa, 0xfa, 0x47, 0x70,
- 0x51, 0x08, 0x99, 0xb6, 0x16, 0xd1, 0x03, 0xe1,
- 0x31, 0x3d, 0xbe, 0xea, 0xa7, 0x4e, 0xbd, 0x7a,
- 0xa9, 0xd3, 0xff, 0x6a, 0xb9, 0xc2, 0x3f, 0x5c,
- 0x7f, 0x47, 0x42, 0x1f, 0x47, 0x91, 0x4f, 0xbd,
- 0x77, 0x1c, 0x21, 0xd3, 0x56, 0xa7, 0x4e, 0x08,
- 0x42, 0x74, 0xdc, 0xf9, 0x56, 0x2f, 0x20, 0x4f,
- 0x5e, 0xa6, 0x53, 0xbf, 0x9c, 0x2a, 0x1c, 0x8b,
- 0xd5, 0x42, 0x05, 0x7c, 0x86, 0x7f, 0x6b, 0xb8,
- 0xff, 0x20, 0xb8, 0xe9, 0xfe, 0xee, 0x2e, 0xcb,
- 0x04, 0x21, 0x2a, 0x72, 0xbf, 0x47, 0x45, 0x0f,
- 0x55, 0x71, 0xd4, 0x22, 0x39, 0xf6, 0x71, 0xf0,
- 0x8b, 0x9a, 0x9e, 0x74, 0xcb, 0x54, 0xe9, 0xfa,
- 0xd8, 0xbb, 0x7d, 0xe3, 0x0d, 0x60, 0x22, 0xb3,
- 0xdc, 0x65, 0x3c, 0xe9, 0xff, 0x93, 0x3a, 0xea,
- 0x67, 0x7a, 0x81, 0x3a, 0x5b, 0x14, 0x55, 0x75,
- 0x1f, 0x44, 0x30, 0xf3, 0x69, 0x42, 0xe8, 0xdb,
- 0x78, 0x8f, 0xee, 0xe9, 0x7b, 0x1d, 0xed, 0x00,
- 0x69, 0x64, 0x54, 0x8e, 0x87, 0x94, 0x0e, 0xc2,
- 0x2b, 0x51, 0xe2, 0x2e, 0x8c, 0x26, 0x7e, 0xef,
- 0x39, 0xc7, 0xb8, 0xe9, 0xf0, 0x2b, 0x39, 0x2e,
- 0x65, 0x46, 0x1e, 0xd8, 0x25, 0xd3, 0xff, 0x86,
- 0xef, 0x6f, 0xf0, 0x72, 0xbb, 0x4e, 0x9d, 0x20,
- 0x4d, 0x10, 0x2c, 0xb4, 0x6a, 0x05, 0x25, 0xbd,
- 0x1b, 0xb0, 0x8f, 0x4f, 0xfb, 0x6b, 0xf4, 0xd8,
- 0x36, 0xe7, 0x94, 0x2a, 0x7f, 0xf6, 0xab, 0xef,
- 0x80, 0xa4, 0xce, 0xe9, 0x7c, 0xe8, 0x44, 0x49,
- 0xed, 0x16, 0x73, 0xdd, 0x71, 0xd0, 0x89, 0xc0,
- 0x2a, 0x10, 0xf4, 0x85, 0xd5, 0xe4, 0x53, 0xf9,
- 0xcb, 0x67, 0x7e, 0x98, 0x74, 0xff, 0xe1, 0x6e,
- 0xe2, 0xee, 0xe2, 0x0a, 0x54, 0xe9, 0xfd, 0xeb,
- 0x53, 0x15, 0x95, 0x3a, 0x30, 0xfe, 0x57, 0x23,
- 0xcf, 0xff, 0xc8, 0x1a, 0xe9, 0xf6, 0xdd, 0x00,
- 0xb8, 0xca, 0x6d, 0x47, 0x46, 0xd1, 0x07, 0xa2,
- 0x39, 0xdc, 0x78, 0x9d, 0x3e, 0xe7, 0xfb, 0x97,
- 0x07, 0x42, 0x1e, 0x2d, 0xe3, 0x73, 0xc8, 0xa7,
- 0xd6, 0x3a, 0x11, 0x3d, 0xb7, 0x46, 0x5d, 0x56,
- 0x8d, 0x11, 0x4f, 0x73, 0xef, 0xd4, 0xe9, 0x82,
- 0x13, 0xa2, 0xa6, 0xe4, 0x24, 0x73, 0xf5, 0x77,
- 0x4f, 0xca, 0x15, 0x63, 0x43, 0x38, 0x21, 0x09,
- 0x53, 0xce, 0xd6, 0x31, 0x56, 0x2f, 0x27, 0xd9,
- 0xc6, 0xf9, 0xa9, 0xd2, 0xf1, 0x3d, 0x8e, 0x97,
- 0xcf, 0xdd, 0x7e, 0xab, 0x66, 0x8e, 0x9f, 0x3d,
- 0x73, 0xde, 0x3e, 0x74, 0xff, 0xb1, 0xb8, 0xc1,
- 0x0f, 0xd1, 0x63, 0xa6, 0x73, 0xc5, 0x43, 0xe7,
- 0xa9, 0xd3, 0xd8, 0x14, 0x52, 0x7c, 0x20, 0x61,
- 0x13, 0x1f, 0xc2, 0x6f, 0x86, 0x9c, 0xff, 0xae,
- 0xa3, 0xfd, 0x4a, 0x52, 0xf6, 0x3a, 0x7e, 0xef,
- 0xdd, 0xa7, 0xb8, 0xe9, 0xc1, 0x08, 0x4a, 0x9c,
- 0x0a, 0x72, 0x55, 0x8b, 0xc9, 0xfe, 0xef, 0xf2,
- 0x03, 0x93, 0x97, 0xce, 0x8e, 0x11, 0xe6, 0xa4,
- 0x1e, 0x52, 0xb4, 0x59, 0x38, 0x21, 0x09, 0x62,
- 0x10, 0x9f, 0x0b, 0x7f, 0xb1, 0x62, 0x10, 0xb1,
- 0xa9, 0x9c, 0x10, 0x84, 0xb1, 0x07, 0xc1, 0x62,
- 0x0f, 0xb1, 0xa9, 0x99, 0x15, 0x88, 0x90, 0x66,
- 0x99, 0xf6, 0x93, 0x48, 0xa3, 0xa7, 0xbb, 0xb4,
- 0xba, 0x74, 0xe0, 0x53, 0x93, 0xa1, 0xe3, 0xc0,
- 0x51, 0x1c, 0xf9, 0x92, 0x88, 0xa2, 0xa7, 0xdd,
- 0xfe, 0xf7, 0x0a, 0x9b, 0x18, 0xa9, 0x82, 0x12,
- 0xa3, 0x0f, 0xd6, 0xa4, 0xba, 0x26, 0x08, 0xa4,
- 0xfe, 0xe8, 0x29, 0xcd, 0x32, 0xe0, 0xab, 0x1b,
- 0xb8, 0x44, 0xe0, 0x36, 0xcd, 0xf0, 0xd3, 0x9f,
- 0xfd, 0x44, 0xe6, 0xb9, 0x9c, 0x7f, 0x7e, 0xe9,
- 0xd3, 0xfa, 0xa0, 0xaa, 0xa1, 0xf7, 0xce, 0x84,
- 0x56, 0xb1, 0xb8, 0x7c, 0x0c, 0x75, 0x9e, 0x69,
- 0x54, 0xb9, 0xc1, 0x08, 0x4a, 0x9f, 0x3b, 0x9f,
- 0xef, 0x05, 0x58, 0xbc, 0x9f, 0xfe, 0xeb, 0xe0,
- 0x3f, 0xca, 0x75, 0xbd, 0xee, 0xf9, 0xd3, 0xff,
- 0xe7, 0x62, 0x5b, 0x8e, 0xa5, 0xed, 0x97, 0x76,
- 0x27, 0x4f, 0x6f, 0x8c, 0x51, 0xd0, 0x89, 0x81,
- 0xb8, 0xe3, 0xd4, 0xef, 0x56, 0x9f, 0xf5, 0x6a,
- 0x83, 0xa4, 0xb7, 0x1b, 0x3a, 0x7f, 0xdd, 0xf5,
- 0xa9, 0xe2, 0x3b, 0xe0, 0xe8, 0xd9, 0xfe, 0x28,
- 0xfa, 0x7e, 0xf1, 0xe3, 0x33, 0xa7, 0x4f, 0xff,
- 0x66, 0xab, 0x8b, 0x51, 0x17, 0x65, 0x28, 0x87,
- 0x4f, 0xed, 0x2f, 0x75, 0xba, 0xbd, 0x9e, 0xbc,
- 0xe8, 0xe1, 0x17, 0xdd, 0x2b, 0xd2, 0x84, 0xff,
- 0xfe, 0xee, 0xb2, 0x9b, 0x4d, 0x6f, 0x94, 0x75,
- 0x82, 0x10, 0x95, 0x3d, 0xc6, 0x65, 0xd2, 0xa7,
- 0x3b, 0xb7, 0x9a, 0x21, 0x99, 0xc1, 0x08, 0x4a,
- 0x9d, 0x9d, 0x62, 0xac, 0x5e, 0x4f, 0xfb, 0x1e,
- 0xce, 0x3d, 0xdd, 0x47, 0x8e, 0x8e, 0x4f, 0xa3,
- 0xa5, 0x30, 0x89, 0xab, 0x3c, 0xc4, 0xf9, 0x18,
- 0xc2, 0xba, 0x7b, 0x7a, 0xda, 0x1d, 0x3f, 0xaf,
- 0xc1, 0xe7, 0x9d, 0xf4, 0xe9, 0xff, 0xf2, 0x3b,
- 0x7c, 0x50, 0x1a, 0xe0, 0xb7, 0xfb, 0x1a, 0x20,
- 0xc8, 0xa2, 0x25, 0x74, 0x6b, 0x3f, 0x97, 0xf2,
- 0xab, 0xf8, 0x28, 0x74, 0x39, 0x30, 0xfd, 0xc2,
- 0xdb, 0x44, 0x73, 0xff, 0xc9, 0xd7, 0x80, 0x5b,
- 0x7d, 0xce, 0x33, 0xb7, 0x4e, 0x9c, 0x82, 0xb1,
- 0xd0, 0x8b, 0x8b, 0xf9, 0x0e, 0x0d, 0xc7, 0x0f,
- 0xf1, 0xa9, 0x5e, 0x6c, 0xbe, 0xab, 0x3f, 0xb5,
- 0xb5, 0xdb, 0xd3, 0x90, 0xa9, 0x28, 0xe9, 0xfd,
- 0x5c, 0xed, 0xd1, 0x4b, 0x6c, 0xf1, 0x41, 0x35,
- 0x9e, 0x1b, 0xdf, 0x71, 0xd3, 0xfb, 0xae, 0xee,
- 0x29, 0x18, 0xe9, 0xca, 0xe3, 0x0e, 0x84, 0x3f,
- 0x0c, 0x23, 0xf3, 0x19, 0xff, 0x5f, 0xaa, 0x82,
- 0x3c, 0xab, 0x75, 0x3a, 0x7f, 0xe4, 0xef, 0xd1,
- 0x39, 0xb0, 0xd6, 0xa5, 0x47, 0x08, 0x85, 0x52,
- 0x14, 0xfa, 0x9b, 0xdb, 0xf5, 0x3a, 0x6e, 0x50,
- 0xe9, 0xf8, 0x7f, 0xa0, 0xa7, 0x27, 0x4d, 0xe2,
- 0x74, 0xb6, 0x73, 0x16, 0x92, 0x63, 0xa4, 0xa3,
- 0xa7, 0x62, 0xfd, 0xb6, 0x89, 0x41, 0x16, 0xa2,
- 0x0f, 0x8f, 0x02, 0x1f, 0x3f, 0xfe, 0xbd, 0x00,
- 0xf1, 0x1f, 0xe5, 0x2c, 0x10, 0x84, 0xe8, 0x72,
- 0xb0, 0x0e, 0x21, 0x79, 0xb8, 0x58, 0xac, 0x49,
- 0xd8, 0x5e, 0xe9, 0x76, 0x7f, 0x27, 0x75, 0xfd,
- 0xbf, 0x0e, 0x9f, 0xc2, 0xee, 0xed, 0xd4, 0xc3,
- 0xa7, 0xd9, 0xce, 0x62, 0xc7, 0x4f, 0xd5, 0xc5,
- 0xdd, 0x47, 0xce, 0x92, 0x62, 0x22, 0x3a, 0x65,
- 0xa2, 0x79, 0xeb, 0xfc, 0x5c, 0x74, 0xf2, 0x5e,
- 0xbd, 0x54, 0xa9, 0xf3, 0xac, 0x10, 0x84, 0xe8,
- 0xe9, 0xe7, 0xde, 0x4f, 0x1c, 0x22, 0x4f, 0x1c,
- 0x21, 0x49, 0xd2, 0x73, 0x0b, 0xab, 0xe1, 0x8f,
- 0x3f, 0x0d, 0xfc, 0xe7, 0x58, 0xe9, 0xee, 0x38,
- 0x45, 0xc7, 0x4f, 0xff, 0x92, 0x88, 0xa6, 0x4d,
- 0x60, 0xb7, 0xfb, 0x1a, 0x2f, 0x89, 0xfc, 0x1f,
- 0xd5, 0x53, 0x1e, 0x3a, 0x7f, 0xfe, 0xcd, 0x02,
- 0xe4, 0x5d, 0xbe, 0xf2, 0x3b, 0x45, 0x61, 0x53,
- 0x6b, 0x0e, 0x9f, 0x0e, 0xde, 0xf5, 0x1a, 0x61,
- 0x39, 0xed, 0x5e, 0x9e, 0x69, 0x84, 0xe6, 0xe5,
- 0x0d, 0x40, 0x9c, 0xfe, 0xef, 0xdd, 0xd2, 0x0f,
- 0x26, 0xa0, 0x4e, 0x7f, 0x57, 0x29, 0xba, 0xde,
- 0xf1, 0xa6, 0x13, 0x9b, 0x38, 0x34, 0xc2, 0x73,
- 0x04, 0x27, 0x98, 0x4e, 0x31, 0x34, 0xe7, 0xcd,
- 0x36, 0x5c, 0xa2, 0x3a, 0xa0, 0xae, 0x42, 0x09,
- 0x1c, 0xb4, 0x59, 0x84, 0xec, 0x7c, 0xf2, 0xdb,
- 0xe9, 0xfc, 0x06, 0x3c, 0xa8, 0xaa, 0xa8, 0x6d,
- 0x4a, 0x55, 0x8e, 0x15, 0xb2, 0x31, 0x2d, 0x16,
- 0xf5, 0x2a, 0xe2, 0x7d, 0xc6, 0x0e, 0xee, 0x9d,
- 0x3e, 0xee, 0x03, 0x8b, 0x1d, 0x3f, 0xb9, 0x07,
- 0xae, 0x5f, 0xf7, 0x8e, 0x8e, 0x9f, 0x0e, 0x8a,
- 0x21, 0x17, 0x20, 0xf2, 0x5c, 0x8e, 0xd1, 0xbe,
- 0x11, 0x53, 0xff, 0x95, 0xaa, 0xef, 0xaf, 0xbb,
- 0x5b, 0xae, 0xce, 0x9f, 0xff, 0xdd, 0xc7, 0xf2,
- 0xbf, 0xda, 0x6d, 0x35, 0x4b, 0xfd, 0x47, 0x4e,
- 0x1a, 0xd4, 0xf1, 0x01, 0xcf, 0xff, 0xdb, 0xd0,
- 0x22, 0x94, 0x40, 0x30, 0x5b, 0xfd, 0x8d, 0x10,
- 0x1d, 0x8d, 0x44, 0xff, 0xff, 0xbb, 0xee, 0xce,
- 0xac, 0xec, 0x7d, 0xc0, 0xa7, 0x36, 0x08, 0x42,
- 0x54, 0xfe, 0x4c, 0x16, 0xff, 0x63, 0x44, 0x13,
- 0x3f, 0xc9, 0xac, 0x16, 0xff, 0x63, 0x45, 0xf3,
- 0x3e, 0xda, 0xee, 0xe5, 0x78, 0x3f, 0xa6, 0x3a,
- 0x9f, 0xf3, 0xde, 0xfa, 0xfe, 0x6b, 0xbe, 0xb8,
- 0xe9, 0xc1, 0x08, 0x4a, 0x9f, 0xb5, 0x4c, 0x6f,
- 0x12, 0xac, 0x5e, 0x43, 0xc8, 0x99, 0xeb, 0x04,
- 0xff, 0xcf, 0x29, 0x1f, 0xaf, 0x71, 0xe0, 0x5c,
- 0x74, 0xff, 0xf0, 0x2f, 0xf4, 0x06, 0xa6, 0xf9,
- 0xe5, 0x05, 0xc7, 0x4e, 0x08, 0x42, 0x54, 0xfe,
- 0x07, 0x94, 0xee, 0x3f, 0xa2, 0xac, 0x5e, 0x4f,
- 0xff, 0xcb, 0xd0, 0x0d, 0x4d, 0xf1, 0xc6, 0x04,
- 0x0d, 0x57, 0x1e, 0x3a, 0x5f, 0x44, 0x54, 0xde,
- 0x89, 0x0e, 0x55, 0x11, 0xb8, 0x6d, 0x09, 0x22,
- 0x92, 0x35, 0x18, 0xcc, 0xff, 0xb3, 0x48, 0x35,
- 0xa2, 0x77, 0x47, 0x88, 0x22, 0x7f, 0x26, 0x0b,
- 0x7f, 0xb1, 0xa2, 0x08, 0xb1, 0xe4, 0xcf, 0xee,
- 0xfd, 0x04, 0x76, 0x13, 0xa3, 0x93, 0xfc, 0xea,
- 0x5c, 0xff, 0x27, 0x74, 0x0e, 0x53, 0xdf, 0x3a,
- 0x7f, 0xfb, 0xc3, 0xac, 0xa2, 0x6f, 0x5d, 0xca,
- 0x6c, 0xe8, 0x72, 0x21, 0xfa, 0x73, 0x3f, 0xb4,
- 0x0a, 0xaa, 0x1f, 0x7c, 0xe9, 0xed, 0xad, 0xb0,
- 0x9d, 0x3f, 0xfe, 0xbd, 0xee, 0xa6, 0x52, 0xc9,
- 0xac, 0xa5, 0xe2, 0x74, 0xfb, 0x35, 0x50, 0x6b,
- 0xc1, 0xfc, 0x82, 0x47, 0x3f, 0x35, 0x36, 0xbf,
- 0xbb, 0xa7, 0x4f, 0xca, 0x4b, 0x9d, 0x31, 0xe3,
- 0xa3, 0x83, 0xe3, 0xd9, 0x94, 0xe1, 0x06, 0xa7,
- 0x4f, 0xfb, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x88,
- 0x46, 0x10, 0xf8, 0x6f, 0x1c, 0x9f, 0xfc, 0x98,
- 0xf8, 0x3a, 0xdf, 0x6f, 0x76, 0x54, 0xe9, 0xff,
- 0xef, 0xf7, 0x81, 0xca, 0x7a, 0xac, 0x10, 0x84,
- 0xe9, 0x67, 0x08, 0x9c, 0x59, 0x32, 0x70, 0x42,
- 0x12, 0xa7, 0xfb, 0x39, 0xf1, 0xc5, 0xd9, 0xc1,
- 0x56, 0x2f, 0x26, 0x08, 0x4a, 0x9c, 0x10, 0x84,
- 0xa9, 0xfb, 0xde, 0xe2, 0x89, 0x52, 0xac, 0x5e,
- 0x47, 0x51, 0x6e, 0x14, 0x85, 0xf3, 0x29, 0xf3,
- 0x6f, 0x80, 0x54, 0x55, 0x8d, 0x9c, 0xe0, 0x84,
- 0x25, 0x4e, 0xaa, 0x09, 0x56, 0x2f, 0x25, 0xce,
- 0xcf, 0xfb, 0x4a, 0xb3, 0xf7, 0x1d, 0x47, 0x7b,
- 0x1d, 0x3f, 0x81, 0x1e, 0x36, 0xb9, 0x38, 0x3a,
- 0x7f, 0x6a, 0x98, 0xbb, 0x35, 0x53, 0xa0, 0x51,
- 0x2f, 0x42, 0xce, 0x9b, 0xc2, 0x23, 0xbf, 0x21,
- 0x81, 0x39, 0xfb, 0x93, 0xaf, 0x73, 0xa7, 0xff,
- 0x65, 0xcf, 0xfb, 0xce, 0x32, 0x51, 0x14, 0x74,
- 0xfc, 0xdb, 0xad, 0x36, 0xb1, 0x53, 0xfc, 0x07,
- 0x71, 0xf7, 0x57, 0x77, 0x4e, 0x9e, 0x4f, 0x52,
- 0xe2, 0xa7, 0x04, 0x21, 0x2a, 0x7f, 0xf8, 0x14,
- 0xe7, 0x33, 0xba, 0xa6, 0xd3, 0xaf, 0x15, 0x62,
- 0xf2, 0x58, 0xc8, 0x9e, 0x51, 0xf4, 0x22, 0x74,
- 0xce, 0x2b, 0x7d, 0x2f, 0x65, 0xd4, 0x86, 0xdc,
- 0xff, 0xf9, 0x58, 0xc9, 0xdf, 0xd5, 0x78, 0xbf,
- 0xc5, 0xc7, 0x4f, 0x93, 0x55, 0x5d, 0x87, 0x42,
- 0x1f, 0xe6, 0x95, 0x27, 0xff, 0xb6, 0xbb, 0x3b,
- 0xc7, 0x7c, 0x39, 0xdf, 0xba, 0x74, 0xff, 0xff,
- 0x71, 0x4d, 0x87, 0x2e, 0x36, 0xaf, 0xd5, 0x6f,
- 0x76, 0x3f, 0xa3, 0xa3, 0x11, 0x81, 0xea, 0x70,
- 0x8c, 0xf7, 0x07, 0x93, 0x5d, 0x08, 0x9e, 0x1d,
- 0x32, 0x5b, 0x96, 0xe3, 0x1b, 0x5a, 0x15, 0x42,
- 0x46, 0xa8, 0x57, 0x52, 0x14, 0xbc, 0xc2, 0x13,
- 0xb0, 0xbe, 0xac, 0xa9, 0xdd, 0x47, 0x99, 0x7c,
- 0x33, 0x03, 0x0e, 0x19, 0xcb, 0x93, 0xa7, 0x4f,
- 0xff, 0x67, 0x6d, 0xab, 0xbb, 0x7e, 0xb4, 0xce,
- 0x7c, 0xe9, 0x3e, 0xe3, 0xf0, 0xe0, 0x76, 0x7e,
- 0xa2, 0xdb, 0xa6, 0xd4, 0x74, 0xff, 0xba, 0x9a,
- 0xa7, 0xf3, 0xef, 0xd4, 0xe9, 0xff, 0xab, 0xfb,
- 0x1c, 0x7e, 0xc1, 0x08, 0x4e, 0x9f, 0xfe, 0xea,
- 0x38, 0x00, 0x75, 0xbe, 0xde, 0xec, 0xa9, 0xd1,
- 0x89, 0x82, 0xb1, 0x7d, 0x0f, 0xf9, 0x44, 0x9f,
- 0xc9, 0xd7, 0x77, 0x33, 0x93, 0xa7, 0xf3, 0xb0,
- 0x6b, 0xd4, 0x78, 0xe9, 0xff, 0xe4, 0x5c, 0x83,
- 0x60, 0x75, 0xdc, 0x7b, 0x62, 0x7b, 0xbd, 0xe7,
- 0xff, 0xb3, 0x49, 0xd6, 0xcd, 0x53, 0x63, 0xcb,
- 0x1d, 0x3e, 0xfa, 0xe7, 0x74, 0x74, 0xed, 0x7d,
- 0xcc, 0xe9, 0xfd, 0xaa, 0x6e, 0xdc, 0xfe, 0xce,
- 0x87, 0x93, 0x24, 0xe1, 0x7b, 0xa9, 0xba, 0x26,
- 0xbc, 0x7e, 0x7f, 0xfe, 0xee, 0x56, 0xf0, 0x32,
- 0x9f, 0xdc, 0x59, 0xc8, 0xf9, 0xd3, 0xfe, 0xca,
- 0xdf, 0x82, 0xdf, 0xec, 0x68, 0x81, 0xa7, 0xd9,
- 0xaa, 0x7b, 0x80, 0x45, 0x27, 0x57, 0x67, 0xff,
- 0xff, 0xec, 0xd5, 0x3f, 0xb7, 0x40, 0xa8, 0xff,
- 0xe9, 0x76, 0x70, 0x06, 0x2b, 0xfa, 0xfb, 0x8f,
- 0x10, 0x5c, 0xff, 0xbf, 0xee, 0xb7, 0xf0, 0x05,
- 0xd0, 0x9e, 0x20, 0xb9, 0xff, 0xa9, 0xba, 0x6d,
- 0x3b, 0xa0, 0x2e, 0x84, 0xf1, 0x05, 0xcf, 0xe4,
- 0xdf, 0x74, 0x05, 0xd0, 0x9e, 0x20, 0xb9, 0xf9,
- 0x59, 0xc0, 0x17, 0x42, 0x78, 0x82, 0xe7, 0xff,
- 0xfb, 0xfb, 0xdd, 0xa8, 0x0a, 0xb5, 0x36, 0x3b,
- 0xba, 0xf6, 0x04, 0xf1, 0x05, 0xcc, 0xf8, 0x1c,
- 0x27, 0x38, 0xc9, 0xe2, 0xab, 0xe8, 0x7d, 0x3e,
- 0x8a, 0x2a, 0x8e, 0xec, 0xa3, 0x79, 0xef, 0x1e,
- 0x7c, 0xe9, 0xff, 0xa9, 0xba, 0x6d, 0x3b, 0xa0,
- 0x2e, 0x84, 0xf1, 0x05, 0xcf, 0xf2, 0xd5, 0x6d,
- 0xbc, 0x05, 0xd0, 0x9e, 0x20, 0xb9, 0xf6, 0xaa,
- 0x8a, 0x01, 0x91, 0x40, 0x0a, 0xac, 0xff, 0xe0,
- 0x1a, 0x9b, 0x64, 0xd5, 0x40, 0xba, 0x13, 0xc4,
- 0x17, 0x3f, 0xff, 0xf7, 0x7b, 0xb5, 0x01, 0x7e,
- 0x01, 0x56, 0xa6, 0xc7, 0x77, 0x5e, 0xc0, 0x9e,
- 0x20, 0xb8, 0xc4, 0xc8, 0x1f, 0x41, 0xf5, 0xa9,
- 0xfe, 0xa6, 0xc7, 0x77, 0x5e, 0xc0, 0x9e, 0x20,
- 0xb9, 0xff, 0xef, 0xf7, 0xdd, 0x5a, 0x6f, 0x8e,
- 0x10, 0x50, 0xa9, 0xff, 0x63, 0x9d, 0x7d, 0x47,
- 0xaf, 0x2f, 0x9e, 0x20, 0xb8, 0x64, 0x74, 0x0a,
- 0x45, 0x54, 0x27, 0xfc, 0xdb, 0x1d, 0x7f, 0x35,
- 0x00, 0x27, 0x88, 0x2e, 0x7e, 0xa6, 0xe9, 0x4d,
- 0xf2, 0x68, 0x02, 0xe7, 0xd9, 0xc8, 0x17, 0x42,
- 0x78, 0x82, 0xe6, 0xcd, 0x31, 0xfa, 0x50, 0xf2,
- 0x1f, 0x47, 0x65, 0x61, 0x81, 0x3f, 0x2b, 0x38,
- 0x02, 0xe8, 0x4f, 0x10, 0x5c, 0xff, 0x9a, 0x9b,
- 0x1d, 0xdd, 0x7b, 0x02, 0x78, 0x82, 0xe6, 0xc0,
- 0x3d, 0x11, 0x75, 0x3e, 0x9f, 0xd7, 0xed, 0x5f,
- 0xd7, 0xdc, 0x78, 0x82, 0xe7, 0xfd, 0x9b, 0x5d,
- 0x9d, 0xce, 0x3d, 0xc7, 0x88, 0x2d, 0x47, 0x85,
- 0x1c, 0x2e, 0xdf, 0xf2, 0x59, 0xd8, 0xf8, 0x2b,
- 0x18, 0xc6, 0xa3, 0x1a, 0xbe, 0x16, 0x81, 0x70,
- 0x9f, 0x73, 0x5e, 0x79, 0x43, 0x44, 0x17, 0x64,
- 0x40, 0xcf, 0xfb, 0x1d, 0x4f, 0x75, 0xc5, 0xc5,
- 0xef, 0x1d, 0x3f, 0x87, 0xb9, 0xc5, 0x2f, 0x09,
- 0xd3, 0xe7, 0xf5, 0xe3, 0xc9, 0xd3, 0xf6, 0x3d,
- 0xf4, 0x4b, 0x99, 0xd1, 0xb4, 0x46, 0x79, 0xa7,
- 0x4a, 0x27, 0x78, 0xbc, 0x74, 0xdc, 0xa1, 0xd3,
- 0xdb, 0x45, 0x61, 0xd0, 0x74, 0xfd, 0xf7, 0x74,
- 0x83, 0xc9, 0xd1, 0xc1, 0xb8, 0xe8, 0x54, 0xff,
- 0xfe, 0x4d, 0xf1, 0xd4, 0xbd, 0xb5, 0x8d, 0xc2,
- 0x30, 0x2a, 0x3a, 0x6e, 0x50, 0xe9, 0x92, 0xe9,
- 0xd3, 0xfd, 0x9a, 0xaa, 0x28, 0x1c, 0x58, 0xe9,
- 0xfd, 0x5c, 0xa6, 0xeb, 0x7b, 0xc7, 0x4c, 0x10,
- 0x95, 0x3f, 0xdd, 0xc5, 0xde, 0xea, 0xef, 0x83,
- 0xa1, 0x93, 0xf8, 0xd8, 0xd8, 0x8b, 0x29, 0x62,
- 0x84, 0x5c, 0xb0, 0xaf, 0x42, 0xdd, 0x17, 0xa9,
- 0xc8, 0x4d, 0x41, 0x16, 0x9c, 0x10, 0x84, 0xa9,
- 0x28, 0xab, 0x17, 0x93, 0xef, 0x5b, 0xfc, 0x4a,
- 0xb2, 0x36, 0x41, 0x85, 0xd4, 0xfe, 0x7f, 0x49,
- 0x94, 0xc7, 0x8e, 0x84, 0x6c, 0x63, 0x32, 0x32,
- 0xfb, 0xa7, 0xaf, 0x99, 0x6e, 0x35, 0x6a, 0x43,
- 0xcb, 0xe9, 0x21, 0xdd, 0x49, 0xac, 0x34, 0xaf,
- 0x96, 0x00, 0xb9, 0x2a, 0x7b, 0x19, 0x34, 0x74,
- 0xf6, 0x2b, 0x34, 0x74, 0xf7, 0xbc, 0x0b, 0x8e,
- 0x84, 0x3e, 0x27, 0xc7, 0xee, 0x08, 0x27, 0xee,
- 0xdf, 0xc2, 0xbd, 0xc7, 0x4f, 0xff, 0x3e, 0xee,
- 0xa0, 0x0a, 0xea, 0x5d, 0xd6, 0xde, 0x3a, 0x11,
- 0x10, 0x9b, 0x2f, 0x9e, 0x03, 0xc0, 0x04, 0xe9,
- 0xf9, 0xe5, 0x9c, 0xbc, 0x17, 0x8e, 0x99, 0xcf,
- 0x1d, 0x3e, 0xa6, 0x6d, 0xd5, 0x3a, 0x7f, 0xfa,
- 0x88, 0x0d, 0xb5, 0xdf, 0xe6, 0xb5, 0x4e, 0x4a,
- 0x9f, 0xdc, 0xe0, 0xb7, 0xfb, 0x1e, 0x20, 0x48,
- 0x72, 0x2d, 0x78, 0x27, 0x15, 0x29, 0xed, 0x3d,
- 0xfd, 0x3a, 0x79, 0xfa, 0xfe, 0x8e, 0x8c, 0x3c,
- 0x4a, 0x11, 0x4f, 0xee, 0xf8, 0x6b, 0x54, 0xe4,
- 0xe9, 0xc1, 0x08, 0x4f, 0x87, 0xd4, 0xef, 0xef,
- 0x05, 0xc3, 0xea, 0xc6, 0xa6, 0x38, 0x44, 0xaf,
- 0x2b, 0x93, 0xff, 0xec, 0xee, 0xee, 0xda, 0xba,
- 0xa5, 0xfe, 0xe7, 0x21, 0xd0, 0xf1, 0xfe, 0xdd,
- 0x25, 0x8b, 0x90, 0xab, 0x31, 0xc6, 0x99, 0x0c,
- 0xcd, 0xba, 0x7c, 0x66, 0x73, 0xed, 0xe9, 0x35,
- 0x52, 0xa7, 0x99, 0x35, 0x52, 0xa6, 0x08, 0x4a,
- 0x87, 0x1e, 0xee, 0x13, 0x84, 0x82, 0x6c, 0x09,
- 0x56, 0x35, 0xd3, 0xff, 0xec, 0xd2, 0x36, 0x67,
- 0x75, 0x4d, 0xa7, 0x5e, 0x3a, 0x39, 0x3f, 0x80,
- 0x92, 0xcf, 0xff, 0xe4, 0x5d, 0xbe, 0xf2, 0x06,
- 0xab, 0x8d, 0x4f, 0xee, 0xaa, 0x74, 0xfe, 0x59,
- 0xf7, 0x52, 0xf4, 0x13, 0xa7, 0x3b, 0xc4, 0xe9,
- 0xf3, 0xb3, 0x59, 0xc1, 0x52, 0xda, 0xc7, 0x83,
- 0xa1, 0xa9, 0xb9, 0x43, 0xa6, 0xe5, 0x0e, 0x9f,
- 0xbb, 0x7b, 0xb3, 0xb6, 0xd9, 0xac, 0xe4, 0x5a,
- 0x7f, 0xed, 0x53, 0x14, 0x0a, 0x73, 0x8f, 0xe8,
- 0xe9, 0xfc, 0xfb, 0x6c, 0x41, 0x4e, 0x0e, 0x9e,
- 0xe5, 0x5e, 0xea, 0x9f, 0xd6, 0x91, 0xa7, 0x2f,
- 0xe3, 0xe7, 0x42, 0x1e, 0xcf, 0x9d, 0x4e, 0x08,
- 0x42, 0x54, 0xfc, 0x99, 0x77, 0xb7, 0xd4, 0xab,
- 0x17, 0x93, 0xc1, 0xfe, 0xb8, 0xe9, 0x9a, 0x87,
- 0x4e, 0x08, 0x42, 0x54, 0xfd, 0xbf, 0xbb, 0x4d,
- 0xe8, 0xab, 0x17, 0x93, 0xec, 0xe7, 0x31, 0x63,
- 0xa5, 0x50, 0x11, 0x2c, 0x26, 0x3d, 0x3e, 0x9e,
- 0xdf, 0x6f, 0x77, 0x08, 0xed, 0xc8, 0x5b, 0xc2,
- 0x2e, 0x09, 0xb8, 0x8f, 0x19, 0x2e, 0xbb, 0x0a,
- 0xad, 0x23, 0x19, 0xa9, 0xe6, 0xa3, 0x2b, 0x9f,
- 0x91, 0x42, 0x3f, 0xa3, 0xa7, 0xff, 0xb6, 0xa7,
- 0xdd, 0x50, 0x33, 0xbd, 0xcd, 0xf2, 0x74, 0x50,
- 0xff, 0x74, 0x55, 0x2b, 0x2f, 0x67, 0xe7, 0xd6,
- 0x49, 0x42, 0xcf, 0x46, 0x2a, 0xe9, 0x41, 0x9c,
- 0x4a, 0x5e, 0xca, 0xd3, 0xf6, 0xec, 0x66, 0xcd,
- 0x1d, 0x13, 0xf2, 0x88, 0xf7, 0x09, 0xd5, 0xa3,
- 0xcf, 0x19, 0xc7, 0xe5, 0x46, 0xe7, 0x49, 0xd1,
- 0x8f, 0x97, 0x63, 0xcc, 0xa0, 0xee, 0xce, 0x60,
- 0x56, 0x9f, 0x73, 0xaa, 0xcc, 0x76, 0xf8, 0xca,
- 0x17, 0x42, 0xd8, 0x24, 0x4b, 0xf2, 0xbc, 0x01,
- 0x9d, 0x71, 0xb8, 0x87, 0xe4, 0x59, 0xfa, 0x8c,
- 0x1d, 0x7d, 0x04, 0x53, 0xfa, 0xd8, 0x2d, 0xfe,
- 0xc6, 0x8b, 0x8e, 0x7f, 0x5b, 0x05, 0xbf, 0xd8,
- 0xd1, 0x75, 0xcf, 0xfd, 0x6f, 0x75, 0xb0, 0x5b,
- 0xfd, 0x8d, 0x12, 0x8c, 0x23, 0xf6, 0xc1, 0xb8,
- 0xa3, 0x83, 0xbb, 0xa7, 0x6c, 0x77, 0xb8, 0x78,
- 0x5c, 0xd0, 0x3e, 0xfa, 0xa0, 0xaa, 0x6d, 0xa3,
- 0xbb, 0x83, 0xb9, 0xff, 0xd6, 0x57, 0xba, 0xd8,
- 0x2d, 0xfe, 0xc6, 0x89, 0x6a, 0x7c, 0x2d, 0xfe,
- 0xc6, 0x88, 0xde, 0x7f, 0xde, 0xeb, 0x60, 0xb7,
- 0xfb, 0x1a, 0x25, 0xf9, 0x5b, 0x0f, 0xd9, 0x46,
- 0x13, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0xae,
- 0x7f, 0xae, 0xe7, 0x71, 0xfd, 0x7a, 0x8e, 0x9b,
- 0x8d, 0x9d, 0x3f, 0x60, 0xb7, 0xfb, 0x1a, 0x24,
- 0x08, 0x00, 0xf3, 0x2c, 0x2f, 0x3e, 0xaf, 0xf7,
- 0xdf, 0x3a, 0x1c, 0x79, 0x4f, 0x91, 0xc5, 0xd4,
- 0x79, 0xfc, 0x34, 0x27, 0xfe, 0xee, 0x3d, 0x65,
- 0xf4, 0xef, 0x73, 0x47, 0x45, 0x8f, 0xc0, 0x4a,
- 0x67, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x16, 0x44,
- 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xd7, 0x9f,
- 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x5c, 0x93, 0xe1,
- 0x6f, 0xf6, 0x34, 0x5d, 0x93, 0xfe, 0xf7, 0x5b,
- 0x05, 0xbf, 0xd8, 0xd1, 0x47, 0x4a, 0xd8, 0x7e,
- 0xca, 0x30, 0x9f, 0x0b, 0x7f, 0xb1, 0xa2, 0x95,
- 0x9f, 0xff, 0xfe, 0xa2, 0x3c, 0x94, 0xda, 0xef,
- 0xe2, 0x9b, 0xb3, 0x53, 0x6b, 0x51, 0x1e, 0xc3,
- 0xa7, 0xd6, 0x57, 0xba, 0xd8, 0x8b, 0x25, 0x8c,
- 0x21, 0xe5, 0xce, 0xe7, 0x43, 0x21, 0xf2, 0x7d,
- 0xc7, 0x3c, 0xa2, 0x1e, 0x4e, 0xea, 0x77, 0xa8,
- 0x58, 0xae, 0x86, 0xcc, 0xff, 0x3a, 0xd8, 0x2d,
- 0xfe, 0xc6, 0x88, 0xe2, 0x7f, 0xb7, 0x6c, 0x16,
- 0xff, 0x63, 0x45, 0x6b, 0x2b, 0x7a, 0x20, 0xb4,
- 0x83, 0x3f, 0xfa, 0xca, 0xf7, 0x5b, 0x05, 0xbf,
- 0xd8, 0xd1, 0x2d, 0xcd, 0x8f, 0x9d, 0x3f, 0xb8,
- 0xc5, 0x29, 0x37, 0x53, 0xa1, 0xf3, 0xc9, 0xd8,
- 0xb4, 0xea, 0x70, 0xe3, 0xa7, 0x39, 0x4c, 0x74,
- 0x1a, 0x21, 0xb9, 0xff, 0x7b, 0xad, 0x82, 0xdf,
- 0xec, 0x68, 0x98, 0x27, 0x0d, 0xfc, 0x95, 0x2b,
- 0x22, 0x35, 0x5e, 0x23, 0xe0, 0x75, 0x86, 0xd4,
- 0x2f, 0xa4, 0x69, 0xca, 0xbc, 0x4a, 0x9f, 0xf7,
- 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x89, 0x8e, 0x56,
- 0xd9, 0xf1, 0x28, 0x72, 0x7e, 0x4a, 0x81, 0xac,
- 0xa1, 0xd3, 0xff, 0xff, 0xce, 0xad, 0x32, 0xf0,
- 0xd6, 0x98, 0xd9, 0x50, 0x31, 0xf7, 0x57, 0x7d,
- 0xd9, 0xd3, 0xcd, 0xfe, 0xc6, 0x8a, 0xc6, 0x7f,
- 0xcb, 0xf9, 0xae, 0xe5, 0xe9, 0xdd, 0x1d, 0x17,
- 0x53, 0x19, 0x7c, 0xb4, 0x61, 0x01, 0xa2, 0xb9,
- 0xff, 0xc9, 0xdd, 0x5d, 0xbd, 0x3b, 0x8c, 0x82,
- 0x74, 0xff, 0xb3, 0x8a, 0x65, 0x5f, 0x72, 0x50,
- 0xe9, 0xff, 0xff, 0xbb, 0x7b, 0xd8, 0xc0, 0x76,
- 0xfb, 0x80, 0x31, 0xf7, 0x65, 0xfd, 0xe6, 0xa7,
- 0x4f, 0xeb, 0x90, 0xf2, 0xce, 0x5e, 0x0b, 0xc7,
- 0x4e, 0xa6, 0xed, 0x89, 0xc5, 0x32, 0x2d, 0x12,
- 0x74, 0x7e, 0xbe, 0xfb, 0x35, 0xeb, 0x1d, 0x3e,
- 0xfe, 0xbd, 0x7d, 0x4e, 0x8e, 0x9e, 0x0d, 0x46,
- 0x27, 0xc1, 0xad, 0x53, 0x93, 0xa7, 0xc8, 0xee,
- 0x6f, 0x71, 0xd3, 0x93, 0xae, 0x3a, 0x16, 0x3c,
- 0x4d, 0x14, 0xcf, 0xc8, 0xac, 0xee, 0xee, 0x9d,
- 0x2a, 0x9d, 0x1b, 0x37, 0xde, 0x5d, 0x37, 0x28,
- 0x54, 0xc1, 0x09, 0x51, 0xb3, 0x58, 0x11, 0x69,
- 0xfd, 0xee, 0xee, 0x6a, 0x9b, 0x2a, 0xc6, 0x86,
- 0x7b, 0x8f, 0x7e, 0xa7, 0x4e, 0x4e, 0xac, 0x74,
- 0xdd, 0x43, 0xa1, 0x63, 0x62, 0x23, 0x93, 0xc3,
- 0xce, 0x5c, 0x1d, 0x38, 0x11, 0xba, 0x74, 0x22,
- 0x2d, 0xf1, 0x53, 0x64, 0x34, 0x24, 0x9a, 0x9a,
- 0x3a, 0x70, 0x42, 0x12, 0xa7, 0xfe, 0xc6, 0xe1,
- 0x1e, 0x07, 0x29, 0xef, 0x95, 0x62, 0xf2, 0x7e,
- 0xbd, 0x5b, 0xd7, 0x3e, 0x74, 0xfe, 0x6d, 0xd7,
- 0xb8, 0xbb, 0xce, 0x9b, 0x34, 0x74, 0x3e, 0x79,
- 0x14, 0x33, 0x9f, 0xfe, 0xd6, 0xeb, 0x4c, 0xe3,
- 0xb8, 0xbb, 0xb9, 0x53, 0xa5, 0x64, 0x5c, 0x02,
- 0xe0, 0x8b, 0x1b, 0x05, 0x85, 0x4d, 0xb4, 0x87,
- 0xcf, 0x9d, 0xf4, 0xca, 0xaa, 0x9a, 0x77, 0x04,
- 0x8e, 0x7c, 0x2d, 0xfe, 0xc6, 0x8a, 0xde, 0x7f,
- 0xde, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x27, 0x09,
- 0x5b, 0x0f, 0xd9, 0x46, 0x13, 0xe1, 0x6f, 0xf6,
- 0x34, 0x5a, 0x33, 0xd8, 0xb6, 0xee, 0x9d, 0x2b,
- 0x61, 0xea, 0x50, 0xc2, 0x79, 0xbf, 0xd8, 0xd1,
- 0x6d, 0x4f, 0xd4, 0x45, 0x26, 0xf8, 0x3a, 0x6b,
- 0x60, 0x9e, 0xc6, 0x8a, 0xe7, 0xf5, 0xb0, 0x5b,
- 0xfd, 0x8d, 0x17, 0x2c, 0xfe, 0xb6, 0x0b, 0x7f,
- 0xb1, 0xa2, 0xed, 0x84, 0x66, 0x3c, 0xbc, 0x50,
- 0xe8, 0xdc, 0x38, 0x85, 0xfd, 0xd9, 0x59, 0x7b,
- 0x9c, 0xa1, 0xb9, 0xc6, 0x35, 0x47, 0xbe, 0xbf,
- 0xd4, 0xb3, 0x47, 0x73, 0xfa, 0xd8, 0x2d, 0xfe,
- 0xc6, 0x8a, 0x9e, 0x79, 0xbf, 0xd8, 0xd1, 0x5c,
- 0xcf, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2c, 0xe8,
- 0x13, 0xe6, 0xa1, 0x5c, 0xff, 0x3a, 0xd8, 0x2d,
- 0xfe, 0xc6, 0x89, 0x0a, 0x79, 0x7b, 0x51, 0x14,
- 0x74, 0xfe, 0xca, 0x56, 0xb8, 0x2f, 0x1d, 0x2b,
- 0x62, 0x2e, 0xfc, 0x86, 0xa8, 0x3a, 0x27, 0x9f,
- 0xfd, 0x65, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68,
- 0x9f, 0x21, 0x93, 0xef, 0xb9, 0xc6, 0xb9, 0x44,
- 0x19, 0xf0, 0xb7, 0xfb, 0x1a, 0x2b, 0x29, 0xff,
- 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x9b, 0xa6,
- 0xdd, 0xb0, 0xfd, 0x94, 0x61, 0x3f, 0xfa, 0xca,
- 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x2b, 0x4f,
- 0x85, 0xbf, 0xd8, 0xd1, 0x2e, 0x4f, 0x2e, 0xdf,
- 0x50, 0xe9, 0xf5, 0x95, 0xee, 0xb6, 0x1e, 0x9f,
- 0x98, 0x4f, 0xfd, 0x6f, 0x75, 0xb0, 0x5b, 0xfd,
- 0x8d, 0x11, 0xdc, 0xff, 0x6a, 0x98, 0xeb, 0x7f,
- 0x6a, 0x74, 0xfc, 0xbc, 0xea, 0x36, 0x74, 0xe9,
- 0xfa, 0xe5, 0xee, 0x53, 0xf4, 0x74, 0xf8, 0x5b,
- 0xfd, 0x8d, 0x15, 0x0c, 0xfb, 0x29, 0xac, 0x78,
- 0xe9, 0x5a, 0xe5, 0x45, 0xba, 0xf0, 0xbf, 0x0c,
- 0x74, 0x61, 0x3e, 0x16, 0xff, 0x63, 0x45, 0x51,
- 0x3f, 0xef, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13,
- 0x5c, 0xad, 0x87, 0xec, 0xa3, 0x09, 0xfd, 0x6c,
- 0x16, 0xff, 0x63, 0x45, 0x59, 0x3f, 0xf5, 0xbd,
- 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x48, 0x93, 0xe1,
- 0x6f, 0xf6, 0x34, 0x5a, 0x53, 0xfe, 0xf7, 0x5b,
- 0x05, 0xbf, 0xd8, 0xd1, 0x3e, 0xca, 0xd8, 0x7e,
- 0xca, 0x30, 0x9f, 0xfd, 0x65, 0x7b, 0xad, 0x82,
- 0xdf, 0xec, 0x68, 0xa1, 0x27, 0xd4, 0xdb, 0xc8,
- 0x27, 0x4f, 0x85, 0xbf, 0xd8, 0xd1, 0x47, 0xcf,
- 0xff, 0xd9, 0xc5, 0x10, 0x1b, 0x6b, 0xbf, 0xcd,
- 0x6a, 0x9c, 0x95, 0x3e, 0xb2, 0xbd, 0xd6, 0x44,
- 0x5a, 0xe1, 0x3a, 0xf9, 0x84, 0x22, 0xeb, 0xf3,
- 0xd0, 0xa5, 0x71, 0xee, 0x26, 0x5d, 0x87, 0x7b,
- 0x43, 0x05, 0xf2, 0x75, 0x8e, 0xe9, 0x0c, 0x2e,
- 0x49, 0xf5, 0x18, 0x3c, 0xfe, 0xb6, 0x0b, 0x7f,
- 0xb1, 0xa2, 0x22, 0x9f, 0xb0, 0x5b, 0xfd, 0x8d,
- 0x11, 0x5c, 0xff, 0x5c, 0xed, 0x82, 0xdf, 0xec,
- 0x68, 0xae, 0x22, 0xc7, 0xf5, 0xe6, 0xb3, 0xd9,
- 0x4f, 0xd1, 0xd3, 0xfb, 0x36, 0x3c, 0xf3, 0x7d,
- 0x4e, 0x95, 0xcb, 0xd3, 0xd5, 0xa9, 0x04, 0xff,
- 0xdf, 0xb7, 0x6f, 0xba, 0xbe, 0x83, 0x87, 0x4f,
- 0xb3, 0x7c, 0x0e, 0x1d, 0x3b, 0x55, 0xdd, 0x0f,
- 0xab, 0x48, 0x93, 0xe1, 0x6f, 0xf6, 0x34, 0x53,
- 0xd0, 0xbc, 0x47, 0xda, 0x42, 0x5f, 0x0d, 0x27,
- 0xff, 0x7b, 0xad, 0xc7, 0x7c, 0x35, 0xaa, 0x72,
- 0x74, 0x59, 0x10, 0x5c, 0x1b, 0xce, 0xb7, 0x18,
- 0x74, 0xf9, 0x1d, 0xcd, 0xee, 0x3a, 0x79, 0xbf,
- 0xd8, 0xd1, 0x59, 0xc2, 0xc7, 0xa8, 0x25, 0x33,
- 0xf3, 0xca, 0x4e, 0xba, 0xa7, 0x4e, 0x47, 0xb6,
- 0x74, 0xfb, 0x5c, 0x83, 0xd7, 0x1d, 0x3e, 0xc5,
- 0x9e, 0xbf, 0x93, 0xa5, 0x6c, 0x46, 0x08, 0x91,
- 0x50, 0xbb, 0xc7, 0x01, 0x2a, 0x9f, 0xfa, 0xde,
- 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x24, 0x59, 0xfd,
- 0x6c, 0x16, 0xff, 0x63, 0x45, 0x93, 0x3f, 0xad,
- 0x82, 0xdf, 0xec, 0x68, 0xb6, 0x27, 0xf5, 0xb0,
- 0x5b, 0xfd, 0x8d, 0x16, 0xdc, 0xff, 0x97, 0x8b,
- 0xcb, 0x92, 0xd5, 0x33, 0xa9, 0xc9, 0xd3, 0xf2,
- 0x75, 0xdc, 0x5e, 0xa3, 0xa7, 0xc2, 0xdf, 0xec,
- 0x68, 0xbc, 0x27, 0xb4, 0xbf, 0x94, 0x3a, 0x7d,
- 0x9d, 0xe6, 0xe1, 0x0e, 0x9f, 0x20, 0x37, 0xfd,
- 0x4e, 0x9d, 0xa4, 0xe4, 0xe9, 0x5a, 0xe4, 0xd4,
- 0xcf, 0xde, 0x4e, 0xc2, 0xf7, 0xcc, 0x39, 0x24,
- 0xe9, 0x56, 0x8a, 0x27, 0xc2, 0xdf, 0xec, 0x68,
- 0xbd, 0x27, 0xfd, 0xdf, 0xd3, 0x92, 0xee, 0xb6,
- 0xf1, 0xd3, 0xec, 0x55, 0x3f, 0x83, 0xa5, 0x6c,
- 0x44, 0xc0, 0x26, 0x17, 0x08, 0x30, 0x8b, 0xf9,
- 0xcf, 0x42, 0xd7, 0x23, 0xf3, 0x62, 0x4d, 0xc6,
- 0x62, 0x29, 0xca, 0x4c, 0xe4, 0xef, 0xa7, 0x77,
- 0xc6, 0xf4, 0x18, 0xc3, 0xa7, 0xb2, 0x9f, 0xa3,
- 0xa7, 0xf6, 0x6c, 0x79, 0xe6, 0xfa, 0x9d, 0x2b,
- 0x97, 0xa7, 0xab, 0x52, 0x09, 0xf0, 0xb7, 0xfb,
- 0x1a, 0x22, 0x39, 0xff, 0xea, 0x5f, 0x5a, 0xe2,
- 0xbb, 0x8b, 0x80, 0x45, 0xee, 0x74, 0xff, 0x9c,
- 0x8f, 0x0e, 0x6b, 0x5b, 0xd1, 0xd3, 0x3c, 0xa2,
- 0xa6, 0x08, 0x4a, 0x9f, 0xf9, 0xd6, 0x6a, 0x6d,
- 0x6a, 0x23, 0xd6, 0xe4, 0xd6, 0x84, 0x5e, 0x7f,
- 0x65, 0xcf, 0xb9, 0x4f, 0xd1, 0xd3, 0xff, 0xf3,
- 0x58, 0x7f, 0xbb, 0xd5, 0x85, 0x35, 0xdf, 0xe4,
- 0xe8, 0x5e, 0x2a, 0x0d, 0xc2, 0xd6, 0x30, 0x7d,
- 0x67, 0xda, 0xf4, 0xbc, 0xb8, 0xd6, 0x7c, 0x2d,
- 0xfe, 0xc6, 0x88, 0xba, 0x7d, 0xae, 0x41, 0xeb,
- 0x8b, 0x67, 0xb4, 0xad, 0x87, 0xcf, 0xe6, 0x11,
- 0x64, 0x7b, 0xba, 0x1a, 0x33, 0xff, 0x2b, 0xdd,
- 0x6c, 0x16, 0xff, 0x63, 0x44, 0xcd, 0x39, 0xf4,
- 0xa9, 0xd3, 0x9b, 0x6a, 0x3a, 0x7f, 0xf6, 0x5c,
- 0x6f, 0x5b, 0x6d, 0xf1, 0xac, 0x63, 0xa7, 0xff,
- 0xdc, 0x6f, 0xaf, 0x65, 0x77, 0xf4, 0xb0, 0x42,
- 0x12, 0xa7, 0x9b, 0xfd, 0x8d, 0x16, 0x7c, 0xff,
- 0xf6, 0xc6, 0x9e, 0x06, 0x2e, 0xee, 0x57, 0x3a,
- 0x74, 0xe0, 0x84, 0x25, 0x4f, 0xfb, 0xdd, 0x5e,
- 0xe3, 0x71, 0x82, 0x55, 0x8b, 0xc9, 0xfe, 0x4a,
- 0x6f, 0x8e, 0xff, 0xac, 0x74, 0xff, 0x6f, 0xbc,
- 0x03, 0xc5, 0xfa, 0xa9, 0xd0, 0xc9, 0xd8, 0x8a,
- 0xc5, 0x0a, 0xf9, 0x6c, 0xd2, 0x5a, 0xe3, 0x99,
- 0xff, 0xff, 0xfb, 0x33, 0x9a, 0xe6, 0x76, 0xe8,
- 0x23, 0xd4, 0xca, 0x5a, 0xbd, 0xc7, 0x95, 0x8a,
- 0x3a, 0x75, 0x51, 0xe3, 0xa7, 0x2f, 0xe5, 0x0e,
- 0x87, 0x23, 0x12, 0xb0, 0x8a, 0xd0, 0xe4, 0xf3,
- 0xfc, 0xde, 0xc7, 0x4f, 0xa9, 0xd4, 0xc1, 0x32,
- 0x7f, 0xdb, 0x17, 0x60, 0xbd, 0x7f, 0xf0, 0x68,
- 0x83, 0x6c, 0x69, 0x67, 0xde, 0xdb, 0x52, 0x1d,
- 0x3f, 0x3a, 0x9d, 0xf7, 0xf4, 0x74, 0xb1, 0x8f,
- 0x4f, 0xa4, 0xb3, 0xff, 0xfe, 0xf0, 0xeb, 0x29,
- 0xa4, 0xce, 0xbf, 0xac, 0x1d, 0xbd, 0xea, 0x3a,
- 0x1c, 0x9a, 0x06, 0x42, 0xbf, 0xa4, 0xd3, 0xf0,
- 0xe7, 0x15, 0xa2, 0x1d, 0x3f, 0xff, 0xaf, 0xef,
- 0xdd, 0x00, 0x1e, 0xfe, 0xab, 0xb7, 0xe9, 0xb0,
- 0x9d, 0x3f, 0xff, 0xd5, 0xaa, 0x0e, 0x92, 0xca,
- 0xcd, 0x54, 0x1a, 0xfb, 0xb0, 0xe9, 0xea, 0x66,
- 0xd7, 0x1d, 0x1b, 0x44, 0x45, 0x19, 0x66, 0x55,
- 0xca, 0x68, 0xbf, 0x27, 0xfe, 0x76, 0xaf, 0x73,
- 0x95, 0xad, 0x22, 0x8e, 0x9f, 0xfb, 0x79, 0xdc,
- 0xca, 0x80, 0xea, 0xa8, 0xe8, 0x7d, 0x11, 0x55,
- 0x46, 0x9e, 0xef, 0x51, 0x8e, 0x84, 0x4c, 0x67,
- 0x82, 0x3c, 0x85, 0x97, 0x92, 0x4f, 0xff, 0xfd,
- 0x70, 0x94, 0xda, 0xac, 0xb3, 0xbc, 0x41, 0xa6,
- 0xdf, 0xab, 0x6d, 0xe3, 0xa7, 0xd7, 0xe5, 0x77,
- 0xd3, 0xa7, 0xc8, 0x0d, 0xff, 0x53, 0xa6, 0x5e,
- 0x94, 0x74, 0xff, 0xff, 0xa9, 0xb7, 0xf5, 0x8f,
- 0xe8, 0x45, 0x35, 0xc8, 0x3d, 0x75, 0x30, 0xe9,
- 0xc1, 0x08, 0x4a, 0x9e, 0xe3, 0x8f, 0xe9, 0x56,
- 0x2f, 0x21, 0x11, 0xb0, 0xc3, 0x7b, 0x84, 0x5c,
- 0xff, 0xd9, 0xd7, 0xf5, 0x83, 0xb7, 0xbd, 0x47,
- 0x4f, 0xb3, 0x4e, 0x55, 0x0e, 0x84, 0x3e, 0xba,
- 0xa2, 0x4d, 0xcd, 0x0e, 0x9f, 0x9e, 0x59, 0xcb,
- 0xc1, 0x78, 0xe9, 0xfd, 0x76, 0x99, 0xaa, 0x6f,
- 0x47, 0x4d, 0xb1, 0x3a, 0x2e, 0x41, 0xff, 0x6c,
- 0xd2, 0x86, 0xb3, 0xff, 0xb8, 0xe1, 0x38, 0x14,
- 0xd6, 0xdb, 0x7c, 0x1d, 0x2b, 0x2f, 0x66, 0x59,
- 0x85, 0xc9, 0x0e, 0x70, 0x37, 0x91, 0xfe, 0xbf,
- 0x18, 0xee, 0xcd, 0x56, 0x8e, 0x24, 0x4d, 0x54,
- 0x59, 0x49, 0x41, 0x3e, 0x83, 0xcb, 0xcf, 0x4a,
- 0x2b, 0x18, 0x06, 0xa1, 0x3c, 0x12, 0x15, 0xf8,
- 0x4a, 0x82, 0x6b, 0x16, 0x66, 0x5a, 0x52, 0x96,
- 0xf9, 0x3f, 0xfa, 0xca, 0xf7, 0x5b, 0x05, 0xbf,
- 0xd8, 0xd1, 0x36, 0x4f, 0xeb, 0x60, 0xb7, 0xfb,
- 0x1a, 0x2a, 0xd9, 0xfc, 0xe7, 0x5f, 0xae, 0xa3,
- 0x8e, 0x9e, 0xca, 0x7e, 0x8e, 0x95, 0xcb, 0x87,
- 0xa9, 0xd3, 0x49, 0xf0, 0xb7, 0xfb, 0x1a, 0x2b,
- 0x49, 0xff, 0xe6, 0x41, 0xce, 0x7d, 0x5e, 0xe4,
- 0xdb, 0x1d, 0x3f, 0xfc, 0xea, 0xe7, 0x51, 0x5f,
- 0x9a, 0xd2, 0x28, 0xe9, 0xb5, 0xa4, 0x44, 0xc7,
- 0xa5, 0xcf, 0xe4, 0x5c, 0x0e, 0xba, 0x9c, 0x9d,
- 0x3f, 0x3d, 0x94, 0xde, 0x28, 0xe9, 0xfe, 0xcb,
- 0x8e, 0xa0, 0x5f, 0x75, 0x4e, 0x9f, 0xce, 0xcd,
- 0x7f, 0x79, 0xbc, 0xe9, 0x59, 0x78, 0x9f, 0xa6,
- 0x16, 0x6e, 0x19, 0x14, 0x2d, 0xf3, 0x6e, 0x96,
- 0xe8, 0xf2, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1,
- 0x60, 0x4f, 0x85, 0xbf, 0xd8, 0xd1, 0x3a, 0xcf,
- 0xff, 0xea, 0x23, 0xdc, 0x62, 0xad, 0x5a, 0xe5,
- 0x37, 0x5b, 0xde, 0x3a, 0x7d, 0x65, 0x7b, 0xad,
- 0x88, 0x95, 0x58, 0xc2, 0x7c, 0x2d, 0xfe, 0xc6,
- 0x8b, 0x66, 0x7f, 0xdc, 0xa5, 0x6d, 0x4d, 0xb7,
- 0x89, 0xd2, 0xb6, 0x1f, 0x6f, 0x98, 0x4f, 0x37,
- 0xfb, 0x1a, 0x2e, 0x69, 0x28, 0xe9, 0xad, 0x82,
- 0x6e, 0xc2, 0x57, 0x3f, 0xad, 0x82, 0xdf, 0xec,
- 0x68, 0xbb, 0xe7, 0xad, 0x77, 0x8e, 0x4e, 0x84,
- 0x6c, 0xaf, 0x72, 0x99, 0xb8, 0xc6, 0x0f, 0xa9,
- 0x6e, 0x54, 0x18, 0xb9, 0x2a, 0x1a, 0x1c, 0xc2,
- 0xb6, 0xac, 0x3a, 0x2b, 0x04, 0xee, 0x7f, 0x75,
- 0xec, 0xb8, 0xd2, 0x5d, 0x3a, 0x7c, 0x2d, 0xfe,
- 0xc6, 0x89, 0x5e, 0x7e, 0xa7, 0x17, 0xf8, 0xb8,
- 0xe9, 0xde, 0xeb, 0x22, 0x25, 0xb0, 0xe2, 0xa6,
- 0x13, 0xb4, 0x9c, 0x15, 0x3f, 0xfa, 0x9f, 0xbd,
- 0x23, 0xb6, 0x2f, 0x5f, 0xc9, 0x53, 0xfb, 0xda,
- 0xdc, 0x0a, 0xf5, 0x64, 0x3e, 0x8a, 0x8e, 0x4a,
- 0xca, 0x47, 0xaa, 0xe8, 0x53, 0xcf, 0xfe, 0xb2,
- 0xbd, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x4c, 0x33,
- 0xff, 0xf6, 0x58, 0x11, 0xfe, 0x6d, 0x77, 0x4e,
- 0x0a, 0x55, 0xc7, 0x4f, 0xfd, 0x72, 0xe3, 0xee,
- 0xbf, 0xf5, 0xd4, 0x71, 0xd3, 0xfd, 0xd4, 0xf7,
- 0xb5, 0x77, 0xc4, 0xe9, 0xf9, 0x49, 0x9d, 0xd2,
- 0xf9, 0xd3, 0xe4, 0xce, 0xe9, 0x7c, 0xe9, 0xfa,
- 0x9b, 0xd5, 0x7d, 0xf0, 0x0f, 0x61, 0x45, 0xf3,
- 0xff, 0xfe, 0xee, 0x06, 0xe3, 0x59, 0x40, 0x3b,
- 0x8f, 0x6f, 0x3a, 0xfb, 0xaa, 0x74, 0xfc, 0xb8,
- 0x1d, 0x75, 0x39, 0x3a, 0x7f, 0xf2, 0x6b, 0x94,
- 0x76, 0x3f, 0xa7, 0xaf, 0x09, 0xd0, 0x87, 0xfd,
- 0xb3, 0x19, 0xfa, 0xbb, 0xba, 0xaf, 0xd1, 0xd3,
- 0xff, 0xfe, 0x1c, 0x5c, 0x9d, 0xd0, 0x00, 0xf5,
- 0x29, 0xfb, 0xd2, 0x6a, 0xa7, 0x4b, 0x1f, 0x44,
- 0xe8, 0x97, 0xcf, 0x78, 0x3c, 0x61, 0xd2, 0xb2,
- 0xf1, 0x58, 0xd7, 0x09, 0x4d, 0x09, 0x15, 0x91,
- 0xe9, 0x0f, 0x0e, 0xc2, 0xfa, 0xf2, 0x89, 0xf0,
- 0xb7, 0xfb, 0x1a, 0x2a, 0xe9, 0xfe, 0x75, 0xb0,
- 0x5b, 0xfd, 0x8d, 0x11, 0xe4, 0xad, 0x87, 0xe3,
- 0xe6, 0x13, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8b,
- 0x06, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x65,
- 0x4f, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2d, 0x39,
- 0xe6, 0xff, 0x63, 0x45, 0xb9, 0x3f, 0xf2, 0x60,
- 0xe7, 0x40, 0xa6, 0x3e, 0x13, 0xa0, 0x4f, 0xba,
- 0xa5, 0x73, 0xfe, 0xf7, 0x5b, 0x05, 0xbf, 0xd8,
- 0xd1, 0x43, 0xcf, 0xdd, 0x5e, 0x60, 0xa5, 0x4e,
- 0x9f, 0xff, 0xb3, 0x8a, 0x20, 0x36, 0xd7, 0x7f,
- 0x9a, 0xd5, 0x39, 0x2a, 0x56, 0xc4, 0x7a, 0x28,
- 0x86, 0xf4, 0x65, 0xf2, 0xf9, 0xfd, 0x6c, 0x16,
- 0xff, 0x63, 0x45, 0xe7, 0x08, 0xbf, 0x4c, 0xe3,
- 0x0e, 0x14, 0xb2, 0x5b, 0xc3, 0xf0, 0xf2, 0x12,
- 0x65, 0x1d, 0xd0, 0xef, 0xb1, 0xce, 0xae, 0x46,
- 0x9f, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x52, 0xd3,
- 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8b, 0x0a, 0x7f,
- 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x65, 0xcf, 0xfe,
- 0xb2, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x51,
- 0x93, 0xfa, 0xc8, 0xb9, 0x05, 0x39, 0x3a, 0x1c,
- 0x99, 0xb0, 0x9d, 0xa8, 0xee, 0xa7, 0x7a, 0x52,
+ 0xd1, 0x3c, 0x4f, 0xfe, 0xb2, 0xbd, 0xd6, 0xc1,
+ 0x6f, 0xf6, 0x34, 0x4f, 0xf3, 0xff, 0xac, 0xaf,
+ 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14, 0x34, 0xff,
+ 0xeb, 0x2b, 0xdd, 0x6c, 0x16, 0xff, 0x63, 0x45,
+ 0x11, 0x3f, 0xef, 0x75, 0xb0, 0x5b, 0xfd, 0x8d,
+ 0x14, 0x8c, 0xff, 0xfd, 0x9c, 0x55, 0x39, 0xdb,
+ 0x5d, 0xf0, 0x52, 0x88, 0x02, 0xa5, 0x65, 0x22,
+ 0x8d, 0x7d, 0x1a, 0x7f, 0xeb, 0x7b, 0xad, 0x82,
+ 0xdf, 0xec, 0x68, 0x94, 0x21, 0xe5, 0xce, 0x57,
+ 0x46, 0x90, 0xc6, 0x23, 0x09, 0x75, 0x13, 0x55,
+ 0x30, 0x0a, 0x4b, 0xda, 0x95, 0x14, 0xae, 0x87,
+ 0xad, 0xe1, 0x64, 0xff, 0xeb, 0x2b, 0xdd, 0x6c,
+ 0x16, 0xff, 0x63, 0x44, 0xe7, 0x3f, 0xfa, 0xca,
+ 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x44, 0xcf,
+ 0xfc, 0x2e, 0xb5, 0x77, 0x45, 0x9d, 0xb0, 0x1d,
+ 0x02, 0x8e, 0xaa, 0x29, 0x5c, 0xa5, 0x3f, 0xad,
+ 0x82, 0xdf, 0xec, 0x68, 0x87, 0x27, 0xc2, 0xdf,
+ 0xec, 0x68, 0x8b, 0xe7, 0xdf, 0xa7, 0x25, 0xf2,
+ 0xa5, 0x6c, 0x3d, 0x8e, 0x98, 0x4f, 0xfe, 0xb2,
+ 0xbd, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x4c, 0x93,
+ 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8b, 0x7a, 0x7f,
+ 0xf5, 0x95, 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2,
+ 0x93, 0x84, 0x4e, 0x65, 0xd0, 0x93, 0xc2, 0x7a,
+ 0x29, 0x2e, 0x3b, 0x9f, 0xd6, 0xc1, 0x6f, 0xf6,
+ 0x34, 0x43, 0xb3, 0xff, 0xac, 0xaf, 0x75, 0xb0,
+ 0x5b, 0xfd, 0x8d, 0x12, 0xc4, 0xfe, 0xb6, 0x0b,
+ 0x7f, 0xb1, 0xa2, 0x30, 0x9f, 0xfa, 0xde, 0xeb,
+ 0x60, 0xb7, 0xfb, 0x1a, 0x23, 0xd9, 0xfd, 0x6c,
+ 0x16, 0xff, 0x63, 0x45, 0x87, 0x3f, 0xad, 0x82,
+ 0xdf, 0xec, 0x68, 0xb9, 0xe1, 0x13, 0x8a, 0x78,
+ 0xed, 0xca, 0x5b, 0x3b, 0x52, 0x66, 0x8e, 0xe7,
+ 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x10, 0xf4, 0xf8,
+ 0x5b, 0xfd, 0x8d, 0x11, 0x34, 0xda, 0x51, 0xd3,
+ 0xff, 0xb2, 0xbc, 0xde, 0xa2, 0x6d, 0xfd, 0x22,
+ 0x8e, 0x87, 0xcf, 0x8e, 0xa2, 0xd3, 0xda, 0xbb,
+ 0xf9, 0x9a, 0x21, 0x79, 0x5b, 0x11, 0xcf, 0x48,
+ 0x49, 0xdc, 0x47, 0x3d, 0xaa, 0xef, 0x47, 0x4f,
+ 0xfe, 0xda, 0xce, 0xc7, 0xdd, 0xc9, 0x5f, 0xfd,
+ 0x3a, 0x6f, 0xbc, 0x3a, 0x57, 0xae, 0x22, 0x1e,
+ 0xa4, 0x5e, 0x9b, 0x3e, 0xaf, 0xeb, 0xdc, 0x74,
+ 0xf6, 0xe9, 0xb0, 0x1d, 0x38, 0x21, 0x09, 0x53,
+ 0xef, 0xee, 0xab, 0x85, 0x58, 0xbc, 0x9f, 0x7e,
+ 0x96, 0xcd, 0x1d, 0x1c, 0x22, 0x68, 0x07, 0xdd,
+ 0x35, 0x9f, 0xf8, 0x1b, 0x5b, 0x95, 0x53, 0x63,
+ 0x75, 0xec, 0xe9, 0xff, 0x6e, 0xfa, 0x75, 0x28,
+ 0x9b, 0x51, 0xd3, 0xf6, 0x2e, 0xb9, 0xd9, 0x43,
+ 0xa7, 0xb3, 0x8c, 0x78, 0xe8, 0xc4, 0xf3, 0x77,
+ 0x0c, 0x05, 0x8c, 0x6a, 0x99, 0xd3, 0xfd, 0x17,
+ 0xcf, 0xd8, 0x14, 0xce, 0x36, 0x74, 0xff, 0xff,
+ 0xee, 0xf5, 0xf4, 0xbf, 0xdc, 0xe2, 0xbb, 0x5b,
+ 0x95, 0x31, 0xf7, 0x0e, 0x04, 0xe9, 0xf6, 0xf5,
+ 0x72, 0x3c, 0x74, 0xfe, 0x7d, 0xd4, 0xbf, 0x72,
+ 0x3e, 0x74, 0xfe, 0xf0, 0xdc, 0xb2, 0x6b, 0xce,
+ 0x8d, 0x9f, 0x5f, 0x4e, 0x21, 0x13, 0x35, 0xc7,
+ 0xf1, 0x84, 0xa4, 0xd7, 0x38, 0xe9, 0xdf, 0xaa,
+ 0x1d, 0x35, 0xcf, 0x1d, 0x3c, 0x9d, 0xd2, 0xce,
+ 0x36, 0x62, 0x37, 0x3f, 0xfe, 0xb9, 0x35, 0xcb,
+ 0xb7, 0x5e, 0x72, 0xcd, 0x2f, 0xe6, 0x8e, 0x9f,
+ 0xfa, 0xa9, 0x7f, 0x96, 0xbb, 0xfa, 0x4d, 0x1d,
+ 0x3f, 0xb9, 0x3e, 0xed, 0xd6, 0xe5, 0x1d, 0x00,
+ 0x3f, 0xfe, 0xa3, 0xcf, 0xf8, 0x56, 0xe5, 0x44,
+ 0xdb, 0xdf, 0xa3, 0xa1, 0x0f, 0x8e, 0xe2, 0x29,
+ 0xff, 0xff, 0xeb, 0xbb, 0x41, 0xea, 0x2d, 0xcb,
+ 0x9e, 0xb6, 0xec, 0x7f, 0x58, 0xbb, 0xb9, 0x43,
+ 0xa4, 0x87, 0x4f, 0xe7, 0x78, 0xee, 0x88, 0xf9,
+ 0xd3, 0xff, 0xff, 0xfb, 0x60, 0xa7, 0x73, 0xdf,
+ 0xe5, 0xc5, 0x6e, 0xe5, 0xdc, 0x7d, 0xd9, 0x73,
+ 0xdd, 0xcf, 0x7c, 0xe9, 0xdf, 0xec, 0x68, 0xa6,
+ 0x23, 0x11, 0x7e, 0xd0, 0x99, 0x9f, 0xf6, 0x75,
+ 0xf7, 0x53, 0x48, 0x2b, 0x1d, 0x3e, 0x7f, 0xb8,
+ 0xbb, 0x0e, 0x8d, 0x9f, 0x47, 0x9f, 0xcf, 0xf7,
+ 0xab, 0x8a, 0xa3, 0xd8, 0x13, 0xa7, 0xff, 0xf7,
+ 0x71, 0xb5, 0xa4, 0xd5, 0x16, 0xee, 0x07, 0x92,
+ 0x5e, 0x83, 0xa7, 0xfc, 0xc8, 0xaa, 0xe5, 0x33,
+ 0x7d, 0x3a, 0x11, 0x14, 0x95, 0x68, 0x9f, 0x0a,
+ 0x2e, 0x41, 0x3a, 0x7e, 0xfe, 0xf2, 0xe1, 0x3a,
+ 0x74, 0x61, 0xfb, 0xec, 0x8a, 0xe2, 0x68, 0x79,
+ 0x76, 0x7f, 0x84, 0xab, 0xe7, 0x0d, 0x1a, 0x1b,
+ 0xe4, 0x5b, 0x84, 0x32, 0xc1, 0xe3, 0x0f, 0x15,
+ 0x42, 0x3b, 0xa4, 0x3a, 0x8d, 0x52, 0x7b, 0x3b,
+ 0x7e, 0xf6, 0x74, 0xff, 0xff, 0xfa, 0xbb, 0xd5,
+ 0x70, 0x51, 0x77, 0x25, 0x5d, 0x79, 0xcb, 0x1f,
+ 0x76, 0x5d, 0xd0, 0x50, 0xe9, 0x6b, 0x68, 0xb6,
+ 0xa1, 0x3c, 0xff, 0xfb, 0x32, 0xbb, 0x6a, 0xe7,
+ 0x2a, 0x5d, 0x54, 0xbd, 0x9d, 0x3f, 0xf5, 0x3d,
+ 0xfe, 0x4a, 0x4c, 0xee, 0x97, 0xce, 0x96, 0xfa,
+ 0x8a, 0x3d, 0x2d, 0x4f, 0x9c, 0x8f, 0xba, 0x87,
+ 0x4f, 0xff, 0xff, 0xfb, 0x3b, 0x7f, 0x96, 0xeb,
+ 0x75, 0x96, 0xde, 0x91, 0x5d, 0xfb, 0xf5, 0xdd,
+ 0xb2, 0xaf, 0x81, 0x38, 0x2a, 0x7f, 0xff, 0xe6,
+ 0xd8, 0x78, 0xb8, 0x79, 0x5c, 0x8f, 0x51, 0xab,
+ 0x75, 0x5f, 0xf0, 0x9d, 0x35, 0xcf, 0x3e, 0x9a,
+ 0x36, 0xca, 0x29, 0x0a, 0x58, 0x45, 0x50, 0x15,
+ 0x86, 0x67, 0x63, 0x6f, 0x9f, 0xfc, 0xa6, 0xe5,
+ 0x5f, 0x76, 0x2b, 0xfa, 0x03, 0xa7, 0xff, 0xdb,
+ 0xee, 0xab, 0x97, 0x9a, 0x5b, 0x2f, 0x7f, 0xd0,
+ 0x1d, 0x3f, 0xf2, 0x75, 0xee, 0xe2, 0xea, 0x5c,
+ 0x8f, 0x9d, 0x14, 0x45, 0x2d, 0xcb, 0xb3, 0xd9,
+ 0xac, 0x5e, 0xce, 0x9c, 0xbf, 0x95, 0x3a, 0x6c,
+ 0xe0, 0xe8, 0x79, 0x36, 0xc7, 0x43, 0xbe, 0x84,
+ 0x9a, 0x25, 0x5c, 0x3d, 0x3f, 0x70, 0x9d, 0xaf,
+ 0xb8, 0xe9, 0xc9, 0xc2, 0x1d, 0x3f, 0x96, 0x76,
+ 0x6a, 0x9e, 0xb7, 0x23, 0xc8, 0x51, 0x6c, 0xfd,
+ 0x79, 0x5f, 0xbd, 0xa0, 0x0e, 0x9f, 0xc2, 0xb7,
+ 0x72, 0xbf, 0xa3, 0xa3, 0x0f, 0x97, 0x66, 0x73,
+ 0xf2, 0x03, 0x35, 0xcd, 0xe3, 0xa1, 0xc7, 0xa1,
+ 0xd2, 0x19, 0xff, 0xff, 0x6b, 0xbe, 0x0a, 0x3d,
+ 0x9b, 0xee, 0xbb, 0x8b, 0xb9, 0x50, 0x3d, 0x3a,
+ 0x7f, 0xdb, 0xc5, 0xb9, 0x51, 0x2b, 0xf7, 0xb3,
+ 0xa7, 0xf7, 0xbf, 0x4a, 0xe7, 0x89, 0xd1, 0xc1,
+ 0xfa, 0xe9, 0x12, 0x4a, 0x3a, 0x77, 0x73, 0x83,
+ 0xa1, 0x0d, 0x63, 0xe2, 0x13, 0xf3, 0xf4, 0xcc,
+ 0xed, 0xf3, 0xa7, 0x95, 0xcd, 0x00, 0x74, 0x61,
+ 0xe9, 0x6c, 0xbe, 0x11, 0x3c, 0xac, 0x87, 0x3e,
+ 0xd3, 0xc5, 0xce, 0x7f, 0x6b, 0x6f, 0x65, 0x6e,
+ 0xd1, 0xd3, 0xd8, 0xfa, 0x2c, 0x74, 0xfd, 0x5f,
+ 0x72, 0x87, 0x67, 0x4f, 0xb6, 0x01, 0xc7, 0xce,
+ 0x8b, 0xe8, 0xaa, 0xd9, 0xa8, 0x08, 0xae, 0x2c,
+ 0x9f, 0xff, 0x85, 0xd5, 0xc5, 0xaa, 0x9d, 0xbf,
+ 0xdc, 0xd5, 0x6e, 0x3a, 0x7f, 0xff, 0x6f, 0x1f,
+ 0x75, 0x35, 0x54, 0x52, 0x6f, 0x8e, 0x49, 0x7a,
+ 0x0e, 0x9f, 0xff, 0xff, 0x5d, 0xde, 0x41, 0xf7,
+ 0xdc, 0x3e, 0x0e, 0x54, 0xb9, 0x1f, 0xae, 0x6f,
+ 0xb9, 0x7c, 0xe9, 0xff, 0xf5, 0xc2, 0x39, 0xaa,
+ 0x57, 0x79, 0xca, 0xa0, 0x43, 0xa3, 0x11, 0xc5,
+ 0x58, 0x46, 0x4f, 0xff, 0x3a, 0xf2, 0xb8, 0x9d,
+ 0x5b, 0xb9, 0xaa, 0x79, 0xd3, 0xff, 0xee, 0x31,
+ 0x5c, 0xaf, 0x34, 0x94, 0x59, 0xde, 0x2f, 0x1d,
+ 0x3f, 0xd9, 0xd7, 0xb9, 0x03, 0xfd, 0x63, 0xa7,
+ 0xfd, 0x4b, 0xbb, 0xca, 0x97, 0x2f, 0xdc, 0x27,
+ 0x4f, 0xfe, 0x7b, 0x95, 0x2b, 0x77, 0x2d, 0x52,
+ 0x88, 0x27, 0x4f, 0xff, 0xfb, 0x1f, 0xa6, 0xf0,
+ 0x3c, 0xab, 0x9a, 0xa6, 0x3d, 0xcb, 0x37, 0xc1,
+ 0xd1, 0x88, 0xc2, 0xda, 0x84, 0x3c, 0xae, 0x1d,
+ 0xa3, 0x4c, 0x7c, 0x9f, 0x6a, 0x4a, 0x5c, 0xa1,
+ 0xde, 0xa3, 0x09, 0x9f, 0xf7, 0x8d, 0x73, 0x49,
+ 0xdd, 0x80, 0xe9, 0xfe, 0xc0, 0xbe, 0xea, 0x72,
+ 0xd6, 0xce, 0x9f, 0xff, 0xf2, 0x32, 0x2b, 0x92,
+ 0xd5, 0xdf, 0x78, 0xe5, 0xcd, 0xbb, 0x95, 0xc3,
+ 0xa1, 0x91, 0xd5, 0xd3, 0xcb, 0xc3, 0xc9, 0xed,
+ 0xeb, 0x68, 0x74, 0xff, 0xff, 0xfd, 0xa4, 0x57,
+ 0x77, 0x7e, 0xbe, 0xb7, 0x2e, 0xdd, 0x79, 0xcb,
+ 0x1f, 0x76, 0x5d, 0xd0, 0x50, 0xe8, 0x72, 0x2e,
+ 0x36, 0x43, 0x08, 0xbc, 0x9f, 0x92, 0xf9, 0x77,
+ 0x1a, 0xef, 0xc3, 0xaa, 0x7b, 0x54, 0xf0, 0x1d,
+ 0x3f, 0xf5, 0x77, 0xcb, 0x63, 0x73, 0xde, 0x2c,
+ 0x74, 0xfd, 0xaf, 0x1e, 0xbf, 0xb3, 0xa3, 0x11,
+ 0x29, 0x7c, 0x87, 0x48, 0xd3, 0xdc, 0xee, 0xfa,
+ 0x1d, 0x3f, 0xff, 0x6c, 0x79, 0x66, 0xf3, 0xb7,
+ 0xeb, 0xbc, 0x56, 0x31, 0xd3, 0xff, 0xfd, 0xb7,
+ 0x85, 0x15, 0x4b, 0x93, 0x92, 0x0a, 0x71, 0x54,
+ 0x51, 0xd1, 0x88, 0xc4, 0x15, 0xc9, 0xff, 0xff,
+ 0xc2, 0x3b, 0x7b, 0x95, 0x73, 0x5d, 0x45, 0xab,
+ 0x8f, 0x23, 0xfa, 0xb9, 0x8e, 0x9f, 0xff, 0xf9,
+ 0x2f, 0xd5, 0x39, 0x77, 0x2e, 0xbf, 0xc9, 0xf7,
+ 0x53, 0x7d, 0xe6, 0x8f, 0x1d, 0x3e, 0x7e, 0x9b,
+ 0xce, 0x9d, 0x18, 0x8a, 0x7b, 0x9f, 0xe3, 0x69,
+ 0xa3, 0x56, 0x32, 0x39, 0xfe, 0xed, 0xcb, 0x77,
+ 0x2b, 0xfa, 0x3a, 0x7f, 0xb8, 0xaa, 0x07, 0x8a,
+ 0xfa, 0x8e, 0x9f, 0xff, 0xef, 0x1a, 0xe6, 0xb7,
+ 0x9d, 0x7a, 0x89, 0x9d, 0xe2, 0xa8, 0x74, 0xf6,
+ 0xb9, 0x3c, 0x27, 0x43, 0xe8, 0x89, 0xf6, 0x59,
+ 0xf9, 0x67, 0xdd, 0x72, 0x68, 0xe9, 0xfe, 0xaf,
+ 0xab, 0xb9, 0x5f, 0xd1, 0xd0, 0x87, 0xcf, 0x43,
+ 0x09, 0xfb, 0x34, 0x23, 0x8e, 0x3a, 0x7e, 0xee,
+ 0x57, 0xb8, 0xc7, 0x4f, 0x77, 0x29, 0xc9, 0x63,
+ 0xd5, 0xd1, 0x54, 0x70, 0xaf, 0x29, 0xa3, 0x67,
+ 0xd9, 0x50, 0x9d, 0x56, 0x18, 0x7a, 0x84, 0x52,
+ 0xe7, 0x69, 0xff, 0xbb, 0xdc, 0xe4, 0x39, 0x5e,
+ 0xe2, 0xc7, 0x42, 0x2e, 0xb7, 0x64, 0xe5, 0x97,
+ 0xbb, 0xcf, 0xba, 0x8a, 0xfe, 0x0e, 0x9f, 0xd8,
+ 0xb5, 0x73, 0x49, 0xc1, 0xd3, 0xff, 0xff, 0xd5,
+ 0xcd, 0x53, 0xd6, 0xe5, 0xdc, 0x7d, 0xd9, 0x73,
+ 0xdd, 0xce, 0x2b, 0xb5, 0x8e, 0x9a, 0xeb, 0xe7,
+ 0x40, 0xa2, 0x7b, 0x50, 0x85, 0x9f, 0xb1, 0xee,
+ 0xe3, 0xf4, 0x3a, 0x7f, 0xf0, 0xbe, 0xea, 0x62,
+ 0x9f, 0x4a, 0xd5, 0x0e, 0x95, 0x0e, 0x8b, 0x8f,
+ 0x6b, 0x9a, 0x54, 0xfe, 0x45, 0x77, 0x2b, 0xfa,
+ 0x3a, 0x7f, 0xff, 0xda, 0xea, 0x01, 0xf7, 0x52,
+ 0xe4, 0xd7, 0x73, 0x8d, 0xe0, 0xac, 0x74, 0x6d,
+ 0x53, 0x62, 0xc4, 0xff, 0x0d, 0x1e, 0x93, 0xd2,
+ 0x11, 0x17, 0x12, 0xf3, 0x31, 0x9f, 0x3b, 0x63,
+ 0x8f, 0x9d, 0x3e, 0xca, 0x3d, 0x81, 0x3a, 0x1f,
+ 0x3c, 0xea, 0x93, 0xcf, 0xff, 0xb6, 0xf6, 0x37,
+ 0x15, 0xde, 0x5f, 0xe5, 0x7e, 0xe4, 0x3a, 0x7a,
+ 0xf3, 0x59, 0x53, 0xa7, 0xff, 0xfe, 0xbc, 0x7d,
+ 0xde, 0xff, 0x2e, 0xdd, 0x79, 0xcb, 0x1f, 0x76,
+ 0x5d, 0xd0, 0x50, 0xe8, 0x79, 0x14, 0xd8, 0x49,
+ 0x3f, 0xff, 0xfe, 0x47, 0xe9, 0x72, 0x3f, 0xca,
+ 0xb9, 0xc7, 0x2e, 0xe5, 0xd7, 0xf9, 0x50, 0x00,
+ 0xde, 0x8e, 0x9f, 0x27, 0x5f, 0xf7, 0x8e, 0x9f,
+ 0xff, 0xff, 0xfd, 0x8a, 0xc6, 0x4a, 0xa2, 0xb5,
+ 0x94, 0xa2, 0x08, 0xa7, 0x71, 0xec, 0xba, 0x97,
+ 0x2d, 0xd4, 0x51, 0xd3, 0xfc, 0x0c, 0xe3, 0xb9,
+ 0x5f, 0xd1, 0xd3, 0xff, 0x3e, 0x97, 0xef, 0x2e,
+ 0xce, 0xad, 0xcd, 0x47, 0x4f, 0xff, 0x66, 0xb8,
+ 0xcc, 0x05, 0x39, 0x0d, 0x38, 0xa1, 0xd0, 0x8a,
+ 0xdf, 0x70, 0x8f, 0x71, 0x81, 0x89, 0x1a, 0xa1,
+ 0x23, 0x52, 0x8f, 0x85, 0x1f, 0x4e, 0x28, 0x9d,
+ 0x3b, 0x8e, 0x4b, 0x1d, 0x3f, 0xfc, 0xfb, 0xba,
+ 0x9c, 0x95, 0xd4, 0xbf, 0xad, 0xbc, 0x74, 0x61,
+ 0xfb, 0x6c, 0x82, 0x7e, 0x79, 0x67, 0x2f, 0x05,
+ 0xe3, 0xa7, 0xca, 0xdf, 0x19, 0xc1, 0xd2, 0x58,
+ 0xe9, 0x91, 0x47, 0x4b, 0x47, 0x40, 0x9a, 0x5f,
+ 0x15, 0x8e, 0x0f, 0x56, 0xa6, 0xd3, 0xda, 0xa7,
+ 0xbe, 0x74, 0xcb, 0x79, 0xd3, 0xfa, 0xbb, 0x17,
+ 0xdd, 0xd4, 0x3a, 0x17, 0xaa, 0x68, 0x08, 0x69,
+ 0x8f, 0xdb, 0x23, 0x51, 0x15, 0xc2, 0xd3, 0xfa,
+ 0x9b, 0x7c, 0x3f, 0xd0, 0x1d, 0x3f, 0xfe, 0x41,
+ 0x46, 0xc5, 0x23, 0x3b, 0x74, 0xb9, 0x47, 0x42,
+ 0xc8, 0x86, 0x5f, 0x34, 0x9d, 0xd0, 0x21, 0xd2,
+ 0xb2, 0xf1, 0xd5, 0x8e, 0xa4, 0xa0, 0x67, 0x97,
+ 0x78, 0x8d, 0x87, 0x27, 0x74, 0x9a, 0x5f, 0x83,
+ 0xf1, 0xd4, 0x6e, 0x13, 0x6b, 0x46, 0x06, 0x31,
+ 0xf6, 0x2a, 0x1d, 0x55, 0x9e, 0x8f, 0xf8, 0x71,
+ 0xf6, 0x76, 0x7e, 0x92, 0xa9, 0x35, 0x38, 0x7c,
+ 0xba, 0x30, 0x25, 0xf8, 0xd8, 0x79, 0xc3, 0x8e,
+ 0xf0, 0x9e, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1,
+ 0x4e, 0xcf, 0x85, 0xbf, 0xd8, 0xd1, 0x51, 0xcf,
+ 0xfb, 0xdd, 0x6c, 0x16, 0xff, 0x63, 0x44, 0xd1,
+ 0x2b, 0x61, 0xfb, 0x28, 0xc2, 0x7f, 0x5b, 0x05,
+ 0xbf, 0xd8, 0xd1, 0x57, 0xcf, 0x85, 0xbf, 0xd8,
+ 0xd1, 0x5b, 0x4f, 0xf3, 0xad, 0x82, 0xdf, 0xec,
+ 0x68, 0x90, 0x65, 0x6c, 0x3f, 0x1f, 0x30, 0x9f,
+ 0xfa, 0xde, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x24,
+ 0x39, 0xf0, 0xb7, 0xfb, 0x1a, 0x2c, 0x49, 0xff,
+ 0x93, 0x29, 0x9d, 0xe3, 0x60, 0x4e, 0x9d, 0x3b,
+ 0xa8, 0xf1, 0xd2, 0x77, 0x4f, 0x7e, 0xe4, 0x39,
+ 0xcb, 0xfb, 0x01, 0xd3, 0xef, 0x77, 0x3a, 0xa1,
+ 0xd3, 0xf5, 0x28, 0x3b, 0x0d, 0xec, 0xe8, 0xd9,
+ 0xec, 0xf9, 0x44, 0xfe, 0x02, 0x66, 0xb7, 0xd0,
+ 0x95, 0x18, 0x9c, 0x1b, 0xf0, 0x8f, 0xd9, 0x4d,
+ 0x5e, 0x00, 0x43, 0x3f, 0xf5, 0x76, 0x9a, 0xaf,
+ 0xdf, 0xce, 0x80, 0xe9, 0xff, 0xfd, 0xad, 0x7b,
+ 0xa9, 0x9d, 0x45, 0x7e, 0x6b, 0x48, 0xa3, 0xa7,
+ 0xff, 0xb1, 0xf7, 0x6a, 0xe7, 0xad, 0x5f, 0x56,
+ 0xe8, 0x74, 0xd5, 0xb6, 0x23, 0xdb, 0x68, 0xbd,
+ 0x5e, 0x8b, 0x27, 0x02, 0x91, 0xa3, 0x4f, 0xeb,
+ 0x60, 0xb7, 0xfb, 0x1a, 0x2c, 0xd9, 0xff, 0xd6,
+ 0x57, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0x02,
+ 0x6e, 0x54, 0x3a, 0x79, 0xbf, 0xd8, 0xd1, 0x6f,
+ 0xcf, 0xdc, 0xf5, 0xed, 0xe2, 0x74, 0x09, 0xeb,
+ 0x80, 0xae, 0x7d, 0xa7, 0x53, 0x9d, 0x0e, 0x9f,
+ 0xc8, 0xbb, 0x9e, 0xba, 0x80, 0x3a, 0x77, 0x71,
+ 0xc7, 0x4a, 0xce, 0x4c, 0x2f, 0x1b, 0xc4, 0x86,
+ 0xa5, 0x5a, 0x36, 0x9f, 0xf7, 0xba, 0xd8, 0x2d,
+ 0xfe, 0xc6, 0x8a, 0x52, 0x7f, 0x9d, 0x6c, 0x16,
+ 0xff, 0x63, 0x44, 0x9d, 0x2b, 0x29, 0x10, 0xfe,
+ 0x8d, 0x08, 0xed, 0x93, 0x5e, 0x8c, 0x8b, 0x8b,
+ 0x57, 0xbf, 0x91, 0xc9, 0xb4, 0x2c, 0x76, 0x4f,
+ 0x7b, 0x85, 0x62, 0xc4, 0xca, 0x96, 0xa1, 0x52,
+ 0x90, 0x1d, 0xd2, 0x35, 0xd5, 0xd0, 0xd6, 0x9f,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0x1f, 0x9f, 0xf7, 0xba,
+ 0xd8, 0x2d, 0xfe, 0xc6, 0x89, 0x4e, 0x56, 0xc3,
+ 0xf6, 0x51, 0x84, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1,
+ 0xa2, 0x27, 0x9f, 0xd6, 0xc1, 0x6f, 0xf6, 0x34,
+ 0x46, 0x33, 0xff, 0xac, 0xaf, 0x75, 0xb0, 0x5b,
+ 0xfd, 0x8d, 0x13, 0xcc, 0x22, 0x3b, 0xde, 0x27,
+ 0x71, 0xdd, 0x4e, 0xe7, 0xc2, 0xdf, 0xec, 0x68,
+ 0x88, 0x27, 0xfd, 0xee, 0xb6, 0x0b, 0x7f, 0xb1,
+ 0xa2, 0x54, 0x95, 0xb0, 0xfd, 0x94, 0x61, 0x3f,
+ 0xad, 0x82, 0xdf, 0xec, 0x68, 0x8a, 0x27, 0xf5,
+ 0xb0, 0x5b, 0xfd, 0x8d, 0x11, 0x94, 0xff, 0xeb,
+ 0x2b, 0xdd, 0x6c, 0x16, 0xff, 0x63, 0x44, 0xcb,
+ 0x3f, 0xad, 0x82, 0xdf, 0xec, 0x68, 0xa9, 0x27,
+ 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x15, 0xd4, 0xfe,
+ 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xc5, 0x9f, 0xf9,
+ 0x5e, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x27, 0xa9,
+ 0xfe, 0x0d, 0xbd, 0x36, 0xbf, 0xbb, 0xc3, 0xa2,
+ 0xc8, 0x8a, 0x44, 0xc9, 0xfa, 0xf4, 0xf9, 0xad,
+ 0xdd, 0x43, 0xa7, 0x85, 0x5a, 0x7c, 0xe9, 0xcd,
+ 0x95, 0x2a, 0x7f, 0xfe, 0xaf, 0x7e, 0xfe, 0xc5,
+ 0x1c, 0xec, 0xa0, 0x00, 0x87, 0x4f, 0xff, 0xc3,
+ 0xbb, 0xcf, 0x55, 0x90, 0x47, 0x77, 0x8d, 0x73,
+ 0xc7, 0x4f, 0x9b, 0x75, 0xe6, 0xa3, 0xa7, 0xff,
+ 0x7d, 0x3b, 0x80, 0xb5, 0x76, 0xde, 0x27, 0x4f,
+ 0xb5, 0x54, 0x53, 0x1d, 0x3f, 0xfb, 0xbc, 0x91,
+ 0x3a, 0x8a, 0xe5, 0xca, 0xab, 0xe7, 0x4f, 0xf5,
+ 0xdf, 0x4f, 0xad, 0xdd, 0x78, 0xe8, 0xda, 0x7b,
+ 0xc2, 0xb6, 0xa6, 0x0a, 0x94, 0xf5, 0x1f, 0x44,
+ 0xd7, 0x8a, 0x53, 0xbb, 0xfa, 0x35, 0x42, 0xd3,
+ 0xbb, 0xba, 0x1d, 0x20, 0xde, 0xa7, 0x88, 0x85,
+ 0x13, 0xc2, 0xbb, 0xd4, 0x74, 0x61, 0xe7, 0x6c,
+ 0xb2, 0x7f, 0xdb, 0xaf, 0xe9, 0x16, 0xa6, 0xd4,
+ 0x74, 0xfd, 0xbe, 0xdf, 0xde, 0x50, 0xe9, 0xee,
+ 0xf1, 0xca, 0xf9, 0xd3, 0xf6, 0x50, 0x3f, 0xd7,
+ 0x8e, 0x8f, 0x3d, 0x4e, 0x93, 0xcf, 0xae, 0xbf,
+ 0x4e, 0x10, 0xe8, 0xc4, 0x67, 0xee, 0x10, 0x75,
+ 0x21, 0x9f, 0xff, 0xfd, 0x54, 0xd8, 0x8a, 0x73,
+ 0xd6, 0xfb, 0x73, 0xb2, 0x9c, 0x5d, 0xe2, 0xe3,
+ 0xa7, 0xcf, 0x70, 0x3b, 0x09, 0xd3, 0xf7, 0x1e,
+ 0x20, 0x5f, 0xc3, 0xa7, 0xfd, 0xdd, 0xbb, 0x55,
+ 0xc1, 0xdd, 0x0e, 0x9f, 0xf7, 0xe0, 0x13, 0xbf,
+ 0xc6, 0x5f, 0x3a, 0x1c, 0x7f, 0x80, 0x3e, 0x9e,
+ 0xba, 0x95, 0x51, 0xd3, 0xf5, 0xd4, 0xd5, 0x33,
+ 0x47, 0x4e, 0x08, 0x42, 0x54, 0xff, 0xed, 0x6f,
+ 0x54, 0xae, 0xd7, 0xf9, 0x8a, 0x38, 0xab, 0x17,
+ 0x91, 0xb4, 0x54, 0x5c, 0x95, 0x0e, 0x54, 0xbf,
+ 0x8f, 0x5b, 0x29, 0x18, 0x55, 0xf4, 0x8b, 0x50,
+ 0xcb, 0x9a, 0xfe, 0x1d, 0x3e, 0x0e, 0x91, 0xf0,
+ 0x9d, 0x3f, 0x93, 0xc6, 0xa1, 0xfe, 0x0a, 0x98,
+ 0x21, 0x2a, 0x38, 0x3c, 0x70, 0x98, 0xcf, 0x53,
+ 0x5b, 0xbd, 0x95, 0x63, 0x47, 0x3f, 0xfa, 0xea,
+ 0x53, 0x8e, 0xa7, 0x15, 0x4d, 0x50, 0xe9, 0xff,
+ 0x6b, 0x63, 0xe0, 0xbc, 0xd6, 0x54, 0xe8, 0x72,
+ 0x23, 0x76, 0x9b, 0x3e, 0xc7, 0xb3, 0x62, 0x74,
+ 0xfd, 0xa4, 0x1e, 0x33, 0xa7, 0x4f, 0xee, 0x2a,
+ 0x9d, 0x0f, 0xbe, 0x74, 0xff, 0xff, 0xb6, 0xaf,
+ 0xeb, 0xee, 0xb0, 0x73, 0x6b, 0xb3, 0xb9, 0xc7,
+ 0xb8, 0xf1, 0x7a, 0xc2, 0x23, 0x73, 0xcb, 0x2e,
+ 0x34, 0x9f, 0xfe, 0xcd, 0x53, 0x16, 0xaa, 0x2e,
+ 0xca, 0xd5, 0x0e, 0x9f, 0xff, 0xff, 0x6f, 0x1f,
+ 0xa6, 0xf0, 0x3c, 0xb1, 0xf7, 0x53, 0x7a, 0xa6,
+ 0xdf, 0xe3, 0x8b, 0x9e, 0x3a, 0x3a, 0x8d, 0xed,
+ 0x28, 0x4d, 0xb0, 0x9d, 0x37, 0x30, 0x1d, 0x0b,
+ 0x1a, 0xe0, 0x0b, 0x4e, 0x77, 0xf0, 0x74, 0xc1,
+ 0x09, 0xd1, 0xb3, 0xd4, 0xa1, 0x10, 0x47, 0x27,
+ 0x6b, 0x98, 0x0a, 0xb1, 0xaf, 0x9f, 0xff, 0xfd,
+ 0xa4, 0xe2, 0xb7, 0x7d, 0xf5, 0x7f, 0x19, 0x9d,
+ 0xbf, 0x4a, 0x67, 0x40, 0x74, 0x3e, 0x8a, 0xbd,
+ 0x97, 0x4f, 0xf6, 0x6a, 0xa8, 0x3a, 0xc6, 0x3a,
+ 0x72, 0x0a, 0xc7, 0x46, 0x27, 0xe7, 0xf1, 0xbf,
+ 0xf4, 0x91, 0x7c, 0xd6, 0x7d, 0xdc, 0xd7, 0xde,
+ 0x1d, 0x3f, 0xf6, 0x08, 0xe2, 0xd5, 0xca, 0x7f,
+ 0x4e, 0x9f, 0xdd, 0x41, 0xb9, 0xaa, 0x87, 0x4f,
+ 0xb7, 0x7e, 0xbe, 0xe3, 0xa7, 0xed, 0xa2, 0x9e,
+ 0xc0, 0x9d, 0x30, 0x42, 0x74, 0x31, 0xf6, 0x09,
+ 0x48, 0x4b, 0x67, 0xfb, 0x16, 0xf5, 0xbd, 0xf7,
+ 0x50, 0xab, 0x1a, 0xd9, 0xff, 0xd9, 0xd0, 0x65,
+ 0x76, 0xfd, 0x2b, 0x75, 0x0e, 0x9f, 0xbb, 0xe0,
+ 0xe3, 0x3a, 0x74, 0xe0, 0x84, 0x25, 0x4f, 0xfc,
+ 0x83, 0xdb, 0xbf, 0x9e, 0x2c, 0x8a, 0x3a, 0xc5,
+ 0xe4, 0x5e, 0xd3, 0xfd, 0x5a, 0x19, 0x54, 0x4a,
+ 0xd2, 0x60, 0x52, 0x67, 0x78, 0xbc, 0x79, 0x04,
+ 0xa7, 0x9d, 0x8f, 0xb8, 0xf2, 0x09, 0x4e, 0xa6,
+ 0xf8, 0x3c, 0x82, 0x53, 0x04, 0x27, 0x90, 0x4a,
+ 0x19, 0x14, 0x8b, 0x14, 0x68, 0xbc, 0x25, 0x53,
+ 0xf7, 0xf4, 0x1d, 0xfd, 0x16, 0x41, 0x2b, 0x1b,
+ 0xd9, 0xe5, 0xfc, 0xfa, 0x9d, 0x2c, 0xbd, 0x9f,
+ 0x60, 0x12, 0x67, 0xf2, 0xce, 0xb9, 0xed, 0x6d,
+ 0xe2, 0xa7, 0xf6, 0xdd, 0x77, 0xd2, 0xbb, 0x3a,
+ 0x4e, 0x2a, 0x77, 0x8b, 0xc5, 0x41, 0x50, 0x86,
+ 0xd5, 0x84, 0x14, 0x37, 0x3d, 0xd4, 0x03, 0x15,
+ 0x63, 0x59, 0x08, 0x8c, 0x5c, 0x84, 0xac, 0xf5,
+ 0xde, 0x2e, 0x3a, 0x4a, 0x3a, 0x6c, 0x77, 0x06,
+ 0xc5, 0x62, 0x19, 0xf0, 0x71, 0x6d, 0xa8, 0xe9,
+ 0xf9, 0x91, 0x67, 0x20, 0x0a, 0x96, 0xce, 0x9f,
+ 0xe7, 0xae, 0x77, 0x15, 0xbb, 0xfa, 0x74, 0xfd,
+ 0xb4, 0x53, 0xd8, 0x13, 0xa7, 0xd8, 0xf2, 0xb1,
+ 0x47, 0x4e, 0xa6, 0xc4, 0xe8, 0xe9, 0xe1, 0x68,
+ 0x9e, 0x7e, 0xef, 0x80, 0x17, 0x50, 0xe9, 0xfb,
+ 0x77, 0xf9, 0xa2, 0xad, 0xc2, 0x61, 0x98, 0x20,
+ 0x27, 0xb4, 0x6f, 0xd1, 0x14, 0x62, 0x7a, 0x3b,
+ 0x28, 0xec, 0x67, 0x13, 0xdd, 0xc7, 0xae, 0x3a,
+ 0x1c, 0xaf, 0x5f, 0x0a, 0xeb, 0x0f, 0xde, 0xab,
+ 0xd2, 0x3f, 0xfd, 0x1b, 0x4e, 0x08, 0x42, 0x54,
+ 0xe1, 0x72, 0x15, 0x62, 0xf2, 0x7e, 0x79, 0x67,
+ 0x2f, 0x05, 0xe3, 0xa7, 0xab, 0xef, 0x84, 0xe9,
+ 0xf3, 0xc3, 0xb4, 0x51, 0xd3, 0xff, 0xc9, 0xcf,
+ 0x5d, 0x40, 0x7e, 0x81, 0xcf, 0xae, 0x3a, 0x17,
+ 0xaa, 0x34, 0x36, 0x69, 0xe4, 0x5a, 0x27, 0x9c,
+ 0xed, 0xf4, 0xe9, 0xfb, 0x48, 0xb7, 0x6e, 0xa1,
+ 0xd0, 0xe3, 0xcb, 0xd0, 0xe4, 0xeb, 0xae, 0x5e,
+ 0xce, 0x9b, 0xec, 0xbd, 0x1b, 0x76, 0xcb, 0xd2,
+ 0x36, 0xbd, 0x30, 0x89, 0x23, 0xf8, 0x7a, 0x1f,
+ 0x2e, 0x21, 0xe2, 0x30, 0xec, 0x95, 0x27, 0x7d,
+ 0x85, 0x85, 0xf7, 0x09, 0x25, 0xa1, 0x86, 0x24,
+ 0x6a, 0x8c, 0x0a, 0xb2, 0xc0, 0x3d, 0x17, 0xa5,
+ 0x34, 0x94, 0x7d, 0xa9, 0xd7, 0x9b, 0x9f, 0xd7,
+ 0xe1, 0xf3, 0xce, 0x11, 0xb7, 0x84, 0x53, 0xff,
+ 0xac, 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14,
+ 0x54, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xe8,
0x9f, 0xfa, 0xde, 0xeb, 0x60, 0xb7, 0xfb, 0x1a,
- 0x23, 0x99, 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d,
- 0xfe, 0xc6, 0x89, 0xca, 0x7f, 0x5b, 0x05, 0xbf,
- 0xd8, 0xd1, 0x66, 0x4f, 0xeb, 0x60, 0xb7, 0xfb,
- 0x1a, 0x2d, 0xd9, 0xff, 0xd6, 0x57, 0xba, 0xd8,
- 0x2d, 0xfe, 0xc6, 0x8a, 0x42, 0x7f, 0xeb, 0x7b,
- 0xad, 0x82, 0xdf, 0xec, 0x68, 0x94, 0xa1, 0xe4,
- 0xec, 0x96, 0x4c, 0x52, 0x97, 0x4e, 0xf4, 0x77,
- 0x70, 0xa5, 0x3f, 0xef, 0x75, 0xb0, 0x5b, 0xfd,
- 0x8d, 0x13, 0xb4, 0xff, 0xfb, 0x7c, 0x5e, 0xa4,
- 0xb8, 0xfe, 0x3a, 0x9d, 0xc6, 0x3a, 0x65, 0x59,
- 0x48, 0x9f, 0xf4, 0x69, 0xf0, 0xb7, 0xfb, 0x1a,
- 0x22, 0xc9, 0xff, 0x7b, 0xad, 0x82, 0xdf, 0xec,
- 0x68, 0x97, 0x67, 0xff, 0xec, 0xe2, 0x88, 0x0d,
- 0xb5, 0xdf, 0xe6, 0xb5, 0x4e, 0x4a, 0x95, 0xb1,
- 0x1a, 0x8a, 0x30, 0x5f, 0x46, 0x9f, 0xfd, 0x65,
- 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x98, 0xa7,
- 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x15, 0x4c, 0xff,
- 0xeb, 0x2b, 0xdd, 0x6c, 0x16, 0xff, 0x63, 0x44,
- 0xe9, 0x3f, 0xb7, 0xe2, 0x8e, 0xf5, 0xc7, 0x4f,
- 0x96, 0x45, 0x92, 0xa7, 0x4f, 0xc1, 0xcd, 0xae,
- 0xce, 0x9d, 0x3d, 0xba, 0x25, 0xb6, 0x7a, 0xd5,
- 0x28, 0x9f, 0xfa, 0xfa, 0xe9, 0x1f, 0xb5, 0xeb,
- 0x6d, 0x47, 0x42, 0x91, 0x05, 0x43, 0x99, 0xff,
- 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x9d, 0xe7,
- 0xda, 0xbf, 0xd5, 0xb2, 0xa5, 0x6e, 0x13, 0x9b,
- 0xc8, 0xc2, 0x94, 0x47, 0xe8, 0xd3, 0xff, 0xac,
- 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14, 0x2c,
- 0xff, 0xeb, 0x2b, 0xdd, 0x6c, 0x16, 0xff, 0x63,
- 0x45, 0x25, 0x3f, 0xff, 0xb2, 0xb6, 0x07, 0x16,
- 0xa7, 0xab, 0x54, 0x4d, 0x5e, 0xa3, 0xa1, 0xe5,
- 0xc0, 0x27, 0x1c, 0x32, 0x90, 0x9d, 0xaa, 0x3e,
- 0xde, 0x52, 0x6f, 0x52, 0x5f, 0x52, 0x9f, 0xd6,
- 0xc1, 0x6f, 0xf6, 0x34, 0x44, 0x93, 0xff, 0xac,
- 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x12, 0xf4,
- 0xf8, 0x5b, 0xfd, 0x8d, 0x14, 0xbc, 0xfe, 0x4e,
- 0x2e, 0x36, 0xa4, 0xa9, 0xd2, 0xb6, 0x1f, 0x36,
- 0x8c, 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x14,
- 0xe4, 0xff, 0xb6, 0x3f, 0x5a, 0x66, 0x75, 0x8e,
- 0x9f, 0xf6, 0x51, 0x07, 0x2c, 0x10, 0x84, 0xa9,
- 0xb6, 0x13, 0xa6, 0x7a, 0xdc, 0x22, 0x35, 0x7c,
- 0xee, 0xe0, 0xf2, 0x7c, 0x2d, 0xfe, 0xc6, 0x8a,
- 0xf2, 0x7f, 0xfe, 0xce, 0x28, 0x80, 0xdb, 0x5d,
- 0xfe, 0x6b, 0x54, 0xe4, 0xa9, 0x5b, 0x11, 0x1c,
- 0xbe, 0x61, 0x3f, 0xf5, 0xbd, 0xd6, 0xc1, 0x6f,
- 0xf6, 0x34, 0x48, 0xf3, 0xb7, 0xca, 0x1d, 0x39,
- 0xb1, 0x45, 0x58, 0xbc, 0x9f, 0x0b, 0x7f, 0xb1,
- 0xa2, 0x48, 0x9e, 0xb7, 0xba, 0xc8, 0x7b, 0x38,
- 0x53, 0x3f, 0xf5, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6,
- 0x34, 0x49, 0x53, 0xe1, 0x6f, 0xf6, 0x34, 0x5e,
- 0x33, 0xf5, 0xfd, 0x7f, 0xdf, 0xa9, 0xd3, 0xea,
- 0xd7, 0x58, 0xc7, 0x4f, 0xf3, 0xad, 0x82, 0xdf,
- 0xec, 0x68, 0x93, 0x65, 0x6c, 0x46, 0x3b, 0xe6,
- 0x02, 0x61, 0xe4, 0xd0, 0x8b, 0xa5, 0x6f, 0x1d,
- 0xba, 0x17, 0x1c, 0x13, 0xee, 0x19, 0x0b, 0x43,
- 0x49, 0x45, 0x74, 0x86, 0x0e, 0x8d, 0xef, 0x8c,
- 0x4e, 0x12, 0x33, 0xea, 0x07, 0xa3, 0x9f, 0x74,
- 0x79, 0x3c, 0x47, 0xb5, 0x96, 0xd9, 0xfa, 0xec,
- 0xa5, 0x76, 0xaf, 0x4d, 0x9f, 0x9e, 0x0b, 0xdc,
- 0xe6, 0x2d, 0xce, 0x3b, 0x05, 0xa9, 0x63, 0xa3,
- 0x3f, 0x70, 0xab, 0xee, 0x55, 0xa4, 0xed, 0x2f,
- 0xd3, 0x65, 0xb9, 0x95, 0x64, 0xbd, 0x42, 0xc3,
- 0xb3, 0xb5, 0x75, 0xa4, 0x43, 0x6a, 0xb6, 0xcd,
- 0xbe, 0x93, 0xce, 0xba, 0x3d, 0x70, 0xc7, 0xf8,
- 0xbf, 0x0f, 0xc0, 0x67, 0x41, 0x2e, 0x27, 0x6a,
- 0x60,
+ 0x24, 0xb9, 0xfd, 0x6c, 0x16, 0xff, 0x63, 0x45,
+ 0xe5, 0x08, 0xde, 0x3b, 0xbc, 0x4e, 0xe3, 0xbc,
+ 0x3b, 0x65, 0x25, 0x8e, 0xd4, 0x77, 0x58, 0x62,
+ 0xf6, 0xb7, 0x8e, 0xa4, 0x75, 0x7a, 0x52, 0xb8,
+ 0xed, 0x72, 0x64, 0xff, 0xeb, 0x2b, 0xdd, 0x6c,
+ 0x16, 0xff, 0x63, 0x44, 0xb3, 0x3c, 0xdf, 0xec,
+ 0x68, 0x8c, 0xe7, 0xed, 0xa2, 0x9e, 0xc0, 0x9d,
+ 0x37, 0x5c, 0x74, 0x94, 0x74, 0xfb, 0x63, 0x5f,
+ 0xb0, 0x9e, 0x9a, 0x8b, 0x79, 0x8b, 0x4f, 0xde,
+ 0xed, 0x8f, 0x89, 0xd3, 0xa8, 0x8f, 0x9d, 0x02,
+ 0x98, 0x82, 0x9f, 0xba, 0x99, 0xa2, 0xa9, 0xff,
+ 0xb5, 0xb1, 0xf0, 0x72, 0x7d, 0xc8, 0xa3, 0xa7,
+ 0xdd, 0x47, 0x53, 0xce, 0x8d, 0x9f, 0x62, 0xe4,
+ 0x69, 0xff, 0xb1, 0x5a, 0xd8, 0x68, 0x95, 0xfb,
+ 0xd9, 0xd3, 0xfe, 0xaa, 0x6e, 0xbb, 0x4e, 0xad,
+ 0x71, 0xd2, 0xb6, 0x26, 0xa8, 0xb4, 0x2a, 0x7a,
+ 0x49, 0x44, 0x79, 0xff, 0xd6, 0x57, 0xba, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x89, 0xa6, 0x7f, 0xf5, 0x95,
+ 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x71, 0x9f,
+ 0xfd, 0x65, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68,
+ 0xa0, 0x67, 0xc2, 0xdf, 0xec, 0x68, 0xb8, 0x26,
+ 0x4d, 0x9d, 0x3f, 0xba, 0xe4, 0xdf, 0x18, 0xa3,
+ 0xa5, 0x6c, 0x3f, 0x8a, 0x98, 0x5c, 0x2b, 0x3f,
+ 0xb7, 0x6e, 0x68, 0x0c, 0x09, 0xd3, 0xfc, 0xeb,
+ 0x60, 0xb7, 0xfb, 0x1a, 0x24, 0x99, 0x5a, 0xa7,
+ 0xeb, 0xe6, 0x90, 0xf2, 0xe9, 0xf3, 0xa5, 0x5b,
+ 0x32, 0x4a, 0xca, 0x40, 0x52, 0xa4, 0x32, 0xb5,
+ 0x0a, 0xa9, 0xff, 0x5f, 0xfb, 0x60, 0xb7, 0xfb,
+ 0x1a, 0x2d, 0x49, 0xff, 0x7b, 0xad, 0x82, 0xdf,
+ 0xec, 0x68, 0x95, 0x60, 0xe9, 0x5a, 0xfa, 0x26,
+ 0x14, 0x91, 0x78, 0x8d, 0x3f, 0xad, 0x82, 0xdf,
+ 0xec, 0x68, 0x8a, 0x67, 0xf5, 0xb0, 0x5b, 0xfd,
+ 0x8d, 0x11, 0xa4, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1,
+ 0xa2, 0x9f, 0x9f, 0xfd, 0x65, 0x7b, 0xad, 0x82,
+ 0xdf, 0xec, 0x68, 0x9a, 0xa7, 0xf5, 0xb0, 0x5b,
+ 0xfd, 0x8d, 0x15, 0xdc, 0xf3, 0x7f, 0xb1, 0xa2,
+ 0xbe, 0x9c, 0x10, 0x84, 0xa9, 0x74, 0xab, 0x17,
+ 0x90, 0x27, 0xcc, 0xa4, 0x79, 0xce, 0x47, 0xce,
+ 0x9f, 0xf6, 0x54, 0x3f, 0xaa, 0x26, 0x3c, 0x74,
+ 0xff, 0xbf, 0x63, 0x8f, 0x6d, 0xd9, 0xc1, 0xd2,
+ 0xb6, 0x22, 0xe1, 0x62, 0x1e, 0x8e, 0x50, 0xf6,
+ 0x7f, 0xf5, 0x95, 0xee, 0xb6, 0x0b, 0x7f, 0xb1,
+ 0xa2, 0x7b, 0x9f, 0xd6, 0xc1, 0x6f, 0xf6, 0x34,
+ 0x5c, 0x33, 0xff, 0x5b, 0xdd, 0x6c, 0x16, 0xff,
+ 0x63, 0x44, 0x9f, 0x08, 0xae, 0xcd, 0xe3, 0xb7,
+ 0x1d, 0xdf, 0x3b, 0x63, 0xb5, 0x94, 0x86, 0x35,
+ 0x9a, 0xa1, 0xd1, 0x49, 0x71, 0xdc, 0xfe, 0xb6,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0x2a, 0x9f, 0xd6, 0xc1,
+ 0x6f, 0xf6, 0x34, 0x53, 0x33, 0xff, 0xac, 0xaf,
+ 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13, 0x3c, 0xff,
+ 0xeb, 0x2b, 0xdd, 0x6c, 0x16, 0xff, 0x63, 0x45,
+ 0x1b, 0x0f, 0x26, 0x35, 0xc1, 0xdd, 0xf3, 0xbd,
+ 0x29, 0x4f, 0xfd, 0x6f, 0x75, 0xb0, 0x5b, 0xfd,
+ 0x8d, 0x11, 0xd4, 0xfd, 0xbc, 0xef, 0x18, 0xf1,
+ 0xd3, 0xe1, 0x6f, 0xf6, 0x34, 0x53, 0x53, 0xf6,
+ 0xd1, 0x4f, 0x60, 0x4e, 0x9f, 0xfe, 0xcd, 0x57,
+ 0x1c, 0x3f, 0xdd, 0x57, 0xdc, 0x74, 0xc8, 0x03,
+ 0xa7, 0xfa, 0x9e, 0xfa, 0x36, 0xda, 0xc2, 0x88,
+ 0xfe, 0x96, 0xf3, 0x4d, 0x95, 0xb8, 0x4d, 0x2f,
+ 0x0b, 0xb5, 0x0b, 0xf9, 0xf0, 0xb7, 0xfb, 0x1a,
+ 0x2a, 0xa9, 0xff, 0x7b, 0xad, 0x82, 0xdf, 0xec,
+ 0x68, 0x9b, 0x65, 0x6c, 0x3f, 0x65, 0x18, 0x4f,
+ 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2b, 0xf9, 0xfd,
+ 0x6c, 0x16, 0xff, 0x63, 0x45, 0x8d, 0x3e, 0x16,
+ 0xff, 0x63, 0x45, 0xab, 0x3f, 0xef, 0x75, 0xb0,
+ 0x5b, 0xfd, 0x8d, 0x14, 0x14, 0xad, 0x87, 0xec,
+ 0xa3, 0x09, 0xfd, 0x6c, 0x16, 0xff, 0x63, 0x45,
+ 0xc5, 0x3f, 0xad, 0x82, 0xdf, 0xec, 0x68, 0xba,
+ 0x67, 0xff, 0xdd, 0xfb, 0x69, 0xd8, 0x23, 0xee,
+ 0x7b, 0x02, 0x74, 0xfd, 0x7a, 0xf7, 0x2b, 0xfa,
+ 0x3a, 0x79, 0xbf, 0xd8, 0xd1, 0x26, 0x4f, 0xf0,
+ 0xe3, 0xfa, 0xd7, 0xba, 0x87, 0x40, 0x9f, 0x1a,
+ 0x8a, 0xe7, 0xee, 0x01, 0x7a, 0xd0, 0x0b, 0xe7,
+ 0x4f, 0xb3, 0x5b, 0x57, 0x9d, 0x3f, 0xfe, 0xf6,
+ 0x14, 0xaf, 0x73, 0x59, 0x60, 0x84, 0x25, 0x43,
+ 0x8f, 0xe3, 0x44, 0xd3, 0xff, 0xae, 0xef, 0xe9,
+ 0x06, 0x95, 0x4e, 0xe8, 0xe9, 0xc1, 0x08, 0x4a,
+ 0x9f, 0x87, 0xde, 0x56, 0xe8, 0x55, 0x8b, 0xc9,
+ 0xf6, 0x28, 0x72, 0xf6, 0x74, 0xff, 0x94, 0x8d,
+ 0x5e, 0xdd, 0xa4, 0xa1, 0xd3, 0xfd, 0x9e, 0x0e,
+ 0x59, 0xc7, 0xb8, 0xe9, 0xff, 0xde, 0xf5, 0x76,
+ 0x9d, 0xc5, 0xb6, 0x3b, 0x3a, 0x31, 0x18, 0x3a,
+ 0x3e, 0x09, 0xcc, 0xfd, 0x7b, 0xee, 0x57, 0xf4,
+ 0x74, 0xf6, 0x9e, 0xce, 0x0e, 0x9f, 0xed, 0xdf,
+ 0xe6, 0x20, 0x56, 0xe8, 0x74, 0x2c, 0x7c, 0x0b,
+ 0xe4, 0x73, 0x82, 0x10, 0x9d, 0x3f, 0xfe, 0xc5,
+ 0x6b, 0xa8, 0x0c, 0xe2, 0x98, 0xa4, 0x62, 0xac,
+ 0x5e, 0x46, 0x26, 0x69, 0xb8, 0x48, 0x55, 0x0a,
+ 0x7f, 0x08, 0xf8, 0xf5, 0x1c, 0x74, 0xce, 0xb2,
+ 0xf1, 0x73, 0x63, 0x21, 0x29, 0x7c, 0x85, 0xf8,
+ 0x57, 0xac, 0x45, 0xec, 0xbd, 0x3c, 0xa4, 0x3a,
+ 0xb5, 0x1b, 0x1f, 0x33, 0x59, 0xf6, 0x28, 0x72,
+ 0xf6, 0x74, 0xff, 0xd9, 0x5e, 0xa3, 0xdc, 0xeb,
+ 0x5f, 0xbd, 0x9d, 0x3f, 0x7b, 0x58, 0x21, 0x09,
+ 0xd2, 0xb3, 0x2f, 0x40, 0xfc, 0xe9, 0x5f, 0x61,
+ 0x6f, 0x42, 0x95, 0xc9, 0x50, 0xe6, 0x56, 0xd7,
+ 0x11, 0xcb, 0xbf, 0x0b, 0x21, 0x27, 0x51, 0xd8,
+ 0x21, 0x63, 0x42, 0x7d, 0x1d, 0xdd, 0x3d, 0x79,
+ 0x3f, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x8d, 0x67,
+ 0xc2, 0xdf, 0xec, 0x68, 0xa9, 0x66, 0xf6, 0x34,
+ 0x43, 0x52, 0xb6, 0x1e, 0x8f, 0x98, 0x4f, 0xfd,
+ 0x6f, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x11, 0xf4,
+ 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xc7, 0x9f,
+ 0xaf, 0x5e, 0xe5, 0x7f, 0x47, 0x4f, 0xf7, 0x7c,
+ 0x14, 0xfd, 0x6b, 0xce, 0x9e, 0x02, 0xb6, 0x27,
+ 0x4f, 0xff, 0xf2, 0x0f, 0x73, 0x8c, 0xad, 0x76,
+ 0xd5, 0xde, 0xa9, 0xef, 0x9d, 0x1b, 0x44, 0x3d,
+ 0x48, 0x67, 0xc2, 0xdf, 0xec, 0x68, 0xb4, 0x27,
+ 0xe5, 0xdc, 0xf5, 0xd4, 0x01, 0xd3, 0xe4, 0xd6,
+ 0x55, 0x0e, 0x9f, 0xfe, 0xcd, 0x53, 0x16, 0xaa,
+ 0x2e, 0xca, 0xd5, 0x0e, 0x87, 0x8f, 0xd7, 0xa4,
+ 0xb0, 0x88, 0xc9, 0xc8, 0x53, 0x4f, 0xf7, 0x73,
+ 0x35, 0x5f, 0xed, 0xf3, 0xa7, 0xf6, 0x55, 0x6d,
+ 0xd7, 0x6a, 0x3a, 0x7f, 0x3b, 0x06, 0x9d, 0x47,
+ 0x8e, 0x9f, 0xec, 0xc0, 0xe3, 0x36, 0x04, 0xe8,
+ 0xc4, 0x4d, 0x3e, 0x69, 0x43, 0x29, 0xec, 0xaf,
+ 0xe8, 0xe9, 0xfd, 0x7f, 0x7d, 0xb9, 0xd9, 0x43,
+ 0xa5, 0x65, 0xe2, 0xb8, 0xa4, 0x31, 0xe2, 0x17,
+ 0xd8, 0x47, 0x58, 0x7c, 0xd0, 0x9b, 0x50, 0xd3,
+ 0x5f, 0x30, 0xe6, 0x41, 0x3f, 0x5e, 0x6f, 0x8e,
+ 0xa2, 0xc7, 0x4f, 0x65, 0x7f, 0x47, 0x4a, 0xf5,
+ 0xc3, 0xd2, 0xe9, 0x94, 0xf8, 0x5b, 0xfd, 0x8d,
+ 0x16, 0xb4, 0xff, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6,
+ 0x34, 0x50, 0x72, 0xb2, 0xf1, 0x14, 0x58, 0x58,
+ 0xa3, 0x09, 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d,
+ 0xfe, 0xc6, 0x8a, 0x2e, 0x7f, 0x5b, 0x05, 0xbf,
+ 0xd8, 0xd1, 0x75, 0x43, 0x97, 0xc6, 0x9a, 0x11,
+ 0x9b, 0x26, 0x52, 0x65, 0x65, 0xe2, 0x82, 0x39,
+ 0x1a, 0x1c, 0xe9, 0x4a, 0x7c, 0x2d, 0xfe, 0xc6,
+ 0x88, 0x86, 0x75, 0x73, 0x83, 0xa5, 0x6c, 0x3c,
+ 0xc7, 0xcc, 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d,
+ 0x11, 0xb4, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2,
+ 0x9b, 0x9f, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x54,
+ 0x13, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0x9a,
+ 0x7c, 0x2d, 0xfe, 0xc6, 0x8a, 0xc2, 0x7d, 0xb0,
+ 0xf1, 0x70, 0x9d, 0x3f, 0xce, 0xb6, 0x0b, 0x7f,
+ 0xb1, 0xa2, 0x3f, 0x9d, 0x88, 0xf1, 0xd2, 0xb6,
+ 0x22, 0xd5, 0x8c, 0x3c, 0xa7, 0xa8, 0x33, 0xff,
+ 0xac, 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13,
+ 0x7c, 0xff, 0xca, 0xf7, 0x5b, 0x05, 0xbf, 0xd8,
+ 0xd1, 0x3f, 0x4f, 0xd7, 0xa1, 0x7a, 0xde, 0xab,
+ 0xf8, 0xf9, 0xd3, 0xff, 0xc8, 0x88, 0x88, 0x88,
+ 0x88, 0x8f, 0xd0, 0xe9, 0xf0, 0xed, 0xef, 0x51,
+ 0x53, 0x04, 0x25, 0x46, 0x1b, 0xd0, 0x93, 0xca,
+ 0xe2, 0xac, 0x68, 0x21, 0x11, 0x8f, 0x48, 0x53,
+ 0x4f, 0xc3, 0xed, 0x5d, 0x89, 0xd3, 0xcf, 0x2b,
+ 0x6e, 0x3a, 0x7f, 0x55, 0x15, 0x60, 0x01, 0x0e,
+ 0x90, 0xa1, 0xea, 0xec, 0x8e, 0x70, 0x29, 0x87,
+ 0x4f, 0x53, 0x5b, 0x58, 0xe8, 0x44, 0xc2, 0xb6,
+ 0x4e, 0x2f, 0xfd, 0x26, 0xd0, 0xdc, 0xf7, 0xad,
+ 0xcd, 0x47, 0x4d, 0xfd, 0x3a, 0x04, 0xdc, 0xa8,
+ 0x92, 0x70, 0x42, 0x13, 0xa7, 0x9e, 0xee, 0xd0,
+ 0xab, 0x17, 0x93, 0xcf, 0xeb, 0x6c, 0x74, 0x22,
+ 0x23, 0xea, 0x79, 0x71, 0x8c, 0xff, 0xcf, 0x5c,
+ 0x0c, 0xed, 0xcb, 0x26, 0xbc, 0xe9, 0xe4, 0xd5,
+ 0x18, 0xd1, 0x07, 0x40, 0x9f, 0xa6, 0x91, 0xe6,
+ 0x1e, 0x0e, 0x98, 0x21, 0x3a, 0x1c, 0x6b, 0x02,
+ 0x2d, 0x3d, 0x44, 0xda, 0xe2, 0xac, 0x68, 0x67,
+ 0xd4, 0xe7, 0xc0, 0x28, 0x74, 0x6c, 0xf7, 0xb9,
+ 0x99, 0xce, 0x08, 0x42, 0x54, 0x15, 0x62, 0xf2,
+ 0x7b, 0x61, 0xda, 0xc5, 0x43, 0x1b, 0xcd, 0x8c,
+ 0xc6, 0xd3, 0x68, 0xac, 0x33, 0x3a, 0xf9, 0x3d,
+ 0xc7, 0xf4, 0x07, 0x4f, 0xfc, 0x9d, 0x07, 0x51,
+ 0xf5, 0x93, 0xa0, 0x3a, 0x00, 0x7c, 0xf4, 0x22,
+ 0x9f, 0x96, 0x4c, 0x1a, 0xec, 0xe9, 0xfb, 0x58,
+ 0xb7, 0x51, 0x47, 0x88, 0x0a, 0x7d, 0xfd, 0xe2,
+ 0xa8, 0x68, 0x80, 0xac, 0x6e, 0xa7, 0xc8, 0x0d,
+ 0xbf, 0x43, 0xa7, 0xf0, 0xad, 0x4d, 0xf7, 0x5b,
+ 0x3a, 0x79, 0xf0, 0x0a, 0x15, 0x30, 0x42, 0x54,
+ 0x21, 0xb7, 0x09, 0x0c, 0xfd, 0xe2, 0xe7, 0x77,
+ 0x65, 0x58, 0xd0, 0x42, 0x27, 0x77, 0x84, 0x5b,
+ 0x66, 0xea, 0x26, 0x8a, 0x2e, 0x84, 0x5c, 0xfa,
+ 0xed, 0x5d, 0xfc, 0xcd, 0x10, 0x3c, 0xff, 0xab,
+ 0x73, 0xc9, 0xc9, 0x34, 0x9c, 0x1d, 0x3b, 0xc5,
+ 0xe3, 0xa6, 0x08, 0x4e, 0x9f, 0xc3, 0xbc, 0x5d,
+ 0xcd, 0xd6, 0x63, 0x62, 0x11, 0xb9, 0x27, 0x08,
+ 0xbf, 0x17, 0x39, 0xff, 0xd8, 0xa5, 0x7b, 0xb0,
+ 0x5b, 0xfd, 0x8d, 0x10, 0xc4, 0x54, 0xfe, 0x7a,
+ 0x51, 0x3f, 0x60, 0xb7, 0xfb, 0x1a, 0x20, 0xa9,
+ 0xed, 0x51, 0x00, 0x54, 0xef, 0x17, 0x8a, 0x9e,
+ 0xbb, 0xbf, 0x7c, 0xa9, 0xfd, 0xb7, 0xb3, 0x54,
+ 0x40, 0x15, 0x05, 0x4f, 0xd8, 0xc9, 0x54, 0x51,
+ 0x53, 0x04, 0x25, 0x4f, 0xdd, 0x4e, 0xbd, 0xb1,
+ 0x2a, 0x31, 0x30, 0xa6, 0x21, 0x50, 0xdd, 0x49,
+ 0x00, 0x67, 0xd0, 0xa0, 0x95, 0x73, 0x16, 0x9b,
+ 0x62, 0x55, 0x8f, 0xca, 0x5e, 0xe4, 0xf5, 0xeb,
+ 0x1d, 0x8c, 0xff, 0x91, 0xdf, 0xdc, 0xa0, 0xa5,
+ 0x0e, 0x9f, 0xf2, 0x6a, 0xa8, 0xbb, 0x84, 0x02,
+ 0x1d, 0x3f, 0xff, 0x2d, 0xfe, 0xef, 0xaf, 0x2c,
+ 0x7a, 0xed, 0x5d, 0xfc, 0xcd, 0x17, 0xdc, 0xfb,
+ 0x7a, 0xee, 0x38, 0xe9, 0xff, 0x77, 0x6e, 0xd5,
+ 0x70, 0x77, 0x43, 0xa7, 0xf6, 0x81, 0xcf, 0xae,
+ 0xae, 0x1e, 0x20, 0x19, 0xde, 0x2e, 0x3c, 0x40,
+ 0x31, 0x87, 0xd3, 0x72, 0x14, 0xde, 0xe3, 0xc4,
+ 0x03, 0x3d, 0xfd, 0x7d, 0xc7, 0x88, 0x06, 0x7f,
+ 0x6d, 0xab, 0x80, 0x02, 0x1e, 0x20, 0x19, 0xdb,
+ 0xef, 0x07, 0x88, 0x06, 0x38, 0x45, 0xca, 0x88,
+ 0xaa, 0x5e, 0xb8, 0xfa, 0x70, 0xa6, 0x8f, 0x10,
+ 0x0c, 0x1e, 0x20, 0x19, 0x91, 0x47, 0x88, 0x06,
+ 0x38, 0x37, 0x3b, 0x17, 0x9e, 0xda, 0xb8, 0x43,
+ 0xc4, 0x03, 0x3b, 0x5e, 0xc7, 0x88, 0x06, 0x7f,
+ 0xdd, 0xf7, 0x5a, 0xbb, 0x6f, 0x13, 0xc4, 0x03,
+ 0x37, 0xf0, 0x78, 0x80, 0x67, 0xf7, 0x7c, 0x34,
+ 0xa2, 0x00, 0xf1, 0x00, 0xcf, 0xb7, 0x7f, 0xfa,
+ 0x03, 0xc4, 0x03, 0x36, 0xe8, 0x78, 0x80, 0x60,
+ 0x4f, 0x67, 0x46, 0xd3, 0xed, 0x75, 0x1f, 0x71,
+ 0xa2, 0x01, 0x98, 0x08, 0x78, 0x80, 0x6c, 0x6d,
+ 0x67, 0xdb, 0x45, 0x7f, 0x07, 0x88, 0x06, 0x7a,
+ 0xef, 0xeb, 0x1e, 0x20, 0x19, 0xc8, 0x2c, 0x78,
+ 0x80, 0x67, 0xfd, 0x8f, 0xd3, 0x84, 0xce, 0x82,
+ 0x87, 0x88, 0x06, 0x7d, 0x77, 0xb9, 0xc8, 0x78,
+ 0x80, 0x63, 0x11, 0x01, 0x54, 0xc9, 0x84, 0x07,
+ 0x88, 0x06, 0x1c, 0xaa, 0x3f, 0x82, 0x3c, 0x84,
+ 0xc6, 0xd5, 0xaa, 0x64, 0x03, 0x4a, 0x17, 0x6a,
+ 0x14, 0xd7, 0x11, 0x4f, 0xb3, 0x54, 0xf7, 0xcf,
+ 0x10, 0x0c, 0xfe, 0xe1, 0x19, 0x61, 0x4d, 0x1e,
+ 0x20, 0x1e, 0x0d, 0xa4, 0xe1, 0x40, 0x9e, 0x20,
+ 0x18, 0x63, 0xf7, 0x15, 0x09, 0xed, 0xf5, 0xd4,
+ 0x3c, 0x40, 0x33, 0xf7, 0xac, 0xec, 0x7d, 0xc7,
+ 0x88, 0x06, 0x31, 0x11, 0x40, 0x20, 0xb8, 0xbe,
+ 0x7f, 0xf7, 0xbd, 0xc5, 0x52, 0x96, 0xa5, 0xc2,
+ 0x03, 0xc4, 0x03, 0x30, 0x80, 0xf1, 0x00, 0xcf,
+ 0xbf, 0x54, 0xdb, 0xe7, 0x88, 0x06, 0x7e, 0xdf,
+ 0x6e, 0x76, 0x50, 0xf1, 0x00, 0xc2, 0x22, 0x4b,
+ 0xa4, 0x5a, 0x35, 0x8e, 0x17, 0xf5, 0x72, 0x1b,
+ 0x6b, 0x20, 0x0b, 0x05, 0x48, 0xbc, 0xbc, 0x04,
+ 0xf4, 0x95, 0xb1, 0xa8, 0xf0, 0x17, 0xcc, 0x39,
+ 0xc3, 0xae, 0x77, 0xfb, 0x1a, 0x20, 0x1b, 0x22,
+ 0xda, 0x7a, 0xfd, 0xe9, 0x70, 0xa3, 0xa6, 0x02,
+ 0x15, 0x2b, 0xe5, 0x4e, 0xaa, 0x3c, 0x74, 0xc1,
+ 0x09, 0x51, 0xb3, 0xd9, 0xbd, 0x8a, 0xac, 0x24,
+ 0x11, 0xc9, 0xca, 0xdd, 0x0a, 0xb1, 0xe0, 0xcf,
+ 0x6a, 0x97, 0x97, 0x1d, 0x0f, 0x32, 0xaa, 0x9c,
+ 0x4e, 0xd4, 0x93, 0x2d, 0x9c, 0x02, 0x18, 0xdc,
+ 0xcb, 0x67, 0xe1, 0x59, 0xc8, 0x2f, 0x1d, 0x3f,
+ 0xe7, 0x53, 0x97, 0x71, 0x48, 0x37, 0xce, 0x9f,
+ 0xb9, 0x84, 0x77, 0x95, 0x2a, 0x79, 0x6a, 0xfa,
+ 0xc7, 0x4f, 0xb1, 0x67, 0x23, 0xe7, 0x4f, 0x67,
+ 0x51, 0xc5, 0x40, 0x9f, 0x5f, 0x48, 0xef, 0x0a,
+ 0x21, 0x13, 0x38, 0xc2, 0xda, 0xa0, 0xfc, 0x26,
+ 0x67, 0xb7, 0xdd, 0x50, 0xe9, 0xd7, 0x2f, 0x74,
+ 0x3a, 0x7f, 0xed, 0x53, 0x38, 0x47, 0xe9, 0x8f,
+ 0xe8, 0xe8, 0x43, 0xe8, 0xf2, 0x29, 0xf7, 0xae,
+ 0xe3, 0x84, 0x3a, 0x6a, 0x50, 0xe9, 0xc1, 0x08,
+ 0x4e, 0x98, 0x1e, 0x55, 0x8b, 0xc8, 0x13, 0xd6,
+ 0xa1, 0x94, 0xef, 0x06, 0x15, 0x0e, 0x45, 0xda,
+ 0xa1, 0x00, 0xbe, 0x43, 0x3f, 0xb5, 0xdc, 0x7c,
+ 0x1c, 0xdc, 0x74, 0xff, 0x77, 0x17, 0x65, 0x82,
+ 0x10, 0x95, 0x39, 0x5f, 0xa3, 0xa2, 0xa7, 0xaa,
+ 0xb8, 0xea, 0x11, 0x1c, 0xfb, 0x38, 0xf8, 0x45,
+ 0xcd, 0x5f, 0x3a, 0x65, 0xa8, 0x74, 0xfd, 0x6c,
+ 0x5d, 0xbe, 0xf1, 0x86, 0xb3, 0x98, 0xac, 0xf7,
+ 0x19, 0x5f, 0x3a, 0x7f, 0xe4, 0xce, 0xba, 0xb9,
+ 0xde, 0xa0, 0x4e, 0x96, 0xc5, 0x15, 0x7d, 0x48,
+ 0xd1, 0x0c, 0x3c, 0xda, 0x4c, 0x3a, 0x37, 0x0e,
+ 0x23, 0xf9, 0xbe, 0x5e, 0xc7, 0x7b, 0x3f, 0x1a,
+ 0x58, 0xc5, 0x63, 0xa3, 0x02, 0x07, 0x61, 0x15,
+ 0xa8, 0xf0, 0x97, 0x46, 0x15, 0x3f, 0x74, 0x19,
+ 0xc7, 0xb8, 0xe9, 0xf7, 0x35, 0x9c, 0x97, 0xb2,
+ 0xa3, 0x0f, 0x6f, 0x99, 0x6c, 0xff, 0xe1, 0xbf,
+ 0xdb, 0xbf, 0x9e, 0x53, 0x69, 0xd3, 0xa5, 0xcc,
+ 0xd1, 0x02, 0xcb, 0x46, 0xa0, 0x52, 0x5b, 0xd1,
+ 0xbc, 0x08, 0xfc, 0xff, 0xb6, 0xbf, 0x5d, 0xf3,
+ 0xb0, 0x00, 0x85, 0x4f, 0xfe, 0xd5, 0x3d, 0xfe,
+ 0x4a, 0x4c, 0xee, 0x97, 0xce, 0x84, 0x44, 0x9e,
+ 0xd1, 0x27, 0x3d, 0xd7, 0x1d, 0x08, 0x9c, 0x12,
+ 0xa1, 0x13, 0x58, 0x5d, 0x5c, 0x45, 0x3f, 0x9c,
+ 0xb6, 0x77, 0xeb, 0x87, 0x4f, 0xfe, 0x16, 0xee,
+ 0x2e, 0xee, 0x20, 0xa5, 0x0e, 0x9f, 0xde, 0xb5,
+ 0x71, 0x59, 0x43, 0xa3, 0x0f, 0xe5, 0x72, 0x3c,
+ 0xff, 0xfc, 0x81, 0xa6, 0x9f, 0x6d, 0xd7, 0x95,
+ 0xe6, 0x57, 0x6a, 0x3a, 0x36, 0x88, 0x4d, 0x11,
+ 0xce, 0xe3, 0xc4, 0xe9, 0xf0, 0x3f, 0xb9, 0x78,
+ 0x74, 0x21, 0xe2, 0x5c, 0x37, 0x3c, 0x8a, 0x7d,
+ 0x63, 0xa1, 0x13, 0xdb, 0x74, 0x65, 0xf4, 0x67,
+ 0xd1, 0x14, 0xf0, 0x3d, 0xfa, 0x1d, 0x30, 0x42,
+ 0x74, 0x50, 0xdc, 0x04, 0x8a, 0x7e, 0xa6, 0xeb,
+ 0xf9, 0x52, 0xac, 0x68, 0x67, 0x04, 0x21, 0x2a,
+ 0x79, 0xda, 0xc6, 0x2a, 0xc5, 0xe4, 0xfb, 0x38,
+ 0xd8, 0x28, 0x74, 0xbc, 0x4f, 0x5f, 0xa5, 0xf3,
+ 0xf7, 0x5f, 0xa2, 0xd9, 0xa3, 0xa7, 0xcf, 0x5e,
+ 0xf7, 0x8f, 0x9d, 0x3f, 0xec, 0x6e, 0x30, 0x43,
+ 0xf5, 0x58, 0xe9, 0x9c, 0xf1, 0x50, 0xf9, 0xea,
+ 0x74, 0xf6, 0x05, 0x14, 0x9f, 0x08, 0x18, 0x44,
+ 0xc7, 0xf0, 0x9b, 0xe1, 0xa7, 0x3f, 0xeb, 0xe8,
+ 0xff, 0x52, 0xb5, 0xb9, 0x8e, 0x9f, 0xbb, 0xf7,
+ 0xeb, 0xee, 0x3a, 0x70, 0x42, 0x12, 0xa7, 0x73,
+ 0x40, 0x15, 0x62, 0xf2, 0x7f, 0xbb, 0xe0, 0xe4,
+ 0xe4, 0x03, 0xe7, 0x47, 0x08, 0xf2, 0x52, 0x08,
+ 0x12, 0xb4, 0x59, 0x38, 0x21, 0x09, 0x62, 0x10,
+ 0x9f, 0x0b, 0x7f, 0xb1, 0x62, 0x10, 0xb1, 0xa9,
+ 0x9c, 0x10, 0x84, 0xb1, 0x07, 0xc1, 0x62, 0x0f,
+ 0xb1, 0xa9, 0x99, 0x15, 0x88, 0x90, 0x66, 0x99,
+ 0xf6, 0x93, 0x48, 0xa3, 0xa7, 0xbb, 0xb4, 0xbe,
+ 0x74, 0xee, 0x68, 0x03, 0xa1, 0xe3, 0xc0, 0x51,
+ 0x1c, 0xf9, 0x92, 0xa8, 0xa2, 0xa7, 0xdd, 0xfe,
+ 0xf7, 0x0a, 0x9b, 0x18, 0xa9, 0x82, 0x12, 0xa3,
+ 0x0f, 0xd6, 0x84, 0xba, 0x26, 0x08, 0xa4, 0xfe,
+ 0xef, 0x34, 0x05, 0x72, 0xf0, 0xab, 0x1b, 0xb8,
+ 0x44, 0xe0, 0x36, 0xcd, 0xf0, 0xd3, 0x9f, 0xfd,
+ 0x54, 0x05, 0x33, 0x38, 0xfe, 0xfd, 0xf3, 0xa7,
+ 0xf5, 0x39, 0xaa, 0x81, 0xf7, 0xce, 0x84, 0x56,
+ 0xaf, 0xb8, 0x7b, 0x8c, 0x75, 0x9e, 0x69, 0x44,
+ 0xa9, 0xc1, 0x08, 0x4a, 0x9f, 0x38, 0x1f, 0xde,
+ 0x0a, 0xb1, 0x79, 0x3f, 0xfd, 0xd7, 0xf9, 0x3e,
+ 0x04, 0xeb, 0x7b, 0xdd, 0xf3, 0xa7, 0xff, 0xce,
+ 0xc4, 0xb7, 0x1d, 0x4b, 0x9b, 0x2f, 0xec, 0x4e,
+ 0x9e, 0xdf, 0x18, 0xa3, 0xa1, 0x13, 0x02, 0x71,
+ 0xbf, 0xa9, 0xdc, 0xad, 0x3f, 0xea, 0x51, 0x07,
+ 0x49, 0x6e, 0x36, 0x74, 0xff, 0xbb, 0xeb, 0x57,
+ 0xc4, 0x77, 0xc1, 0xd1, 0xb3, 0xfc, 0x51, 0xf4,
+ 0xfd, 0xe3, 0xc6, 0x67, 0x4e, 0x9f, 0xfe, 0xcd,
+ 0x53, 0x16, 0xaa, 0x2e, 0xca, 0xd5, 0x0e, 0x9f,
+ 0xda, 0xbd, 0x0b, 0x75, 0x7a, 0x3d, 0x71, 0xd1,
+ 0xc2, 0x2f, 0xba, 0x57, 0xa5, 0x09, 0xff, 0xfd,
+ 0xdd, 0x65, 0x76, 0x9a, 0xd8, 0x11, 0xd6, 0x08,
+ 0x42, 0x54, 0xf7, 0x19, 0x97, 0xca, 0x9c, 0xee,
+ 0xdc, 0x68, 0x86, 0x67, 0x04, 0x21, 0x2a, 0x76,
+ 0x75, 0x8a, 0xb1, 0x79, 0x3f, 0xec, 0x7b, 0x38,
+ 0xf7, 0x75, 0x1e, 0x3a, 0x00, 0x7d, 0x1d, 0x29,
+ 0x84, 0x4d, 0x51, 0xe6, 0x17, 0xc8, 0xc6, 0x15,
+ 0xd3, 0xdb, 0xd6, 0xd0, 0xe9, 0xfd, 0x76, 0x08,
+ 0x01, 0xbe, 0x9d, 0x3f, 0xfe, 0x47, 0x6f, 0x8a,
+ 0xf3, 0xa6, 0x0b, 0x7f, 0xb1, 0xa2, 0x0c, 0x8a,
+ 0xa2, 0x53, 0x46, 0x73, 0xf9, 0x7f, 0x28, 0xbf,
+ 0x82, 0x87, 0x43, 0x93, 0x0e, 0xdc, 0x2d, 0x74,
+ 0x47, 0x3f, 0xfc, 0x9d, 0x7b, 0x92, 0xdb, 0xee,
+ 0x71, 0x9d, 0xbe, 0x74, 0xe4, 0x15, 0x8e, 0x84,
+ 0x5c, 0x5d, 0xc8, 0x70, 0x6e, 0x38, 0x5f, 0x8d,
+ 0x46, 0xe3, 0x65, 0xf5, 0x69, 0xfd, 0xad, 0xae,
+ 0xde, 0x9c, 0x85, 0x49, 0x47, 0x4f, 0xea, 0x67,
+ 0x6f, 0x8a, 0x5b, 0x67, 0x8b, 0xcc, 0xd6, 0x78,
+ 0x6e, 0x7d, 0xc7, 0x4f, 0xee, 0xbb, 0xb8, 0xa4,
+ 0x63, 0xa7, 0x2b, 0x8c, 0x3a, 0x10, 0xfc, 0x30,
+ 0x8f, 0xcc, 0x67, 0xfd, 0x76, 0xa9, 0xcc, 0x40,
+ 0xad, 0xd0, 0xe9, 0xff, 0x93, 0xbf, 0x54, 0x05,
+ 0x86, 0x94, 0x2a, 0x38, 0x44, 0x22, 0x90, 0xa7,
+ 0xd5, 0xde, 0xdf, 0xa1, 0xd0, 0x54, 0xfd, 0x4e,
+ 0x68, 0x28, 0xa2, 0xa0, 0xa8, 0x2a, 0x0a, 0x82,
+ 0xa1, 0xc7, 0xbf, 0xb0, 0xa0, 0x16, 0xdc, 0x14,
+ 0xbe, 0x15, 0x78, 0x15, 0x35, 0x70, 0xa9, 0xfb,
+ 0xff, 0x4b, 0x22, 0x8a, 0xe4, 0x5a, 0xc9, 0x7b,
+ 0x2a, 0x0a, 0x82, 0xa1, 0xc5, 0xa6, 0xc2, 0xa0,
+ 0xa8, 0x2a, 0x0a, 0x82, 0xa0, 0xa8, 0x2a, 0x1e,
+ 0x37, 0x9c, 0x05, 0x6c, 0x28, 0x01, 0x54, 0x0a,
+ 0x5c, 0x15, 0x05, 0x41, 0x50, 0xe2, 0xd2, 0x81,
+ 0x50, 0x54, 0x15, 0x05, 0x41, 0x50, 0xe3, 0x50,
+ 0x00, 0xad, 0x05, 0x5e, 0x05, 0x41, 0x50, 0x54,
+ 0x15, 0x05, 0x43, 0xc6, 0xa2, 0xf8, 0x50, 0x85,
+ 0x54, 0x2a, 0x57, 0xca, 0x82, 0xa0, 0xa8, 0x2a,
+ 0x0a, 0x8e, 0x0d, 0x43, 0xe1, 0x40, 0x0a, 0xb8,
+ 0x2a, 0x0a, 0x82, 0xa0, 0xa9, 0xf5, 0x50, 0x14,
+ 0xc2, 0xa0, 0xa8, 0x71, 0xe7, 0x30, 0x55, 0x42,
+ 0xbc, 0x28, 0x04, 0xd2, 0x62, 0xa0, 0xa8, 0x2a,
+ 0x0a, 0x82, 0xa1, 0xc6, 0xa1, 0xf0, 0xad, 0x85,
+ 0x2e, 0x0a, 0x82, 0xa0, 0xa8, 0x2a, 0x0a, 0x87,
+ 0x1a, 0x8e, 0x02, 0xaa, 0x15, 0xd0, 0xa9, 0x54,
+ 0xa8, 0x2a, 0x0a, 0x93, 0x8a, 0x82, 0x9f, 0x2c,
+ 0x20, 0xa8, 0x2a, 0x0a, 0x82, 0xa1, 0xe3, 0xe6,
+ 0x70, 0x55, 0xf1, 0xa6, 0x1a, 0x58, 0x28, 0x01,
+ 0x5a, 0x0a, 0x96, 0x15, 0x05, 0x41, 0x52, 0x71,
+ 0x50, 0x53, 0xe5, 0x84, 0x15, 0x05, 0x42, 0x1e,
+ 0x93, 0x82, 0xb6, 0x34, 0x23, 0x4a, 0x0a, 0x82,
+ 0xa0, 0xa8, 0x2a, 0x0a, 0x82, 0xa1, 0x0d, 0x93,
+ 0xe1, 0x42, 0x14, 0xa0, 0xae, 0x85, 0x41, 0x50,
+ 0x54, 0x15, 0x02, 0x5f, 0x50, 0x2b, 0x41, 0x50,
+ 0x54, 0x15, 0x05, 0x42, 0x8b, 0xee, 0x85, 0x68,
+ 0x2a, 0x4a, 0x2a, 0x0a, 0x82, 0xa0, 0x05, 0xa5,
+ 0xc1, 0x50, 0x54, 0x15, 0x05, 0x41, 0x50, 0x86,
+ 0xa1, 0x60, 0xaa, 0x85, 0x5c, 0x15, 0x08, 0xbf,
+ 0x5a, 0xf3, 0x93, 0x8f, 0x78, 0x29, 0xc5, 0xc6,
+ 0x6d, 0x7d, 0x23, 0x6c, 0xd7, 0xb3, 0xd5, 0x8e,
+ 0x86, 0x11, 0x8a, 0x47, 0xa9, 0xbf, 0xb3, 0x00,
+ 0xf3, 0xae, 0xd4, 0x66, 0xd3, 0x0d, 0xcf, 0x2b,
+ 0x99, 0x42, 0x94, 0xbe, 0x5b, 0xcc, 0x92, 0xf1,
+ 0x26, 0x7c, 0xee, 0xa6, 0x50, 0xab, 0x26, 0xaf,
+ 0x3b, 0x68, 0xa2, 0xa7, 0xb6, 0xde, 0x27, 0x4e,
+ 0xdf, 0x18, 0x74, 0xf3, 0xe9, 0xce, 0xcf, 0xa2,
+ 0x3c, 0x4e, 0x6a, 0x37, 0xa1, 0xf9, 0x80, 0x87,
+ 0x4f, 0xc3, 0xfd, 0xe6, 0x80, 0x3a, 0x6f, 0x13,
+ 0xa5, 0xb3, 0x98, 0xb4, 0x93, 0x1d, 0x25, 0x1d,
+ 0x3b, 0x17, 0xed, 0xb4, 0x49, 0x88, 0xad, 0x50,
+ 0x7c, 0x7b, 0x98, 0x7c, 0xff, 0xfa, 0xe4, 0xe5,
+ 0xe2, 0x3e, 0x04, 0xb0, 0x42, 0x13, 0xa1, 0xcc,
+ 0xd4, 0x9e, 0x21, 0x7b, 0xb8, 0x58, 0x2c, 0x49,
+ 0xf4, 0xa1, 0xbe, 0xc3, 0xab, 0x4b, 0xd3, 0xf9,
+ 0x3b, 0xaf, 0xed, 0xd8, 0x74, 0xfe, 0x17, 0x77,
+ 0x6e, 0xae, 0x1d, 0x3e, 0xc0, 0x66, 0x2c, 0x74,
+ 0xfd, 0x4c, 0x5d, 0xd4, 0x7c, 0xe9, 0x26, 0x22,
+ 0x1f, 0xa6, 0x5a, 0x26, 0x9e, 0xbb, 0xc5, 0xc7,
+ 0x4f, 0x25, 0xcb, 0xdd, 0x0a, 0x9f, 0x3a, 0xc1,
+ 0x08, 0x4e, 0x8e, 0x9e, 0x7d, 0xc4, 0xf1, 0xc2,
+ 0x24, 0xf1, 0xc2, 0x14, 0x9d, 0x18, 0x21, 0x73,
+ 0x74, 0x31, 0xe7, 0xe1, 0xb8, 0x19, 0xd6, 0x3a,
+ 0x7b, 0x8e, 0x11, 0x71, 0xd3, 0xff, 0xe4, 0xaa,
+ 0x29, 0x93, 0x58, 0x2d, 0xfe, 0xc6, 0x8b, 0xe2,
+ 0x7f, 0x07, 0xf5, 0x44, 0xc7, 0x8e, 0x9f, 0xff,
+ 0xb3, 0x5c, 0xdc, 0x8b, 0xb7, 0xd0, 0x0e, 0xd1,
+ 0x58, 0x54, 0xda, 0xc3, 0xa7, 0xc3, 0xb7, 0xbd,
+ 0x46, 0x98, 0x4e, 0x7b, 0x57, 0x27, 0x9a, 0x61,
+ 0x39, 0x80, 0x86, 0xa0, 0x4e, 0x7f, 0x77, 0xef,
+ 0xe9, 0x04, 0x06, 0xa0, 0x4e, 0x7f, 0x53, 0x2b,
+ 0xba, 0x5c, 0xf1, 0xa6, 0x13, 0x9b, 0x38, 0x34,
+ 0xc2, 0x73, 0x04, 0x27, 0x98, 0x4e, 0x31, 0x34,
+ 0xc7, 0xcd, 0x36, 0x5c, 0xa2, 0x2a, 0x20, 0x2e,
+ 0x42, 0x09, 0x1c, 0xb4, 0x59, 0x84, 0xec, 0x7c,
+ 0xf2, 0xdb, 0xe9, 0xfb, 0x06, 0x3c, 0x88, 0xa2,
+ 0xa8, 0x4d, 0x4a, 0x53, 0x8e, 0x15, 0xb1, 0x31,
+ 0x2d, 0x56, 0xf5, 0x2a, 0xda, 0x7d, 0xc6, 0x0e,
+ 0xef, 0x9d, 0x3e, 0xee, 0x73, 0xc5, 0x8e, 0x9f,
+ 0xc0, 0xe7, 0xd7, 0x2f, 0xfb, 0xc7, 0x47, 0x4f,
+ 0x8b, 0x45, 0x30, 0x8b, 0x90, 0x39, 0x2e, 0x3b,
+ 0x68, 0xdf, 0x08, 0xb9, 0xff, 0xca, 0xd5, 0x37,
+ 0xd7, 0xdd, 0xad, 0xd3, 0x67, 0x4f, 0xff, 0xee,
+ 0xe3, 0xf9, 0x4f, 0xed, 0x76, 0x9a, 0xad, 0xde,
+ 0xa3, 0xa7, 0x0d, 0x28, 0x78, 0x80, 0xe7, 0xff,
+ 0xed, 0xeb, 0x98, 0xa5, 0x53, 0x96, 0x0b, 0x7f,
+ 0xb1, 0xa2, 0x03, 0xb1, 0xa8, 0x9f, 0xff, 0xf7,
+ 0x7d, 0xd9, 0xd5, 0x9d, 0x8f, 0xbb, 0x9a, 0x02,
+ 0xc1, 0x08, 0x4a, 0x9f, 0xc9, 0x82, 0xdf, 0xec,
+ 0x68, 0x82, 0x67, 0xf9, 0x35, 0x82, 0xdf, 0xec,
+ 0x68, 0xbe, 0x67, 0xdb, 0x5d, 0xdc, 0xa7, 0x07,
+ 0xf4, 0xc7, 0x53, 0xfe, 0x7b, 0xdf, 0x5f, 0xcd,
+ 0x77, 0xd7, 0x1d, 0x38, 0x21, 0x09, 0x53, 0xf6,
+ 0xab, 0x8d, 0xe2, 0x55, 0x8b, 0xc8, 0x79, 0x13,
+ 0x3d, 0x60, 0x9f, 0xf9, 0xe5, 0x23, 0xf4, 0xee,
+ 0x3d, 0xcd, 0xc7, 0x4f, 0xff, 0x73, 0x7f, 0xbc,
+ 0x9a, 0xbb, 0x00, 0x10, 0x5c, 0x74, 0xe0, 0x84,
+ 0x25, 0x4f, 0xee, 0x60, 0x4e, 0xe3, 0xfa, 0x2a,
+ 0xc5, 0xe4, 0xff, 0xfc, 0xbd, 0xf2, 0x6a, 0xef,
+ 0x8e, 0x30, 0x3c, 0xb5, 0x4c, 0x78, 0xe9, 0x7d,
+ 0x51, 0x57, 0x72, 0x24, 0x39, 0x54, 0x5e, 0xe1,
+ 0xb4, 0x24, 0x8a, 0x49, 0xd4, 0x63, 0x73, 0xfe,
+ 0xcd, 0x20, 0xd2, 0xa9, 0xdd, 0x1e, 0x20, 0x89,
+ 0xfc, 0x98, 0x2d, 0xfe, 0xc6, 0x88, 0x22, 0xc7,
+ 0x93, 0x3f, 0xbb, 0xf5, 0x11, 0xd8, 0x4e, 0x80,
+ 0x1f, 0xe7, 0x52, 0xe7, 0xf9, 0x3b, 0xae, 0x79,
+ 0x5f, 0x7c, 0xe9, 0xff, 0xef, 0x0e, 0xb2, 0xa9,
+ 0xbd, 0x77, 0x2b, 0xb3, 0xa1, 0xc8, 0x88, 0xe9,
+ 0xd4, 0xfe, 0xd7, 0x35, 0x50, 0x3e, 0xf9, 0xd3,
+ 0xdb, 0x5b, 0x61, 0x3a, 0x7f, 0xfd, 0x73, 0xdd,
+ 0x4c, 0xad, 0x93, 0x59, 0x5b, 0x84, 0xe9, 0xf6,
+ 0x6a, 0x9c, 0xe9, 0xc1, 0xfc, 0xf3, 0x23, 0x9f,
+ 0x9a, 0xbb, 0x5f, 0xdd, 0xf3, 0xa7, 0xe5, 0x25,
+ 0xee, 0xb8, 0xf1, 0xd1, 0xc1, 0xf1, 0xec, 0xca,
+ 0x70, 0xf3, 0xa1, 0xd3, 0xfe, 0xfe, 0xb6, 0x0b,
+ 0x7f, 0xb1, 0xa2, 0x11, 0x84, 0x3e, 0x2b, 0x87,
+ 0x67, 0xff, 0x26, 0x3f, 0xcf, 0x5b, 0xed, 0xce,
+ 0xca, 0x1d, 0x3f, 0xfd, 0xfe, 0xf7, 0x3c, 0xaf,
+ 0xaa, 0xc1, 0x08, 0x4e, 0x96, 0x70, 0x89, 0xe5,
+ 0x93, 0x67, 0x04, 0x21, 0x2a, 0x7f, 0xb0, 0x1e,
+ 0x38, 0xbb, 0x38, 0x2a, 0xc5, 0xe4, 0xc1, 0x09,
+ 0x53, 0x82, 0x10, 0x95, 0x3f, 0x7b, 0xdc, 0x55,
+ 0x28, 0x55, 0x8b, 0xc8, 0xea, 0x2d, 0x82, 0x8e,
+ 0xbe, 0x65, 0x3e, 0x6d, 0xf1, 0xcd, 0x45, 0x58,
+ 0xd9, 0xce, 0x08, 0x42, 0x54, 0xea, 0x20, 0x95,
+ 0x62, 0xf2, 0x40, 0xd9, 0xff, 0xe9, 0x5a, 0x7e,
+ 0xe3, 0xa8, 0xef, 0x63, 0xa7, 0xf7, 0x31, 0xe3,
+ 0x6b, 0x93, 0x83, 0xa7, 0xf6, 0xab, 0x8b, 0xb3,
+ 0x54, 0x3a, 0x05, 0x13, 0x15, 0x2c, 0xe9, 0xc4,
+ 0x22, 0x3b, 0xf2, 0x18, 0x13, 0x9f, 0xbd, 0x3d,
+ 0xe8, 0x3a, 0x7f, 0xf6, 0x5e, 0xff, 0xa0, 0xc6,
+ 0x4a, 0xa2, 0x8e, 0x9f, 0x9b, 0x74, 0xae, 0xd6,
+ 0x2a, 0x7f, 0xb9, 0x77, 0x1f, 0x75, 0x37, 0x7c,
+ 0xe9, 0xe4, 0xf5, 0x2e, 0x2a, 0x70, 0x42, 0x12,
+ 0xa7, 0xff, 0xb9, 0xa0, 0x33, 0x3b, 0xaa, 0xed,
+ 0x3a, 0xf1, 0x56, 0x2f, 0x25, 0x8c, 0x89, 0xe5,
+ 0x1f, 0x42, 0x27, 0x4c, 0xe2, 0xb7, 0xd2, 0xb6,
+ 0x5d, 0x58, 0x6e, 0x4f, 0xff, 0x95, 0x8c, 0x9d,
+ 0xfd, 0x53, 0x8b, 0xbc, 0x5c, 0x74, 0xf9, 0x35,
+ 0x45, 0xd8, 0x74, 0x21, 0xfe, 0x69, 0x52, 0x7f,
+ 0xfb, 0x6b, 0xb3, 0xbc, 0x77, 0xc3, 0x9d, 0xfb,
+ 0xe7, 0x4f, 0xff, 0xf7, 0x15, 0xd8, 0x72, 0xf3,
+ 0x6a, 0xfd, 0x52, 0xe7, 0x63, 0xfa, 0x3a, 0x31,
+ 0x18, 0x1e, 0xa7, 0x08, 0xcf, 0x7b, 0x79, 0x35,
+ 0xd0, 0x89, 0xe1, 0xdb, 0x25, 0xba, 0xee, 0x31,
+ 0xb5, 0xa1, 0x54, 0x24, 0x6a, 0x85, 0x7d, 0x61,
+ 0x4e, 0x08, 0x42, 0xf6, 0x18, 0x14, 0x95, 0x3b,
+ 0xa8, 0xf3, 0x2e, 0x86, 0x60, 0x61, 0xc3, 0x39,
+ 0x72, 0x74, 0xe9, 0xff, 0xec, 0xed, 0xb5, 0x7f,
+ 0x6f, 0xd2, 0xb8, 0x0f, 0x3a, 0x4f, 0xb8, 0xfb,
+ 0xf8, 0x1d, 0x9f, 0xaa, 0xb6, 0xeb, 0xb5, 0x1d,
+ 0x3f, 0xee, 0xa6, 0xab, 0xe0, 0xf7, 0xe8, 0x74,
+ 0xff, 0xd4, 0xfd, 0x8e, 0x3f, 0x60, 0x84, 0x27,
+ 0x4f, 0xff, 0x75, 0x1d, 0xcb, 0x9e, 0xb7, 0xdb,
+ 0x9d, 0x94, 0x3a, 0x31, 0x30, 0x66, 0x2f, 0xa9,
+ 0xf0, 0x11, 0x27, 0xf2, 0x75, 0xdd, 0xcc, 0x01,
+ 0xd3, 0xf9, 0xd8, 0x34, 0xea, 0x3c, 0x74, 0xff,
+ 0xf2, 0x2e, 0x41, 0xb7, 0x3d, 0x77, 0x1e, 0xd8,
+ 0x9e, 0xef, 0x79, 0xff, 0xec, 0xd2, 0x75, 0xb3,
+ 0x55, 0xd8, 0x81, 0x8e, 0x9f, 0x7d, 0x33, 0xba,
+ 0x3a, 0x76, 0xbe, 0xf6, 0x74, 0xfe, 0xd5, 0x77,
+ 0x60, 0x7e, 0xce, 0x87, 0x93, 0x23, 0xe1, 0x7f,
+ 0xa9, 0x9a, 0x26, 0xb8, 0x7e, 0x7f, 0xfe, 0xee,
+ 0x52, 0xee, 0x59, 0x5f, 0xee, 0x2c, 0xe4, 0x7c,
+ 0xe9, 0xff, 0x65, 0x2e, 0xc1, 0x6f, 0xf6, 0x34,
+ 0x40, 0xd3, 0xec, 0xd5, 0x7d, 0xdc, 0x91, 0x4b,
+ 0xd5, 0xe9, 0xff, 0xff, 0xfb, 0x35, 0x5f, 0xed,
+ 0xfe, 0x54, 0x1f, 0xfd, 0x2e, 0xce, 0x39, 0x62,
+ 0xbf, 0xaf, 0xb8, 0xf1, 0x05, 0xcf, 0xfb, 0xfe,
+ 0xfb, 0x7f, 0x1c, 0xaf, 0x84, 0xf1, 0x05, 0xcf,
+ 0xfd, 0x5d, 0xd7, 0x69, 0xdd, 0x72, 0xbe, 0x13,
+ 0xc4, 0x17, 0x3f, 0x93, 0x7d, 0xd7, 0x2b, 0xe1,
+ 0x3c, 0x41, 0x73, 0xf2, 0xb3, 0x8e, 0x57, 0xc2,
+ 0x78, 0x82, 0xe7, 0xff, 0xfb, 0xfb, 0xdd, 0xab,
+ 0x95, 0x1a, 0xbb, 0x1d, 0xdf, 0x7b, 0x02, 0x78,
+ 0x82, 0xe6, 0x7f, 0x97, 0x09, 0xd0, 0xb2, 0x80,
+ 0xab, 0x7a, 0x27, 0x4f, 0xe2, 0xaa, 0xa5, 0xbb,
+ 0x28, 0xfa, 0x7b, 0xc4, 0x1e, 0x74, 0xff, 0xd5,
+ 0xdd, 0x76, 0x9d, 0xd7, 0x2b, 0xe1, 0x3c, 0x41,
+ 0x73, 0xfc, 0xb5, 0x1b, 0x6f, 0x72, 0xbe, 0x13,
+ 0xc4, 0x17, 0x3e, 0xd5, 0x11, 0x5c, 0x99, 0x14,
+ 0x5c, 0xd5, 0xa7, 0xff, 0x72, 0x6a, 0xed, 0x93,
+ 0x54, 0xe5, 0x7c, 0x27, 0x88, 0x2e, 0x7f, 0xff,
+ 0xee, 0xf7, 0x6a, 0xe5, 0x76, 0x72, 0xa3, 0x57,
+ 0x63, 0xbb, 0xef, 0x60, 0x4f, 0x10, 0x5c, 0x62,
+ 0x64, 0xcf, 0xa1, 0xfa, 0xe4, 0xff, 0x57, 0x63,
+ 0xbb, 0xef, 0x60, 0x4f, 0x10, 0x5c, 0xff, 0xf7,
+ 0xfb, 0xee, 0xa5, 0x77, 0xc7, 0x08, 0x28, 0x54,
+ 0xff, 0xb1, 0xce, 0xba, 0x83, 0xd7, 0x97, 0xcf,
+ 0x10, 0x5c, 0x32, 0x3a, 0x05, 0x22, 0x8a, 0x13,
+ 0xfe, 0x6d, 0x8e, 0xbc, 0x14, 0xe4, 0x13, 0xc4,
+ 0x17, 0x3f, 0x57, 0x75, 0xae, 0xc0, 0x68, 0x02,
+ 0xe7, 0xd8, 0x0e, 0x57, 0xc2, 0x78, 0x82, 0xe6,
+ 0xcd, 0x31, 0xf9, 0xd4, 0xee, 0x1f, 0x47, 0x5d,
+ 0x21, 0x7f, 0x3f, 0x2b, 0x38, 0xe5, 0x7c, 0x27,
+ 0x88, 0x2e, 0x7f, 0xcd, 0x5d, 0x8e, 0xef, 0xbd,
+ 0x81, 0x3c, 0x41, 0x73, 0x67, 0x2f, 0x44, 0x65,
+ 0x0f, 0xe7, 0xf5, 0xdb, 0x57, 0xf5, 0xf7, 0x1e,
+ 0x20, 0xb9, 0xff, 0x66, 0xd7, 0x67, 0x73, 0x8f,
+ 0x71, 0xe2, 0x0b, 0x51, 0xe1, 0x47, 0x0b, 0xb8,
+ 0xe0, 0x2c, 0xec, 0x7c, 0xf4, 0x8c, 0x63, 0x51,
+ 0x8c, 0xdd, 0x0b, 0x50, 0xb8, 0xcf, 0x81, 0x40,
+ 0x01, 0x0d, 0x10, 0x5d, 0x91, 0x01, 0x3f, 0xec,
+ 0x75, 0x7d, 0xd7, 0x97, 0x97, 0x3c, 0x74, 0xfe,
+ 0x1e, 0xe7, 0x15, 0xb8, 0x27, 0x4f, 0x9f, 0xd7,
+ 0x88, 0x0e, 0x9f, 0xb1, 0xef, 0xaa, 0x5e, 0xce,
+ 0x8d, 0xa2, 0x2f, 0xcd, 0x3a, 0x4f, 0x3b, 0xc5,
+ 0xe3, 0xa6, 0x02, 0x1d, 0x3d, 0xb4, 0x56, 0x1d,
+ 0x07, 0x4f, 0xdf, 0x7f, 0x48, 0x20, 0x3a, 0x38,
+ 0x36, 0xfd, 0x0a, 0x9f, 0xff, 0xc9, 0xbe, 0x3a,
+ 0x97, 0x36, 0xb1, 0xb8, 0x46, 0xe6, 0xa3, 0xa6,
+ 0x02, 0x1d, 0x32, 0x5f, 0x3a, 0x7f, 0xb3, 0x54,
+ 0x45, 0x73, 0xc5, 0x8e, 0x9f, 0xd4, 0xca, 0xee,
+ 0x97, 0x3c, 0x74, 0xc1, 0x09, 0x53, 0xfd, 0xdc,
+ 0x5d, 0xee, 0xa6, 0xf8, 0x3a, 0x19, 0x3f, 0x7d,
+ 0x8d, 0x88, 0xaa, 0x95, 0xea, 0x44, 0x06, 0x25,
+ 0xec, 0x57, 0xa2, 0xf4, 0x3a, 0x09, 0xaf, 0x31,
+ 0x69, 0xc1, 0x08, 0x4a, 0x92, 0x8a, 0xb1, 0x79,
+ 0x3e, 0xf5, 0xbf, 0xc4, 0xab, 0x23, 0x67, 0x9c,
+ 0x2e, 0xa7, 0xf3, 0xfa, 0x4c, 0xae, 0x3c, 0x74,
+ 0x23, 0x63, 0x2f, 0x91, 0x98, 0x5f, 0x3c, 0x7c,
+ 0xc7, 0x71, 0xaa, 0xd6, 0x1e, 0x7f, 0x49, 0x1e,
+ 0xea, 0x35, 0x21, 0xa3, 0x74, 0xaf, 0xf5, 0xc9,
+ 0x73, 0xd8, 0xc9, 0xa3, 0xa7, 0xb1, 0x59, 0xa3,
+ 0xa7, 0xbd, 0xee, 0x6e, 0x3a, 0x10, 0xf8, 0xdf,
+ 0x1f, 0xbc, 0x20, 0x9f, 0xbb, 0x77, 0x0a, 0xf7,
+ 0x1d, 0x3f, 0xfc, 0xfb, 0xba, 0x9c, 0x95, 0xd4,
+ 0xbf, 0xad, 0xbc, 0x74, 0x22, 0x21, 0x76, 0x5f,
+ 0x3d, 0xcb, 0xf9, 0x73, 0x3a, 0x7e, 0x79, 0x67,
+ 0x2f, 0x05, 0xe3, 0xa6, 0x73, 0xc7, 0x4f, 0xab,
+ 0x9b, 0x75, 0x0e, 0x9f, 0xfe, 0xaa, 0x73, 0xb6,
+ 0xbb, 0xe0, 0xa5, 0x10, 0x05, 0x4f, 0xe0, 0x60,
+ 0xb7, 0xfb, 0x1e, 0x20, 0x48, 0x72, 0x2c, 0xf8,
+ 0x27, 0x15, 0x19, 0xed, 0x3d, 0xfd, 0x3a, 0x79,
+ 0xfa, 0x7e, 0x8e, 0x8c, 0x3c, 0x4a, 0x91, 0x4f,
+ 0xee, 0xf8, 0x69, 0x44, 0x01, 0xd3, 0x82, 0x10,
+ 0x9f, 0x0f, 0xa9, 0xdf, 0xde, 0x0b, 0x87, 0xd5,
+ 0x8d, 0x4c, 0x70, 0x89, 0x40, 0x2d, 0xcf, 0xff,
+ 0xb3, 0xbb, 0xbf, 0x6a, 0x6a, 0xb7, 0x7b, 0x9c,
+ 0x87, 0x43, 0xc7, 0xf9, 0x7c, 0x92, 0x17, 0xaa,
+ 0xac, 0x87, 0x1a, 0x64, 0x32, 0xb6, 0xe9, 0xf1,
+ 0x98, 0xcf, 0xb7, 0xa4, 0xd5, 0x0a, 0x9e, 0x64,
+ 0xd5, 0x0a, 0x98, 0x21, 0x2a, 0x1c, 0x7b, 0xb8,
+ 0x4e, 0x12, 0x09, 0xb0, 0x25, 0x58, 0xd7, 0x4f,
+ 0xff, 0xb3, 0x48, 0xd9, 0x9d, 0xd5, 0x76, 0x9d,
+ 0x78, 0xe8, 0x01, 0xfc, 0x04, 0x96, 0x7f, 0xff,
+ 0x22, 0xed, 0xf4, 0x1c, 0xb5, 0x4c, 0x6a, 0xff,
+ 0x75, 0x43, 0xa7, 0xf2, 0xcf, 0xba, 0xb7, 0x20,
+ 0x9d, 0x39, 0xde, 0x27, 0x4f, 0x9d, 0x9a, 0xce,
+ 0x0a, 0x96, 0xd6, 0x3c, 0x1d, 0x0d, 0x4c, 0x04,
+ 0x3a, 0x60, 0x21, 0xd3, 0xf7, 0x6e, 0x76, 0x76,
+ 0xdb, 0x35, 0x40, 0x15, 0x9f, 0xfb, 0x55, 0xc5,
+ 0x73, 0x40, 0x63, 0xfa, 0x3a, 0x7f, 0x3e, 0xdb,
+ 0x1e, 0x69, 0xc1, 0xd3, 0xc0, 0x57, 0xba, 0x87,
+ 0xf7, 0xa4, 0x69, 0xcb, 0xf8, 0xf9, 0xd0, 0x87,
+ 0xb1, 0xe7, 0x33, 0x82, 0x10, 0x95, 0x3f, 0x26,
+ 0x5f, 0xed, 0xd4, 0x2a, 0xc5, 0xe4, 0xf0, 0x7f,
+ 0xae, 0x3a, 0x66, 0xa9, 0xd3, 0x82, 0x10, 0x95,
+ 0x3f, 0x6f, 0xef, 0xd7, 0x7a, 0x2a, 0xc5, 0xe4,
+ 0xfb, 0x01, 0x98, 0xb1, 0xd2, 0xa7, 0x24, 0x4a,
+ 0x89, 0x8f, 0x4f, 0xa7, 0xb7, 0xdb, 0x9d, 0xc2,
+ 0x3b, 0x72, 0x16, 0xd0, 0x8b, 0x81, 0xee, 0x22,
+ 0xc6, 0x4b, 0xee, 0xc2, 0xa7, 0x58, 0xc6, 0x28,
+ 0x79, 0xa8, 0xca, 0xe7, 0xe4, 0x50, 0x8f, 0xe8,
+ 0xe9, 0xff, 0xed, 0xa9, 0xf7, 0x53, 0x96, 0x77,
+ 0xb9, 0xb0, 0x1d, 0x15, 0x3f, 0xdd, 0x15, 0x4a,
+ 0xcb, 0xd1, 0xfc, 0x8a, 0x12, 0x50, 0x9b, 0xd1,
+ 0x88, 0xba, 0x50, 0x67, 0x12, 0x96, 0x32, 0xb4,
+ 0xf4, 0xbf, 0x19, 0xab, 0x47, 0x4a, 0xfc, 0xa2,
+ 0x3d, 0xc2, 0x71, 0x68, 0xf3, 0x86, 0x71, 0xf1,
+ 0x51, 0xb9, 0x56, 0x74, 0x5b, 0xe9, 0xbf, 0x40,
+ 0x94, 0x49, 0xd9, 0xcb, 0xda, 0x53, 0xf1, 0x35,
+ 0x59, 0x93, 0x5d, 0x19, 0x4a, 0xe8, 0x5b, 0x84,
+ 0x89, 0x7e, 0x57, 0x7f, 0x39, 0xd6, 0xdb, 0xc8,
+ 0x7e, 0x45, 0x9f, 0xd2, 0x11, 0xd7, 0xe4, 0xe9,
+ 0x3f, 0xad, 0x82, 0xdf, 0xec, 0x68, 0xb8, 0xe7,
+ 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x17, 0x5c, 0xff,
+ 0xd6, 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x28,
+ 0xc2, 0x3f, 0xbe, 0xbb, 0x8a, 0x38, 0x3b, 0xbe,
+ 0x76, 0xc7, 0x7b, 0x87, 0x85, 0xed, 0x03, 0xef,
+ 0xd3, 0x5a, 0x86, 0xda, 0x3b, 0xbc, 0x3b, 0x9f,
+ 0xfd, 0x65, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68,
+ 0x96, 0xa7, 0xc2, 0xdf, 0xec, 0x68, 0x8d, 0xe7,
+ 0xfd, 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x5f,
+ 0x95, 0xb0, 0xfd, 0x94, 0x61, 0x3f, 0xad, 0x82,
+ 0xdf, 0xec, 0x68, 0xaa, 0xe7, 0xfa, 0xfe, 0x77,
+ 0x1f, 0xd7, 0xa8, 0xe9, 0xb8, 0xd9, 0xd3, 0xf6,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0x40, 0x8e, 0x47, 0x99,
+ 0x61, 0x79, 0xf5, 0x3f, 0xbe, 0xf9, 0xd0, 0xe3,
+ 0xcb, 0x7c, 0x92, 0x2f, 0xa3, 0xd3, 0xe1, 0xa3,
+ 0x3f, 0xf7, 0x71, 0xeb, 0x2f, 0xa7, 0x7b, 0x9a,
+ 0x3a, 0x2c, 0x7e, 0x02, 0x53, 0x3f, 0xad, 0x82,
+ 0xdf, 0xec, 0x68, 0xb2, 0x27, 0xf5, 0xb0, 0x5b,
+ 0xfd, 0x8d, 0x16, 0xbc, 0xfe, 0xb6, 0x0b, 0x7f,
+ 0xb1, 0xa2, 0xe4, 0x9f, 0x0b, 0x7f, 0xb1, 0xa2,
+ 0xec, 0x9f, 0xf7, 0xba, 0xd8, 0x2d, 0xfe, 0xc6,
+ 0x8a, 0x3a, 0x56, 0xc3, 0xf6, 0x51, 0x84, 0xf8,
+ 0x5b, 0xfd, 0x8d, 0x14, 0xac, 0xff, 0xff, 0xf5,
+ 0x51, 0xe4, 0xae, 0xd7, 0x7f, 0x15, 0xdd, 0x9a,
+ 0xbb, 0x5a, 0xa8, 0xf6, 0x1d, 0x3e, 0xb2, 0xbd,
+ 0xd6, 0xc4, 0x59, 0x2c, 0x61, 0x0f, 0x2e, 0x77,
+ 0xba, 0x19, 0x0f, 0x93, 0xee, 0x39, 0xf5, 0x10,
+ 0x80, 0xee, 0x87, 0x7a, 0x85, 0x8a, 0xe8, 0x6c,
+ 0xcf, 0xf3, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x8e,
+ 0x27, 0xfb, 0x76, 0xc1, 0x6f, 0xf6, 0x34, 0x56,
+ 0xb2, 0xb7, 0xa2, 0x0b, 0x48, 0x33, 0xff, 0xac,
+ 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x12, 0xdc,
+ 0xd8, 0xf9, 0xd3, 0xfb, 0x8c, 0x52, 0x93, 0x74,
+ 0x3a, 0x1f, 0x3c, 0x9d, 0x8b, 0x4e, 0xaf, 0x0e,
+ 0x3a, 0x73, 0x94, 0xc7, 0x41, 0xa2, 0x1b, 0x9f,
+ 0xf7, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x89, 0x82,
+ 0x70, 0xdc, 0x02, 0xa5, 0x64, 0x46, 0xa3, 0xc4,
+ 0x7c, 0x0e, 0xb0, 0xda, 0x85, 0xf4, 0x8d, 0x39,
+ 0x57, 0x09, 0x53, 0xfe, 0xf7, 0x5b, 0x05, 0xbf,
+ 0xd8, 0xd1, 0x31, 0xca, 0xdb, 0x3e, 0x25, 0x0e,
+ 0x4f, 0xc9, 0x4e, 0x5a, 0xca, 0x9d, 0x3f, 0xff,
+ 0xfc, 0xea, 0x57, 0x2e, 0x0d, 0x2b, 0x8d, 0x94,
+ 0xe5, 0x8f, 0xba, 0x9b, 0xee, 0xce, 0x9e, 0x6f,
+ 0xf6, 0x34, 0x56, 0x33, 0xfe, 0x5f, 0xcd, 0x77,
+ 0x2e, 0x4e, 0xe8, 0xe8, 0xbe, 0x98, 0xdb, 0xe5,
+ 0xc3, 0x08, 0x1d, 0x15, 0xcf, 0xfe, 0x4e, 0xea,
+ 0xfd, 0xc9, 0xdc, 0x64, 0x13, 0xa7, 0xfd, 0x9c,
+ 0x57, 0x28, 0xfb, 0x92, 0xa7, 0x4f, 0xff, 0xfd,
+ 0xdb, 0x9e, 0xc6, 0xe5, 0xdb, 0xaf, 0x39, 0x63,
+ 0xee, 0xcb, 0xba, 0x0a, 0x1d, 0x3f, 0x97, 0xab,
+ 0xcb, 0x39, 0x78, 0x2f, 0x1d, 0x3a, 0xbb, 0xb6,
+ 0x27, 0x16, 0xc8, 0xb5, 0x49, 0xd1, 0xfa, 0xfb,
+ 0xf4, 0xd7, 0x2c, 0x74, 0xfb, 0xfa, 0xf5, 0xd4,
+ 0x3a, 0x3a, 0x78, 0x34, 0x18, 0x9f, 0x06, 0x94,
+ 0x40, 0x1d, 0x3e, 0x47, 0x02, 0xe7, 0x1d, 0x39,
+ 0x3a, 0xe3, 0xa1, 0x63, 0xc3, 0xd1, 0x44, 0xfc,
+ 0x8a, 0xce, 0xee, 0xf9, 0xd2, 0xa1, 0xd1, 0xb3,
+ 0x7d, 0xe5, 0xd3, 0x01, 0x0a, 0x98, 0x21, 0x2a,
+ 0x36, 0x6a, 0xc2, 0x2b, 0x3f, 0xbd, 0xdd, 0xcd,
+ 0x57, 0x65, 0x58, 0xd0, 0xcf, 0x71, 0xef, 0xd0,
+ 0xe9, 0xc9, 0xd5, 0x8e, 0x9b, 0xa8, 0x74, 0x2c,
+ 0x6c, 0x44, 0x72, 0x78, 0x41, 0x97, 0x87, 0x4e,
+ 0xe6, 0x37, 0xce, 0x84, 0x45, 0xbe, 0x2a, 0x6c,
+ 0x86, 0xa4, 0x73, 0x57, 0x47, 0x4e, 0x08, 0x42,
+ 0x54, 0xff, 0xd8, 0xdc, 0x23, 0xdc, 0xf2, 0xbe,
+ 0xf9, 0x56, 0x2f, 0x27, 0xeb, 0x95, 0xbd, 0x03,
+ 0xce, 0x9f, 0xcd, 0xba, 0x77, 0x17, 0x79, 0xd3,
+ 0x66, 0x8e, 0x87, 0xcf, 0x22, 0xa6, 0x73, 0xff,
+ 0xda, 0xdd, 0x2b, 0x9c, 0x77, 0x17, 0x77, 0x28,
+ 0x74, 0xac, 0x8a, 0xff, 0xf8, 0x22, 0xc6, 0xa1,
+ 0x61, 0x53, 0x65, 0x61, 0xf3, 0xe7, 0x7d, 0x32,
+ 0xa2, 0xae, 0x9d, 0xb9, 0x91, 0xcf, 0x85, 0xbf,
+ 0xd8, 0xd1, 0x5b, 0xcf, 0xfb, 0xdd, 0x6c, 0x16,
+ 0xff, 0x63, 0x44, 0xe1, 0x2b, 0x61, 0xfb, 0x28,
+ 0xc2, 0x7c, 0x2d, 0xfe, 0xc6, 0x8b, 0x46, 0x7b,
+ 0x16, 0xdd, 0xf3, 0xa5, 0x6c, 0x3d, 0x4a, 0x98,
+ 0x4f, 0x37, 0xfb, 0x1a, 0x2d, 0xa9, 0xfa, 0xa8,
+ 0xa4, 0xdf, 0x07, 0x4d, 0x6c, 0x13, 0xd8, 0xd1,
+ 0x5c, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xe5,
+ 0x9f, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x5d, 0xb0,
+ 0x8c, 0xc7, 0x87, 0x8a, 0x1d, 0x1b, 0x7f, 0x10,
+ 0xbf, 0xbf, 0x2b, 0x3b, 0x73, 0x93, 0xd7, 0xb8,
+ 0xc6, 0xaa, 0xf7, 0xd7, 0xfa, 0x16, 0x68, 0xee,
+ 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x53, 0xcf,
+ 0x37, 0xfb, 0x1a, 0x2b, 0x99, 0xfd, 0x6c, 0x16,
+ 0xff, 0x63, 0x45, 0x9d, 0x02, 0x7c, 0xd5, 0x2b,
+ 0x9f, 0xe7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x21,
+ 0x4f, 0x2f, 0x4a, 0xa2, 0x8e, 0x9f, 0xd9, 0x5a,
+ 0x53, 0x05, 0xe3, 0xa5, 0x6c, 0x45, 0xdf, 0x90,
+ 0xd1, 0x07, 0x44, 0xf3, 0xff, 0xac, 0xaf, 0x75,
+ 0xb0, 0x5b, 0xfd, 0x8d, 0x13, 0xe4, 0x32, 0x7d,
+ 0xf7, 0xb8, 0xd7, 0x2a, 0x83, 0x3e, 0x16, 0xff,
+ 0x63, 0x45, 0x65, 0x3f, 0xef, 0x75, 0xb0, 0x5b,
+ 0xfd, 0x8d, 0x13, 0x74, 0xdb, 0xb6, 0x1f, 0xb2,
+ 0x8c, 0x27, 0xff, 0x59, 0x5e, 0xeb, 0x60, 0xb7,
+ 0xfb, 0x1a, 0x25, 0x69, 0xf0, 0xb7, 0xfb, 0x1a,
+ 0x25, 0xc9, 0xe5, 0xdb, 0xea, 0x1d, 0x3e, 0xb2,
+ 0xbd, 0xd6, 0xc3, 0xd3, 0xf3, 0x09, 0xff, 0xad,
+ 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x3b, 0x9f,
+ 0xed, 0x57, 0x1d, 0x6f, 0xed, 0x0e, 0x9f, 0x97,
+ 0x9d, 0x46, 0xce, 0x9d, 0x3f, 0x5e, 0xbd, 0xca,
+ 0xfe, 0x8e, 0x9f, 0x0b, 0x7f, 0xb1, 0xa2, 0xa1,
+ 0x9f, 0x65, 0x75, 0x8f, 0x1d, 0x2b, 0x5e, 0xa8,
+ 0xb7, 0x5e, 0x17, 0xe1, 0x8e, 0x8c, 0x27, 0xc2,
+ 0xdf, 0xec, 0x68, 0xaa, 0x27, 0xfd, 0xee, 0xb6,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0x6b, 0x95, 0xb0, 0xfd,
+ 0x94, 0x61, 0x3f, 0xad, 0x82, 0xdf, 0xec, 0x68,
+ 0xab, 0x27, 0xfe, 0xb7, 0xba, 0xd8, 0x2d, 0xfe,
+ 0xc6, 0x89, 0x12, 0x7c, 0x2d, 0xfe, 0xc6, 0x8b,
+ 0x4a, 0x7f, 0xde, 0xeb, 0x60, 0xb7, 0xfb, 0x1a,
+ 0x27, 0xd9, 0x5b, 0x0f, 0xd9, 0x46, 0x13, 0xff,
+ 0xac, 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14,
+ 0x24, 0xfa, 0xbb, 0x79, 0x04, 0xe9, 0xf0, 0xb7,
+ 0xfb, 0x1a, 0x28, 0xf9, 0xff, 0xfb, 0x38, 0xaa,
+ 0x73, 0xb6, 0xbb, 0xe0, 0xa5, 0x10, 0x05, 0x4f,
+ 0xac, 0xaf, 0x75, 0x91, 0x16, 0x98, 0x4e, 0xbe,
+ 0x61, 0x08, 0xba, 0xfa, 0xf4, 0x29, 0x5c, 0x7b,
+ 0x89, 0x97, 0xe1, 0xde, 0xd0, 0xc1, 0x7c, 0x9d,
+ 0x63, 0xba, 0xc3, 0x08, 0x04, 0xfa, 0x8c, 0x1a,
+ 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x11, 0x4f,
+ 0xd8, 0x2d, 0xfe, 0xc6, 0x88, 0xae, 0x7f, 0xaf,
+ 0x76, 0xc1, 0x6f, 0xf6, 0x34, 0x57, 0x11, 0x63,
+ 0xfa, 0xf3, 0x59, 0xec, 0xaf, 0xe8, 0xe9, 0xfd,
+ 0x9b, 0x10, 0x02, 0xea, 0x1d, 0x2b, 0xd7, 0xa7,
+ 0xa7, 0x42, 0x09, 0xff, 0xbf, 0x6e, 0xdf, 0x75,
+ 0x75, 0x47, 0x0e, 0x9f, 0x66, 0xf8, 0x1c, 0x3a,
+ 0x76, 0xa9, 0xba, 0x9f, 0x56, 0x91, 0x27, 0xc2,
+ 0xdf, 0xec, 0x68, 0xa7, 0xa1, 0x78, 0x8f, 0xb4,
+ 0x84, 0xbe, 0x1a, 0x4f, 0xfe, 0xf7, 0x5b, 0x8e,
+ 0xf8, 0x69, 0x44, 0x01, 0xd1, 0x64, 0x40, 0xf0,
+ 0x6f, 0x3a, 0xdc, 0x61, 0xd3, 0xe4, 0x70, 0x2e,
+ 0x71, 0xd3, 0xcd, 0xfe, 0xc6, 0x8a, 0xce, 0x16,
+ 0x3d, 0x31, 0x28, 0x9f, 0x9e, 0x52, 0x75, 0xd4,
+ 0x3a, 0x72, 0x3d, 0xb3, 0xa7, 0xda, 0x07, 0x3e,
+ 0xb8, 0xe9, 0xf6, 0x2c, 0xf5, 0xc0, 0x3a, 0x56,
+ 0xc4, 0x60, 0x09, 0x15, 0x4b, 0xbc, 0x73, 0x99,
+ 0x54, 0xff, 0xd6, 0xf7, 0x5b, 0x05, 0xbf, 0xd8,
+ 0xd1, 0x22, 0xcf, 0xeb, 0x60, 0xb7, 0xfb, 0x1a,
+ 0x2c, 0x99, 0xfd, 0x6c, 0x16, 0xff, 0x63, 0x45,
+ 0xb1, 0x3f, 0xad, 0x82, 0xdf, 0xec, 0x68, 0xb6,
+ 0xe7, 0xfc, 0xbc, 0x5e, 0x5e, 0x96, 0xab, 0x9d,
+ 0x40, 0x1d, 0x3f, 0x27, 0x5d, 0xc5, 0xca, 0x3a,
+ 0x7c, 0x2d, 0xfe, 0xc6, 0x8b, 0xc2, 0x7b, 0x4b,
+ 0xf9, 0x53, 0xa7, 0xd9, 0xd0, 0x5e, 0x21, 0xd3,
+ 0xe4, 0xe7, 0x77, 0xd0, 0xe9, 0xda, 0x40, 0x1d,
+ 0x2b, 0x5e, 0x9a, 0x99, 0xeb, 0xc9, 0xb8, 0x5e,
+ 0xf9, 0x80, 0x09, 0x3a, 0x53, 0xa2, 0x99, 0xf0,
+ 0xb7, 0xfb, 0x1a, 0x2f, 0x49, 0xff, 0x77, 0xf4,
+ 0xe4, 0xbf, 0xad, 0xbc, 0x74, 0xfb, 0x15, 0x5f,
+ 0xe0, 0xe9, 0x5b, 0x11, 0x31, 0xcc, 0xc2, 0xf1,
+ 0x06, 0x11, 0x7f, 0x21, 0xe8, 0x5a, 0xe4, 0x7e,
+ 0x0c, 0x49, 0xb8, 0xcb, 0xc5, 0x3d, 0x49, 0x80,
+ 0x3b, 0xe9, 0xdd, 0xd1, 0xbc, 0x06, 0x30, 0xd9,
+ 0xec, 0xaf, 0xe8, 0xe9, 0xfd, 0x9b, 0x10, 0x02,
+ 0xea, 0x1d, 0x2b, 0xd7, 0xa7, 0xa7, 0x42, 0x09,
+ 0xf0, 0xb7, 0xfb, 0x1a, 0x22, 0x39, 0xff, 0xea,
+ 0xdd, 0x4a, 0x62, 0xbb, 0x8b, 0xb9, 0x25, 0xe8,
+ 0x3a, 0x7f, 0xce, 0x47, 0x87, 0x35, 0xad, 0xe8,
+ 0xe9, 0x9e, 0x51, 0x53, 0x04, 0x25, 0x4f, 0xfc,
+ 0xeb, 0x35, 0x76, 0xb5, 0x51, 0xeb, 0x00, 0xd6,
+ 0x84, 0x5e, 0x7f, 0x65, 0xef, 0xb9, 0x5f, 0xd1,
+ 0xd3, 0xff, 0xf3, 0x58, 0x7f, 0xbb, 0xd5, 0x85,
+ 0x35, 0xdf, 0x01, 0xd0, 0xbc, 0x54, 0x19, 0x85,
+ 0xac, 0x60, 0xfa, 0xd7, 0xb5, 0xe9, 0x75, 0x71,
+ 0xac, 0xf8, 0x5b, 0xfd, 0x8d, 0x11, 0x74, 0xfb,
+ 0x40, 0xe7, 0xd7, 0x16, 0xcf, 0x69, 0x5b, 0x0f,
+ 0x9f, 0xcc, 0x22, 0xc8, 0xf7, 0x74, 0x34, 0x67,
+ 0xfe, 0x57, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x89,
+ 0x9a, 0x73, 0xe9, 0x43, 0xa7, 0x36, 0xd4, 0x74,
+ 0xff, 0xec, 0xbc, 0xde, 0xb6, 0xdb, 0xe3, 0x58,
+ 0xc7, 0x4f, 0xff, 0xb8, 0xdf, 0x5e, 0xca, 0x6f,
+ 0xeb, 0x60, 0x84, 0x25, 0x4f, 0x37, 0xfb, 0x1a,
+ 0x2c, 0xf9, 0xff, 0xed, 0x8d, 0x7f, 0x96, 0x2e,
+ 0xee, 0x53, 0x3a, 0x74, 0xe0, 0x84, 0x25, 0x4f,
+ 0xfb, 0xdd, 0x4e, 0xe3, 0x71, 0x82, 0x55, 0x8b,
+ 0xc9, 0xfe, 0x4a, 0xef, 0x8e, 0xff, 0xac, 0x74,
+ 0xff, 0x6f, 0xbc, 0x73, 0xe2, 0xed, 0x50, 0xe8,
+ 0x64, 0xec, 0xc5, 0x62, 0xa5, 0x60, 0x6d, 0xd2,
+ 0x5a, 0xe3, 0x99, 0xff, 0xff, 0xfb, 0x30, 0x14,
+ 0xcc, 0xed, 0xfe, 0x63, 0xd4, 0xca, 0xda, 0x9d,
+ 0xc7, 0x95, 0x8a, 0x3a, 0x75, 0x11, 0xe3, 0xa7,
+ 0x2f, 0xe5, 0x4e, 0x87, 0x23, 0x12, 0x90, 0x8a,
+ 0xd0, 0xe4, 0xf3, 0xe0, 0xb9, 0x8e, 0x9f, 0x57,
+ 0xa9, 0x82, 0x64, 0xff, 0xb6, 0x2e, 0xc1, 0x7a,
+ 0xef, 0xe0, 0xd1, 0x06, 0xd8, 0xd2, 0xcf, 0xbd,
+ 0xb6, 0xa4, 0x3a, 0x7e, 0x75, 0x7b, 0xef, 0xe8,
+ 0xe9, 0x63, 0x1e, 0x9f, 0x49, 0x67, 0xff, 0xfd,
+ 0xe1, 0xd6, 0x57, 0x49, 0x9d, 0x7f, 0x58, 0x3b,
+ 0x7b, 0xd4, 0x74, 0x39, 0x34, 0x0c, 0x85, 0x7f,
+ 0x49, 0xa7, 0xe1, 0xce, 0x29, 0x54, 0x3a, 0x7f,
+ 0xff, 0x5d, 0xdf, 0xbf, 0xcb, 0x9f, 0x7f, 0x54,
+ 0xdb, 0xf5, 0xd8, 0x4e, 0x9f, 0xff, 0xea, 0x51,
+ 0x07, 0x49, 0x65, 0x66, 0xa9, 0xce, 0x9e, 0xec,
+ 0x3a, 0x7a, 0xb9, 0xb5, 0xc7, 0x46, 0xd1, 0x13,
+ 0x56, 0x69, 0x95, 0x7a, 0x9a, 0x2f, 0xc9, 0xff,
+ 0x9d, 0xab, 0x9c, 0xe5, 0x6b, 0x48, 0xa3, 0xa7,
+ 0xfe, 0xde, 0x77, 0x32, 0x9c, 0x9d, 0x45, 0x1d,
+ 0x0f, 0xa2, 0x2e, 0x88, 0xd3, 0xdd, 0xea, 0x31,
+ 0xd0, 0x89, 0x8d, 0x70, 0x47, 0x90, 0xb3, 0xf2,
+ 0x49, 0xff, 0xff, 0xaf, 0x12, 0xbb, 0x55, 0x96,
+ 0x77, 0x8f, 0x3a, 0xed, 0xfa, 0x36, 0xde, 0x3a,
+ 0x7d, 0x76, 0x53, 0x7d, 0x3a, 0x7c, 0x9c, 0xee,
+ 0xfa, 0x1d, 0x32, 0xf6, 0xa3, 0xa7, 0xff, 0xfd,
+ 0x5d, 0xbf, 0xac, 0x7f, 0x42, 0x29, 0xa0, 0x73,
+ 0xeb, 0xab, 0x87, 0x4e, 0x08, 0x42, 0x54, 0xf7,
+ 0x1c, 0x7f, 0x4a, 0xb1, 0x79, 0x08, 0x8d, 0x86,
+ 0x1b, 0xdc, 0x22, 0xe7, 0xfe, 0xce, 0xbf, 0xac,
+ 0x1d, 0xbd, 0xea, 0x3a, 0x7d, 0x9a, 0x72, 0xaa,
+ 0x74, 0x21, 0xf5, 0xd1, 0x12, 0x60, 0x54, 0xe9,
+ 0xf9, 0xe5, 0x9c, 0xbc, 0x17, 0x8e, 0x9f, 0xd7,
+ 0xeb, 0x9a, 0xae, 0xf4, 0x74, 0xdb, 0x13, 0xa1,
+ 0x7a, 0x9f, 0xf6, 0xcd, 0x2a, 0x6b, 0x3f, 0xfb,
+ 0x8e, 0x13, 0x81, 0x4d, 0x6d, 0xb7, 0xc1, 0xd2,
+ 0xb2, 0xf4, 0x65, 0x9a, 0xde, 0x90, 0xe7, 0x03,
+ 0x79, 0x1f, 0xfb, 0xf1, 0x8e, 0x6c, 0xd5, 0x68,
+ 0xe2, 0x04, 0xd5, 0x45, 0x95, 0x94, 0x1b, 0xe8,
+ 0x20, 0x7a, 0xe9, 0x45, 0x23, 0x01, 0xd4, 0x27,
+ 0x82, 0x42, 0xbf, 0x09, 0x4e, 0x66, 0xb1, 0x66,
+ 0x65, 0xcd, 0x69, 0x70, 0x33, 0xff, 0xac, 0xaf,
+ 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13, 0x64, 0xfe,
+ 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xad, 0x9f, 0xce,
+ 0x75, 0xda, 0xea, 0x38, 0xe9, 0xec, 0xaf, 0xe8,
+ 0xe9, 0x5e, 0xb8, 0x7a, 0x9d, 0x34, 0x9f, 0x0b,
+ 0x7f, 0xb1, 0xa2, 0xb4, 0x9f, 0xfe, 0x64, 0x1c,
+ 0x07, 0xab, 0xdc, 0x9b, 0x63, 0xa7, 0xff, 0x9d,
+ 0x4c, 0xea, 0x2b, 0xf3, 0x5a, 0x45, 0x1d, 0x36,
+ 0xb4, 0x88, 0x97, 0xf4, 0xa9, 0xfc, 0x8b, 0xb9,
+ 0xeb, 0xa8, 0x03, 0xa7, 0xe7, 0xb2, 0xbb, 0xc5,
+ 0x1d, 0x3f, 0xd9, 0x79, 0xd4, 0x0b, 0xee, 0xa1,
+ 0xd3, 0xf9, 0xd9, 0xaf, 0xe8, 0x2e, 0x3a, 0x56,
+ 0x5e, 0x27, 0xe5, 0x85, 0x9b, 0x86, 0x3d, 0x4b,
+ 0x7c, 0xdb, 0xa5, 0xba, 0x3c, 0x9f, 0xd6, 0xc1,
+ 0x6f, 0xf6, 0x34, 0x58, 0x13, 0xe1, 0x6f, 0xf6,
+ 0x34, 0x4e, 0xb3, 0xff, 0xfa, 0xa8, 0xf7, 0x18,
+ 0xab, 0x52, 0x99, 0x5d, 0xd2, 0xe7, 0x8e, 0x9f,
+ 0x59, 0x5e, 0xeb, 0x62, 0x25, 0x56, 0x30, 0x9f,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0xd9, 0x9f, 0xf0, 0x12,
+ 0x96, 0xae, 0xdb, 0xc4, 0xe9, 0x5b, 0x0f, 0xb3,
+ 0xcc, 0x27, 0x9b, 0xfd, 0x8d, 0x17, 0x34, 0x94,
+ 0x74, 0xd6, 0xc1, 0x37, 0x61, 0x2b, 0x9f, 0xd6,
+ 0xc1, 0x6f, 0xf6, 0x34, 0x5d, 0xf3, 0xd6, 0xbf,
+ 0xc0, 0x0e, 0x84, 0x6c, 0xaf, 0xb2, 0x99, 0xc2,
+ 0xc6, 0x0f, 0xa9, 0x6e, 0x54, 0x08, 0xb9, 0x2a,
+ 0x1a, 0x00, 0x85, 0x65, 0x18, 0x74, 0x57, 0xcc,
+ 0xee, 0x7f, 0x75, 0xec, 0xbc, 0xd2, 0x5f, 0x3a,
+ 0x7c, 0x2d, 0xfe, 0xc6, 0x89, 0x5e, 0x7e, 0xaf,
+ 0x17, 0x78, 0xb8, 0xe9, 0xde, 0xeb, 0x22, 0x25,
+ 0xb0, 0xe2, 0x86, 0x13, 0xb4, 0x9c, 0x15, 0x3f,
+ 0xfa, 0xbf, 0xbd, 0x23, 0xb6, 0x2f, 0x5c, 0x02,
+ 0xa7, 0xf7, 0xb5, 0xb8, 0x15, 0xee, 0xc8, 0x7c,
+ 0xf4, 0x1c, 0x95, 0x94, 0x8f, 0x45, 0xd0, 0xa6,
+ 0x9f, 0xfd, 0x65, 0x7b, 0xad, 0x82, 0xdf, 0xec,
+ 0x68, 0x98, 0x67, 0xff, 0xec, 0xb7, 0x31, 0xf0,
+ 0x5a, 0xfe, 0x9c, 0x14, 0xa3, 0x8e, 0x9f, 0xfa,
+ 0xf5, 0xc7, 0xdd, 0x77, 0xeb, 0xa8, 0xe3, 0xa7,
+ 0xfb, 0xa9, 0xef, 0x6a, 0xff, 0x89, 0xd3, 0xf2,
+ 0x93, 0x3b, 0xa5, 0xf3, 0xa7, 0xc9, 0x9d, 0xd2,
+ 0xf9, 0xd3, 0xf5, 0x77, 0xaa, 0x7b, 0xfc, 0x8f,
+ 0x61, 0x45, 0xf3, 0xff, 0xfe, 0xee, 0x06, 0xf3,
+ 0x59, 0x5e, 0x5d, 0xc7, 0xb7, 0x9d, 0x7d, 0xd4,
+ 0x3a, 0x7e, 0x5d, 0xcf, 0x5d, 0x40, 0x1d, 0x3f,
+ 0xf9, 0x34, 0x04, 0x76, 0x3f, 0xa7, 0xae, 0x09,
+ 0xd0, 0x87, 0xfb, 0xb3, 0x19, 0xfa, 0x9b, 0xbe,
+ 0xaf, 0xd1, 0xd3, 0xff, 0xfe, 0x1c, 0x5c, 0x9d,
+ 0xd7, 0x2e, 0x7d, 0x4a, 0xfe, 0xf4, 0x9a, 0xa1,
+ 0xd2, 0xc7, 0xd1, 0x3e, 0x25, 0xf3, 0xdf, 0xcf,
+ 0x8c, 0x3a, 0x56, 0x5e, 0x2b, 0x1e, 0xe1, 0x29,
+ 0xa1, 0x22, 0xb2, 0x45, 0x61, 0xe1, 0xd8, 0x60,
+ 0x5c, 0x51, 0x3e, 0x16, 0xff, 0x63, 0x45, 0x5d,
+ 0x3f, 0xce, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x3c,
+ 0x95, 0xb0, 0xfc, 0x7c, 0xc2, 0x7f, 0x5b, 0x05,
+ 0xbf, 0xd8, 0xd1, 0x60, 0xcf, 0xeb, 0x60, 0xb7,
+ 0xfb, 0x1a, 0x2c, 0xa9, 0xfd, 0x6c, 0x16, 0xff,
+ 0x63, 0x45, 0xa7, 0x3c, 0xdf, 0xec, 0x68, 0xb7,
+ 0x27, 0xfe, 0x4c, 0x1c, 0xef, 0x2a, 0xe3, 0xe1,
+ 0x3a, 0x04, 0xfb, 0xe8, 0x57, 0x3f, 0xef, 0x75,
+ 0xb0, 0x5b, 0xfd, 0x8d, 0x14, 0x3c, 0xfd, 0xd5,
+ 0xe6, 0x0a, 0x50, 0xe9, 0xff, 0xfb, 0x38, 0xaa,
+ 0x73, 0xb6, 0xbb, 0xe0, 0xa5, 0x10, 0x05, 0x4a,
+ 0xd8, 0x8f, 0x35, 0x10, 0xdc, 0x8c, 0xbe, 0x5f,
+ 0x3f, 0xad, 0x82, 0xdf, 0xec, 0x68, 0xbc, 0xe1,
+ 0x17, 0xea, 0x9c, 0x61, 0xc2, 0x96, 0x4b, 0x7c,
+ 0x7e, 0x1e, 0x42, 0x4c, 0xa3, 0xba, 0x9d, 0xf6,
+ 0x39, 0xd5, 0xc8, 0xd3, 0xfa, 0xd8, 0x2d, 0xfe,
+ 0xc6, 0x8a, 0x5a, 0x7f, 0x5b, 0x05, 0xbf, 0xd8,
+ 0xd1, 0x61, 0x4f, 0xeb, 0x60, 0xb7, 0xfb, 0x1a,
+ 0x2c, 0xb9, 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d,
+ 0xfe, 0xc6, 0x8a, 0x32, 0x7f, 0x59, 0x17, 0x20,
+ 0xa0, 0x0e, 0x87, 0x26, 0x6a, 0x27, 0x6a, 0x3b,
+ 0xa1, 0xde, 0x94, 0xa7, 0xfe, 0xb7, 0xba, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x88, 0xe6, 0x7f, 0xf5, 0x95,
+ 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x72, 0x9f,
+ 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x59, 0x93, 0xfa,
+ 0xd8, 0x2d, 0xfe, 0xc6, 0x8b, 0x76, 0x7f, 0xf5,
+ 0x95, 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x90,
+ 0x9f, 0xfa, 0xde, 0xeb, 0x60, 0xb7, 0xfb, 0x1a,
+ 0x25, 0x28, 0x79, 0x3b, 0x25, 0x93, 0x14, 0xa5,
+ 0xd3, 0xbd, 0x1d, 0xde, 0x29, 0x4f, 0xfb, 0xdd,
+ 0x6c, 0x16, 0xff, 0x63, 0x44, 0xed, 0x3f, 0xfe,
+ 0xdf, 0x17, 0x29, 0x2f, 0x3f, 0x8e, 0xa7, 0x71,
+ 0x8e, 0x99, 0x56, 0x52, 0x27, 0xfd, 0x1a, 0x7c,
+ 0x2d, 0xfe, 0xc6, 0x88, 0xb2, 0x7f, 0xde, 0xeb,
+ 0x60, 0xb7, 0xfb, 0x1a, 0x25, 0xd9, 0xff, 0xfb,
+ 0x38, 0xaa, 0x73, 0xb6, 0xbb, 0xe0, 0xa5, 0x10,
+ 0x05, 0x4a, 0xd8, 0x8d, 0x35, 0x18, 0x2f, 0xa3,
+ 0x4f, 0xfe, 0xb2, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6,
+ 0x34, 0x4c, 0x53, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6,
+ 0x8a, 0xa6, 0x7f, 0xf5, 0x95, 0xee, 0xb6, 0x0b,
+ 0x7f, 0xb1, 0xa2, 0x74, 0x9f, 0xdb, 0xf1, 0x47,
+ 0x7a, 0xe3, 0xa7, 0xcb, 0x22, 0xc9, 0x43, 0xa7,
+ 0xe0, 0xe6, 0xd7, 0x67, 0x4e, 0x9e, 0xdd, 0x52,
+ 0xdb, 0x3d, 0x6a, 0x14, 0x4f, 0xfd, 0x75, 0x34,
+ 0x8f, 0xda, 0xe5, 0xb6, 0xa3, 0xa1, 0x48, 0x82,
+ 0xa9, 0xcc, 0xff, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6,
+ 0x34, 0x4e, 0xf3, 0xed, 0x5d, 0xea, 0xd9, 0x52,
+ 0xb7, 0x09, 0xcd, 0xe4, 0x61, 0x4a, 0x23, 0xf4,
+ 0x69, 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d, 0xfe,
+ 0xc6, 0x8a, 0x16, 0x7f, 0xf5, 0x95, 0xee, 0xb6,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0x92, 0x9f, 0xff, 0xd9,
+ 0x4b, 0x73, 0xc5, 0xab, 0xea, 0xd5, 0x53, 0x57,
+ 0x28, 0xe8, 0x79, 0x70, 0x0d, 0xc7, 0x0c, 0xa4,
+ 0x27, 0x6a, 0x8f, 0xb4, 0x09, 0x37, 0x29, 0x2f,
+ 0xa9, 0x4f, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x22,
+ 0x49, 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d, 0xfe,
+ 0xc6, 0x89, 0x7a, 0x7c, 0x2d, 0xfe, 0xc6, 0x8a,
+ 0x5e, 0x7f, 0x27, 0x17, 0x9b, 0x52, 0x50, 0xe9,
+ 0x5b, 0x0f, 0x9b, 0x46, 0x13, 0xfa, 0xd8, 0x2d,
+ 0xfe, 0xc6, 0x8a, 0x72, 0x7f, 0xdb, 0x1f, 0xa5,
+ 0x73, 0x3a, 0xc7, 0x4f, 0xfb, 0x2a, 0x83, 0x96,
+ 0x08, 0x42, 0x54, 0xdb, 0x09, 0xd3, 0x3d, 0x6e,
+ 0x11, 0x1a, 0xbe, 0x77, 0x78, 0x79, 0x3e, 0x16,
+ 0xff, 0x63, 0x45, 0x79, 0x3f, 0xff, 0x67, 0x15,
+ 0x4e, 0x76, 0xd7, 0x7c, 0x14, 0xa2, 0x00, 0xa9,
+ 0x5b, 0x11, 0x1a, 0xbe, 0x61, 0x3f, 0xf5, 0xbd,
+ 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x48, 0xf3, 0xb6,
+ 0x04, 0x3a, 0x73, 0x62, 0x8a, 0xb1, 0x77, 0x3e,
+ 0x16, 0xff, 0x63, 0x44, 0x91, 0x3d, 0x6f, 0x75,
+ 0x90, 0xf6, 0x70, 0xa6, 0x7f, 0xeb, 0x7b, 0xad,
+ 0x82, 0xdf, 0xec, 0x68, 0x92, 0xa7, 0xc2, 0xdf,
+ 0xec, 0x68, 0xbc, 0x67, 0xeb, 0xba, 0xff, 0xbf,
+ 0x43, 0xa7, 0xd4, 0xa6, 0xb1, 0x8e, 0x9f, 0xe7,
+ 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x26, 0xca, 0xd8,
+ 0x8c, 0x77, 0xcc, 0x04, 0xc3, 0xc9, 0xa1, 0x17,
+ 0x4a, 0x5e, 0x3b, 0x74, 0x2e, 0x38, 0x27, 0xdc,
+ 0x32, 0x16, 0x86, 0x8a, 0x8a, 0xeb, 0x0c, 0x0d,
+ 0x1b, 0xdd, 0x18, 0x9c, 0x24, 0x69, 0x1f, 0x6f,
+ 0x47, 0x3a, 0xe8, 0xf2, 0x78, 0x8f, 0x6b, 0x2d,
+ 0xb5, 0x2d, 0xf9, 0x4a, 0xcd, 0x5e, 0x95, 0x3f,
+ 0x3c, 0x19, 0xb9, 0xcc, 0x4b, 0xdc, 0x76, 0x0b,
+ 0x52, 0xc7, 0x06, 0x7e, 0xd9, 0x57, 0xf1, 0x51,
+ 0x59, 0xda, 0x6f, 0xa6, 0xca, 0x02, 0x55, 0x92,
+ 0xf7, 0x0b, 0x0e, 0xce, 0xd5, 0x52, 0x90, 0xff,
+ 0xaa, 0xdb, 0x2a, 0xea, 0x4f, 0x52, 0xe8, 0xf5,
+ 0x83, 0x1f, 0xe2, 0xfc, 0x3f, 0x39, 0xce, 0x82,
+ 0x5e, 0x4e, 0xd3, 0x40,
};
-static const unsigned kPreloadedHSTSBits = 83397;
+static const unsigned kPreloadedHSTSBits = 86044;
-static const unsigned kHSTSRootPosition = 82825;
+static const unsigned kHSTSRootPosition = 85472;
#endif // NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
diff --git a/net/http/transport_security_state_static.json b/net/http/transport_security_state_static.json
index 1f163aa..282cd58 100644
--- a/net/http/transport_security_state_static.json
+++ b/net/http/transport_security_state_static.json
@@ -1262,7 +1262,92 @@
{ "name": "tno.io", "include_subdomains": true, "mode": "force-https" },
{ "name": "translatoruk.co.uk", "include_subdomains": true, "mode": "force-https" },
{ "name": "wepay.in.th", "include_subdomains": true, "mode": "force-https" },
- { "name": "zixiao.wang", "include_subdomains": true, "mode": "force-https" }
+ { "name": "zixiao.wang", "include_subdomains": true, "mode": "force-https" },
+
+ { "name": "at.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "au.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "az.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "be.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "bi.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "br.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ca.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "cd.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "cg.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "chfr.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "chit.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ch.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "cl.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "cn.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "co.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "cr.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ct.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "de.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "dk.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "do.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "en-maktoob.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "espanol.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "es.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "fi.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "fj.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "fr.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "gl.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "gm.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "gr.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "hk.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "hn.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "hu.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "id.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ie.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "in.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "it.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "kr.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "kz.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "li.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "lt.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "lu.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "lv.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "maktoob.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "malaysia.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "mt.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "mu.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "mw.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "mx.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ni.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "nl.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "no.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "np.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "nz.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "pa.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "pe.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ph.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "pk.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "pl.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "pr.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "py.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "qc.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ro.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ru.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "rw.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "se.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "sg.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "sv.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "th.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "tr.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "tv.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "tw.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ua.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "uk.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "uy.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "uz.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "ve.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "vn.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "xa.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "za.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "zh.search.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "login.yahoo.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "mail.yahoo.com", "include_subdomains": false, "mode": "force-https" },
+ { "name": "edit.yahoo.com", "include_subdomains": true, "mode": "force-https" }
],
// |ReportUMAOnPinFailure| uses these to report which domain was associated
diff --git a/net/http/url_security_manager.h b/net/http/url_security_manager.h
index 4015fc2..2835d89 100644
--- a/net/http/url_security_manager.h
+++ b/net/http/url_security_manager.h
@@ -64,8 +64,8 @@
virtual ~URLSecurityManagerWhitelist();
// URLSecurityManager methods.
- virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const OVERRIDE;
- virtual bool CanDelegate(const GURL& auth_origin) const OVERRIDE;
+ virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
+ virtual bool CanDelegate(const GURL& auth_origin) const override;
private:
scoped_ptr<const HttpAuthFilter> whitelist_default_;
diff --git a/net/net.gypi b/net/net.gypi
index 8ed69df..36aa3e6 100644
--- a/net/net.gypi
+++ b/net/net.gypi
@@ -189,6 +189,8 @@
'base/bandwidth_metrics.cc',
'base/bandwidth_metrics.h',
'base/cache_type.h',
+ 'base/chunked_upload_data_stream.cc',
+ 'base/chunked_upload_data_stream.h',
'base/crypto_module.h',
'base/crypto_module_nss.cc',
'base/crypto_module_openssl.cc',
@@ -198,6 +200,8 @@
'base/directory_lister.h',
'base/dns_reloader.cc',
'base/dns_reloader.h',
+ 'base/elements_upload_data_stream.cc',
+ 'base/elements_upload_data_stream.h',
'base/expiring_cache.h',
'base/file_stream.cc',
'base/file_stream.h',
@@ -1254,9 +1258,11 @@
'base/address_list_unittest.cc',
'base/address_tracker_linux_unittest.cc',
'base/backoff_entry_unittest.cc',
+ 'base/chunked_upload_data_stream_unittest.cc',
'base/data_url_unittest.cc',
'base/directory_lister_unittest.cc',
'base/dns_util_unittest.cc',
+ 'base/elements_upload_data_stream_unittest.cc',
'base/escape_unittest.cc',
'base/expiring_cache_unittest.cc',
'base/file_stream_unittest.cc',
@@ -1285,7 +1291,6 @@
'base/test_completion_callback_unittest.cc',
'base/trace_net_log_observer_unittest.cc',
'base/upload_bytes_element_reader_unittest.cc',
- 'base/upload_data_stream_unittest.cc',
'base/upload_file_element_reader_unittest.cc',
'base/url_util_unittest.cc',
'cert/cert_verify_proc_unittest.cc',
diff --git a/net/net_unittests.isolate b/net/net_unittests.isolate
index dafa0d7..15b3f08 100644
--- a/net/net_unittests.isolate
+++ b/net/net_unittests.isolate
@@ -17,6 +17,8 @@
'<(PRODUCT_DIR)/net_unittests<(EXECUTABLE_SUFFIX)',
'--brave-new-test-launcher',
'--test-launcher-bot-mode',
+ '--asan=<(asan)',
+ '--lsan=<(lsan)',
],
'files': [
'../testing/test_env.py',
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc
index 1d7fa9d..02eb2c7 100644
--- a/net/ocsp/nss_ocsp.cc
+++ b/net/ocsp/nss_ocsp.cc
@@ -30,12 +30,12 @@
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/host_port_pair.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/request_priority.h"
#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_data_stream.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/redirect_info.h"
@@ -285,7 +285,7 @@
virtual void OnReceivedRedirect(URLRequest* request,
const RedirectInfo& redirect_info,
- bool* defer_redirect) OVERRIDE {
+ bool* defer_redirect) override {
DCHECK_EQ(request_.get(), request);
DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_);
@@ -296,7 +296,7 @@
}
}
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE {
+ virtual void OnResponseStarted(URLRequest* request) override {
DCHECK_EQ(request_.get(), request);
DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_);
@@ -311,7 +311,7 @@
}
virtual void OnReadCompleted(URLRequest* request,
- int bytes_read) OVERRIDE {
+ int bytes_read) override {
DCHECK_EQ(request_.get(), request);
DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_);
@@ -411,8 +411,8 @@
scoped_ptr<UploadElementReader> reader(new UploadBytesElementReader(
upload_content_.data(), upload_content_.size()));
- request_->set_upload(make_scoped_ptr(
- UploadDataStream::CreateWithReader(reader.Pass(), 0)));
+ request_->set_upload(
+ ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
}
if (!extra_request_headers_.IsEmpty())
request_->SetExtraRequestHeaders(extra_request_headers_);
diff --git a/net/ocsp/nss_ocsp_unittest.cc b/net/ocsp/nss_ocsp_unittest.cc
index 0201ad1..3df446e 100644
--- a/net/ocsp/nss_ocsp_unittest.cc
+++ b/net/ocsp/nss_ocsp_unittest.cc
@@ -49,7 +49,7 @@
// net::URLRequestInterceptor implementation:
virtual net::URLRequestJob* MaybeInterceptRequest(
net::URLRequest* request,
- net::NetworkDelegate* network_delegate) const OVERRIDE {
+ net::NetworkDelegate* network_delegate) const override {
++const_cast<AiaResponseHandler*>(this)->request_count_;
return new net::URLRequestTestJob(
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
index b50b579..8d41d66 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
@@ -220,7 +220,6 @@
DHCPCAPI_PARAMS_ARRAY send_params = { 0, NULL };
- BYTE option_data[] = { 1, 252 };
DHCPCAPI_PARAMS wpad_params = { 0 };
wpad_params.OptionId = 252;
wpad_params.IsVendor = FALSE; // Surprising, but intentional.
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
index 821e4eb..8e19001 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
@@ -51,7 +51,7 @@
fetcher_ = NULL;
}
- virtual ProxyScriptFetcher* ImplCreateScriptFetcher() OVERRIDE {
+ virtual ProxyScriptFetcher* ImplCreateScriptFetcher() override {
// We don't maintain ownership of the fetcher, it is transferred to
// the caller.
fetcher_ = new MockProxyScriptFetcher();
@@ -71,7 +71,7 @@
}
std::string ImplGetPacURLFromDhcp(
- const std::string& adapter_name) OVERRIDE {
+ const std::string& adapter_name) override {
base::ElapsedTimer timer;
test_finished_event_.TimedWait(dhcp_delay_);
return configured_url_;
@@ -82,7 +82,7 @@
std::string configured_url_;
};
- virtual DhcpQuery* ImplCreateDhcpQuery() OVERRIDE {
+ virtual DhcpQuery* ImplCreateDhcpQuery() override {
dhcp_query_ = new DelayingDhcpQuery();
dhcp_query_->dhcp_delay_ = dhcp_delay_;
dhcp_query_->configured_url_ = configured_url_;
@@ -90,7 +90,7 @@
}
// Use a shorter timeout so tests can finish more quickly.
- virtual base::TimeDelta ImplGetTimeout() const OVERRIDE {
+ virtual base::TimeDelta ImplGetTimeout() const override {
return timeout_;
}
@@ -272,7 +272,7 @@
}
// Returns a real proxy script fetcher.
- ProxyScriptFetcher* ImplCreateScriptFetcher() OVERRIDE {
+ ProxyScriptFetcher* ImplCreateScriptFetcher() override {
ProxyScriptFetcher* fetcher =
new ProxyScriptFetcherImpl(url_request_context_);
return fetcher;
diff --git a/net/proxy/dhcp_proxy_script_fetcher.h b/net/proxy/dhcp_proxy_script_fetcher.h
index 0ec2ed4..bb293de 100644
--- a/net/proxy/dhcp_proxy_script_fetcher.h
+++ b/net/proxy/dhcp_proxy_script_fetcher.h
@@ -86,9 +86,9 @@
virtual ~DoNothingDhcpProxyScriptFetcher();
virtual int Fetch(base::string16* utf16_text,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Cancel() OVERRIDE;
- virtual const GURL& GetPacURL() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void Cancel() override;
+ virtual const GURL& GetPacURL() const override;
private:
GURL gurl_;
DISALLOW_COPY_AND_ASSIGN(DoNothingDhcpProxyScriptFetcher);
diff --git a/net/proxy/dhcp_proxy_script_fetcher_win.h b/net/proxy/dhcp_proxy_script_fetcher_win.h
index d6f14f9..1122997 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_win.h
+++ b/net/proxy/dhcp_proxy_script_fetcher_win.h
@@ -39,10 +39,10 @@
// DhcpProxyScriptFetcher implementation.
int Fetch(base::string16* utf16_text,
- const net::CompletionCallback& callback) OVERRIDE;
- void Cancel() OVERRIDE;
- const GURL& GetPacURL() const OVERRIDE;
- std::string GetFetcherName() const OVERRIDE;
+ const net::CompletionCallback& callback) override;
+ void Cancel() override;
+ const GURL& GetPacURL() const override;
+ std::string GetFetcherName() const override;
// Sets |adapter_names| to contain the name of each network adapter on
// this machine that has DHCP enabled and is not a loop-back adapter. Returns
diff --git a/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc b/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc
index 743fb26..eb98330 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc
@@ -169,13 +169,13 @@
}
std::string ImplGetPacURLFromDhcp(
- const std::string& adapter_name) OVERRIDE {
+ const std::string& adapter_name) override {
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(20));
return DhcpQuery::ImplGetPacURLFromDhcp(adapter_name);
}
};
- DhcpQuery* ImplCreateDhcpQuery() OVERRIDE {
+ DhcpQuery* ImplCreateDhcpQuery() override {
return new DelayingDhcpQuery();
}
};
@@ -189,7 +189,7 @@
: DhcpProxyScriptFetcherWin(context) {
}
- DhcpProxyScriptAdapterFetcher* ImplCreateAdapterFetcher() OVERRIDE {
+ DhcpProxyScriptAdapterFetcher* ImplCreateAdapterFetcher() override {
return new DelayingDhcpProxyScriptAdapterFetcher(url_request_context(),
GetTaskRunner());
}
@@ -224,25 +224,25 @@
}
void Fetch(const std::string& adapter_name,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
callback_ = callback;
timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(fetch_delay_ms_),
this, &DummyDhcpProxyScriptAdapterFetcher::OnTimer);
}
- void Cancel() OVERRIDE {
+ void Cancel() override {
timer_.Stop();
}
- bool DidFinish() const OVERRIDE {
+ bool DidFinish() const override {
return did_finish_;
}
- int GetResult() const OVERRIDE {
+ int GetResult() const override {
return result_;
}
- base::string16 GetPacScript() const OVERRIDE {
+ base::string16 GetPacScript() const override {
return pac_script_;
}
@@ -280,7 +280,7 @@
}
virtual bool ImplGetCandidateAdapterNames(
- std::set<std::string>* adapter_names) OVERRIDE {
+ std::set<std::string>* adapter_names) override {
adapter_names->insert(
mock_adapter_names_.begin(), mock_adapter_names_.end());
return true;
@@ -324,21 +324,21 @@
PushBackAdapter(adapter_name, adapter_fetcher.release());
}
- DhcpProxyScriptAdapterFetcher* ImplCreateAdapterFetcher() OVERRIDE {
+ DhcpProxyScriptAdapterFetcher* ImplCreateAdapterFetcher() override {
++num_fetchers_created_;
return adapter_fetchers_[next_adapter_fetcher_index_++];
}
- virtual AdapterQuery* ImplCreateAdapterQuery() OVERRIDE {
+ virtual AdapterQuery* ImplCreateAdapterQuery() override {
DCHECK(adapter_query_);
return adapter_query_.get();
}
- base::TimeDelta ImplGetMaxWait() OVERRIDE {
+ base::TimeDelta ImplGetMaxWait() override {
return max_wait_;
}
- void ImplOnGetCandidateAdapterNamesDone() OVERRIDE {
+ void ImplOnGetCandidateAdapterNamesDone() override {
worker_finished_event_.Signal();
}
diff --git a/net/proxy/mock_proxy_resolver.h b/net/proxy/mock_proxy_resolver.h
index 3864d53..5a616dd 100644
--- a/net/proxy/mock_proxy_resolver.h
+++ b/net/proxy/mock_proxy_resolver.h
@@ -77,13 +77,13 @@
ProxyInfo* results,
const net::CompletionCallback& callback,
RequestHandle* request_handle,
- const BoundNetLog& /*net_log*/) OVERRIDE;
- virtual void CancelRequest(RequestHandle request_handle) OVERRIDE;
- virtual LoadState GetLoadState(RequestHandle request_handle) const OVERRIDE;
+ const BoundNetLog& /*net_log*/) override;
+ virtual void CancelRequest(RequestHandle request_handle) override;
+ virtual LoadState GetLoadState(RequestHandle request_handle) const override;
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual void CancelSetPacScript() OVERRIDE;
+ const net::CompletionCallback& callback) override;
+ virtual void CancelSetPacScript() override;
const RequestsList& pending_requests() const {
return pending_requests_;
diff --git a/net/proxy/mock_proxy_script_fetcher.h b/net/proxy/mock_proxy_script_fetcher.h
index 81e221f..910c6b2 100644
--- a/net/proxy/mock_proxy_script_fetcher.h
+++ b/net/proxy/mock_proxy_script_fetcher.h
@@ -25,9 +25,9 @@
// ProxyScriptFetcher implementation.
virtual int Fetch(const GURL& url,
base::string16* text,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Cancel() OVERRIDE;
- virtual URLRequestContext* GetRequestContext() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void Cancel() override;
+ virtual URLRequestContext* GetRequestContext() const override;
void NotifyFetchCompletion(int result, const std::string& ascii_text);
const GURL& pending_request_url() const;
diff --git a/net/proxy/multi_threaded_proxy_resolver.cc b/net/proxy/multi_threaded_proxy_resolver.cc
index 4b68321..a2a6515 100644
--- a/net/proxy/multi_threaded_proxy_resolver.cc
+++ b/net/proxy/multi_threaded_proxy_resolver.cc
@@ -175,7 +175,7 @@
}
// Runs on the worker thread.
- virtual void Run(scoped_refptr<base::MessageLoopProxy> origin_loop) OVERRIDE {
+ virtual void Run(scoped_refptr<base::MessageLoopProxy> origin_loop) override {
ProxyResolver* resolver = executor()->resolver();
int rv = resolver->SetPacScript(script_data_, CompletionCallback());
@@ -222,12 +222,12 @@
BoundNetLog* net_log() { return &net_log_; }
- virtual void WaitingForThread() OVERRIDE {
+ virtual void WaitingForThread() override {
was_waiting_for_thread_ = true;
net_log_.BeginEvent(NetLog::TYPE_WAITING_FOR_PROXY_RESOLVER_THREAD);
}
- virtual void FinishedWaitingForThread() OVERRIDE {
+ virtual void FinishedWaitingForThread() override {
DCHECK(executor());
if (was_waiting_for_thread_) {
@@ -240,7 +240,7 @@
}
// Runs on the worker thread.
- virtual void Run(scoped_refptr<base::MessageLoopProxy> origin_loop) OVERRIDE {
+ virtual void Run(scoped_refptr<base::MessageLoopProxy> origin_loop) override {
ProxyResolver* resolver = executor()->resolver();
int rv = resolver->GetProxyForURL(
url_, &results_buf_, CompletionCallback(), NULL, net_log_);
diff --git a/net/proxy/multi_threaded_proxy_resolver.h b/net/proxy/multi_threaded_proxy_resolver.h
index 5c470f4..0a14461 100644
--- a/net/proxy/multi_threaded_proxy_resolver.h
+++ b/net/proxy/multi_threaded_proxy_resolver.h
@@ -95,13 +95,13 @@
ProxyInfo* results,
const CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle request) OVERRIDE;
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE;
- virtual void CancelSetPacScript() OVERRIDE;
+ const BoundNetLog& net_log) override;
+ virtual void CancelRequest(RequestHandle request) override;
+ virtual LoadState GetLoadState(RequestHandle request) const override;
+ virtual void CancelSetPacScript() override;
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
private:
class Executor;
diff --git a/net/proxy/multi_threaded_proxy_resolver_unittest.cc b/net/proxy/multi_threaded_proxy_resolver_unittest.cc
index e1c9e90..d2e465c 100644
--- a/net/proxy/multi_threaded_proxy_resolver_unittest.cc
+++ b/net/proxy/multi_threaded_proxy_resolver_unittest.cc
@@ -40,7 +40,7 @@
ProxyInfo* results,
const CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
if (resolve_latency_ != base::TimeDelta())
base::PlatformThread::Sleep(resolve_latency_);
@@ -58,22 +58,22 @@
return request_count_++;
}
- virtual void CancelRequest(RequestHandle request) OVERRIDE {
+ virtual void CancelRequest(RequestHandle request) override {
NOTREACHED();
}
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE {
+ virtual LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() OVERRIDE {
+ virtual void CancelSetPacScript() override {
NOTREACHED();
}
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
CheckIsOnWorkerThread();
last_script_data_ = script_data;
return OK;
@@ -137,7 +137,7 @@
ProxyInfo* results,
const CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
if (should_block_) {
blocked_.Signal();
unblocked_.Wait();
@@ -164,27 +164,27 @@
ProxyInfo* results,
const CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
return impl_->GetProxyForURL(
query_url, results, callback, request, net_log);
}
- virtual void CancelRequest(RequestHandle request) OVERRIDE {
+ virtual void CancelRequest(RequestHandle request) override {
impl_->CancelRequest(request);
}
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE {
+ virtual LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() OVERRIDE {
+ virtual void CancelSetPacScript() override {
impl_->CancelSetPacScript();
}
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return impl_->SetPacScript(script_data, callback);
}
@@ -200,7 +200,7 @@
: ProxyResolverFactory(resolver->expects_pac_bytes()),
resolver_(resolver) {}
- virtual ProxyResolver* CreateProxyResolver() OVERRIDE {
+ virtual ProxyResolver* CreateProxyResolver() override {
return new ForwardingProxyResolver(resolver_);
}
@@ -217,7 +217,7 @@
STLDeleteElements(&resolvers_);
}
- virtual ProxyResolver* CreateProxyResolver() OVERRIDE {
+ virtual ProxyResolver* CreateProxyResolver() override {
BlockableProxyResolver* resolver = new BlockableProxyResolver;
resolvers_.push_back(resolver);
return new ForwardingProxyResolver(resolver);
diff --git a/net/proxy/network_delegate_error_observer.h b/net/proxy/network_delegate_error_observer.h
index e4b03aa..70a2bed 100644
--- a/net/proxy/network_delegate_error_observer.h
+++ b/net/proxy/network_delegate_error_observer.h
@@ -28,7 +28,7 @@
// ProxyResolverErrorObserver implementation.
virtual void OnPACScriptError(int line_number, const base::string16& error)
- OVERRIDE;
+ override;
private:
class Core;
diff --git a/net/proxy/network_delegate_error_observer_unittest.cc b/net/proxy/network_delegate_error_observer_unittest.cc
index 1f6330f..8547761 100644
--- a/net/proxy/network_delegate_error_observer_unittest.cc
+++ b/net/proxy/network_delegate_error_observer_unittest.cc
@@ -27,62 +27,62 @@
// net::NetworkDelegate implementation.
virtual int OnBeforeURLRequest(URLRequest* request,
const CompletionCallback& callback,
- GURL* new_url) OVERRIDE {
+ GURL* new_url) override {
return OK;
}
virtual int OnBeforeSendHeaders(URLRequest* request,
const CompletionCallback& callback,
- HttpRequestHeaders* headers) OVERRIDE {
+ HttpRequestHeaders* headers) override {
return OK;
}
virtual void OnSendHeaders(URLRequest* request,
- const HttpRequestHeaders& headers) OVERRIDE {}
+ const HttpRequestHeaders& headers) override {}
virtual int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
- GURL* allowed_unsafe_redirect_url) OVERRIDE {
+ GURL* allowed_unsafe_redirect_url) override {
return net::OK;
}
virtual void OnBeforeRedirect(URLRequest* request,
- const GURL& new_location) OVERRIDE {}
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE {}
+ const GURL& new_location) override {}
+ virtual void OnResponseStarted(URLRequest* request) override {}
virtual void OnRawBytesRead(const URLRequest& request,
- int bytes_read) OVERRIDE {}
- virtual void OnCompleted(URLRequest* request, bool started) OVERRIDE {}
- virtual void OnURLRequestDestroyed(URLRequest* request) OVERRIDE {}
+ int bytes_read) override {}
+ virtual void OnCompleted(URLRequest* request, bool started) override {}
+ virtual void OnURLRequestDestroyed(URLRequest* request) override {}
virtual void OnPACScriptError(int line_number,
- const base::string16& error) OVERRIDE {
+ const base::string16& error) override {
got_pac_error_ = true;
}
virtual AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
- AuthCredentials* credentials) OVERRIDE {
+ AuthCredentials* credentials) override {
return AUTH_REQUIRED_RESPONSE_NO_ACTION;
}
virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) OVERRIDE {
+ const CookieList& cookie_list) override {
return true;
}
virtual bool OnCanSetCookie(const URLRequest& request,
const std::string& cookie_line,
- CookieOptions* options) OVERRIDE {
+ CookieOptions* options) override {
return true;
}
virtual bool OnCanAccessFile(const net::URLRequest& request,
- const base::FilePath& path) const OVERRIDE {
+ const base::FilePath& path) const override {
return true;
}
- virtual bool OnCanThrottleRequest(const URLRequest& request) const OVERRIDE {
+ virtual bool OnCanThrottleRequest(const URLRequest& request) const override {
return false;
}
virtual int OnBeforeSocketStreamConnect(
SocketStream* stream,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return OK;
}
diff --git a/net/proxy/polling_proxy_config_service.h b/net/proxy/polling_proxy_config_service.h
index f5f5117..dc0db48 100644
--- a/net/proxy/polling_proxy_config_service.h
+++ b/net/proxy/polling_proxy_config_service.h
@@ -20,10 +20,10 @@
class NET_EXPORT_PRIVATE PollingProxyConfigService : public ProxyConfigService {
public:
// ProxyConfigService implementation:
- virtual void AddObserver(Observer* observer) OVERRIDE;
- virtual void RemoveObserver(Observer* observer) OVERRIDE;
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) OVERRIDE;
- virtual void OnLazyPoll() OVERRIDE;
+ virtual void AddObserver(Observer* observer) override;
+ virtual void RemoveObserver(Observer* observer) override;
+ virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
+ virtual void OnLazyPoll() override;
protected:
// Function for retrieving the current proxy configuration.
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index 239a2fe..debb2e8 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.cc
@@ -27,7 +27,7 @@
optional_port_(optional_port) {
}
- virtual bool Matches(const GURL& url) const OVERRIDE {
+ virtual bool Matches(const GURL& url) const override {
if (optional_port_ != -1 && url.EffectiveIntPort() != optional_port_)
return false; // Didn't match port expectation.
@@ -40,7 +40,7 @@
hostname_pattern_);
}
- virtual std::string ToString() const OVERRIDE {
+ virtual std::string ToString() const override {
std::string str;
if (!optional_scheme_.empty())
base::StringAppendF(&str, "%s://", optional_scheme_.c_str());
@@ -50,7 +50,7 @@
return str;
}
- virtual Rule* Clone() const OVERRIDE {
+ virtual Rule* Clone() const override {
return new HostnamePatternRule(optional_scheme_,
hostname_pattern_,
optional_port_);
@@ -64,18 +64,18 @@
class BypassLocalRule : public ProxyBypassRules::Rule {
public:
- virtual bool Matches(const GURL& url) const OVERRIDE {
+ virtual bool Matches(const GURL& url) const override {
const std::string& host = url.host();
if (host == "127.0.0.1" || host == "[::1]")
return true;
return host.find('.') == std::string::npos;
}
- virtual std::string ToString() const OVERRIDE {
+ virtual std::string ToString() const override {
return "<local>";
}
- virtual Rule* Clone() const OVERRIDE {
+ virtual Rule* Clone() const override {
return new BypassLocalRule();
}
};
@@ -96,7 +96,7 @@
prefix_length_in_bits_(prefix_length_in_bits) {
}
- virtual bool Matches(const GURL& url) const OVERRIDE {
+ virtual bool Matches(const GURL& url) const override {
if (!url.HostIsIPAddress())
return false;
@@ -113,11 +113,11 @@
prefix_length_in_bits_);
}
- virtual std::string ToString() const OVERRIDE {
+ virtual std::string ToString() const override {
return description_;
}
- virtual Rule* Clone() const OVERRIDE {
+ virtual Rule* Clone() const override {
return new BypassIPBlockRule(description_,
optional_scheme_,
ip_prefix_,
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc
index d27bc5a..f1a0b6c 100644
--- a/net/proxy/proxy_config_service_android.cc
+++ b/net/proxy/proxy_config_service_android.cc
@@ -6,6 +6,7 @@
#include <sys/system_properties.h>
+#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "base/basictypes.h"
#include "base/bind.h"
@@ -162,6 +163,7 @@
void CreateStaticProxyConfig(const std::string& host,
int port,
const std::string& pac_url,
+ const std::vector<std::string>& exclusion_list,
ProxyConfig* config) {
if (!pac_url.empty()) {
config->set_pac_url(GURL(pac_url));
@@ -169,6 +171,16 @@
} else if (port != 0) {
std::string rules = base::StringPrintf("%s:%d", host.c_str(), port);
config->proxy_rules().ParseFromString(rules);
+ config->proxy_rules().bypass_rules.Clear();
+
+ std::vector<std::string>::const_iterator it;
+ for (it = exclusion_list.begin(); it != exclusion_list.end(); ++it) {
+ std::string pattern;
+ base::TrimWhitespaceASCII(*it, base::TRIM_ALL, &pattern);
+ if (pattern.empty())
+ continue;
+ config->proxy_rules().bypass_rules.AddRuleForHostname("", pattern, -1);
+ }
} else {
*config = ProxyConfig::CreateDirect();
}
@@ -255,10 +267,11 @@
// Called on the JNI thread.
void ProxySettingsChangedTo(const std::string& host,
int port,
- const std::string& pac_url) {
+ const std::string& pac_url,
+ const std::vector<std::string>& exclusion_list) {
DCHECK(OnJNIThread());
ProxyConfig proxy_config;
- CreateStaticProxyConfig(host, port, pac_url, &proxy_config);
+ CreateStaticProxyConfig(host, port, pac_url, exclusion_list, &proxy_config);
network_task_runner_->PostTask(
FROM_HERE,
base::Bind(
@@ -277,15 +290,19 @@
jobject jself,
jstring jhost,
jint jport,
- jstring jpac_url) OVERRIDE {
+ jstring jpac_url,
+ jobjectArray jexclusion_list) override {
std::string host = ConvertJavaStringToUTF8(env, jhost);
std::string pac_url;
if (jpac_url)
ConvertJavaStringToUTF8(env, jpac_url, &pac_url);
- delegate_->ProxySettingsChangedTo(host, jport, pac_url);
+ std::vector<std::string> exclusion_list;
+ base::android::AppendJavaStringArrayToStringVector(
+ env, jexclusion_list, &exclusion_list);
+ delegate_->ProxySettingsChangedTo(host, jport, pac_url, exclusion_list);
}
- virtual void ProxySettingsChanged(JNIEnv* env, jobject self) OVERRIDE {
+ virtual void ProxySettingsChanged(JNIEnv* env, jobject self) override {
delegate_->ProxySettingsChanged();
}
diff --git a/net/proxy/proxy_config_service_android.h b/net/proxy/proxy_config_service_android.h
index ee54b94..d642d37 100644
--- a/net/proxy/proxy_config_service_android.h
+++ b/net/proxy/proxy_config_service_android.h
@@ -42,11 +42,13 @@
// changed. The string and int arguments (the host/port pair for the proxy)
// are either a host/port pair or ("", 0) to indicate "no proxy".
// The third argument indicates the PAC url.
+ // The fourth argument is the proxy exclusion list.
virtual void ProxySettingsChangedTo(JNIEnv*,
jobject,
jstring,
jint,
- jstring) = 0;
+ jstring,
+ jobjectArray) = 0;
// Called from Java (on JNI thread) to signal that the proxy settings have
// changed. New proxy settings are fetched from the system property store.
@@ -64,9 +66,9 @@
// ProxyConfigService:
// Called only on the network thread.
- virtual void AddObserver(Observer* observer) OVERRIDE;
- virtual void RemoveObserver(Observer* observer) OVERRIDE;
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) OVERRIDE;
+ virtual void AddObserver(Observer* observer) override;
+ virtual void RemoveObserver(Observer* observer) override;
+ virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
private:
friend class ProxyConfigServiceAndroidTestBase;
diff --git a/net/proxy/proxy_config_service_android_unittest.cc b/net/proxy/proxy_config_service_android_unittest.cc
index 03324b9..41f2387 100644
--- a/net/proxy/proxy_config_service_android_unittest.cc
+++ b/net/proxy/proxy_config_service_android_unittest.cc
@@ -25,7 +25,7 @@
// ProxyConfigService::Observer:
virtual void OnProxyConfigChanged(
const ProxyConfig& config,
- ProxyConfigService::ConfigAvailability availability) OVERRIDE {
+ ProxyConfigService::ConfigAvailability availability) override {
config_ = config;
availability_ = availability;
}
@@ -62,12 +62,12 @@
virtual ~ProxyConfigServiceAndroidTestBase() {}
// testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
message_loop_->RunUntilIdle();
service_.AddObserver(&observer_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
service_.RemoveObserver(&observer_);
}
diff --git a/net/proxy/proxy_config_service_fixed.h b/net/proxy/proxy_config_service_fixed.h
index b5f30e3..14185c6 100644
--- a/net/proxy/proxy_config_service_fixed.h
+++ b/net/proxy/proxy_config_service_fixed.h
@@ -19,9 +19,9 @@
virtual ~ProxyConfigServiceFixed();
// ProxyConfigService methods:
- virtual void AddObserver(Observer* observer) OVERRIDE {}
- virtual void RemoveObserver(Observer* observer) OVERRIDE {}
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) OVERRIDE;
+ virtual void AddObserver(Observer* observer) override {}
+ virtual void RemoveObserver(Observer* observer) override {}
+ virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
private:
ProxyConfig pc_;
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index 4e9065e..145312e 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -235,7 +235,7 @@
virtual bool Init(
const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner)
- OVERRIDE {
+ override {
DCHECK(glib_task_runner->BelongsToCurrentThread());
DCHECK(!client_);
DCHECK(!task_runner_.get());
@@ -273,7 +273,7 @@
return true;
}
- virtual void ShutDown() OVERRIDE {
+ virtual void ShutDown() override {
if (client_) {
DCHECK(task_runner_->BelongsToCurrentThread());
// We must explicitly disable gconf notifications here, because the gconf
@@ -291,7 +291,7 @@
}
virtual bool SetUpNotifications(
- ProxyConfigServiceLinux::Delegate* delegate) OVERRIDE {
+ ProxyConfigServiceLinux::Delegate* delegate) override {
DCHECK(client_);
DCHECK(task_runner_->BelongsToCurrentThread());
GError* error = NULL;
@@ -321,15 +321,15 @@
}
virtual const scoped_refptr<base::SingleThreadTaskRunner>&
- GetNotificationTaskRunner() OVERRIDE {
+ GetNotificationTaskRunner() override {
return task_runner_;
}
- virtual ProxyConfigSource GetConfigSource() OVERRIDE {
+ virtual ProxyConfigSource GetConfigSource() override {
return PROXY_CONFIG_SOURCE_GCONF;
}
- virtual bool GetString(StringSetting key, std::string* result) OVERRIDE {
+ virtual bool GetString(StringSetting key, std::string* result) override {
switch (key) {
case PROXY_MODE:
return GetStringByPath("/system/proxy/mode", result);
@@ -346,7 +346,7 @@
}
return false; // Placate compiler.
}
- virtual bool GetBool(BoolSetting key, bool* result) OVERRIDE {
+ virtual bool GetBool(BoolSetting key, bool* result) override {
switch (key) {
case PROXY_USE_HTTP_PROXY:
return GetBoolByPath("/system/http_proxy/use_http_proxy", result);
@@ -357,7 +357,7 @@
}
return false; // Placate compiler.
}
- virtual bool GetInt(IntSetting key, int* result) OVERRIDE {
+ virtual bool GetInt(IntSetting key, int* result) override {
switch (key) {
case PROXY_HTTP_PORT:
return GetIntByPath("/system/http_proxy/port", result);
@@ -371,7 +371,7 @@
return false; // Placate compiler.
}
virtual bool GetStringList(StringListSetting key,
- std::vector<std::string>* result) OVERRIDE {
+ std::vector<std::string>* result) override {
switch (key) {
case PROXY_IGNORE_HOSTS:
return GetStringListByPath("/system/http_proxy/ignore_hosts", result);
@@ -379,12 +379,12 @@
return false; // Placate compiler.
}
- virtual bool BypassListIsReversed() OVERRIDE {
+ virtual bool BypassListIsReversed() override {
// This is a KDE-specific setting.
return false;
}
- virtual bool MatchHostsUsingSuffixMatching() OVERRIDE {
+ virtual bool MatchHostsUsingSuffixMatching() override {
return false;
}
@@ -568,7 +568,7 @@
virtual bool Init(
const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner)
- OVERRIDE {
+ override {
DCHECK(glib_task_runner->BelongsToCurrentThread());
DCHECK(!client_);
DCHECK(!task_runner_.get());
@@ -589,7 +589,7 @@
return true;
}
- virtual void ShutDown() OVERRIDE {
+ virtual void ShutDown() override {
if (client_) {
DCHECK(task_runner_->BelongsToCurrentThread());
// This also disables gsettings notifications.
@@ -605,7 +605,7 @@
}
virtual bool SetUpNotifications(
- ProxyConfigServiceLinux::Delegate* delegate) OVERRIDE {
+ ProxyConfigServiceLinux::Delegate* delegate) override {
DCHECK(client_);
DCHECK(task_runner_->BelongsToCurrentThread());
notify_delegate_ = delegate;
@@ -628,15 +628,15 @@
}
virtual const scoped_refptr<base::SingleThreadTaskRunner>&
- GetNotificationTaskRunner() OVERRIDE {
+ GetNotificationTaskRunner() override {
return task_runner_;
}
- virtual ProxyConfigSource GetConfigSource() OVERRIDE {
+ virtual ProxyConfigSource GetConfigSource() override {
return PROXY_CONFIG_SOURCE_GSETTINGS;
}
- virtual bool GetString(StringSetting key, std::string* result) OVERRIDE {
+ virtual bool GetString(StringSetting key, std::string* result) override {
DCHECK(client_);
switch (key) {
case PROXY_MODE:
@@ -654,7 +654,7 @@
}
return false; // Placate compiler.
}
- virtual bool GetBool(BoolSetting key, bool* result) OVERRIDE {
+ virtual bool GetBool(BoolSetting key, bool* result) override {
DCHECK(client_);
switch (key) {
case PROXY_USE_HTTP_PROXY:
@@ -672,7 +672,7 @@
}
return false; // Placate compiler.
}
- virtual bool GetInt(IntSetting key, int* result) OVERRIDE {
+ virtual bool GetInt(IntSetting key, int* result) override {
DCHECK(client_);
switch (key) {
case PROXY_HTTP_PORT:
@@ -687,7 +687,7 @@
return false; // Placate compiler.
}
virtual bool GetStringList(StringListSetting key,
- std::vector<std::string>* result) OVERRIDE {
+ std::vector<std::string>* result) override {
DCHECK(client_);
switch (key) {
case PROXY_IGNORE_HOSTS:
@@ -696,12 +696,12 @@
return false; // Placate compiler.
}
- virtual bool BypassListIsReversed() OVERRIDE {
+ virtual bool BypassListIsReversed() override {
// This is a KDE-specific setting.
return false;
}
- virtual bool MatchHostsUsingSuffixMatching() OVERRIDE {
+ virtual bool MatchHostsUsingSuffixMatching() override {
return false;
}
@@ -932,7 +932,7 @@
virtual bool Init(
const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner)
- OVERRIDE {
+ override {
// This has to be called on the UI thread (http://crbug.com/69057).
base::ThreadRestrictions::ScopedAllowIO allow_io;
DCHECK(inotify_fd_ < 0);
@@ -956,7 +956,7 @@
return true;
}
- virtual void ShutDown() OVERRIDE {
+ virtual void ShutDown() override {
if (inotify_fd_ >= 0) {
ResetCachedSettings();
inotify_watcher_.StopWatchingFileDescriptor();
@@ -966,7 +966,7 @@
}
virtual bool SetUpNotifications(
- ProxyConfigServiceLinux::Delegate* delegate) OVERRIDE {
+ ProxyConfigServiceLinux::Delegate* delegate) override {
DCHECK(inotify_fd_ >= 0);
DCHECK(file_task_runner_->BelongsToCurrentThread());
// We can't just watch the kioslaverc file directly, since KDE will write
@@ -990,41 +990,41 @@
}
virtual const scoped_refptr<base::SingleThreadTaskRunner>&
- GetNotificationTaskRunner() OVERRIDE {
+ GetNotificationTaskRunner() override {
return file_task_runner_;
}
// Implement base::MessagePumpLibevent::Watcher.
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE {
+ virtual void OnFileCanReadWithoutBlocking(int fd) override {
DCHECK_EQ(fd, inotify_fd_);
DCHECK(file_task_runner_->BelongsToCurrentThread());
OnChangeNotification();
}
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override {
NOTREACHED();
}
- virtual ProxyConfigSource GetConfigSource() OVERRIDE {
+ virtual ProxyConfigSource GetConfigSource() override {
return PROXY_CONFIG_SOURCE_KDE;
}
- virtual bool GetString(StringSetting key, std::string* result) OVERRIDE {
+ virtual bool GetString(StringSetting key, std::string* result) override {
string_map_type::iterator it = string_table_.find(key);
if (it == string_table_.end())
return false;
*result = it->second;
return true;
}
- virtual bool GetBool(BoolSetting key, bool* result) OVERRIDE {
+ virtual bool GetBool(BoolSetting key, bool* result) override {
// We don't ever have any booleans.
return false;
}
- virtual bool GetInt(IntSetting key, int* result) OVERRIDE {
+ virtual bool GetInt(IntSetting key, int* result) override {
// We don't ever have any integers. (See AddProxy() below about ports.)
return false;
}
virtual bool GetStringList(StringListSetting key,
- std::vector<std::string>* result) OVERRIDE {
+ std::vector<std::string>* result) override {
strings_map_type::iterator it = strings_table_.find(key);
if (it == strings_table_.end())
return false;
@@ -1032,11 +1032,11 @@
return true;
}
- virtual bool BypassListIsReversed() OVERRIDE {
+ virtual bool BypassListIsReversed() override {
return reversed_bypass_list_;
}
- virtual bool MatchHostsUsingSuffixMatching() OVERRIDE {
+ virtual bool MatchHostsUsingSuffixMatching() override {
return true;
}
diff --git a/net/proxy/proxy_config_service_linux.h b/net/proxy/proxy_config_service_linux.h
index fa7bd45..a8438c2 100644
--- a/net/proxy/proxy_config_service_linux.h
+++ b/net/proxy/proxy_config_service_linux.h
@@ -296,10 +296,10 @@
// ProxyConfigService methods:
// Called from IO thread.
- virtual void AddObserver(Observer* observer) OVERRIDE;
- virtual void RemoveObserver(Observer* observer) OVERRIDE;
+ virtual void AddObserver(Observer* observer) override;
+ virtual void RemoveObserver(Observer* observer) override;
virtual ProxyConfigService::ConfigAvailability GetLatestProxyConfig(
- ProxyConfig* config) OVERRIDE;
+ ProxyConfig* config) override;
private:
scoped_refptr<Delegate> delegate_;
diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc
index 5ca0fdc..cfb0cff 100644
--- a/net/proxy/proxy_config_service_linux_unittest.cc
+++ b/net/proxy/proxy_config_service_linux_unittest.cc
@@ -107,7 +107,7 @@
}
// Begin base::Environment implementation.
- virtual bool GetVar(const char* variable_name, std::string* result) OVERRIDE {
+ virtual bool GetVar(const char* variable_name, std::string* result) override {
std::map<std::string, const char**>::iterator it =
table.find(variable_name);
if (it != table.end() && *(it->second) != NULL) {
@@ -119,12 +119,12 @@
}
virtual bool SetVar(const char* variable_name, const std::string& new_value)
- OVERRIDE {
+ override {
ADD_FAILURE();
return false;
}
- virtual bool UnSetVar(const char* variable_name) OVERRIDE {
+ virtual bool UnSetVar(const char* variable_name) override {
ADD_FAILURE();
return false;
}
@@ -178,28 +178,28 @@
virtual bool Init(
const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner)
- OVERRIDE {
+ override {
task_runner_ = glib_task_runner;
return true;
}
- virtual void ShutDown() OVERRIDE {}
+ virtual void ShutDown() override {}
virtual bool SetUpNotifications(ProxyConfigServiceLinux::Delegate* delegate)
- OVERRIDE {
+ override {
return true;
}
virtual const scoped_refptr<base::SingleThreadTaskRunner>&
- GetNotificationTaskRunner() OVERRIDE {
+ GetNotificationTaskRunner() override {
return task_runner_;
}
- virtual ProxyConfigSource GetConfigSource() OVERRIDE {
+ virtual ProxyConfigSource GetConfigSource() override {
return PROXY_CONFIG_SOURCE_TEST;
}
- virtual bool GetString(StringSetting key, std::string* result) OVERRIDE {
+ virtual bool GetString(StringSetting key, std::string* result) override {
const char* value = strings_table.Get(key);
if (value) {
*result = value;
@@ -208,7 +208,7 @@
return false;
}
- virtual bool GetBool(BoolSetting key, bool* result) OVERRIDE {
+ virtual bool GetBool(BoolSetting key, bool* result) override {
BoolSettingValue value = bools_table.Get(key);
switch (value) {
case UNSET:
@@ -222,24 +222,24 @@
return true;
}
- virtual bool GetInt(IntSetting key, int* result) OVERRIDE {
+ virtual bool GetInt(IntSetting key, int* result) override {
// We don't bother to distinguish unset keys from 0 values.
*result = ints_table.Get(key);
return true;
}
virtual bool GetStringList(StringListSetting key,
- std::vector<std::string>* result) OVERRIDE {
+ std::vector<std::string>* result) override {
*result = string_lists_table.Get(key);
// We don't bother to distinguish unset keys from empty lists.
return !result->empty();
}
- virtual bool BypassListIsReversed() OVERRIDE {
+ virtual bool BypassListIsReversed() override {
return false;
}
- virtual bool MatchHostsUsingSuffixMatching() OVERRIDE {
+ virtual bool MatchHostsUsingSuffixMatching() override {
return false;
}
@@ -355,7 +355,7 @@
// must use the same test fixture class (also "ProxyConfigServiceLinuxTest").
class ProxyConfigServiceLinuxTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
PlatformTest::SetUp();
// Set up a temporary KDE home directory.
std::string prefix("ProxyConfigServiceLinuxTest_user_home");
@@ -372,7 +372,7 @@
kioslaverc4_ = kde4_config_.Append(FILE_PATH_LITERAL("kioslaverc"));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Delete the temporary KDE home directory.
base::DeleteFile(user_home_, true);
PlatformTest::TearDown();
diff --git a/net/proxy/proxy_config_service_mac.h b/net/proxy/proxy_config_service_mac.h
index 6c11c6f..6c60daf 100644
--- a/net/proxy/proxy_config_service_mac.h
+++ b/net/proxy/proxy_config_service_mac.h
@@ -31,9 +31,9 @@
public:
// ProxyConfigService implementation:
- virtual void AddObserver(Observer* observer) OVERRIDE;
- virtual void RemoveObserver(Observer* observer) OVERRIDE;
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) OVERRIDE;
+ virtual void AddObserver(Observer* observer) override;
+ virtual void RemoveObserver(Observer* observer) override;
+ virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
private:
class Helper;
@@ -46,10 +46,10 @@
: proxy_config_service_(proxy_config_service) {}
// NetworkConfigWatcherMac::Delegate implementation:
- virtual void StartReachabilityNotifications() OVERRIDE {}
+ virtual void StartReachabilityNotifications() override {}
virtual void SetDynamicStoreNotificationKeys(
- SCDynamicStoreRef store) OVERRIDE;
- virtual void OnNetworkConfigChange(CFArrayRef changed_keys) OVERRIDE;
+ SCDynamicStoreRef store) override;
+ virtual void OnNetworkConfigChange(CFArrayRef changed_keys) override;
private:
ProxyConfigServiceMac* const proxy_config_service_;
diff --git a/net/proxy/proxy_config_service_win.h b/net/proxy/proxy_config_service_win.h
index aa91b68..62f1f12 100644
--- a/net/proxy/proxy_config_service_win.h
+++ b/net/proxy/proxy_config_service_win.h
@@ -47,7 +47,7 @@
virtual ~ProxyConfigServiceWin();
// Overrides a function from PollingProxyConfigService.
- virtual void AddObserver(Observer* observer) OVERRIDE;
+ virtual void AddObserver(Observer* observer) override;
private:
FRIEND_TEST_ALL_PREFIXES(ProxyConfigServiceWinTest, SetFromIEConfig);
@@ -63,7 +63,7 @@
// ObjectWatcher::Delegate methods:
// This is called whenever one of the registry keys we are watching change.
- virtual void OnObjectSignaled(HANDLE object) OVERRIDE;
+ virtual void OnObjectSignaled(HANDLE object) override;
static void GetCurrentProxyConfig(ProxyConfig* config);
diff --git a/net/proxy/proxy_resolver_mac.h b/net/proxy/proxy_resolver_mac.h
index 24eb10d..c732988 100644
--- a/net/proxy/proxy_resolver_mac.h
+++ b/net/proxy/proxy_resolver_mac.h
@@ -25,17 +25,17 @@
ProxyInfo* results,
const net::CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle request) OVERRIDE;
+ virtual void CancelRequest(RequestHandle request) override;
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE;
+ virtual LoadState GetLoadState(RequestHandle request) const override;
- virtual void CancelSetPacScript() OVERRIDE;
+ virtual void CancelSetPacScript() override;
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& /*callback*/) OVERRIDE;
+ const net::CompletionCallback& /*callback*/) override;
private:
scoped_refptr<ProxyResolverScriptData> script_data_;
diff --git a/net/proxy/proxy_resolver_perftest.cc b/net/proxy/proxy_resolver_perftest.cc
index 3d7854c..061c13e 100644
--- a/net/proxy/proxy_resolver_perftest.cc
+++ b/net/proxy/proxy_resolver_perftest.cc
@@ -199,20 +199,20 @@
public:
MockJSBindings() {}
- virtual void Alert(const base::string16& message) OVERRIDE {
+ virtual void Alert(const base::string16& message) override {
CHECK(false);
}
virtual bool ResolveDns(const std::string& host,
ResolveDnsOperation op,
std::string* output,
- bool* terminate) OVERRIDE {
+ bool* terminate) override {
CHECK(false);
return false;
}
virtual void OnError(int line_number,
- const base::string16& message) OVERRIDE {
+ const base::string16& message) override {
CHECK(false);
}
};
diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc
index 37f31bf..dc224cd 100644
--- a/net/proxy/proxy_resolver_v8.cc
+++ b/net/proxy/proxy_resolver_v8.cc
@@ -93,11 +93,11 @@
const scoped_refptr<ProxyResolverScriptData>& script_data)
: script_data_(script_data) {}
- virtual const uint16_t* data() const OVERRIDE {
+ virtual const uint16_t* data() const override {
return reinterpret_cast<const uint16*>(script_data_->utf16().data());
}
- virtual size_t length() const OVERRIDE {
+ virtual size_t length() const override {
return script_data_->utf16().size();
}
@@ -107,7 +107,8 @@
};
// External string wrapper so V8 can access a string literal.
-class V8ExternalASCIILiteral : public v8::String::ExternalAsciiStringResource {
+class V8ExternalASCIILiteral
+ : public v8::String::ExternalOneByteStringResource {
public:
// |ascii| must be a NULL-terminated C string, and must remain valid
// throughout this object's lifetime.
@@ -116,11 +117,11 @@
DCHECK(base::IsStringASCII(ascii));
}
- virtual const char* data() const OVERRIDE {
+ virtual const char* data() const override {
return ascii_;
}
- virtual size_t length() const OVERRIDE {
+ virtual size_t length() const override {
return length_;
}
diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h
index c754e31..38b958d 100644
--- a/net/proxy/proxy_resolver_v8.h
+++ b/net/proxy/proxy_resolver_v8.h
@@ -86,13 +86,13 @@
ProxyInfo* results,
const net::CompletionCallback& /*callback*/,
RequestHandle* /*request*/,
- const BoundNetLog& net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle request) OVERRIDE;
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE;
- virtual void CancelSetPacScript() OVERRIDE;
+ const BoundNetLog& net_log) override;
+ virtual void CancelRequest(RequestHandle request) override;
+ virtual LoadState GetLoadState(RequestHandle request) const override;
+ virtual void CancelSetPacScript() override;
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& /*callback*/) OVERRIDE;
+ const net::CompletionCallback& /*callback*/) override;
// Create an isolate to use for the proxy resolver. If the embedder invokes
// this method multiple times, it must be invoked in a thread safe manner,
diff --git a/net/proxy/proxy_resolver_v8_tracing.cc b/net/proxy/proxy_resolver_v8_tracing.cc
index b7cb185..b5e934b 100644
--- a/net/proxy/proxy_resolver_v8_tracing.cc
+++ b/net/proxy/proxy_resolver_v8_tracing.cc
@@ -148,9 +148,9 @@
virtual bool ResolveDns(const std::string& host,
ResolveDnsOperation op,
std::string* output,
- bool* terminate) OVERRIDE;
- virtual void Alert(const base::string16& message) OVERRIDE;
- virtual void OnError(int line_number, const base::string16& error) OVERRIDE;
+ bool* terminate) override;
+ virtual void Alert(const base::string16& message) override;
+ virtual void OnError(int line_number, const base::string16& error) override;
bool ResolveDnsBlocking(const std::string& host,
ResolveDnsOperation op,
diff --git a/net/proxy/proxy_resolver_v8_tracing.h b/net/proxy/proxy_resolver_v8_tracing.h
index d738a09..92eac03 100644
--- a/net/proxy/proxy_resolver_v8_tracing.h
+++ b/net/proxy/proxy_resolver_v8_tracing.h
@@ -49,13 +49,13 @@
ProxyInfo* results,
const CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle request) OVERRIDE;
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE;
- virtual void CancelSetPacScript() OVERRIDE;
+ const BoundNetLog& net_log) override;
+ virtual void CancelRequest(RequestHandle request) override;
+ virtual LoadState GetLoadState(RequestHandle request) const override;
+ virtual void CancelSetPacScript() override;
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
private:
class Job;
diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
index b5ea3e8..a6e38cb 100644
--- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
@@ -31,7 +31,7 @@
class ProxyResolverV8TracingTest : public testing::Test {
public:
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Drain any pending messages, which may be left over from cancellation.
// This way they get reliably run as part of the current test, rather than
// spilling into the next test's execution.
@@ -71,7 +71,7 @@
MockErrorObserver() : event_(true, false) {}
virtual void OnPACScriptError(int line_number,
- const base::string16& error) OVERRIDE {
+ const base::string16& error) override {
{
base::AutoLock l(lock_);
output += base::StringPrintf("Error: line %d: %s\n", line_number,
@@ -768,7 +768,7 @@
AddressList* addresses,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
EXPECT_FALSE(callback.is_null());
EXPECT_TRUE(out_req);
@@ -791,12 +791,12 @@
virtual int ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
NOTREACHED();
return ERR_DNS_CACHE_MISS;
}
- virtual void CancelRequest(RequestHandle req) OVERRIDE {
+ virtual void CancelRequest(RequestHandle req) override {
EXPECT_EQ(reinterpret_cast<RequestHandle*>(1), req);
num_cancelled_requests_++;
}
diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc
index b0f2d17..d0d01d9 100644
--- a/net/proxy/proxy_resolver_v8_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_unittest.cc
@@ -26,7 +26,7 @@
MockJSBindings() : my_ip_address_count(0), my_ip_address_ex_count(0),
should_terminate(false) {}
- virtual void Alert(const base::string16& message) OVERRIDE {
+ virtual void Alert(const base::string16& message) override {
VLOG(1) << "PAC-alert: " << message; // Helpful when debugging.
alerts.push_back(base::UTF16ToUTF8(message));
}
@@ -34,7 +34,7 @@
virtual bool ResolveDns(const std::string& host,
ResolveDnsOperation op,
std::string* output,
- bool* terminate) OVERRIDE {
+ bool* terminate) override {
*terminate = should_terminate;
if (op == MY_IP_ADDRESS) {
@@ -66,7 +66,7 @@
}
virtual void OnError(int line_number,
- const base::string16& message) OVERRIDE {
+ const base::string16& message) override {
// Helpful when debugging.
VLOG(1) << "PAC-error: [" << line_number << "] " << message;
diff --git a/net/proxy/proxy_resolver_winhttp.h b/net/proxy/proxy_resolver_winhttp.h
index 62b5643..caa7a9f 100644
--- a/net/proxy/proxy_resolver_winhttp.h
+++ b/net/proxy/proxy_resolver_winhttp.h
@@ -25,16 +25,16 @@
ProxyInfo* results,
const net::CompletionCallback& /*callback*/,
RequestHandle* /*request*/,
- const BoundNetLog& /*net_log*/) OVERRIDE;
- virtual void CancelRequest(RequestHandle request) OVERRIDE;
+ const BoundNetLog& /*net_log*/) override;
+ virtual void CancelRequest(RequestHandle request) override;
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE;
+ virtual LoadState GetLoadState(RequestHandle request) const override;
- virtual void CancelSetPacScript() OVERRIDE;
+ virtual void CancelSetPacScript() override;
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& /*callback*/) OVERRIDE;
+ const net::CompletionCallback& /*callback*/) override;
private:
bool OpenWinHttpSession();
diff --git a/net/proxy/proxy_script_decider_unittest.cc b/net/proxy/proxy_script_decider_unittest.cc
index c50b31e..880a187 100644
--- a/net/proxy/proxy_script_decider_unittest.cc
+++ b/net/proxy/proxy_script_decider_unittest.cc
@@ -107,7 +107,7 @@
// ProxyScriptFetcher implementation.
virtual int Fetch(const GURL& url,
base::string16* text,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
const Rules::Rule& rule = rules_->GetRuleByUrl(url);
int rv = rule.fetch_error;
EXPECT_NE(ERR_UNEXPECTED, rv);
@@ -116,9 +116,9 @@
return rv;
}
- virtual void Cancel() OVERRIDE {}
+ virtual void Cancel() override {}
- virtual URLRequestContext* GetRequestContext() const OVERRIDE {
+ virtual URLRequestContext* GetRequestContext() const override {
return request_context_;
}
@@ -134,9 +134,9 @@
virtual ~MockDhcpProxyScriptFetcher();
virtual int Fetch(base::string16* utf16_text,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Cancel() OVERRIDE;
- virtual const GURL& GetPacURL() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void Cancel() override;
+ virtual const GURL& GetPacURL() const override;
virtual void SetPacURL(const GURL& url);
@@ -310,7 +310,7 @@
: rule_(rules_.AddSuccessRule("http://wpad/wpad.dat")),
fetcher_(&rules_) { }
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
request_context_.set_host_resolver(&resolver_);
fetcher_.SetRequestContext(&request_context_);
config_.set_auto_detect(true);
@@ -643,15 +643,15 @@
}
virtual int Fetch(base::string16* utf16_text,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
*utf16_text = expected_text_;
return OK;
}
- virtual void Cancel() OVERRIDE {
+ virtual void Cancel() override {
}
- virtual const GURL& GetPacURL() const OVERRIDE {
+ virtual const GURL& GetPacURL() const override {
return gurl_;
}
@@ -725,7 +725,7 @@
virtual ~AsyncFailDhcpFetcher() {}
virtual int Fetch(base::string16* utf16_text,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
callback_ = callback;
base::MessageLoop::current()->PostTask(
FROM_HERE,
@@ -733,11 +733,11 @@
return ERR_IO_PENDING;
}
- virtual void Cancel() OVERRIDE {
+ virtual void Cancel() override {
callback_.Reset();
}
- virtual const GURL& GetPacURL() const OVERRIDE {
+ virtual const GURL& GetPacURL() const override {
return dummy_gurl_;
}
diff --git a/net/proxy/proxy_script_fetcher_impl.h b/net/proxy/proxy_script_fetcher_impl.h
index 31e60b4..8cdcf81 100644
--- a/net/proxy/proxy_script_fetcher_impl.h
+++ b/net/proxy/proxy_script_fetcher_impl.h
@@ -46,18 +46,18 @@
// ProxyScriptFetcher methods:
virtual int Fetch(const GURL& url, base::string16* text,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual void Cancel() OVERRIDE;
- virtual URLRequestContext* GetRequestContext() const OVERRIDE;
+ const net::CompletionCallback& callback) override;
+ virtual void Cancel() override;
+ virtual URLRequestContext* GetRequestContext() const override;
// URLRequest::Delegate methods:
virtual void OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info) OVERRIDE;
+ AuthChallengeInfo* auth_info) override;
virtual void OnSSLCertificateError(URLRequest* request,
const SSLInfo& ssl_info,
- bool is_hsts_ok) OVERRIDE;
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE;
- virtual void OnReadCompleted(URLRequest* request, int num_bytes) OVERRIDE;
+ bool is_hsts_ok) override;
+ virtual void OnResponseStarted(URLRequest* request) override;
+ virtual void OnReadCompleted(URLRequest* request, int num_bytes) override;
private:
enum { kBufSize = 4096 };
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index bc927e0..5eb887e 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -117,74 +117,74 @@
private:
virtual int OnBeforeURLRequest(URLRequest* request,
const CompletionCallback& callback,
- GURL* new_url) OVERRIDE {
+ GURL* new_url) override {
EXPECT_TRUE(request->load_flags() & LOAD_DISABLE_CERT_REVOCATION_CHECKING);
return OK;
}
virtual int OnBeforeSendHeaders(URLRequest* request,
const CompletionCallback& callback,
- HttpRequestHeaders* headers) OVERRIDE {
+ HttpRequestHeaders* headers) override {
return OK;
}
virtual void OnSendHeaders(URLRequest* request,
- const HttpRequestHeaders& headers) OVERRIDE {}
+ const HttpRequestHeaders& headers) override {}
virtual int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
- GURL* allowed_unsafe_redirect_url) OVERRIDE {
+ GURL* allowed_unsafe_redirect_url) override {
return OK;
}
virtual void OnBeforeRedirect(URLRequest* request,
- const GURL& new_location) OVERRIDE {}
+ const GURL& new_location) override {}
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE {}
+ virtual void OnResponseStarted(URLRequest* request) override {}
virtual void OnRawBytesRead(const URLRequest& request,
- int bytes_read) OVERRIDE {}
+ int bytes_read) override {}
- virtual void OnCompleted(URLRequest* request, bool started) OVERRIDE {}
+ virtual void OnCompleted(URLRequest* request, bool started) override {}
- virtual void OnURLRequestDestroyed(URLRequest* request) OVERRIDE {}
+ virtual void OnURLRequestDestroyed(URLRequest* request) override {}
virtual void OnPACScriptError(int line_number,
- const base::string16& error) OVERRIDE {}
+ const base::string16& error) override {}
virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
- AuthCredentials* credentials) OVERRIDE {
+ AuthCredentials* credentials) override {
return NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION;
}
virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) OVERRIDE {
+ const CookieList& cookie_list) override {
return true;
}
virtual bool OnCanSetCookie(const URLRequest& request,
const std::string& cookie_line,
- CookieOptions* options) OVERRIDE {
+ CookieOptions* options) override {
return true;
}
virtual bool OnCanAccessFile(const net::URLRequest& request,
- const base::FilePath& path) const OVERRIDE {
+ const base::FilePath& path) const override {
return true;
}
- virtual bool OnCanThrottleRequest(const URLRequest& request) const OVERRIDE {
+ virtual bool OnCanThrottleRequest(const URLRequest& request) const override {
return false;
}
virtual int OnBeforeSocketStreamConnect(
SocketStream* stream,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return OK;
}
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 47a4dc2..52e9f7f 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -121,7 +121,7 @@
virtual Mode GetNextDelay(int initial_error,
TimeDelta current_delay,
- TimeDelta* next_delay) const OVERRIDE {
+ TimeDelta* next_delay) const override {
if (initial_error != OK) {
// Re-try policy for failures.
const int kDelay1Seconds = 8;
@@ -160,10 +160,10 @@
class ProxyConfigServiceDirect : public ProxyConfigService {
public:
// ProxyConfigService implementation:
- virtual void AddObserver(Observer* observer) OVERRIDE {}
- virtual void RemoveObserver(Observer* observer) OVERRIDE {}
+ virtual void AddObserver(Observer* observer) override {}
+ virtual void RemoveObserver(Observer* observer) override {}
virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config)
- OVERRIDE {
+ override {
*config = ProxyConfig::CreateDirect();
config->set_source(PROXY_CONFIG_SOURCE_UNKNOWN);
return CONFIG_VALID;
@@ -180,26 +180,26 @@
ProxyInfo* results,
const CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
return ERR_NOT_IMPLEMENTED;
}
- virtual void CancelRequest(RequestHandle request) OVERRIDE {
+ virtual void CancelRequest(RequestHandle request) override {
NOTREACHED();
}
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE {
+ virtual LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() OVERRIDE {
+ virtual void CancelSetPacScript() override {
NOTREACHED();
}
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& /*script_data*/,
- const CompletionCallback& /*callback*/) OVERRIDE {
+ const CompletionCallback& /*callback*/) override {
return ERR_NOT_IMPLEMENTED;
}
};
@@ -216,27 +216,27 @@
ProxyInfo* results,
const CompletionCallback& callback,
RequestHandle* request,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
results->UsePacString(pac_string_);
return OK;
}
- virtual void CancelRequest(RequestHandle request) OVERRIDE {
+ virtual void CancelRequest(RequestHandle request) override {
NOTREACHED();
}
- virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE {
+ virtual LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() OVERRIDE {
+ virtual void CancelSetPacScript() override {
NOTREACHED();
}
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& pac_script,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return OK;
}
@@ -250,7 +250,7 @@
ProxyResolverFactoryForSystem()
: ProxyResolverFactory(false /*expects_pac_bytes*/) {}
- virtual ProxyResolver* CreateProxyResolver() OVERRIDE {
+ virtual ProxyResolver* CreateProxyResolver() override {
DCHECK(IsSupported());
#if defined(OS_WIN)
return new ProxyResolverWinHttp();
@@ -313,10 +313,10 @@
UnsetProxyConfigService() {}
virtual ~UnsetProxyConfigService() {}
- virtual void AddObserver(Observer* observer) OVERRIDE {}
- virtual void RemoveObserver(Observer* observer) OVERRIDE {}
+ virtual void AddObserver(Observer* observer) override {}
+ virtual void RemoveObserver(Observer* observer) override {}
virtual ConfigAvailability GetLatestProxyConfig(
- ProxyConfig* config) OVERRIDE {
+ ProxyConfig* config) override {
return CONFIG_UNSET;
}
};
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index 9fdcb58..6f32c29 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -356,16 +356,16 @@
// NetworkChangeNotifier::IPAddressObserver
// When this is called, we re-fetch PAC scripts and re-run WPAD.
- virtual void OnIPAddressChanged() OVERRIDE;
+ virtual void OnIPAddressChanged() override;
// NetworkChangeNotifier::DNSObserver
// We respond as above.
- virtual void OnDNSChanged() OVERRIDE;
+ virtual void OnDNSChanged() override;
// ProxyConfigService::Observer
virtual void OnProxyConfigChanged(
const ProxyConfig& config,
- ProxyConfigService::ConfigAvailability availability) OVERRIDE;
+ ProxyConfigService::ConfigAvailability availability) override;
scoped_ptr<ProxyConfigService> config_service_;
scoped_ptr<ProxyResolver> resolver_;
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index a222710..12f9af2 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -38,7 +38,7 @@
ImmediatePollPolicy() {}
virtual Mode GetNextDelay(int error, base::TimeDelta current_delay,
- base::TimeDelta* next_delay) const OVERRIDE {
+ base::TimeDelta* next_delay) const override {
*next_delay = base::TimeDelta::FromMilliseconds(1);
return MODE_USE_TIMER;
}
@@ -54,7 +54,7 @@
NeverPollPolicy() {}
virtual Mode GetNextDelay(int error, base::TimeDelta current_delay,
- base::TimeDelta* next_delay) const OVERRIDE {
+ base::TimeDelta* next_delay) const override {
*next_delay = base::TimeDelta::FromDays(60);
return MODE_USE_TIMER;
}
@@ -69,7 +69,7 @@
ImmediateAfterActivityPollPolicy() {}
virtual Mode GetNextDelay(int error, base::TimeDelta current_delay,
- base::TimeDelta* next_delay) const OVERRIDE {
+ base::TimeDelta* next_delay) const override {
*next_delay = base::TimeDelta();
return MODE_START_AFTER_ACTIVITY;
}
@@ -95,13 +95,13 @@
// are careful to avoid timing problems.
class ProxyServiceTest : public testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
testing::Test::SetUp();
previous_policy_ =
ProxyService::set_pac_script_poll_policy(&never_poll_policy_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Restore the original policy.
ProxyService::set_pac_script_poll_policy(previous_policy_);
testing::Test::TearDown();
@@ -127,16 +127,16 @@
config_(ProxyConfig::CreateFromCustomPacURL(GURL(pac_url))) {
}
- virtual void AddObserver(Observer* observer) OVERRIDE {
+ virtual void AddObserver(Observer* observer) override {
observers_.AddObserver(observer);
}
- virtual void RemoveObserver(Observer* observer) OVERRIDE {
+ virtual void RemoveObserver(Observer* observer) override {
observers_.RemoveObserver(observer);
}
virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* results)
- OVERRIDE {
+ override {
if (availability_ == CONFIG_VALID)
*results = config_;
return availability_;
@@ -168,7 +168,7 @@
virtual void OnResolveProxy(const GURL& url,
int load_flags,
const ProxyService& proxy_service,
- ProxyInfo* result) OVERRIDE {
+ ProxyInfo* result) override {
on_resolve_proxy_called_ = true;
proxy_service_ = &proxy_service;
DCHECK(!add_proxy_ || !remove_proxy_);
@@ -211,7 +211,7 @@
}
virtual void OnProxyFallback(const ProxyServer& proxy_server,
- int net_error) OVERRIDE {
+ int net_error) override {
proxy_server_ = proxy_server;
proxy_fallback_net_error_ = net_error;
on_proxy_fallback_called_ = true;
diff --git a/net/quic/congestion_control/cubic.cc b/net/quic/congestion_control/cubic.cc
index dec529d..22b0a90 100644
--- a/net/quic/congestion_control/cubic.cc
+++ b/net/quic/congestion_control/cubic.cc
@@ -82,8 +82,8 @@
QuicTcpCongestionWindow new_cubic_mode_cwnd,
QuicTcpCongestionWindow new_reno_mode_cwnd) {
- QuicTcpCongestionWindow highest_new_cwnd = std::max(new_cubic_mode_cwnd,
- new_reno_mode_cwnd);
+ QuicTcpCongestionWindow highest_new_cwnd = max(new_cubic_mode_cwnd,
+ new_reno_mode_cwnd);
if (last_congestion_window_ < highest_new_cwnd) {
// cwnd will increase to highest_new_cwnd.
stats_->cwnd_increase_congestion_avoidance +=
diff --git a/net/quic/congestion_control/hybrid_slow_start.cc b/net/quic/congestion_control/hybrid_slow_start.cc
index 2ae3b50..4b1e842 100644
--- a/net/quic/congestion_control/hybrid_slow_start.cc
+++ b/net/quic/congestion_control/hybrid_slow_start.cc
@@ -18,8 +18,8 @@
const uint32 kHybridStartMinSamples = 8;
const int kHybridStartDelayFactorExp = 4; // 2^4 = 16
// The original paper specifies 2 and 8ms, but those have changed over time.
-const int kHybridStartDelayMinThresholdUs = 4000;
-const int kHybridStartDelayMaxThresholdUs = 16000;
+const int64 kHybridStartDelayMinThresholdUs = 4000;
+const int64 kHybridStartDelayMaxThresholdUs = 16000;
HybridSlowStart::HybridSlowStart(const QuicClock* clock)
: clock_(clock),
@@ -116,7 +116,7 @@
// We only need to check this once per round.
if (rtt_sample_count_ == kHybridStartMinSamples) {
// Divide min_rtt by 16 to get a rtt increase threshold for exiting.
- int min_rtt_increase_threshold_us = min_rtt.ToMicroseconds() >>
+ int64 min_rtt_increase_threshold_us = min_rtt.ToMicroseconds() >>
kHybridStartDelayFactorExp;
// Ensure the rtt threshold is never less than 2ms or more than 16ms.
min_rtt_increase_threshold_us = min(min_rtt_increase_threshold_us,
diff --git a/net/quic/congestion_control/pacing_sender.cc b/net/quic/congestion_control/pacing_sender.cc
index 20d2b3b..03e5534 100644
--- a/net/quic/congestion_control/pacing_sender.cc
+++ b/net/quic/congestion_control/pacing_sender.cc
@@ -15,15 +15,12 @@
burst_tokens_(initial_packet_burst),
last_delayed_packet_sent_time_(QuicTime::Zero()),
next_packet_send_time_(QuicTime::Zero()),
- was_last_send_delayed_(false),
- has_valid_rtt_(false) {
+ was_last_send_delayed_(false) {
}
PacingSender::~PacingSender() {}
void PacingSender::SetFromConfig(const QuicConfig& config, bool is_server) {
- // TODO(ianswett): Consider using the suggested RTT for pacing an initial
- // response.
sender_->SetFromConfig(config, is_server);
}
@@ -42,9 +39,6 @@
QuicByteCount bytes_in_flight,
const CongestionVector& acked_packets,
const CongestionVector& lost_packets) {
- if (rtt_updated) {
- has_valid_rtt_ = true;
- }
sender_->OnCongestionEvent(
rtt_updated, bytes_in_flight, acked_packets, lost_packets);
}
@@ -55,11 +49,10 @@
QuicPacketSequenceNumber sequence_number,
QuicByteCount bytes,
HasRetransmittableData has_retransmittable_data) {
- // Only pace data packets once we have an updated RTT.
const bool in_flight =
sender_->OnPacketSent(sent_time, bytes_in_flight, sequence_number,
bytes, has_retransmittable_data);
- if (has_retransmittable_data != HAS_RETRANSMITTABLE_DATA || !has_valid_rtt_) {
+ if (has_retransmittable_data != HAS_RETRANSMITTABLE_DATA) {
return in_flight;
}
if (burst_tokens_ > 0) {
@@ -117,10 +110,6 @@
HasRetransmittableData has_retransmittable_data) const {
QuicTime::Delta time_until_send =
sender_->TimeUntilSend(now, bytes_in_flight, has_retransmittable_data);
- if (!has_valid_rtt_) {
- // Don't pace if we don't have an updated RTT estimate.
- return time_until_send;
- }
if (bytes_in_flight == 0) {
// Add more burst tokens anytime the connection is entering quiescence.
burst_tokens_ = initial_packet_burst_;
@@ -143,6 +132,8 @@
}
// If the next send time is within the alarm granularity, send immediately.
+ // TODO(ianswett): This granularity logic ends up sending more packets than
+ // intended in an effort to make up for lost time that wasn't lost.
if (next_packet_send_time_ > now.Add(alarm_granularity_)) {
DVLOG(1) << "Delaying packet: "
<< next_packet_send_time_.Subtract(now).ToMicroseconds();
diff --git a/net/quic/congestion_control/pacing_sender.h b/net/quic/congestion_control/pacing_sender.h
index f61ae75..e50527d 100644
--- a/net/quic/congestion_control/pacing_sender.h
+++ b/net/quic/congestion_control/pacing_sender.h
@@ -35,34 +35,34 @@
virtual ~PacingSender();
// SendAlgorithmInterface methods.
- virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE;
- virtual void SetNumEmulatedConnections(int num_connections) OVERRIDE;
+ virtual void SetFromConfig(const QuicConfig& config, bool is_server) override;
+ virtual void SetNumEmulatedConnections(int num_connections) override;
virtual void OnIncomingQuicCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& feedback,
- QuicTime feedback_receive_time) OVERRIDE;
+ QuicTime feedback_receive_time) override;
virtual void OnCongestionEvent(bool rtt_updated,
QuicByteCount bytes_in_flight,
const CongestionVector& acked_packets,
- const CongestionVector& lost_packets) OVERRIDE;
+ const CongestionVector& lost_packets) override;
virtual bool OnPacketSent(QuicTime sent_time,
QuicByteCount bytes_in_flight,
QuicPacketSequenceNumber sequence_number,
QuicByteCount bytes,
- HasRetransmittableData is_retransmittable) OVERRIDE;
- virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE;
- virtual void RevertRetransmissionTimeout() OVERRIDE;
+ HasRetransmittableData is_retransmittable) override;
+ virtual void OnRetransmissionTimeout(bool packets_retransmitted) override;
+ virtual void RevertRetransmissionTimeout() override;
virtual QuicTime::Delta TimeUntilSend(
QuicTime now,
QuicByteCount bytes_in_flight,
- HasRetransmittableData has_retransmittable_data) const OVERRIDE;
- virtual QuicBandwidth BandwidthEstimate() const OVERRIDE;
- virtual bool HasReliableBandwidthEstimate() const OVERRIDE;
- virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE;
- virtual QuicByteCount GetCongestionWindow() const OVERRIDE;
- virtual bool InSlowStart() const OVERRIDE;
- virtual bool InRecovery() const OVERRIDE;
- virtual QuicByteCount GetSlowStartThreshold() const OVERRIDE;
- virtual CongestionControlType GetCongestionControlType() const OVERRIDE;
+ HasRetransmittableData has_retransmittable_data) const override;
+ virtual QuicBandwidth BandwidthEstimate() const override;
+ virtual bool HasReliableBandwidthEstimate() const override;
+ virtual QuicTime::Delta RetransmissionDelay() const override;
+ virtual QuicByteCount GetCongestionWindow() const override;
+ virtual bool InSlowStart() const override;
+ virtual bool InRecovery() const override;
+ virtual QuicByteCount GetSlowStartThreshold() const override;
+ virtual CongestionControlType GetCongestionControlType() const override;
private:
scoped_ptr<SendAlgorithmInterface> sender_; // Underlying sender.
@@ -73,7 +73,6 @@
QuicTime last_delayed_packet_sent_time_;
QuicTime next_packet_send_time_; // When can the next packet be sent.
mutable bool was_last_send_delayed_; // True when the last send was delayed.
- bool has_valid_rtt_; // True if we have at least one RTT update.
DISALLOW_COPY_AND_ASSIGN(PacingSender);
};
diff --git a/net/quic/congestion_control/pacing_sender_test.cc b/net/quic/congestion_control/pacing_sender_test.cc
index 768cc22..f887c54 100644
--- a/net/quic/congestion_control/pacing_sender_test.cc
+++ b/net/quic/congestion_control/pacing_sender_test.cc
@@ -19,6 +19,7 @@
namespace test {
const QuicByteCount kBytesInFlight = 1024;
+const int kInitialBurstPackets = 10;
class PacingSenderTest : public ::testing::Test {
protected:
@@ -142,11 +143,6 @@
.WillRepeatedly(Return(QuicBandwidth::FromBytesAndTimeDelta(
kMaxPacketSize, QuicTime::Delta::FromMilliseconds(2))));
- // Send a whole pile of packets, and verify that they are not paced.
- for (int i = 0 ; i < 1000; ++i) {
- CheckPacketIsSentImmediately();
- }
-
// Now update the RTT and verify that packets are actually paced.
EXPECT_CALL(*mock_sender_, OnCongestionEvent(true, kBytesInFlight, _, _));
SendAlgorithmInterface::CongestionVector empty_map;
@@ -217,11 +213,6 @@
.WillRepeatedly(Return(QuicBandwidth::FromBytesAndTimeDelta(
kMaxPacketSize, QuicTime::Delta::FromMilliseconds(2))));
- // Send a whole pile of packets, and verify that they are not paced.
- for (int i = 0 ; i < 1000; ++i) {
- CheckPacketIsSentImmediately();
- }
-
// Now update the RTT and verify that packets are actually paced.
EXPECT_CALL(*mock_sender_, OnCongestionEvent(true, kBytesInFlight, _, _));
SendAlgorithmInterface::CongestionVector empty_map;
@@ -296,17 +287,17 @@
pacing_sender_->OnCongestionEvent(true, kBytesInFlight, empty_map, empty_map);
// Send 10 packets, and verify that they are not paced.
- for (int i = 0 ; i < 10; ++i) {
+ for (int i = 0 ; i < kInitialBurstPackets; ++i) {
CheckPacketIsSentImmediately();
}
- CheckPacketIsSentImmediately();
- CheckPacketIsSentImmediately();
- CheckPacketIsSentImmediately();
-
// The first packet was a "make up", then we sent two packets "into the
- // future", so the delay should be 2.
+ // future", so the delay should be 2ms.
+ CheckPacketIsSentImmediately();
+ CheckPacketIsSentImmediately();
+ CheckPacketIsSentImmediately();
CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
+
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(5));
CheckPacketIsSentImmediately();
@@ -321,14 +312,70 @@
pacing_sender_->TimeUntilSend(clock_.Now(),
0,
HAS_RETRANSMITTABLE_DATA));
- for (int i = 0 ; i < 10; ++i) {
+ for (int i = 0 ; i < kInitialBurstPackets; ++i) {
CheckPacketIsSentImmediately();
}
+ // The first packet was a "make up", then we sent two packets "into the
+ // future", so the delay should be 2ms.
CheckPacketIsSentImmediately();
CheckPacketIsSentImmediately();
CheckPacketIsSentImmediately();
+ CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
+}
+
+TEST_F(PacingSenderTest, InitialBurstNoRttMeasurement) {
+ pacing_sender_.reset();
+ mock_sender_ = new StrictMock<MockSendAlgorithm>();
+ pacing_sender_.reset(new PacingSender(mock_sender_,
+ QuicTime::Delta::FromMilliseconds(1),
+ 10));
+ // Start the test in slow start.
+ EXPECT_CALL(*mock_sender_, InSlowStart()).WillRepeatedly(Return(true));
+
+ // Configure bandwith of 1 packet per 2 ms, for which the pacing rate
+ // will be 1 packet per 1 ms.
+ EXPECT_CALL(*mock_sender_, BandwidthEstimate())
+ .WillRepeatedly(Return(QuicBandwidth::FromBytesAndTimeDelta(
+ kMaxPacketSize, QuicTime::Delta::FromMilliseconds(2))));
+
+ // Send 10 packets, and verify that they are not paced.
+ for (int i = 0 ; i < kInitialBurstPackets; ++i) {
+ CheckPacketIsSentImmediately();
+ }
+
+ // The first packet was a "make up", then we sent two packets "into the
+ // future", so the delay should be 2ms.
+ CheckPacketIsSentImmediately();
+ CheckPacketIsSentImmediately();
+ CheckPacketIsSentImmediately();
+ CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
+
+
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(5));
+ CheckPacketIsSentImmediately();
+ // Next time TimeUntilSend is called with no bytes in flight, the tokens
+ // should be refilled and there should be no delay.
+ EXPECT_CALL(*mock_sender_,
+ TimeUntilSend(clock_.Now(),
+ 0,
+ HAS_RETRANSMITTABLE_DATA)).
+ WillOnce(Return(zero_time_));
+ EXPECT_EQ(zero_time_,
+ pacing_sender_->TimeUntilSend(clock_.Now(),
+ 0,
+ HAS_RETRANSMITTABLE_DATA));
+ // Send 10 packets, and verify that they are not paced.
+ for (int i = 0 ; i < kInitialBurstPackets; ++i) {
+ CheckPacketIsSentImmediately();
+ }
+
+ // The first packet was a "make up", then we sent two packets "into the
+ // future", so the delay should be 2ms.
+ CheckPacketIsSentImmediately();
+ CheckPacketIsSentImmediately();
+ CheckPacketIsSentImmediately();
CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
}
diff --git a/net/quic/congestion_control/tcp_cubic_sender.h b/net/quic/congestion_control/tcp_cubic_sender.h
index 8851ac4..dd0df58 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.h
+++ b/net/quic/congestion_control/tcp_cubic_sender.h
@@ -38,34 +38,34 @@
virtual ~TcpCubicSender();
// Start implementation of SendAlgorithmInterface.
- virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE;
- virtual void SetNumEmulatedConnections(int num_connections) OVERRIDE;
+ virtual void SetFromConfig(const QuicConfig& config, bool is_server) override;
+ virtual void SetNumEmulatedConnections(int num_connections) override;
virtual void OnIncomingQuicCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& feedback,
- QuicTime feedback_receive_time) OVERRIDE;
+ QuicTime feedback_receive_time) override;
virtual void OnCongestionEvent(bool rtt_updated,
QuicByteCount bytes_in_flight,
const CongestionVector& acked_packets,
- const CongestionVector& lost_packets) OVERRIDE;
+ const CongestionVector& lost_packets) override;
virtual bool OnPacketSent(QuicTime sent_time,
QuicByteCount bytes_in_flight,
QuicPacketSequenceNumber sequence_number,
QuicByteCount bytes,
- HasRetransmittableData is_retransmittable) OVERRIDE;
- virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE;
- virtual void RevertRetransmissionTimeout() OVERRIDE;
+ HasRetransmittableData is_retransmittable) override;
+ virtual void OnRetransmissionTimeout(bool packets_retransmitted) override;
+ virtual void RevertRetransmissionTimeout() override;
virtual QuicTime::Delta TimeUntilSend(
QuicTime now,
QuicByteCount bytes_in_flight,
- HasRetransmittableData has_retransmittable_data) const OVERRIDE;
- virtual QuicBandwidth BandwidthEstimate() const OVERRIDE;
- virtual bool HasReliableBandwidthEstimate() const OVERRIDE;
- virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE;
- virtual QuicByteCount GetCongestionWindow() const OVERRIDE;
- virtual bool InSlowStart() const OVERRIDE;
- virtual bool InRecovery() const OVERRIDE;
- virtual QuicByteCount GetSlowStartThreshold() const OVERRIDE;
- virtual CongestionControlType GetCongestionControlType() const OVERRIDE;
+ HasRetransmittableData has_retransmittable_data) const override;
+ virtual QuicBandwidth BandwidthEstimate() const override;
+ virtual bool HasReliableBandwidthEstimate() const override;
+ virtual QuicTime::Delta RetransmissionDelay() const override;
+ virtual QuicByteCount GetCongestionWindow() const override;
+ virtual bool InSlowStart() const override;
+ virtual bool InRecovery() const override;
+ virtual QuicByteCount GetSlowStartThreshold() const override;
+ virtual CongestionControlType GetCongestionControlType() const override;
// End implementation of SendAlgorithmInterface.
private:
diff --git a/net/quic/congestion_control/tcp_cubic_sender_test.cc b/net/quic/congestion_control/tcp_cubic_sender_test.cc
index 851c1a1..731b8f5 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_test.cc
@@ -670,8 +670,8 @@
expected_send_window /= 2;
EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
- // No congestion window growth should occur in recovery phase, i.e.,
- // until the currently outstanding 20 packets are acked.
+ // No congestion window growth should occur in recovery phase, i.e., until the
+ // currently outstanding 20 packets are acked.
for (int i = 0; i < 10; ++i) {
// Send our full send window.
SendAvailableSendWindow();
diff --git a/net/quic/congestion_control/tcp_loss_algorithm.cc b/net/quic/congestion_control/tcp_loss_algorithm.cc
index 557681e..b0a5a15 100644
--- a/net/quic/congestion_control/tcp_loss_algorithm.cc
+++ b/net/quic/congestion_control/tcp_loss_algorithm.cc
@@ -46,7 +46,9 @@
}
LOG_IF(DFATAL, it->nack_count == 0)
- << "All packets less than largest observed should have been nacked.";
+ << "All packets less than largest observed should have been nacked."
+ << "sequence_number:" << sequence_number
+ << " largest_observed:" << largest_observed;
if (it->nack_count >= kNumberOfNacksBeforeRetransmission) {
lost_packets.insert(sequence_number);
continue;
diff --git a/net/quic/congestion_control/tcp_loss_algorithm.h b/net/quic/congestion_control/tcp_loss_algorithm.h
index 5f0bcfb..201354b 100644
--- a/net/quic/congestion_control/tcp_loss_algorithm.h
+++ b/net/quic/congestion_control/tcp_loss_algorithm.h
@@ -23,17 +23,17 @@
TCPLossAlgorithm();
virtual ~TCPLossAlgorithm() {}
- virtual LossDetectionType GetLossDetectionType() const OVERRIDE;
+ virtual LossDetectionType GetLossDetectionType() const override;
// Uses nack counts to decide when packets are lost.
virtual SequenceNumberSet DetectLostPackets(
const QuicUnackedPacketMap& unacked_packets,
const QuicTime& time,
QuicPacketSequenceNumber largest_observed,
- const RttStats& rtt_stats) OVERRIDE;
+ const RttStats& rtt_stats) override;
// Returns a non-zero value when the early retransmit timer is active.
- virtual QuicTime GetLossTimeout() const OVERRIDE;
+ virtual QuicTime GetLossTimeout() const override;
private:
QuicTime loss_detection_timeout_;
diff --git a/net/quic/congestion_control/tcp_receiver.h b/net/quic/congestion_control/tcp_receiver.h
index a5e5b1b..89e9186 100644
--- a/net/quic/congestion_control/tcp_receiver.h
+++ b/net/quic/congestion_control/tcp_receiver.h
@@ -25,11 +25,11 @@
// Start implementation of SendAlgorithmInterface.
virtual bool GenerateCongestionFeedback(
- QuicCongestionFeedbackFrame* feedback) OVERRIDE;
+ QuicCongestionFeedbackFrame* feedback) override;
virtual void RecordIncomingPacket(QuicByteCount bytes,
QuicPacketSequenceNumber sequence_number,
- QuicTime timestamp) OVERRIDE;
+ QuicTime timestamp) override;
private:
QuicByteCount receive_window_;
diff --git a/net/quic/congestion_control/time_loss_algorithm.h b/net/quic/congestion_control/time_loss_algorithm.h
index ae37e1e..de517ef 100644
--- a/net/quic/congestion_control/time_loss_algorithm.h
+++ b/net/quic/congestion_control/time_loss_algorithm.h
@@ -23,7 +23,7 @@
TimeLossAlgorithm();
virtual ~TimeLossAlgorithm() {}
- virtual LossDetectionType GetLossDetectionType() const OVERRIDE;
+ virtual LossDetectionType GetLossDetectionType() const override;
// Declares pending packets less than the largest observed lost when it has
// been 1.25 RTT since they were sent. Packets larger than the largest
@@ -32,14 +32,14 @@
const QuicUnackedPacketMap& unacked_packets,
const QuicTime& time,
QuicPacketSequenceNumber largest_observed,
- const RttStats& rtt_stats) OVERRIDE;
+ const RttStats& rtt_stats) override;
// Returns the time the next packet will be lost, or zero if there
// are no nacked pending packets outstanding.
// TODO(ianswett): Ideally the RTT variance and the RTT would be used to
// determine the time a packet is considered lost.
// TODO(ianswett): Consider using Max(1.25 * srtt, 1.125 * last_rtt).
- virtual QuicTime GetLossTimeout() const OVERRIDE;
+ virtual QuicTime GetLossTimeout() const override;
private:
QuicTime loss_detection_timeout_;
diff --git a/net/quic/crypto/aead_base_decrypter.h b/net/quic/crypto/aead_base_decrypter.h
index 6257409..116dbe1 100644
--- a/net/quic/crypto/aead_base_decrypter.h
+++ b/net/quic/crypto/aead_base_decrypter.h
@@ -40,18 +40,18 @@
virtual ~AeadBaseDecrypter();
// QuicDecrypter implementation
- virtual bool SetKey(base::StringPiece key) OVERRIDE;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) OVERRIDE;
+ virtual bool SetKey(base::StringPiece key) override;
+ virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
virtual bool Decrypt(base::StringPiece nonce,
base::StringPiece associated_data,
base::StringPiece ciphertext,
unsigned char* output,
- size_t* output_length) OVERRIDE;
+ size_t* output_length) override;
virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
base::StringPiece associated_data,
- base::StringPiece ciphertext) OVERRIDE;
- virtual base::StringPiece GetKey() const OVERRIDE;
- virtual base::StringPiece GetNoncePrefix() const OVERRIDE;
+ base::StringPiece ciphertext) override;
+ virtual base::StringPiece GetKey() const override;
+ virtual base::StringPiece GetNoncePrefix() const override;
protected:
// Make these constants available to the subclasses so that the subclasses
diff --git a/net/quic/crypto/aead_base_encrypter.h b/net/quic/crypto/aead_base_encrypter.h
index 7138131..89c7a1f 100644
--- a/net/quic/crypto/aead_base_encrypter.h
+++ b/net/quic/crypto/aead_base_encrypter.h
@@ -40,21 +40,21 @@
virtual ~AeadBaseEncrypter();
// QuicEncrypter implementation
- virtual bool SetKey(base::StringPiece key) OVERRIDE;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) OVERRIDE;
+ virtual bool SetKey(base::StringPiece key) override;
+ virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
virtual bool Encrypt(base::StringPiece nonce,
base::StringPiece associated_data,
base::StringPiece plaintext,
- unsigned char* output) OVERRIDE;
+ unsigned char* output) override;
virtual QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
base::StringPiece associated_data,
- base::StringPiece plaintext) OVERRIDE;
- virtual size_t GetKeySize() const OVERRIDE;
- virtual size_t GetNoncePrefixSize() const OVERRIDE;
- virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const OVERRIDE;
- virtual size_t GetCiphertextSize(size_t plaintext_size) const OVERRIDE;
- virtual base::StringPiece GetKey() const OVERRIDE;
- virtual base::StringPiece GetNoncePrefix() const OVERRIDE;
+ base::StringPiece plaintext) override;
+ virtual size_t GetKeySize() const override;
+ virtual size_t GetNoncePrefixSize() const override;
+ virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
+ virtual size_t GetCiphertextSize(size_t plaintext_size) const override;
+ virtual base::StringPiece GetKey() const override;
+ virtual base::StringPiece GetNoncePrefix() const override;
protected:
// Make these constants available to the subclasses so that the subclasses
diff --git a/net/quic/crypto/aes_128_gcm_12_decrypter.h b/net/quic/crypto/aes_128_gcm_12_decrypter.h
index 0511c8b..4395dc2 100644
--- a/net/quic/crypto/aes_128_gcm_12_decrypter.h
+++ b/net/quic/crypto/aes_128_gcm_12_decrypter.h
@@ -31,7 +31,7 @@
virtual void FillAeadParams(base::StringPiece nonce,
base::StringPiece associated_data,
size_t auth_tag_size,
- AeadParams* aead_params) const OVERRIDE;
+ AeadParams* aead_params) const override;
#endif
private:
diff --git a/net/quic/crypto/aes_128_gcm_12_encrypter.h b/net/quic/crypto/aes_128_gcm_12_encrypter.h
index 1d8f321..afbeb14 100644
--- a/net/quic/crypto/aes_128_gcm_12_encrypter.h
+++ b/net/quic/crypto/aes_128_gcm_12_encrypter.h
@@ -31,7 +31,7 @@
virtual void FillAeadParams(base::StringPiece nonce,
base::StringPiece associated_data,
size_t auth_tag_size,
- AeadParams* aead_params) const OVERRIDE;
+ AeadParams* aead_params) const override;
#endif
private:
diff --git a/net/quic/crypto/chacha20_poly1305_decrypter.h b/net/quic/crypto/chacha20_poly1305_decrypter.h
index 9d24ba2..e3c3e7f 100644
--- a/net/quic/crypto/chacha20_poly1305_decrypter.h
+++ b/net/quic/crypto/chacha20_poly1305_decrypter.h
@@ -35,7 +35,7 @@
virtual void FillAeadParams(base::StringPiece nonce,
base::StringPiece associated_data,
size_t auth_tag_size,
- AeadParams* aead_params) const OVERRIDE;
+ AeadParams* aead_params) const override;
#endif
private:
diff --git a/net/quic/crypto/chacha20_poly1305_encrypter.h b/net/quic/crypto/chacha20_poly1305_encrypter.h
index 4a68caa..b99fa27 100644
--- a/net/quic/crypto/chacha20_poly1305_encrypter.h
+++ b/net/quic/crypto/chacha20_poly1305_encrypter.h
@@ -35,7 +35,7 @@
virtual void FillAeadParams(base::StringPiece nonce,
base::StringPiece associated_data,
size_t auth_tag_size,
- AeadParams* aead_params) const OVERRIDE;
+ AeadParams* aead_params) const override;
#endif
private:
diff --git a/net/quic/crypto/channel_id_chromium.h b/net/quic/crypto/channel_id_chromium.h
index 08cfff9..72f694d 100644
--- a/net/quic/crypto/channel_id_chromium.h
+++ b/net/quic/crypto/channel_id_chromium.h
@@ -24,8 +24,8 @@
// ChannelIDKey interface
virtual bool Sign(base::StringPiece signed_data,
- std::string* out_signature) const OVERRIDE;
- virtual std::string SerializeKey() const OVERRIDE;
+ std::string* out_signature) const override;
+ virtual std::string SerializeKey() const override;
private:
scoped_ptr<crypto::ECPrivateKey> ec_private_key_;
@@ -42,7 +42,7 @@
virtual QuicAsyncStatus GetChannelIDKey(
const std::string& hostname,
scoped_ptr<ChannelIDKey>* channel_id_key,
- ChannelIDSourceCallback* callback) OVERRIDE;
+ ChannelIDSourceCallback* callback) override;
private:
class Job;
diff --git a/net/quic/crypto/common_cert_set.cc b/net/quic/crypto/common_cert_set.cc
index f631cd6..0d39ecc 100644
--- a/net/quic/crypto/common_cert_set.cc
+++ b/net/quic/crypto/common_cert_set.cc
@@ -69,12 +69,12 @@
class CommonCertSetsQUIC : public CommonCertSets {
public:
// CommonCertSets interface.
- virtual StringPiece GetCommonHashes() const OVERRIDE {
+ virtual StringPiece GetCommonHashes() const override {
return StringPiece(reinterpret_cast<const char*>(kSetHashes),
sizeof(uint64) * arraysize(kSetHashes));
}
- virtual StringPiece GetCert(uint64 hash, uint32 index) const OVERRIDE {
+ virtual StringPiece GetCert(uint64 hash, uint32 index) const override {
for (size_t i = 0; i < arraysize(kSets); i++) {
if (kSets[i].hash == hash) {
if (index < kSets[i].num_certs) {
@@ -90,7 +90,7 @@
}
virtual bool MatchCert(StringPiece cert, StringPiece common_set_hashes,
- uint64* out_hash, uint32* out_index) const OVERRIDE {
+ uint64* out_hash, uint32* out_index) const override {
if (common_set_hashes.size() % sizeof(uint64) != 0) {
return false;
}
diff --git a/net/quic/crypto/crypto_framer.cc b/net/quic/crypto/crypto_framer.cc
index bc5c8b7..3f61115 100644
--- a/net/quic/crypto/crypto_framer.cc
+++ b/net/quic/crypto/crypto_framer.cc
@@ -26,10 +26,10 @@
public:
OneShotVisitor() : error_(false) {}
- virtual void OnError(CryptoFramer* framer) OVERRIDE { error_ = true; }
+ virtual void OnError(CryptoFramer* framer) override { error_ = true; }
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE {
+ const CryptoHandshakeMessage& message) override {
out_.reset(new CryptoHandshakeMessage(message));
}
diff --git a/net/quic/crypto/crypto_framer_test.cc b/net/quic/crypto/crypto_framer_test.cc
index 01e9157..f9ea55d 100644
--- a/net/quic/crypto/crypto_framer_test.cc
+++ b/net/quic/crypto/crypto_framer_test.cc
@@ -33,13 +33,13 @@
public:
TestCryptoVisitor() : error_count_(0) {}
- virtual void OnError(CryptoFramer* framer) OVERRIDE {
+ virtual void OnError(CryptoFramer* framer) override {
DLOG(ERROR) << "CryptoFramer Error: " << framer->error();
++error_count_;
}
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE {
+ const CryptoHandshakeMessage& message) override {
messages_.push_back(message);
}
diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc
index bb47cbf..1f3380a 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -156,7 +156,7 @@
}
virtual void RunImpl(const CryptoHandshakeMessage& client_hello,
- const Result& result) OVERRIDE {
+ const Result& result) override {
{
// Ensure that the strike register client lock is not held.
QuicCryptoServerConfigPeer peer(&test_->config_);
diff --git a/net/quic/crypto/curve25519_key_exchange.h b/net/quic/crypto/curve25519_key_exchange.h
index 93288f6..310c614 100644
--- a/net/quic/crypto/curve25519_key_exchange.h
+++ b/net/quic/crypto/curve25519_key_exchange.h
@@ -31,11 +31,11 @@
static std::string NewPrivateKey(QuicRandom* rand);
// KeyExchange interface.
- virtual KeyExchange* NewKeyPair(QuicRandom* rand) const OVERRIDE;
+ virtual KeyExchange* NewKeyPair(QuicRandom* rand) const override;
virtual bool CalculateSharedKey(const base::StringPiece& peer_public_value,
- std::string* shared_key) const OVERRIDE;
- virtual base::StringPiece public_value() const OVERRIDE;
- virtual QuicTag tag() const OVERRIDE;
+ std::string* shared_key) const override;
+ virtual base::StringPiece public_value() const override;
+ virtual QuicTag tag() const override;
private:
Curve25519KeyExchange();
diff --git a/net/quic/crypto/local_strike_register_client.h b/net/quic/crypto/local_strike_register_client.h
index fe8ae93..b121299 100644
--- a/net/quic/crypto/local_strike_register_client.h
+++ b/net/quic/crypto/local_strike_register_client.h
@@ -26,10 +26,10 @@
const uint8 orbit[8],
StrikeRegister::StartupType startup);
- virtual bool IsKnownOrbit(base::StringPiece orbit) const OVERRIDE;
+ virtual bool IsKnownOrbit(base::StringPiece orbit) const override;
virtual void VerifyNonceIsValidAndUnique(base::StringPiece nonce,
QuicWallTime now,
- ResultCallback* cb) OVERRIDE;
+ ResultCallback* cb) override;
private:
mutable base::Lock m_;
diff --git a/net/quic/crypto/local_strike_register_client_test.cc b/net/quic/crypto/local_strike_register_client_test.cc
index 1a3b6f9..70d2428 100644
--- a/net/quic/crypto/local_strike_register_client_test.cc
+++ b/net/quic/crypto/local_strike_register_client_test.cc
@@ -36,7 +36,7 @@
protected:
virtual void RunImpl(bool nonce_is_valid_and_unique,
- InsertStatus nonce_error) OVERRIDE {
+ InsertStatus nonce_error) override {
*called_ = true;
*saved_value_ = nonce_is_valid_and_unique;
*saved_nonce_error_ = nonce_error;
diff --git a/net/quic/crypto/null_decrypter.h b/net/quic/crypto/null_decrypter.h
index 2bc2fe8..03038bd 100644
--- a/net/quic/crypto/null_decrypter.h
+++ b/net/quic/crypto/null_decrypter.h
@@ -22,18 +22,18 @@
virtual ~NullDecrypter() {}
// QuicDecrypter implementation
- virtual bool SetKey(base::StringPiece key) OVERRIDE;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) OVERRIDE;
+ virtual bool SetKey(base::StringPiece key) override;
+ virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
virtual bool Decrypt(base::StringPiece nonce,
base::StringPiece associated_data,
base::StringPiece ciphertext,
unsigned char* output,
- size_t* output_length) OVERRIDE;
+ size_t* output_length) override;
virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
base::StringPiece associated_data,
- base::StringPiece ciphertext) OVERRIDE;
- virtual base::StringPiece GetKey() const OVERRIDE;
- virtual base::StringPiece GetNoncePrefix() const OVERRIDE;
+ base::StringPiece ciphertext) override;
+ virtual base::StringPiece GetKey() const override;
+ virtual base::StringPiece GetNoncePrefix() const override;
private:
bool ReadHash(QuicDataReader* reader, uint128* hash);
diff --git a/net/quic/crypto/null_encrypter.h b/net/quic/crypto/null_encrypter.h
index 1bcdff5..fbd2dff 100644
--- a/net/quic/crypto/null_encrypter.h
+++ b/net/quic/crypto/null_encrypter.h
@@ -20,21 +20,21 @@
virtual ~NullEncrypter() {}
// QuicEncrypter implementation
- virtual bool SetKey(base::StringPiece key) OVERRIDE;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) OVERRIDE;
+ virtual bool SetKey(base::StringPiece key) override;
+ virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
virtual bool Encrypt(base::StringPiece nonce,
base::StringPiece associated_data,
base::StringPiece plaintext,
- unsigned char* output) OVERRIDE;
+ unsigned char* output) override;
virtual QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
base::StringPiece associated_data,
- base::StringPiece plaintext) OVERRIDE;
- virtual size_t GetKeySize() const OVERRIDE;
- virtual size_t GetNoncePrefixSize() const OVERRIDE;
- virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const OVERRIDE;
- virtual size_t GetCiphertextSize(size_t plaintext_size) const OVERRIDE;
- virtual base::StringPiece GetKey() const OVERRIDE;
- virtual base::StringPiece GetNoncePrefix() const OVERRIDE;
+ base::StringPiece plaintext) override;
+ virtual size_t GetKeySize() const override;
+ virtual size_t GetNoncePrefixSize() const override;
+ virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
+ virtual size_t GetCiphertextSize(size_t plaintext_size) const override;
+ virtual base::StringPiece GetKey() const override;
+ virtual base::StringPiece GetNoncePrefix() const override;
private:
size_t GetHashLength() const;
diff --git a/net/quic/crypto/p256_key_exchange.h b/net/quic/crypto/p256_key_exchange.h
index ce5a0d4..36ba296 100644
--- a/net/quic/crypto/p256_key_exchange.h
+++ b/net/quic/crypto/p256_key_exchange.h
@@ -38,11 +38,11 @@
static std::string NewPrivateKey();
// KeyExchange interface.
- virtual KeyExchange* NewKeyPair(QuicRandom* rand) const OVERRIDE;
+ virtual KeyExchange* NewKeyPair(QuicRandom* rand) const override;
virtual bool CalculateSharedKey(const base::StringPiece& peer_public_value,
- std::string* shared_key) const OVERRIDE;
- virtual base::StringPiece public_value() const OVERRIDE;
- virtual QuicTag tag() const OVERRIDE;
+ std::string* shared_key) const override;
+ virtual base::StringPiece public_value() const override;
+ virtual QuicTag tag() const override;
private:
enum {
diff --git a/net/quic/crypto/proof_source_chromium.h b/net/quic/crypto/proof_source_chromium.h
index 70ab92d..3d1849e 100644
--- a/net/quic/crypto/proof_source_chromium.h
+++ b/net/quic/crypto/proof_source_chromium.h
@@ -27,7 +27,7 @@
const std::string& server_config,
bool ecdsa_ok,
const std::vector<std::string>** out_certs,
- std::string* out_signature) OVERRIDE;
+ std::string* out_signature) override;
private:
DISALLOW_COPY_AND_ASSIGN(ProofSourceChromium);
diff --git a/net/quic/crypto/proof_test.cc b/net/quic/crypto/proof_test.cc
index 031cba2..0dde97c 100644
--- a/net/quic/crypto/proof_test.cc
+++ b/net/quic/crypto/proof_test.cc
@@ -40,7 +40,7 @@
virtual void Run(bool ok,
const string& error_details,
- scoped_ptr<ProofVerifyDetails>* details) OVERRIDE {
+ scoped_ptr<ProofVerifyDetails>* details) override {
*ok_ = ok;
*error_details_ = error_details;
diff --git a/net/quic/crypto/proof_verifier_chromium.h b/net/quic/crypto/proof_verifier_chromium.h
index 7b305e2..057cc16 100644
--- a/net/quic/crypto/proof_verifier_chromium.h
+++ b/net/quic/crypto/proof_verifier_chromium.h
@@ -30,7 +30,7 @@
public:
// ProofVerifyDetails implementation
- virtual ProofVerifyDetails* Clone() const OVERRIDE;
+ virtual ProofVerifyDetails* Clone() const override;
CertVerifyResult cert_verify_result;
@@ -67,7 +67,7 @@
const ProofVerifyContext* verify_context,
std::string* error_details,
scoped_ptr<ProofVerifyDetails>* verify_details,
- ProofVerifierCallback* callback) OVERRIDE;
+ ProofVerifierCallback* callback) override;
private:
class Job;
diff --git a/net/quic/crypto/quic_crypto_client_config.cc b/net/quic/crypto/quic_crypto_client_config.cc
index 90dc265..1f668af 100644
--- a/net/quic/crypto/quic_crypto_client_config.cc
+++ b/net/quic/crypto/quic_crypto_client_config.cc
@@ -56,7 +56,9 @@
} // namespace
QuicCryptoClientConfig::QuicCryptoClientConfig()
- : disable_ecdsa_(false) {}
+ : disable_ecdsa_(false) {
+ SetDefaults();
+}
QuicCryptoClientConfig::~QuicCryptoClientConfig() {
STLDeleteValues(&cached_states_);
diff --git a/net/quic/crypto/quic_crypto_client_config.h b/net/quic/crypto/quic_crypto_client_config.h
index 39c2508..9fc8ff0 100644
--- a/net/quic/crypto/quic_crypto_client_config.h
+++ b/net/quic/crypto/quic_crypto_client_config.h
@@ -133,9 +133,6 @@
QuicCryptoClientConfig();
~QuicCryptoClientConfig();
- // Sets the members to reasonable, default values.
- void SetDefaults();
-
// LookupOrCreate returns a CachedState for the given |server_id|. If no such
// CachedState currently exists, it will be created and cached.
CachedState* LookupOrCreate(const QuicServerId& server_id);
@@ -269,6 +266,9 @@
private:
typedef std::map<QuicServerId, CachedState*> CachedStateMap;
+ // Sets the members to reasonable, default values.
+ void SetDefaults();
+
// CacheNewServerConfig checks for SCFG, STK, PROF, and CRT tags in |message|,
// verifies them, and stores them in the cached state if they validate.
// This is used on receipt of a REJ from a server, or when a server sends
diff --git a/net/quic/crypto/quic_crypto_client_config_test.cc b/net/quic/crypto/quic_crypto_client_config_test.cc
index b02243b..d2c4920 100644
--- a/net/quic/crypto/quic_crypto_client_config_test.cc
+++ b/net/quic/crypto/quic_crypto_client_config_test.cc
@@ -21,7 +21,7 @@
virtual ~TestProofVerifyDetails() {}
// ProofVerifyDetails implementation
- virtual ProofVerifyDetails* Clone() const OVERRIDE {
+ virtual ProofVerifyDetails* Clone() const override {
return new TestProofVerifyDetails;
}
};
@@ -81,7 +81,6 @@
TEST(QuicCryptoClientConfigTest, PreferAesGcm) {
QuicCryptoClientConfig config;
- config.SetDefaults();
if (config.aead.size() > 1)
EXPECT_NE(kAESG, config.aead[0]);
config.PreferAesGcm();
diff --git a/net/quic/crypto/quic_crypto_server_config.cc b/net/quic/crypto/quic_crypto_server_config.cc
index 6281043..d5a2b75 100644
--- a/net/quic/crypto/quic_crypto_server_config.cc
+++ b/net/quic/crypto/quic_crypto_server_config.cc
@@ -18,6 +18,7 @@
#include "net/quic/crypto/chacha20_poly1305_encrypter.h"
#include "net/quic/crypto/channel_id.h"
#include "net/quic/crypto/crypto_framer.h"
+#include "net/quic/crypto/crypto_handshake_message.h"
#include "net/quic/crypto/crypto_server_config_protobuf.h"
#include "net/quic/crypto/crypto_utils.h"
#include "net/quic/crypto/curve25519_key_exchange.h"
@@ -61,49 +62,6 @@
} // namespace
-// ClientHelloInfo contains information about a client hello message that is
-// only kept for as long as it's being processed.
-struct ClientHelloInfo {
- ClientHelloInfo(const IPEndPoint& in_client_ip, QuicWallTime in_now)
- : client_ip(in_client_ip),
- now(in_now),
- valid_source_address_token(false),
- client_nonce_well_formed(false),
- unique(false) {}
-
- // Inputs to EvaluateClientHello.
- const IPEndPoint client_ip;
- const QuicWallTime now;
-
- // Outputs from EvaluateClientHello.
- bool valid_source_address_token;
- bool client_nonce_well_formed;
- bool unique;
- StringPiece sni;
- StringPiece client_nonce;
- StringPiece server_nonce;
- StringPiece user_agent_id;
-
- // Errors from EvaluateClientHello.
- vector<uint32> reject_reasons;
- COMPILE_ASSERT(sizeof(QuicTag) == sizeof(uint32), header_out_of_sync);
-};
-
-struct ValidateClientHelloResultCallback::Result {
- Result(const CryptoHandshakeMessage& in_client_hello,
- IPEndPoint in_client_ip,
- QuicWallTime in_now)
- : client_hello(in_client_hello),
- info(in_client_ip, in_now),
- error_code(QUIC_NO_ERROR) {
- }
-
- CryptoHandshakeMessage client_hello;
- ClientHelloInfo info;
- QuicErrorCode error_code;
- string error_details;
-};
-
class ValidateClientHelloHelper {
public:
ValidateClientHelloHelper(ValidateClientHelloResultCallback::Result* result,
@@ -150,7 +108,7 @@
protected:
virtual void RunImpl(bool nonce_is_valid_and_unique,
- InsertStatus nonce_error) OVERRIDE {
+ InsertStatus nonce_error) override {
DVLOG(1) << "Using client nonce, unique: " << nonce_is_valid_and_unique
<< " nonce_error: " << nonce_error;
result_->info.unique = nonce_is_valid_and_unique;
@@ -199,12 +157,36 @@
// static
const char QuicCryptoServerConfig::TESTING[] = "secret string for testing";
+ClientHelloInfo::ClientHelloInfo(const IPEndPoint& in_client_ip,
+ QuicWallTime in_now)
+ : client_ip(in_client_ip),
+ now(in_now),
+ valid_source_address_token(false),
+ client_nonce_well_formed(false),
+ unique(false) {
+}
+
+ClientHelloInfo::~ClientHelloInfo() {
+}
+
PrimaryConfigChangedCallback::PrimaryConfigChangedCallback() {
}
PrimaryConfigChangedCallback::~PrimaryConfigChangedCallback() {
}
+ValidateClientHelloResultCallback::Result::Result(
+ const CryptoHandshakeMessage& in_client_hello,
+ IPEndPoint in_client_ip,
+ QuicWallTime in_now)
+ : client_hello(in_client_hello),
+ info(in_client_ip, in_now),
+ error_code(QUIC_NO_ERROR) {
+}
+
+ValidateClientHelloResultCallback::Result::~Result() {
+}
+
ValidateClientHelloResultCallback::ValidateClientHelloResultCallback() {
}
@@ -603,8 +585,9 @@
!info.client_nonce_well_formed ||
!info.unique ||
!requested_config.get()) {
- BuildRejection(
- *primary_config.get(), client_hello, info, rand, params, out);
+ BuildRejection(*primary_config.get(), client_hello, info,
+ validate_chlo_result.cached_network_params, rand, params,
+ out);
return QUIC_NO_ERROR;
}
@@ -773,13 +756,12 @@
(QuicVersionToQuicTag(supported_versions[i]));
}
out->SetVector(kVER, supported_version_tags);
- out->SetStringPiece(
- kSourceAddressTokenTag,
- NewSourceAddressToken(*requested_config.get(),
- client_address,
- rand,
- info.now,
- nullptr));
+ out->SetStringPiece(kSourceAddressTokenTag,
+ NewSourceAddressToken(*requested_config.get(),
+ client_address,
+ rand,
+ info.now,
+ nullptr));
QuicSocketAddressCoder address_coder(client_address);
out->SetStringPiece(kCADR, address_coder.Encode());
out->SetStringPiece(kPUBS, forward_secure_public_value);
@@ -949,8 +931,12 @@
HandshakeFailureReason source_address_token_error;
StringPiece srct;
if (client_hello.GetStringPiece(kSourceAddressTokenTag, &srct)) {
- source_address_token_error = ValidateSourceAddressToken(
- *requested_config.get(), srct, info->client_ip, info->now);
+ source_address_token_error =
+ ValidateSourceAddressToken(*requested_config.get(),
+ srct,
+ info->client_ip,
+ info->now,
+ &client_hello_state->cached_network_params);
info->valid_source_address_token =
(source_address_token_error == HANDSHAKE_OK);
} else {
@@ -1083,6 +1069,7 @@
const Config& config,
const CryptoHandshakeMessage& client_hello,
const ClientHelloInfo& info,
+ const CachedNetworkParameters& cached_network_params,
QuicRandom* rand,
QuicCryptoNegotiatedParameters *params,
CryptoHandshakeMessage* out) const {
@@ -1094,7 +1081,7 @@
info.client_ip,
rand,
info.now,
- nullptr));
+ &cached_network_params));
if (replay_protection_) {
out->SetStringPiece(kServerNonceTag, NewServerNonce(rand, info.now));
}
@@ -1437,7 +1424,8 @@
const Config& config,
StringPiece token,
const IPEndPoint& ip,
- QuicWallTime now) const {
+ QuicWallTime now,
+ CachedNetworkParameters* cached_network_params) const {
string storage;
StringPiece plaintext;
if (!config.source_address_token_boxer->Unbox(token, &storage, &plaintext)) {
@@ -1473,6 +1461,11 @@
return SOURCE_ADDRESS_TOKEN_EXPIRED_FAILURE;
}
+ if (FLAGS_quic_store_cached_network_params_from_chlo &&
+ source_address_token.has_cached_network_parameters()) {
+ *cached_network_params = source_address_token.cached_network_parameters();
+ }
+
return HANDSHAKE_OK;
}
diff --git a/net/quic/crypto/quic_crypto_server_config.h b/net/quic/crypto/quic_crypto_server_config.h
index ef8f6e9..30e0f6d 100644
--- a/net/quic/crypto/quic_crypto_server_config.h
+++ b/net/quic/crypto/quic_crypto_server_config.h
@@ -36,7 +36,29 @@
class StrikeRegister;
class StrikeRegisterClient;
-struct ClientHelloInfo;
+// ClientHelloInfo contains information about a client hello message that is
+// only kept for as long as it's being processed.
+struct ClientHelloInfo {
+ ClientHelloInfo(const IPEndPoint& in_client_ip, QuicWallTime in_now);
+ ~ClientHelloInfo();
+
+ // Inputs to EvaluateClientHello.
+ const IPEndPoint client_ip;
+ const QuicWallTime now;
+
+ // Outputs from EvaluateClientHello.
+ bool valid_source_address_token;
+ bool client_nonce_well_formed;
+ bool unique;
+ base::StringPiece sni;
+ base::StringPiece client_nonce;
+ base::StringPiece server_nonce;
+ base::StringPiece user_agent_id;
+
+ // Errors from EvaluateClientHello.
+ std::vector<uint32> reject_reasons;
+ COMPILE_ASSERT(sizeof(QuicTag) == sizeof(uint32), header_out_of_sync);
+};
namespace test {
class QuicCryptoServerConfigPeer;
@@ -58,7 +80,20 @@
public:
// Opaque token that holds information about the client_hello and
// its validity. Can be interpreted by calling ProcessClientHello.
- struct Result;
+ struct Result {
+ Result(const CryptoHandshakeMessage& in_client_hello,
+ IPEndPoint in_client_ip,
+ QuicWallTime in_now);
+ ~Result();
+
+ CryptoHandshakeMessage client_hello;
+ ClientHelloInfo info;
+ QuicErrorCode error_code;
+ std::string error_details;
+
+ // Populated if the CHLO STK contained a CachedNetworkParameters proto.
+ CachedNetworkParameters cached_network_params;
+ };
ValidateClientHelloResultCallback();
virtual ~ValidateClientHelloResultCallback();
@@ -386,6 +421,7 @@
const Config& config,
const CryptoHandshakeMessage& client_hello,
const ClientHelloInfo& info,
+ const CachedNetworkParameters& cached_network_params,
QuicRandom* rand,
QuicCryptoNegotiatedParameters *params,
CryptoHandshakeMessage* out) const;
@@ -407,10 +443,14 @@
// ValidateSourceAddressToken returns HANDSHAKE_OK if the source address token
// in |token| is a valid and timely token for the IP address |ip| given that
// the current time is |now|. Otherwise it returns the reason for failure.
- HandshakeFailureReason ValidateSourceAddressToken(const Config& config,
- base::StringPiece token,
- const IPEndPoint& ip,
- QuicWallTime now) const;
+ // |cached_network_params| is populated if |token| contains a
+ // CachedNetworkParameters proto.
+ HandshakeFailureReason ValidateSourceAddressToken(
+ const Config& config,
+ base::StringPiece token,
+ const IPEndPoint& ip,
+ QuicWallTime now,
+ CachedNetworkParameters* cached_network_params) const;
// NewServerNonce generates and encrypts a random nonce.
std::string NewServerNonce(QuicRandom* rand, QuicWallTime now) const;
diff --git a/net/quic/crypto/quic_crypto_server_config_test.cc b/net/quic/crypto/quic_crypto_server_config_test.cc
index f44dc5c..59d6cf4 100644
--- a/net/quic/crypto/quic_crypto_server_config_test.cc
+++ b/net/quic/crypto/quic_crypto_server_config_test.cc
@@ -13,6 +13,7 @@
#include "net/quic/crypto/crypto_server_config_protobuf.h"
#include "net/quic/crypto/quic_random.h"
#include "net/quic/crypto/strike_register_client.h"
+#include "net/quic/quic_flags.h"
#include "net/quic/quic_time.h"
#include "net/quic/test_tools/mock_clock.h"
#include "net/quic/test_tools/quic_test_utils.h"
@@ -52,19 +53,37 @@
string NewSourceAddressToken(
string config_id,
- IPEndPoint ip,
+ const IPEndPoint& ip,
QuicRandom* rand,
QuicWallTime now) {
+ return NewSourceAddressToken(config_id, ip, rand, now, NULL);
+ }
+
+ string NewSourceAddressToken(
+ string config_id,
+ const IPEndPoint& ip,
+ QuicRandom* rand,
+ QuicWallTime now,
+ CachedNetworkParameters* cached_network_params) {
return server_config_->NewSourceAddressToken(
- *GetConfig(config_id), ip, rand, now, nullptr);
+ *GetConfig(config_id), ip, rand, now, cached_network_params);
}
HandshakeFailureReason ValidateSourceAddressToken(string config_id,
StringPiece srct,
- IPEndPoint ip,
+ const IPEndPoint& ip,
QuicWallTime now) {
+ return ValidateSourceAddressToken(config_id, srct, ip, now, NULL);
+ }
+
+ HandshakeFailureReason ValidateSourceAddressToken(
+ string config_id,
+ StringPiece srct,
+ const IPEndPoint& ip,
+ QuicWallTime now,
+ CachedNetworkParameters* cached_network_params) {
return server_config_->ValidateSourceAddressToken(
- *GetConfig(config_id), srct, ip, now);
+ *GetConfig(config_id), srct, ip, now, cached_network_params);
}
string NewServerNonce(QuicRandom* rand, QuicWallTime now) const {
@@ -188,7 +207,7 @@
is_known_orbit_called_(false) {
}
- virtual bool IsKnownOrbit(StringPiece orbit) const OVERRIDE {
+ virtual bool IsKnownOrbit(StringPiece orbit) const override {
// Ensure that the strike register client lock is not held.
QuicCryptoServerConfigPeer peer(config_);
base::Lock* m = peer.GetStrikeRegisterClientLock();
@@ -204,7 +223,7 @@
virtual void VerifyNonceIsValidAndUnique(
StringPiece nonce,
QuicWallTime now,
- ResultCallback* cb) OVERRIDE {
+ ResultCallback* cb) override {
LOG(FATAL) << "Not implemented";
}
@@ -241,6 +260,8 @@
}
TEST(QuicCryptoServerConfigTest, SourceAddressTokens) {
+ ValueRestore<bool> old_flag(&FLAGS_quic_store_cached_network_params_from_chlo,
+ true);
const string kPrimary = "<primary>";
const string kOverride = "Config with custom source address token key";
@@ -329,6 +350,21 @@
now = original_time.Subtract(QuicTime::Delta::FromSeconds(3600 * 2));
DCHECK_EQ(SOURCE_ADDRESS_TOKEN_CLOCK_SKEW_FAILURE,
peer.ValidateSourceAddressToken(kPrimary, token4, ip4, now));
+
+ // Make sure that if the source address token contains CachedNetworkParameters
+ // that this gets written to ValidateSourceAddressToken output argument.
+ CachedNetworkParameters cached_network_params_input;
+ cached_network_params_input.set_bandwidth_estimate_bytes_per_second(1234);
+ const string token4_with_cached_network_params = peer.NewSourceAddressToken(
+ kPrimary, ip4, rand, now, &cached_network_params_input);
+
+ CachedNetworkParameters cached_network_params_output;
+ EXPECT_NE(cached_network_params_output, cached_network_params_input);
+ peer.ValidateSourceAddressToken(kPrimary, token4_with_cached_network_params,
+ ip4, now, &cached_network_params_output);
+ // TODO(rtenneti): For server, enable the following check after serialization
+ // of optional CachedNetworkParameters is implemented.
+ // EXPECT_EQ(cached_network_params_output, cached_network_params_input);
}
TEST(QuicCryptoServerConfigTest, ValidateServerNonce) {
diff --git a/net/quic/crypto/quic_random.cc b/net/quic/crypto/quic_random.cc
index 6f46013..bc85c2d 100644
--- a/net/quic/crypto/quic_random.cc
+++ b/net/quic/crypto/quic_random.cc
@@ -17,10 +17,10 @@
static DefaultRandom* GetInstance();
// QuicRandom implementation
- virtual void RandBytes(void* data, size_t len) OVERRIDE;
- virtual uint64 RandUint64() OVERRIDE;
+ virtual void RandBytes(void* data, size_t len) override;
+ virtual uint64 RandUint64() override;
virtual void Reseed(const void* additional_entropy,
- size_t entropy_len) OVERRIDE;
+ size_t entropy_len) override;
private:
DefaultRandom() {};
diff --git a/net/quic/crypto/source_address_token.cc b/net/quic/crypto/source_address_token.cc
index f20c343..7ac43f0 100644
--- a/net/quic/crypto/source_address_token.cc
+++ b/net/quic/crypto/source_address_token.cc
@@ -14,13 +14,39 @@
namespace net {
-CachedNetworkParameters::CachedNetworkParameters() {
+CachedNetworkParameters::CachedNetworkParameters()
+ : bandwidth_estimate_bytes_per_second_(0),
+ max_bandwidth_estimate_bytes_per_second_(0),
+ max_bandwidth_timestamp_seconds_(0),
+ min_rtt_ms_(0),
+ previous_connection_state_(0),
+ timestamp_(0) {
}
CachedNetworkParameters::~CachedNetworkParameters() {
}
-SourceAddressToken::SourceAddressToken() {
+bool CachedNetworkParameters::operator==(
+ const CachedNetworkParameters& other) const {
+ return serving_region_ == other.serving_region_ &&
+ bandwidth_estimate_bytes_per_second_ ==
+ other.bandwidth_estimate_bytes_per_second_ &&
+ max_bandwidth_estimate_bytes_per_second_ ==
+ other.max_bandwidth_estimate_bytes_per_second_ &&
+ max_bandwidth_timestamp_seconds_ ==
+ other.max_bandwidth_timestamp_seconds_ &&
+ min_rtt_ms_ == other.min_rtt_ms_ &&
+ previous_connection_state_ == other.previous_connection_state_ &&
+ timestamp_ == other.timestamp_;
+}
+
+bool CachedNetworkParameters::operator!=(
+ const CachedNetworkParameters& other) const {
+ return !(*this == other);
+}
+
+SourceAddressToken::SourceAddressToken()
+ : has_cached_network_parameters_(false) {
}
SourceAddressToken::~SourceAddressToken() {
diff --git a/net/quic/crypto/source_address_token.h b/net/quic/crypto/source_address_token.h
index 1101351..76c3454 100644
--- a/net/quic/crypto/source_address_token.h
+++ b/net/quic/crypto/source_address_token.h
@@ -28,6 +28,9 @@
CachedNetworkParameters();
~CachedNetworkParameters();
+ bool operator==(const CachedNetworkParameters& other) const;
+ bool operator!=(const CachedNetworkParameters& other) const;
+
std::string serving_region() const {
return serving_region_;
}
@@ -133,6 +136,10 @@
void set_cached_network_parameters(
const CachedNetworkParameters& cached_network_parameters) {
cached_network_parameters_ = cached_network_parameters;
+ has_cached_network_parameters_ = true;
+ }
+ bool has_cached_network_parameters() const {
+ return has_cached_network_parameters_;
}
private:
@@ -146,6 +153,9 @@
// The server can provide estimated network parameters to be used for
// initial parameter selection in future connections.
CachedNetworkParameters cached_network_parameters_;
+ // TODO(rtenneti): Delete |has_cached_network_parameters_| after we convert
+ // SourceAddressToken to protobuf.
+ bool has_cached_network_parameters_;
DISALLOW_COPY_AND_ASSIGN(SourceAddressToken);
};
diff --git a/net/quic/quic_ack_notifier_manager.h b/net/quic/quic_ack_notifier_manager.h
index bf5b345..122bda1 100644
--- a/net/quic/quic_ack_notifier_manager.h
+++ b/net/quic/quic_ack_notifier_manager.h
@@ -10,17 +10,6 @@
#include "base/containers/hash_tables.h"
#include "net/quic/quic_protocol.h"
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-template<>
-struct hash<net::QuicAckNotifier*> {
- std::size_t operator()(const net::QuicAckNotifier* ptr) const {
- return hash<size_t>()(reinterpret_cast<size_t>(ptr));
- }
-};
-}
-#endif
-
namespace net {
class QuicAckNotifier;
diff --git a/net/quic/quic_alarm_test.cc b/net/quic/quic_alarm_test.cc
index 434bb38..47e23e3 100644
--- a/net/quic/quic_alarm_test.cc
+++ b/net/quic/quic_alarm_test.cc
@@ -32,12 +32,12 @@
}
protected:
- virtual void SetImpl() OVERRIDE {
+ virtual void SetImpl() override {
DCHECK(deadline().IsInitialized());
scheduled_ = true;
}
- virtual void CancelImpl() OVERRIDE {
+ virtual void CancelImpl() override {
DCHECK(!deadline().IsInitialized());
scheduled_ = false;
}
diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
index 5454c10..b7e8185 100644
--- a/net/quic/quic_client_session.cc
+++ b/net/quic/quic_client_session.cc
@@ -153,7 +153,7 @@
num_total_streams_(0),
task_runner_(task_runner),
net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_QUIC_SESSION)),
- logger_(new QuicConnectionLogger(net_log_)),
+ logger_(new QuicConnectionLogger(this, net_log_)),
num_packets_read_(0),
going_away_(false),
weak_factory_(this) {
@@ -265,14 +265,14 @@
const QuicConnectionStats stats = connection()->GetStats();
if (stats.max_sequence_reordering == 0)
return;
- const uint64 kMaxReordering = 100;
- uint64 reordering = kMaxReordering;
- if (stats.min_rtt_us > 0 ) {
- reordering =
- GG_UINT64_C(100) * stats.max_time_reordering_us / stats.min_rtt_us;
+ const base::HistogramBase::Sample kMaxReordering = 100;
+ base::HistogramBase::Sample reordering = kMaxReordering;
+ if (stats.min_rtt_us > 0) {
+ reordering = static_cast<base::HistogramBase::Sample>(
+ 100 * stats.max_time_reordering_us / stats.min_rtt_us);
}
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTime",
- reordering, 0, kMaxReordering, 50);
+ reordering, 0, kMaxReordering, 50);
if (stats.min_rtt_us > 100 * 1000) {
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.MaxReorderingTimeLongRtt",
reordering, 0, kMaxReordering, 50);
diff --git a/net/quic/quic_client_session.h b/net/quic/quic_client_session.h
index fa712c2..430ef52 100644
--- a/net/quic/quic_client_session.h
+++ b/net/quic/quic_client_session.h
@@ -124,30 +124,30 @@
// QuicSession methods:
virtual void OnStreamFrames(
- const std::vector<QuicStreamFrame>& frames) OVERRIDE;
- virtual QuicReliableClientStream* CreateOutgoingDataStream() OVERRIDE;
- virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE;
- virtual void CloseStream(QuicStreamId stream_id) OVERRIDE;
+ const std::vector<QuicStreamFrame>& frames) override;
+ virtual QuicReliableClientStream* CreateOutgoingDataStream() override;
+ virtual QuicCryptoClientStream* GetCryptoStream() override;
+ virtual void CloseStream(QuicStreamId stream_id) override;
virtual void SendRstStream(QuicStreamId id,
QuicRstStreamErrorCode error,
- QuicStreamOffset bytes_written) OVERRIDE;
- virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE;
+ QuicStreamOffset bytes_written) override;
+ virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override;
virtual void OnCryptoHandshakeMessageSent(
- const CryptoHandshakeMessage& message) OVERRIDE;
+ const CryptoHandshakeMessage& message) override;
virtual void OnCryptoHandshakeMessageReceived(
- const CryptoHandshakeMessage& message) OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) const OVERRIDE;
+ const CryptoHandshakeMessage& message) override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) const override;
// QuicClientSessionBase methods:
virtual void OnProofValid(
- const QuicCryptoClientConfig::CachedState& cached) OVERRIDE;
+ const QuicCryptoClientConfig::CachedState& cached) override;
virtual void OnProofVerifyDetailsAvailable(
- const ProofVerifyDetails& verify_details) OVERRIDE;
+ const ProofVerifyDetails& verify_details) override;
// QuicConnectionVisitorInterface methods:
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE;
+ virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
virtual void OnSuccessfulVersionNegotiation(
- const QuicVersion& version) OVERRIDE;
+ const QuicVersion& version) override;
// Performs a crypto handshake with the server.
int CryptoConnect(bool require_confirmation,
@@ -182,7 +182,7 @@
protected:
// QuicSession methods:
- virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE;
+ virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
private:
friend class test::QuicClientSessionPeer;
diff --git a/net/quic/quic_client_session_base.h b/net/quic/quic_client_session_base.h
index 834d006..ae0644e 100644
--- a/net/quic/quic_client_session_base.h
+++ b/net/quic/quic_client_session_base.h
@@ -33,7 +33,7 @@
const ProofVerifyDetails& verify_details) = 0;
// Override base class to set FEC policy before any data is sent by client.
- virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE;
+ virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override;
private:
DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase);
diff --git a/net/quic/quic_client_session_test.cc b/net/quic/quic_client_session_test.cc
index 9758ed4..b1cfe3d 100644
--- a/net/quic/quic_client_session_test.cc
+++ b/net/quic/quic_client_session_test.cc
@@ -51,11 +51,9 @@
session_.InitializeSession(QuicServerId(kServerHostname, kServerPort, false,
PRIVACY_MODE_DISABLED),
&crypto_config_, nullptr);
- session_.config()->SetDefaults();
- crypto_config_.SetDefaults();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
session_.CloseSessionOnError(ERR_ABORTED);
}
diff --git a/net/quic/quic_config.cc b/net/quic/quic_config.cc
index 5330b7c..7b7976c 100644
--- a/net/quic/quic_config.cc
+++ b/net/quic/quic_config.cc
@@ -427,6 +427,7 @@
QuicConfig::QuicConfig()
: max_time_before_crypto_handshake_(QuicTime::Delta::Zero()),
max_idle_time_before_crypto_handshake_(QuicTime::Delta::Zero()),
+ max_undecryptable_packets_(0),
congestion_feedback_(kCGST, PRESENCE_REQUIRED),
connection_options_(kCOPT, PRESENCE_OPTIONAL),
idle_connection_state_lifetime_seconds_(kICSL, PRESENCE_REQUIRED),
@@ -443,6 +444,7 @@
// QUIC_VERSION_19.
initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL),
socket_receive_buffer_(kSRBF, PRESENCE_OPTIONAL) {
+ SetDefaults();
}
QuicConfig::~QuicConfig() {}
@@ -643,6 +645,7 @@
QuicTime::Delta::FromSeconds(kMaxTimeForCryptoHandshakeSecs);
max_idle_time_before_crypto_handshake_ =
QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs);
+ max_undecryptable_packets_ = kDefaultMaxUndecryptablePackets;
SetInitialFlowControlWindowToSend(kDefaultFlowControlSendWindow);
SetInitialStreamFlowControlWindowToSend(kDefaultFlowControlSendWindow);
diff --git a/net/quic/quic_config.h b/net/quic/quic_config.h
index 203eb2e..7be4569 100644
--- a/net/quic/quic_config.h
+++ b/net/quic/quic_config.h
@@ -89,7 +89,7 @@
// Serialises |name_| and value to |out|. If |negotiated_| is true then
// |negotiated_value_| is serialised, otherwise |max_value_| is serialised.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const OVERRIDE;
+ virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Sets |negotiated_value_| to the minimum of |max_value_| and the
// corresponding value from |peer_hello|. If the corresponding value is
@@ -98,7 +98,7 @@
virtual QuicErrorCode ProcessPeerHello(
const CryptoHandshakeMessage& peer_hello,
HelloType hello_type,
- std::string* error_details) OVERRIDE;
+ std::string* error_details) override;
private:
uint32 max_value_;
@@ -123,7 +123,7 @@
// Serialises |name_| and vector (either possible or negotiated) to |out|. If
// |negotiated_| is true then |negotiated_tag_| is serialised, otherwise
// |possible_values_| is serialised.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const OVERRIDE;
+ virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Selects the tag common to both tags in |client_hello| for |name_| and
// |possible_values_| with preference to tag in |possible_values_|. The
@@ -131,7 +131,7 @@
virtual QuicErrorCode ProcessPeerHello(
const CryptoHandshakeMessage& peer_hello,
HelloType hello_type,
- std::string* error_details) OVERRIDE;
+ std::string* error_details) override;
private:
// Reads the vector corresponding to |name_| from |msg| into |out|. If the
@@ -166,13 +166,13 @@
void SetReceivedValue(uint32 value);
// If has_send_value is true, serialises |tag_| and |send_value_| to |out|.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const OVERRIDE;
+ virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Sets |value_| to the corresponding value from |peer_hello_| if it exists.
virtual QuicErrorCode ProcessPeerHello(
const CryptoHandshakeMessage& peer_hello,
HelloType hello_type,
- std::string* error_details) OVERRIDE;
+ std::string* error_details) override;
private:
uint32 send_value_;
@@ -200,13 +200,13 @@
void SetReceivedValue(QuicTag value);
// If has_send_value is true, serialises |tag_| and |send_value_| to |out|.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const OVERRIDE;
+ virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Sets |value_| to the corresponding value from |client_hello_| if it exists.
virtual QuicErrorCode ProcessPeerHello(
const CryptoHandshakeMessage& peer_hello,
HelloType hello_type,
- std::string* error_details) OVERRIDE;
+ std::string* error_details) override;
private:
QuicTag send_value_;
@@ -235,14 +235,14 @@
// If has_send_value is true, serialises |tag_vector_| and |send_value_| to
// |out|.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const OVERRIDE;
+ virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Sets |receive_values_| to the corresponding value from |client_hello_| if
// it exists.
virtual QuicErrorCode ProcessPeerHello(
const CryptoHandshakeMessage& peer_hello,
HelloType hello_type,
- std::string* error_details) OVERRIDE;
+ std::string* error_details) override;
private:
QuicTagVector send_values_;
@@ -304,6 +304,14 @@
return max_idle_time_before_crypto_handshake_;
}
+ void set_max_undecryptable_packets(size_t max_undecryptable_packets) {
+ max_undecryptable_packets_ = max_undecryptable_packets;
+ }
+
+ size_t max_undecryptable_packets() const {
+ return max_undecryptable_packets_;
+ }
+
// Sets the peer's default initial congestion window in packets.
void SetInitialCongestionWindowToSend(size_t initial_window);
@@ -362,9 +370,6 @@
bool negotiated() const;
- // SetDefaults sets the members to sensible, default values.
- void SetDefaults();
-
// ToHandshakeMessage serialises the settings in this object as a series of
// tags /value pairs and adds them to |out|.
void ToHandshakeMessage(CryptoHandshakeMessage* out) const;
@@ -378,11 +383,16 @@
private:
friend class test::QuicConfigPeer;
+ // SetDefaults sets the members to sensible, default values.
+ void SetDefaults();
+
// Configurations options that are not negotiated.
// Maximum time the session can be alive before crypto handshake is finished.
QuicTime::Delta max_time_before_crypto_handshake_;
// Maximum idle time before the crypto handshake has completed.
QuicTime::Delta max_idle_time_before_crypto_handshake_;
+ // Maximum number of undecryptable packets stored before CHLO/SHLO.
+ size_t max_undecryptable_packets_;
// Congestion control feedback type.
QuicNegotiableTag congestion_feedback_;
diff --git a/net/quic/quic_config_test.cc b/net/quic/quic_config_test.cc
index 2263e44..914b137 100644
--- a/net/quic/quic_config_test.cc
+++ b/net/quic/quic_config_test.cc
@@ -22,15 +22,10 @@
class QuicConfigTest : public ::testing::Test {
protected:
- QuicConfigTest() {
- config_.SetDefaults();
- }
-
QuicConfig config_;
};
TEST_F(QuicConfigTest, ToHandshakeMessage) {
- config_.SetDefaults();
config_.SetInitialFlowControlWindowToSend(
kInitialSessionFlowControlWindowForTest);
config_.SetInitialStreamFlowControlWindowToSend(
@@ -265,7 +260,6 @@
TEST_F(QuicConfigTest, NoOverLapInCGST) {
QuicConfig server_config;
- server_config.SetDefaults();
QuicTagVector cgst;
cgst.push_back(kTBBR);
server_config.SetCongestionFeedback(cgst, kTBBR);
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index 8d49010..f684cf2 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -6,6 +6,7 @@
#include <string.h>
#include <sys/types.h>
+
#include <algorithm>
#include <iterator>
#include <limits>
@@ -53,10 +54,6 @@
// that this becomes limiting, we can revisit.
const size_t kMaxFecGroups = 2;
-// Limit the number of undecryptable packets we buffer in
-// expectation of the CHLO/SHLO arriving.
-const size_t kMaxUndecryptablePackets = 10;
-
// Maximum number of acks received before sending an ack in response.
const size_t kMaxPacketsReceivedBeforeAckSend = 20;
@@ -72,7 +69,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
connection_->SendAck();
return QuicTime::Zero();
}
@@ -92,7 +89,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
connection_->OnRetransmissionTimeout();
return QuicTime::Zero();
}
@@ -111,7 +108,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
connection_->WriteIfNotBlocked();
// Never reschedule the alarm, since CanWrite does that.
return QuicTime::Zero();
@@ -129,7 +126,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
connection_->CheckForTimeout();
// Never reschedule the alarm, since CheckForTimeout does that.
return QuicTime::Zero();
@@ -147,7 +144,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
connection_->SendPing();
return QuicTime::Zero();
}
@@ -162,10 +159,10 @@
QuicConnection::QueuedPacket::QueuedPacket(SerializedPacket packet,
EncryptionLevel level)
- : serialized_packet(packet),
- encryption_level(level),
- transmission_type(NOT_RETRANSMISSION),
- original_sequence_number(0) {
+ : serialized_packet(packet),
+ encryption_level(level),
+ transmission_type(NOT_RETRANSMISSION),
+ original_sequence_number(0) {
}
QuicConnection::QueuedPacket::QueuedPacket(
@@ -204,6 +201,7 @@
last_decrypted_packet_level_(ENCRYPTION_NONE),
largest_seen_packet_with_ack_(0),
largest_seen_packet_with_stop_waiting_(0),
+ max_undecryptable_packets_(0),
pending_version_negotiation_packet_(false),
received_packet_manager_(&stats_),
ack_queued_(false),
@@ -271,6 +269,7 @@
SetIdleNetworkTimeout(config.IdleConnectionStateLifetime());
}
sent_packet_manager_.SetFromConfig(config);
+ max_undecryptable_packets_ = config.max_undecryptable_packets();
}
bool QuicConnection::SelectMutualVersion(
@@ -1116,7 +1115,7 @@
// because the CHLO or SHLO packet was lost.
if (framer_.error() == QUIC_DECRYPTION_FAILURE) {
if (encryption_level_ != ENCRYPTION_FORWARD_SECURE &&
- undecryptable_packets_.size() < kMaxUndecryptablePackets) {
+ undecryptable_packets_.size() < max_undecryptable_packets_) {
QueueUndecryptablePacket(packet);
} else if (debug_visitor_.get() != nullptr) {
debug_visitor_->OnUndecryptablePacket();
@@ -1176,8 +1175,7 @@
return;
}
- { // Limit the scope of the bundler.
- // Set |include_ack| to false in bundler; ack inclusion happens elsewhere.
+ { // Limit the scope of the bundler. ACK inclusion happens elsewhere.
ScopedPacketBundler bundler(this, NO_ACK);
visitor_->OnCanWrite();
}
@@ -1322,7 +1320,8 @@
// If the scheduler requires a delay, then we can not send this packet now.
if (!delay.IsZero()) {
send_alarm_->Update(now.Add(delay), QuicTime::Delta::FromMilliseconds(1));
- DVLOG(1) << "Delaying sending.";
+ DVLOG(1) << ENDPOINT << "Delaying sending " << delay.ToMilliseconds()
+ << "ms";
return false;
}
send_alarm_->Cancel();
@@ -1408,15 +1407,6 @@
if (result.error_code == ERR_IO_PENDING) {
DCHECK_EQ(WRITE_STATUS_BLOCKED, result.status);
}
- if (debug_visitor_.get() != nullptr) {
- // Pass the write result to the visitor.
- debug_visitor_->OnPacketSent(sequence_number,
- packet->original_sequence_number,
- packet->encryption_level,
- packet->transmission_type,
- *encrypted,
- result);
- }
if (result.status == WRITE_STATUS_BLOCKED) {
visitor_->OnWriteBlocked();
@@ -1429,6 +1419,15 @@
}
}
QuicTime now = clock_->Now();
+ if (result.status != WRITE_STATUS_ERROR && debug_visitor_.get() != nullptr) {
+ // Pass the write result to the visitor.
+ debug_visitor_->OnPacketSent(packet->serialized_packet,
+ packet->original_sequence_number,
+ packet->encryption_level,
+ packet->transmission_type,
+ *encrypted,
+ now);
+ }
if (packet->transmission_type == NOT_RETRANSMISSION) {
time_of_last_sent_new_packet_ = now;
}
@@ -1857,7 +1856,7 @@
// Adjust the idle timeout on client and server to prevent clients from
// sending requests to servers which have already closed the connection.
if (is_server_) {
- timeout = timeout.Add(QuicTime::Delta::FromSeconds(1));
+ timeout = timeout.Add(QuicTime::Delta::FromSeconds(3));
} else if (timeout > QuicTime::Delta::FromSeconds(1)) {
timeout = timeout.Subtract(QuicTime::Delta::FromSeconds(1));
}
@@ -1895,7 +1894,7 @@
// Adjust the idle timeout on client and server to prevent clients from
// sending requests to servers which have already closed the connection.
if (is_server_) {
- idle_timeout = idle_timeout.Add(QuicTime::Delta::FromSeconds(1));
+ idle_timeout = idle_timeout.Add(QuicTime::Delta::FromSeconds(3));
} else if (idle_timeout > QuicTime::Delta::FromSeconds(1)) {
idle_timeout = idle_timeout.Subtract(QuicTime::Delta::FromSeconds(1));
}
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h
index 0b017b0..fa117f8 100644
--- a/net/quic/quic_connection.h
+++ b/net/quic/quic_connection.h
@@ -124,12 +124,12 @@
virtual ~QuicConnectionDebugVisitor() {}
// Called when a packet has been sent.
- virtual void OnPacketSent(QuicPacketSequenceNumber sequence_number,
+ virtual void OnPacketSent(const SerializedPacket& serialized_packet,
QuicPacketSequenceNumber original_sequence_number,
EncryptionLevel level,
TransmissionType transmission_type,
const QuicEncryptedPacket& packet,
- WriteResult result) {}
+ QuicTime sent_time) {}
// Called when a packet has been received, but before it is
// validated or parsed.
@@ -299,7 +299,7 @@
virtual void SendConnectionCloseWithDetails(QuicErrorCode error,
const std::string& details);
// Notifies the visitor of the close and marks the connection as disconnected.
- virtual void CloseConnection(QuicErrorCode error, bool from_peer) OVERRIDE;
+ virtual void CloseConnection(QuicErrorCode error, bool from_peer) override;
virtual void SendGoAway(QuicErrorCode error,
QuicStreamId last_good_stream_id,
const std::string& reason);
@@ -317,7 +317,7 @@
// QuicBlockedWriterInterface
// Called when the underlying connection becomes writable to allow queued
// writes to happen.
- virtual void OnCanWrite() OVERRIDE;
+ virtual void OnCanWrite() override;
// Called when an error occurs while attempting to write a packet to the
// network.
@@ -335,47 +335,47 @@
}
// From QuicFramerVisitorInterface
- virtual void OnError(QuicFramer* framer) OVERRIDE;
- virtual bool OnProtocolVersionMismatch(QuicVersion received_version) OVERRIDE;
- virtual void OnPacket() OVERRIDE;
+ virtual void OnError(QuicFramer* framer) override;
+ virtual bool OnProtocolVersionMismatch(QuicVersion received_version) override;
+ virtual void OnPacket() override;
virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) OVERRIDE;
+ const QuicPublicResetPacket& packet) override;
virtual void OnVersionNegotiationPacket(
- const QuicVersionNegotiationPacket& packet) OVERRIDE;
- virtual void OnRevivedPacket() OVERRIDE;
+ const QuicVersionNegotiationPacket& packet) override;
+ virtual void OnRevivedPacket() override;
virtual bool OnUnauthenticatedPublicHeader(
- const QuicPacketPublicHeader& header) OVERRIDE;
- virtual bool OnUnauthenticatedHeader(const QuicPacketHeader& header) OVERRIDE;
- virtual void OnDecryptedPacket(EncryptionLevel level) OVERRIDE;
- virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE;
- virtual void OnFecProtectedPayload(base::StringPiece payload) OVERRIDE;
- virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE;
- virtual bool OnAckFrame(const QuicAckFrame& frame) OVERRIDE;
+ const QuicPacketPublicHeader& header) override;
+ virtual bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
+ virtual void OnDecryptedPacket(EncryptionLevel level) override;
+ virtual bool OnPacketHeader(const QuicPacketHeader& header) override;
+ virtual void OnFecProtectedPayload(base::StringPiece payload) override;
+ virtual bool OnStreamFrame(const QuicStreamFrame& frame) override;
+ virtual bool OnAckFrame(const QuicAckFrame& frame) override;
virtual bool OnCongestionFeedbackFrame(
- const QuicCongestionFeedbackFrame& frame) OVERRIDE;
- virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) OVERRIDE;
- virtual bool OnPingFrame(const QuicPingFrame& frame) OVERRIDE;
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE;
+ const QuicCongestionFeedbackFrame& frame) override;
+ virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override;
+ virtual bool OnPingFrame(const QuicPingFrame& frame) override;
+ virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) OVERRIDE;
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE;
- virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) OVERRIDE;
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE;
- virtual void OnFecData(const QuicFecData& fec) OVERRIDE;
- virtual void OnPacketComplete() OVERRIDE;
+ const QuicConnectionCloseFrame& frame) override;
+ virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
+ virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
+ virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override;
+ virtual void OnFecData(const QuicFecData& fec) override;
+ virtual void OnPacketComplete() override;
// QuicPacketGenerator::DelegateInterface
virtual bool ShouldGeneratePacket(TransmissionType transmission_type,
HasRetransmittableData retransmittable,
- IsHandshake handshake) OVERRIDE;
- virtual QuicAckFrame* CreateAckFrame() OVERRIDE;
- virtual QuicCongestionFeedbackFrame* CreateFeedbackFrame() OVERRIDE;
- virtual QuicStopWaitingFrame* CreateStopWaitingFrame() OVERRIDE;
- virtual void OnSerializedPacket(const SerializedPacket& packet) OVERRIDE;
+ IsHandshake handshake) override;
+ virtual QuicAckFrame* CreateAckFrame() override;
+ virtual QuicCongestionFeedbackFrame* CreateFeedbackFrame() override;
+ virtual QuicStopWaitingFrame* CreateStopWaitingFrame() override;
+ virtual void OnSerializedPacket(const SerializedPacket& packet) override;
// QuicSentPacketManager::NetworkChangeVisitor
virtual void OnCongestionWindowChange(
- QuicByteCount congestion_window) OVERRIDE;
+ QuicByteCount congestion_window) override;
// Called by the crypto stream when the handshake completes. In the server's
// case this is when the SHLO has been ACKed. Clients call this on receipt of
@@ -713,6 +713,9 @@
// sent with the INITIAL encryption and the CHLO message was lost.
std::deque<QuicEncryptedPacket*> undecryptable_packets_;
+ // Maximum number of undecryptable packets the connection will store.
+ size_t max_undecryptable_packets_;
+
// When the version negotiation packet could not be sent because the socket
// was not writable, this is set to true.
bool pending_version_negotiation_packet_;
diff --git a/net/quic/quic_connection_helper.cc b/net/quic/quic_connection_helper.cc
index fefd6fa..83c1648 100644
--- a/net/quic/quic_connection_helper.cc
+++ b/net/quic/quic_connection_helper.cc
@@ -29,7 +29,7 @@
weak_factory_(this) {}
protected:
- virtual void SetImpl() OVERRIDE {
+ virtual void SetImpl() override {
DCHECK(deadline().IsInitialized());
if (task_deadline_.IsInitialized()) {
if (task_deadline_ <= deadline()) {
@@ -54,7 +54,7 @@
task_deadline_ = deadline();
}
- virtual void CancelImpl() OVERRIDE {
+ virtual void CancelImpl() override {
DCHECK(!deadline().IsInitialized());
// Since tasks can not be un-posted, OnAlarm will be invoked which
// will notice that deadline is not Initialized and will do nothing.
diff --git a/net/quic/quic_connection_helper.h b/net/quic/quic_connection_helper.h
index 28cff52..e1754e5 100644
--- a/net/quic/quic_connection_helper.h
+++ b/net/quic/quic_connection_helper.h
@@ -37,9 +37,9 @@
virtual ~QuicConnectionHelper();
// QuicConnectionHelperInterface
- virtual const QuicClock* GetClock() const OVERRIDE;
- virtual QuicRandom* GetRandomGenerator() OVERRIDE;
- virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) OVERRIDE;
+ virtual const QuicClock* GetClock() const override;
+ virtual QuicRandom* GetRandomGenerator() override;
+ virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
private:
base::TaskRunner* task_runner_;
diff --git a/net/quic/quic_connection_helper_test.cc b/net/quic/quic_connection_helper_test.cc
index 638ca46..8a2c931 100644
--- a/net/quic/quic_connection_helper_test.cc
+++ b/net/quic/quic_connection_helper_test.cc
@@ -17,7 +17,7 @@
public:
TestDelegate() : fired_(false) {}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
fired_ = true;
return QuicTime::Zero();
}
diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc
index 4e40417..b5ca18b 100644
--- a/net/quic/quic_connection_logger.cc
+++ b/net/quic/quic_connection_logger.cc
@@ -46,24 +46,22 @@
}
base::Value* NetLogQuicPacketSentCallback(
- QuicPacketSequenceNumber sequence_number,
+ const SerializedPacket& serialized_packet,
QuicPacketSequenceNumber original_sequence_number,
EncryptionLevel level,
TransmissionType transmission_type,
size_t packet_size,
- WriteResult result,
+ QuicTime sent_time,
NetLog::LogLevel /* log_level */) {
base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetInteger("encryption_level", level);
dict->SetInteger("transmission_type", transmission_type);
dict->SetString("packet_sequence_number",
- base::Uint64ToString(sequence_number));
+ base::Uint64ToString(serialized_packet.sequence_number));
dict->SetString("original_sequence_number",
base::Uint64ToString(original_sequence_number));
dict->SetInteger("size", packet_size);
- if (result.status != WRITE_STATUS_OK) {
- dict->SetInteger("net_error", result.error_code);
- }
+ dict->SetInteger("sent_time_us", sent_time.ToDebuggingValue());
return dict;
}
@@ -324,8 +322,10 @@
} // namespace
-QuicConnectionLogger::QuicConnectionLogger(const BoundNetLog& net_log)
+QuicConnectionLogger::QuicConnectionLogger(QuicSession* session,
+ const BoundNetLog& net_log)
: net_log_(net_log),
+ session_(session),
last_received_packet_sequence_number_(0),
last_received_packet_size_(0),
largest_received_packet_sequence_number_(0),
@@ -454,6 +454,10 @@
frame.stop_waiting_frame));
break;
case PING_FRAME:
+ UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ConnectionFlowControlBlocked",
+ session_->IsConnectionFlowControlBlocked());
+ UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.StreamFlowControlBlocked",
+ session_->IsStreamFlowControlBlocked());
// PingFrame has no contents to log, so just record that it was sent.
net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PING_FRAME_SENT);
break;
@@ -463,17 +467,17 @@
}
void QuicConnectionLogger::OnPacketSent(
- QuicPacketSequenceNumber sequence_number,
+ const SerializedPacket& serialized_packet,
QuicPacketSequenceNumber original_sequence_number,
EncryptionLevel level,
TransmissionType transmission_type,
const QuicEncryptedPacket& packet,
- WriteResult result) {
+ QuicTime sent_time) {
net_log_.AddEvent(
NetLog::TYPE_QUIC_SESSION_PACKET_SENT,
- base::Bind(&NetLogQuicPacketSentCallback, sequence_number,
+ base::Bind(&NetLogQuicPacketSentCallback, serialized_packet,
original_sequence_number, level, transmission_type,
- packet.length(), result));
+ packet.length(), sent_time));
}
void QuicConnectionLogger::OnPacketReceived(const IPEndPoint& self_address,
diff --git a/net/quic/quic_connection_logger.h b/net/quic/quic_connection_logger.h
index 7693d79..c714e3b 100644
--- a/net/quic/quic_connection_logger.h
+++ b/net/quic/quic_connection_logger.h
@@ -12,6 +12,7 @@
#include "net/base/network_change_notifier.h"
#include "net/quic/quic_connection.h"
#include "net/quic/quic_protocol.h"
+#include "net/quic/quic_session.h"
namespace net {
namespace test {
@@ -26,51 +27,51 @@
class NET_EXPORT_PRIVATE QuicConnectionLogger
: public QuicConnectionDebugVisitor {
public:
- explicit QuicConnectionLogger(const BoundNetLog& net_log);
+ QuicConnectionLogger(QuicSession* session, const BoundNetLog& net_log);
virtual ~QuicConnectionLogger();
// QuicPacketGenerator::DebugDelegateInterface
- virtual void OnFrameAddedToPacket(const QuicFrame& frame) OVERRIDE;
+ virtual void OnFrameAddedToPacket(const QuicFrame& frame) override;
// QuicConnectionDebugVisitorInterface
- virtual void OnPacketSent(QuicPacketSequenceNumber sequence_number,
+ virtual void OnPacketSent(const SerializedPacket& serialized_packet,
QuicPacketSequenceNumber original_sequence_number,
EncryptionLevel level,
TransmissionType transmission_type,
const QuicEncryptedPacket& packet,
- WriteResult result) OVERRIDE;
+ QuicTime sent_time) override;
virtual void OnPacketReceived(const IPEndPoint& self_address,
const IPEndPoint& peer_address,
- const QuicEncryptedPacket& packet) OVERRIDE;
+ const QuicEncryptedPacket& packet) override;
virtual void OnIncorrectConnectionId(
- QuicConnectionId connection_id) OVERRIDE;
- virtual void OnUndecryptablePacket() OVERRIDE;
+ QuicConnectionId connection_id) override;
+ virtual void OnUndecryptablePacket() override;
virtual void OnDuplicatePacket(QuicPacketSequenceNumber sequence_number)
- OVERRIDE;
- virtual void OnProtocolVersionMismatch(QuicVersion version) OVERRIDE;
- virtual void OnPacketHeader(const QuicPacketHeader& header) OVERRIDE;
- virtual void OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE;
- virtual void OnAckFrame(const QuicAckFrame& frame) OVERRIDE;
+ override;
+ virtual void OnProtocolVersionMismatch(QuicVersion version) override;
+ virtual void OnPacketHeader(const QuicPacketHeader& header) override;
+ virtual void OnStreamFrame(const QuicStreamFrame& frame) override;
+ virtual void OnAckFrame(const QuicAckFrame& frame) override;
virtual void OnCongestionFeedbackFrame(
- const QuicCongestionFeedbackFrame& frame) OVERRIDE;
- virtual void OnStopWaitingFrame(const QuicStopWaitingFrame& frame) OVERRIDE;
- virtual void OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE;
+ const QuicCongestionFeedbackFrame& frame) override;
+ virtual void OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override;
+ virtual void OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
virtual void OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) OVERRIDE;
- virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) OVERRIDE;
- virtual void OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE;
- virtual void OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE;
- virtual void OnPingFrame(const QuicPingFrame& frame) OVERRIDE;
+ const QuicConnectionCloseFrame& frame) override;
+ virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
+ virtual void OnBlockedFrame(const QuicBlockedFrame& frame) override;
+ virtual void OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
+ virtual void OnPingFrame(const QuicPingFrame& frame) override;
virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) OVERRIDE;
+ const QuicPublicResetPacket& packet) override;
virtual void OnVersionNegotiationPacket(
- const QuicVersionNegotiationPacket& packet) OVERRIDE;
+ const QuicVersionNegotiationPacket& packet) override;
virtual void OnRevivedPacket(const QuicPacketHeader& revived_header,
- base::StringPiece payload) OVERRIDE;
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE;
+ base::StringPiece payload) override;
+ virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
virtual void OnSuccessfulVersionNegotiation(
- const QuicVersion& version) OVERRIDE;
+ const QuicVersion& version) override;
void OnCryptoHandshakeMessageReceived(
const CryptoHandshakeMessage& message);
@@ -119,6 +120,7 @@
void RecordLossHistograms() const;
BoundNetLog net_log_;
+ QuicSession* session_; // Unowned.
// The last packet sequence number received.
QuicPacketSequenceNumber last_received_packet_sequence_number_;
// The size of the most recently received packet.
diff --git a/net/quic/quic_connection_logger_unittest.cc b/net/quic/quic_connection_logger_unittest.cc
index 9f9cd9a..dbba7d7 100644
--- a/net/quic/quic_connection_logger_unittest.cc
+++ b/net/quic/quic_connection_logger_unittest.cc
@@ -19,7 +19,7 @@
class QuicConnectionLoggerTest : public ::testing::Test {
protected:
- QuicConnectionLoggerTest() : logger_(net_log_) {}
+ QuicConnectionLoggerTest() : logger_(nullptr, net_log_) {}
BoundNetLog net_log_;
QuicConnectionLogger logger_;
diff --git a/net/quic/quic_connection_stats.h b/net/quic/quic_connection_stats.h
index 1cb8ca7..c681dea 100644
--- a/net/quic/quic_connection_stats.h
+++ b/net/quic/quic_connection_stats.h
@@ -51,8 +51,8 @@
uint32 rto_count; // Count of times the rto timer fired.
uint32 spurious_rto_count;
- uint32 min_rtt_us; // Minimum RTT in microseconds.
- uint32 srtt_us; // Smoothed RTT in microseconds.
+ int64 min_rtt_us; // Minimum RTT in microseconds.
+ int64 srtt_us; // Smoothed RTT in microseconds.
uint32 max_packet_size; // In bytes.
uint64 estimated_bandwidth; // In bytes per second.
uint32 congestion_window; // In bytes
@@ -64,7 +64,7 @@
// Maximum reordering observed in sequence space.
uint32 max_sequence_reordering;
// Maximum reordering observed in microseconds
- uint32 max_time_reordering_us;
+ int64 max_time_reordering_us;
// The following stats are used only in TcpCubicSender.
// The number of loss events from TCP's perspective. Each loss event includes
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index 2869513..b084428 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -93,15 +93,15 @@
virtual ~TaggingEncrypter() {}
// QuicEncrypter interface.
- virtual bool SetKey(StringPiece key) OVERRIDE { return true; }
- virtual bool SetNoncePrefix(StringPiece nonce_prefix) OVERRIDE {
+ virtual bool SetKey(StringPiece key) override { return true; }
+ virtual bool SetNoncePrefix(StringPiece nonce_prefix) override {
return true;
}
virtual bool Encrypt(StringPiece nonce,
StringPiece associated_data,
StringPiece plaintext,
- unsigned char* output) OVERRIDE {
+ unsigned char* output) override {
memcpy(output, plaintext.data(), plaintext.size());
output += plaintext.size();
memset(output, tag_, kTagSize);
@@ -110,29 +110,29 @@
virtual QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
StringPiece associated_data,
- StringPiece plaintext) OVERRIDE {
+ StringPiece plaintext) override {
const size_t len = plaintext.size() + kTagSize;
uint8* buffer = new uint8[len];
Encrypt(StringPiece(), associated_data, plaintext, buffer);
return new QuicData(reinterpret_cast<char*>(buffer), len, true);
}
- virtual size_t GetKeySize() const OVERRIDE { return 0; }
- virtual size_t GetNoncePrefixSize() const OVERRIDE { return 0; }
+ virtual size_t GetKeySize() const override { return 0; }
+ virtual size_t GetNoncePrefixSize() const override { return 0; }
- virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const OVERRIDE {
+ virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const override {
return ciphertext_size - kTagSize;
}
- virtual size_t GetCiphertextSize(size_t plaintext_size) const OVERRIDE {
+ virtual size_t GetCiphertextSize(size_t plaintext_size) const override {
return plaintext_size + kTagSize;
}
- virtual StringPiece GetKey() const OVERRIDE {
+ virtual StringPiece GetKey() const override {
return StringPiece();
}
- virtual StringPiece GetNoncePrefix() const OVERRIDE {
+ virtual StringPiece GetNoncePrefix() const override {
return StringPiece();
}
@@ -153,8 +153,8 @@
virtual ~TaggingDecrypter() {}
// QuicDecrypter interface
- virtual bool SetKey(StringPiece key) OVERRIDE { return true; }
- virtual bool SetNoncePrefix(StringPiece nonce_prefix) OVERRIDE {
+ virtual bool SetKey(StringPiece key) override { return true; }
+ virtual bool SetNoncePrefix(StringPiece nonce_prefix) override {
return true;
}
@@ -162,7 +162,7 @@
StringPiece associated_data,
StringPiece ciphertext,
unsigned char* output,
- size_t* output_length) OVERRIDE {
+ size_t* output_length) override {
if (ciphertext.size() < kTagSize) {
return false;
}
@@ -176,7 +176,7 @@
virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
StringPiece associated_data,
- StringPiece ciphertext) OVERRIDE {
+ StringPiece ciphertext) override {
if (ciphertext.size() < kTagSize) {
return nullptr;
}
@@ -190,8 +190,8 @@
true /* owns buffer */);
}
- virtual StringPiece GetKey() const OVERRIDE { return StringPiece(); }
- virtual StringPiece GetNoncePrefix() const OVERRIDE { return StringPiece(); }
+ virtual StringPiece GetKey() const override { return StringPiece(); }
+ virtual StringPiece GetNoncePrefix() const override { return StringPiece(); }
protected:
virtual uint8 GetTag(StringPiece ciphertext) {
@@ -222,7 +222,7 @@
virtual ~StrictTaggingDecrypter() {}
// TaggingQuicDecrypter
- virtual uint8 GetTag(StringPiece ciphertext) OVERRIDE {
+ virtual uint8 GetTag(StringPiece ciphertext) override {
return tag_;
}
@@ -238,8 +238,8 @@
: QuicAlarm(delegate) {
}
- virtual void SetImpl() OVERRIDE {}
- virtual void CancelImpl() OVERRIDE {}
+ virtual void SetImpl() override {}
+ virtual void CancelImpl() override {}
using QuicAlarm::Fire;
};
@@ -250,15 +250,15 @@
}
// QuicConnectionHelperInterface
- virtual const QuicClock* GetClock() const OVERRIDE {
+ virtual const QuicClock* GetClock() const override {
return clock_;
}
- virtual QuicRandom* GetRandomGenerator() OVERRIDE {
+ virtual QuicRandom* GetRandomGenerator() override {
return random_generator_;
}
- virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) OVERRIDE {
+ virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override {
return new TestAlarm(delegate);
}
@@ -288,7 +288,7 @@
virtual WriteResult WritePacket(
const char* buffer, size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE {
+ const IPEndPoint& peer_address) override {
QuicEncryptedPacket packet(buffer, buf_len);
++packets_write_attempts_;
@@ -313,13 +313,13 @@
return WriteResult(WRITE_STATUS_OK, last_packet_size_);
}
- virtual bool IsWriteBlockedDataBuffered() const OVERRIDE {
+ virtual bool IsWriteBlockedDataBuffered() const override {
return is_write_blocked_data_buffered_;
}
- virtual bool IsWriteBlocked() const OVERRIDE { return write_blocked_; }
+ virtual bool IsWriteBlocked() const override { return write_blocked_; }
- virtual void SetWritable() OVERRIDE { write_blocked_ = false; }
+ virtual void SetWritable() override { write_blocked_ = false; }
void BlockOnNextWrite() { block_on_next_write_ = true; }
@@ -591,7 +591,7 @@
: public QuicConnectionDebugVisitor {
public:
virtual void OnRevivedPacket(const QuicPacketHeader& header,
- StringPiece data) OVERRIDE {
+ StringPiece data) override {
revived_header_ = header;
}
@@ -2416,19 +2416,22 @@
}
TEST_P(QuicConnectionTest, BufferNonDecryptablePackets) {
+ // SetFromConfig is always called after construction from InitializeSession.
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ QuicConfig config;
+ connection_.SetFromConfig(config);
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
use_tagging_decrypter();
const uint8 tag = 0x07;
framer_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
- // Process an encrypted packet which can not yet be decrypted
- // which should result in the packet being buffered.
+ // Process an encrypted packet which can not yet be decrypted which should
+ // result in the packet being buffered.
ProcessDataPacketAtLevel(1, 0, kEntropyFlag, ENCRYPTION_INITIAL);
- // Transition to the new encryption state and process another
- // encrypted packet which should result in the original packet being
- // processed.
+ // Transition to the new encryption state and process another encrypted packet
+ // which should result in the original packet being processed.
connection_.SetDecrypter(new StrictTaggingDecrypter(tag),
ENCRYPTION_INITIAL);
connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL);
@@ -2436,12 +2439,44 @@
EXPECT_CALL(visitor_, OnStreamFrames(_)).Times(2);
ProcessDataPacketAtLevel(2, 0, kEntropyFlag, ENCRYPTION_INITIAL);
- // Finally, process a third packet and note that we do not
- // reprocess the buffered packet.
+ // Finally, process a third packet and note that we do not reprocess the
+ // buffered packet.
EXPECT_CALL(visitor_, OnStreamFrames(_)).Times(1);
ProcessDataPacketAtLevel(3, 0, kEntropyFlag, ENCRYPTION_INITIAL);
}
+TEST_P(QuicConnectionTest, Buffer100NonDecryptablePackets) {
+ // SetFromConfig is always called after construction from InitializeSession.
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ QuicConfig config;
+ config.set_max_undecryptable_packets(100);
+ connection_.SetFromConfig(config);
+ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
+ use_tagging_decrypter();
+
+ const uint8 tag = 0x07;
+ framer_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
+
+ // Process an encrypted packet which can not yet be decrypted which should
+ // result in the packet being buffered.
+ for (QuicPacketSequenceNumber i = 1; i <= 100; ++i) {
+ ProcessDataPacketAtLevel(i, 0, kEntropyFlag, ENCRYPTION_INITIAL);
+ }
+
+ // Transition to the new encryption state and process another encrypted packet
+ // which should result in the original packets being processed.
+ connection_.SetDecrypter(new StrictTaggingDecrypter(tag), ENCRYPTION_INITIAL);
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL);
+ connection_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).Times(101);
+ ProcessDataPacketAtLevel(101, 0, kEntropyFlag, ENCRYPTION_INITIAL);
+
+ // Finally, process a third packet and note that we do not reprocess the
+ // buffered packet.
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).Times(1);
+ ProcessDataPacketAtLevel(102, 0, kEntropyFlag, ENCRYPTION_INITIAL);
+}
+
TEST_P(QuicConnectionTest, TestRetransmitOrder) {
QuicByteCount first_packet_size;
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).WillOnce(
@@ -2682,7 +2717,6 @@
// SetFromConfig sets the initial timeouts before negotiation.
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
QuicConfig config;
- config.SetDefaults();
connection_.SetFromConfig(config);
// Subtract a second from the idle timeout on the client side.
QuicTime default_timeout = clock_.ApproximateNow().Add(
@@ -2835,7 +2869,6 @@
EXPECT_TRUE(connection_.connected());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
QuicConfig config;
- config.SetDefaults();
connection_.SetFromConfig(config);
const QuicTime::Delta initial_idle_timeout =
@@ -3924,12 +3957,12 @@
void(const QuicFrame&));
MOCK_METHOD6(OnPacketSent,
- void(QuicPacketSequenceNumber,
+ void(const SerializedPacket&,
QuicPacketSequenceNumber,
EncryptionLevel,
TransmissionType,
const QuicEncryptedPacket&,
- WriteResult));
+ QuicTime));
MOCK_METHOD3(OnPacketReceived,
void(const IPEndPoint&,
diff --git a/net/quic/quic_crypto_client_stream.h b/net/quic/quic_crypto_client_stream.h
index 96d2556..801c3da 100644
--- a/net/quic/quic_crypto_client_stream.h
+++ b/net/quic/quic_crypto_client_stream.h
@@ -33,7 +33,7 @@
// CryptoFramerVisitorInterface implementation
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE;
+ const CryptoHandshakeMessage& message) override;
// Performs a crypto handshake with the server. Returns true if the crypto
// handshake is started successfully.
@@ -62,7 +62,7 @@
virtual ~ChannelIDSourceCallbackImpl();
// ChannelIDSourceCallback interface.
- virtual void Run(scoped_ptr<ChannelIDKey>* channel_id_key) OVERRIDE;
+ virtual void Run(scoped_ptr<ChannelIDKey>* channel_id_key) override;
// Cancel causes any future callbacks to be ignored. It must be called on
// the same thread as the callback will be made on.
@@ -83,7 +83,7 @@
// ProofVerifierCallback interface.
virtual void Run(bool ok,
const string& error_details,
- scoped_ptr<ProofVerifyDetails>* details) OVERRIDE;
+ scoped_ptr<ProofVerifyDetails>* details) override;
// Cancel causes any future callbacks to be ignored. It must be called on
// the same thread as the callback will be made on.
diff --git a/net/quic/quic_crypto_client_stream_test.cc b/net/quic/quic_crypto_client_stream_test.cc
index 5a8b08c..1df2313 100644
--- a/net/quic/quic_crypto_client_stream_test.cc
+++ b/net/quic/quic_crypto_client_stream_test.cc
@@ -34,8 +34,6 @@
stream_(new QuicCryptoClientStream(server_id_, session_.get(), nullptr,
&crypto_config_)) {
session_->SetCryptoStream(stream_.get());
- session_->config()->SetDefaults();
- crypto_config_.SetDefaults();
}
void CompleteCryptoHandshake() {
@@ -127,7 +125,6 @@
&crypto_config_));
session_->SetCryptoStream(stream_.get());
- session_->config()->SetDefaults();
// Advance time 5 years to ensure that we pass the expiry time of the cached
// server config.
diff --git a/net/quic/quic_crypto_server_stream.cc b/net/quic/quic_crypto_server_stream.cc
index eebab90..e912c32 100644
--- a/net/quic/quic_crypto_server_stream.cc
+++ b/net/quic/quic_crypto_server_stream.cc
@@ -11,6 +11,7 @@
#include "net/quic/crypto/quic_crypto_server_config.h"
#include "net/quic/crypto/source_address_token.h"
#include "net/quic/quic_config.h"
+#include "net/quic/quic_flags.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_session.h"
@@ -152,11 +153,12 @@
// Now that the handshake is complete, send an updated server config and
// source-address token to the client.
- SendServerConfigUpdate(nullptr);
+ SendServerConfigUpdate(previous_cached_network_params_.get(), true);
}
void QuicCryptoServerStream::SendServerConfigUpdate(
- const CachedNetworkParameters* cached_network_params) {
+ const CachedNetworkParameters* cached_network_params,
+ bool on_handshake_complete) {
if (session()->connection()->version() <= QUIC_VERSION_21 ||
!handshake_confirmed_) {
return;
@@ -174,7 +176,8 @@
return;
}
- DVLOG(1) << "Server: Sending server config update: "
+ DVLOG(1) << "Server: Sending server config update"
+ << (on_handshake_complete ? " immediately after handshake: " : ": ")
<< server_config_update_message.DebugString();
const QuicData& data = server_config_update_message.GetSerialized();
WriteOrBufferData(string(data.data(), data.length()), false, nullptr);
@@ -221,6 +224,13 @@
const ValidateClientHelloResultCallback::Result& result,
CryptoHandshakeMessage* reply,
string* error_details) {
+ // Store the bandwidth estimate from the client.
+ if (FLAGS_quic_store_cached_network_params_from_chlo &&
+ result.cached_network_params.bandwidth_estimate_bytes_per_second() > 0) {
+ previous_cached_network_params_.reset(
+ new CachedNetworkParameters(result.cached_network_params));
+ }
+
return crypto_config_.ProcessClientHello(
result,
session()->connection()->connection_id(),
diff --git a/net/quic/quic_crypto_server_stream.h b/net/quic/quic_crypto_server_stream.h
index 46ac4f3..5d55564 100644
--- a/net/quic/quic_crypto_server_stream.h
+++ b/net/quic/quic_crypto_server_stream.h
@@ -38,7 +38,7 @@
int num_original_bytes,
int num_retransmitted_packets,
int num_retransmitted_bytes,
- QuicTime::Delta delta_largest_observed) OVERRIDE;
+ QuicTime::Delta delta_largest_observed) override;
private:
virtual ~ServerHelloNotifier() {}
@@ -60,7 +60,7 @@
// CryptoFramerVisitorInterface implementation
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE;
+ const CryptoHandshakeMessage& message) override;
// GetBase64SHA256ClientChannelID sets |*output| to the base64 encoded,
// SHA-256 hash of the client's ChannelID key and returns true, if the client
@@ -74,8 +74,11 @@
}
// Sends the latest server config and source-address token to the client.
+ // |on_handshake_complete| is true when this is called immediately after
+ // handshake completes, and should be false for subsequent updates.
virtual void SendServerConfigUpdate(
- const CachedNetworkParameters* cached_network_params);
+ const CachedNetworkParameters* cached_network_params,
+ bool on_handshake_complete);
// Called by the ServerHello AckNotifier once the SHLO has been ACKed by the
// client.
@@ -103,7 +106,7 @@
// From ValidateClientHelloResultCallback
virtual void RunImpl(const CryptoHandshakeMessage& client_hello,
- const Result& result) OVERRIDE;
+ const Result& result) override;
private:
QuicCryptoServerStream* parent_;
@@ -133,6 +136,11 @@
// Number of server config update (SCUP) messages sent by this stream.
int num_server_config_update_messages_sent_;
+ // If the client provides CachedNetworkParameters in the STK in the CHLO, then
+ // store here, and send back in future STKs if we have no better bandwidth
+ // estimate to send.
+ scoped_ptr<CachedNetworkParameters> previous_cached_network_params_;
+
DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream);
};
diff --git a/net/quic/quic_crypto_server_stream_test.cc b/net/quic/quic_crypto_server_stream_test.cc
index 6ce059b..38b4a57 100644
--- a/net/quic/quic_crypto_server_stream_test.cc
+++ b/net/quic/quic_crypto_server_stream_test.cc
@@ -61,8 +61,6 @@
QuicRandom::GetInstance()),
stream_(crypto_config_, &session_),
strike_register_client_(nullptr) {
- config_.SetDefaults();
- session_.config()->SetDefaults();
session_.SetCryptoStream(&stream_);
// We advance the clock initially because the default time is zero and the
// strike register worries that we've just overflowed a uint32 time.
@@ -141,11 +139,9 @@
server_conn->AdvanceTime(QuicTime::Delta::FromSeconds(100000));
QuicConfig client_config;
- client_config.SetDefaults();
scoped_ptr<TestClientSession> client_session(
new TestClientSession(client_conn, client_config));
QuicCryptoClientConfig client_crypto_config;
- client_crypto_config.SetDefaults();
QuicServerId server_id(kServerHostname, kServerPort, false,
PRIVACY_MODE_DISABLED);
@@ -277,7 +273,7 @@
TEST_P(QuicCryptoServerStreamTest, OnlySendSCUPAfterHandshakeComplete) {
// An attempt to send a SCUP before completing handshake should fail.
- stream_.SendServerConfigUpdate(nullptr);
+ stream_.SendServerConfigUpdate(nullptr, false);
EXPECT_EQ(0, stream_.num_server_config_update_messages_sent());
}
diff --git a/net/quic/quic_crypto_stream.h b/net/quic/quic_crypto_stream.h
index dc8b227..6698e3e 100644
--- a/net/quic/quic_crypto_stream.h
+++ b/net/quic/quic_crypto_stream.h
@@ -34,13 +34,13 @@
explicit QuicCryptoStream(QuicSession* session);
// CryptoFramerVisitorInterface implementation
- virtual void OnError(CryptoFramer* framer) OVERRIDE;
+ virtual void OnError(CryptoFramer* framer) override;
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE;
+ const CryptoHandshakeMessage& message) override;
// ReliableQuicStream implementation
- virtual uint32 ProcessRawData(const char* data, uint32 data_len) OVERRIDE;
- virtual QuicPriority EffectivePriority() const OVERRIDE;
+ virtual uint32 ProcessRawData(const char* data, uint32 data_len) override;
+ virtual QuicPriority EffectivePriority() const override;
// Sends |message| to the peer.
// TODO(wtc): return a success/failure status.
diff --git a/net/quic/quic_crypto_stream_test.cc b/net/quic/quic_crypto_stream_test.cc
index 4ea8f49..e79a1f3 100644
--- a/net/quic/quic_crypto_stream_test.cc
+++ b/net/quic/quic_crypto_stream_test.cc
@@ -30,7 +30,7 @@
}
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE {
+ const CryptoHandshakeMessage& message) override {
messages_.push_back(message);
}
diff --git a/net/quic/quic_data_stream.h b/net/quic/quic_data_stream.h
index 1af9004..7cb9816 100644
--- a/net/quic/quic_data_stream.h
+++ b/net/quic/quic_data_stream.h
@@ -57,13 +57,13 @@
virtual ~QuicDataStream();
// ReliableQuicStream implementation
- virtual void OnClose() OVERRIDE;
- virtual uint32 ProcessRawData(const char* data, uint32 data_len) OVERRIDE;
+ virtual void OnClose() override;
+ virtual uint32 ProcessRawData(const char* data, uint32 data_len) override;
// By default, this is the same as priority(), however it allows streams
// to temporarily alter effective priority. For example if a SPDY stream has
// compressed but not written headers it can write the headers with a higher
// priority.
- virtual QuicPriority EffectivePriority() const OVERRIDE;
+ virtual QuicPriority EffectivePriority() const override;
// Overridden by subclasses to process data. The headers will be delivered
// via OnStreamHeaders, so only data will be delivered through this method.
diff --git a/net/quic/quic_data_stream_test.cc b/net/quic/quic_data_stream_test.cc
index 279dcd3..2f6d84e 100644
--- a/net/quic/quic_data_stream_test.cc
+++ b/net/quic/quic_data_stream_test.cc
@@ -40,7 +40,7 @@
: QuicDataStream(id, session),
should_process_data_(should_process_data) {}
- virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE {
+ virtual uint32 ProcessData(const char* data, uint32 data_len) override {
EXPECT_NE(0u, data_len);
DVLOG(1) << "ProcessData data_len: " << data_len;
data_ += string(data, data_len);
diff --git a/net/quic/quic_default_packet_writer.h b/net/quic/quic_default_packet_writer.h
index 15eb0dd..329f7cc 100644
--- a/net/quic/quic_default_packet_writer.h
+++ b/net/quic/quic_default_packet_writer.h
@@ -29,10 +29,10 @@
virtual WriteResult WritePacket(const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
- virtual bool IsWriteBlockedDataBuffered() const OVERRIDE;
- virtual bool IsWriteBlocked() const OVERRIDE;
- virtual void SetWritable() OVERRIDE;
+ const IPEndPoint& peer_address) override;
+ virtual bool IsWriteBlockedDataBuffered() const override;
+ virtual bool IsWriteBlocked() const override;
+ virtual void SetWritable() override;
void OnWriteComplete(int rv);
void SetConnection(QuicConnection* connection) {
diff --git a/net/quic/quic_dispatcher.cc b/net/quic/quic_dispatcher.cc
index a72faa6..121e32f 100644
--- a/net/quic/quic_dispatcher.cc
+++ b/net/quic/quic_dispatcher.cc
@@ -28,7 +28,7 @@
: dispatcher_(dispatcher) {
}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
dispatcher_->DeleteSessions();
return QuicTime::Zero();
}
@@ -44,23 +44,23 @@
connection_id_(0) {}
// QuicFramerVisitorInterface implementation
- virtual void OnPacket() OVERRIDE {}
+ virtual void OnPacket() override {}
virtual bool OnUnauthenticatedPublicHeader(
- const QuicPacketPublicHeader& header) OVERRIDE {
+ const QuicPacketPublicHeader& header) override {
connection_id_ = header.connection_id;
return dispatcher_->OnUnauthenticatedPublicHeader(header);
}
virtual bool OnUnauthenticatedHeader(
- const QuicPacketHeader& header) OVERRIDE {
+ const QuicPacketHeader& header) override {
dispatcher_->OnUnauthenticatedHeader(header);
return false;
}
- virtual void OnError(QuicFramer* framer) OVERRIDE {
+ virtual void OnError(QuicFramer* framer) override {
DVLOG(1) << QuicUtils::ErrorToString(framer->error());
}
virtual bool OnProtocolVersionMismatch(
- QuicVersion /*received_version*/) OVERRIDE {
+ QuicVersion /*received_version*/) override {
if (dispatcher_->time_wait_list_manager()->IsConnectionIdInTimeWait(
connection_id_)) {
// Keep processing after protocol mismatch - this will be dealt with by
@@ -77,74 +77,74 @@
// false from OnUnauthenticatedHeader(). As a result, we never process the
// payload of the packet.
virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& /*packet*/) OVERRIDE {
+ const QuicPublicResetPacket& /*packet*/) override {
DCHECK(false);
}
virtual void OnVersionNegotiationPacket(
- const QuicVersionNegotiationPacket& /*packet*/) OVERRIDE {
+ const QuicVersionNegotiationPacket& /*packet*/) override {
DCHECK(false);
}
- virtual void OnDecryptedPacket(EncryptionLevel level) OVERRIDE {
+ virtual void OnDecryptedPacket(EncryptionLevel level) override {
DCHECK(false);
}
- virtual bool OnPacketHeader(const QuicPacketHeader& /*header*/) OVERRIDE {
+ virtual bool OnPacketHeader(const QuicPacketHeader& /*header*/) override {
DCHECK(false);
return false;
}
- virtual void OnRevivedPacket() OVERRIDE {
+ virtual void OnRevivedPacket() override {
DCHECK(false);
}
- virtual void OnFecProtectedPayload(StringPiece /*payload*/) OVERRIDE {
+ virtual void OnFecProtectedPayload(StringPiece /*payload*/) override {
DCHECK(false);
}
- virtual bool OnStreamFrame(const QuicStreamFrame& /*frame*/) OVERRIDE {
+ virtual bool OnStreamFrame(const QuicStreamFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnAckFrame(const QuicAckFrame& /*frame*/) OVERRIDE {
+ virtual bool OnAckFrame(const QuicAckFrame& /*frame*/) override {
DCHECK(false);
return false;
}
virtual bool OnCongestionFeedbackFrame(
- const QuicCongestionFeedbackFrame& /*frame*/) OVERRIDE {
+ const QuicCongestionFeedbackFrame& /*frame*/) override {
DCHECK(false);
return false;
}
virtual bool OnStopWaitingFrame(
- const QuicStopWaitingFrame& /*frame*/) OVERRIDE {
+ const QuicStopWaitingFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnPingFrame(const QuicPingFrame& /*frame*/) OVERRIDE {
+ virtual bool OnPingFrame(const QuicPingFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) OVERRIDE {
+ virtual bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) override {
DCHECK(false);
return false;
}
virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame & /*frame*/) OVERRIDE {
+ const QuicConnectionCloseFrame & /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) OVERRIDE {
+ virtual bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) override {
DCHECK(false);
return false;
}
virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/)
- OVERRIDE {
+ override {
DCHECK(false);
return false;
}
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE {
+ virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
DCHECK(false);
return false;
}
- virtual void OnFecData(const QuicFecData& /*fec*/) OVERRIDE {
+ virtual void OnFecData(const QuicFecData& /*fec*/) override {
DCHECK(false);
}
- virtual void OnPacketComplete() OVERRIDE {
+ virtual void OnPacketComplete() override {
DCHECK(false);
}
diff --git a/net/quic/quic_dispatcher.h b/net/quic/quic_dispatcher.h
index d07c46c..b4be0ee 100644
--- a/net/quic/quic_dispatcher.h
+++ b/net/quic/quic_dispatcher.h
@@ -64,7 +64,7 @@
virtual QuicPacketWriter* Create(
QuicServerPacketWriter* writer,
- QuicConnection* connection) OVERRIDE;
+ QuicConnection* connection) override;
};
// Ideally we'd have a linked_hash_set: the boolean is unused.
@@ -89,7 +89,7 @@
// an existing session, or passing it to the TimeWaitListManager.
virtual void ProcessPacket(const IPEndPoint& server_address,
const IPEndPoint& client_address,
- const QuicEncryptedPacket& packet) OVERRIDE;
+ const QuicEncryptedPacket& packet) override;
// Returns true if there's anything in the blocked writer list.
virtual bool HasPendingWrites() const;
@@ -99,16 +99,16 @@
// QuicBlockedWriterInterface implementation:
// Called when the socket becomes writable to allow queued writes to happen.
- virtual void OnCanWrite() OVERRIDE;
+ virtual void OnCanWrite() override;
// QuicServerSessionVisitor interface implementation:
// Ensure that the closed connection is cleaned up asynchronously.
virtual void OnConnectionClosed(QuicConnectionId connection_id,
- QuicErrorCode error) OVERRIDE;
+ QuicErrorCode error) override;
// Queues the blocked writer for later resumption.
virtual void OnWriteBlocked(
- QuicBlockedWriterInterface* blocked_writer) OVERRIDE;
+ QuicBlockedWriterInterface* blocked_writer) override;
typedef base::hash_map<QuicConnectionId, QuicSession*> SessionMap;
@@ -185,7 +185,7 @@
PacketWriterFactoryAdapter(QuicDispatcher* dispatcher);
virtual ~PacketWriterFactoryAdapter ();
- virtual QuicPacketWriter* Create(QuicConnection* connection) const OVERRIDE;
+ virtual QuicPacketWriter* Create(QuicConnection* connection) const override;
private:
QuicDispatcher* dispatcher_;
diff --git a/net/quic/quic_end_to_end_unittest.cc b/net/quic/quic_end_to_end_unittest.cc
index a37bd19..b589bc6 100644
--- a/net/quic/quic_end_to_end_unittest.cc
+++ b/net/quic/quic_end_to_end_unittest.cc
@@ -7,6 +7,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/test_completion_callback.h"
#include "net/base/upload_bytes_element_reader.h"
#include "net/base/upload_data_stream.h"
@@ -53,16 +54,16 @@
// HttpTransactionFactory methods
virtual int CreateTransaction(RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) OVERRIDE {
+ scoped_ptr<HttpTransaction>* trans) override {
trans->reset(new HttpNetworkTransaction(priority, session_.get()));
return OK;
}
- virtual HttpCache* GetCache() OVERRIDE {
+ virtual HttpCache* GetCache() override {
return nullptr;
}
- virtual HttpNetworkSession* GetSession() OVERRIDE { return session_.get(); };
+ virtual HttpNetworkSession* GetSession() override { return session_.get(); };
private:
scoped_refptr<HttpNetworkSession> session_;
@@ -132,7 +133,6 @@
net::IPAddressNumber ip;
CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip));
server_address_ = IPEndPoint(ip, 0);
- server_config_.SetDefaults();
server_config_.SetInitialFlowControlWindowToSend(
kInitialSessionFlowControlWindowForTest);
server_config_.SetInitialStreamFlowControlWindowToSend(
@@ -189,7 +189,8 @@
element_readers.push_back(
new UploadBytesElementReader(request_body_.data(),
request_body_.length()));
- upload_data_stream_.reset(new UploadDataStream(element_readers.Pass(), 0));
+ upload_data_stream_.reset(
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
request_.method = "POST";
request_.url = GURL("http://www.google.com/");
request_.upload_data_stream = upload_data_stream_.get();
diff --git a/net/quic/quic_flags.cc b/net/quic/quic_flags.cc
index 864e12b..9a49a34 100644
--- a/net/quic/quic_flags.cc
+++ b/net/quic/quic_flags.cc
@@ -46,3 +46,7 @@
// If true, then QUIC connections will set both idle and overall timeouts in a
// single method.
bool FLAGS_quic_unified_timeouts = false;
+
+// If true, store any CachedNetworkParams that are provided in the STK from the
+// CHLO.
+bool FLAGS_quic_store_cached_network_params_from_chlo = false;
diff --git a/net/quic/quic_flags.h b/net/quic/quic_flags.h
index f1fea1e..7693260 100644
--- a/net/quic/quic_flags.h
+++ b/net/quic/quic_flags.h
@@ -18,5 +18,6 @@
NET_EXPORT_PRIVATE extern bool FLAGS_quic_allow_more_open_streams;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_timeouts_only_from_alarms;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_unified_timeouts;
+NET_EXPORT_PRIVATE extern bool FLAGS_quic_store_cached_network_params_from_chlo;
#endif // NET_QUIC_QUIC_FLAGS_H_
diff --git a/net/quic/quic_flow_controller.cc b/net/quic/quic_flow_controller.cc
index b145280..722b243 100644
--- a/net/quic/quic_flow_controller.cc
+++ b/net/quic/quic_flow_controller.cc
@@ -163,10 +163,12 @@
DVLOG(1) << ENDPOINT << "UpdateSendWindowOffset for stream " << id_
<< " with new offset " << new_send_window_offset
- << " , current offset: " << send_window_offset_;
+ << " current offset: " << send_window_offset_
+ << " bytes_sent: " << bytes_sent_;
+ const bool blocked = IsBlocked();
send_window_offset_ = new_send_window_offset;
- return true;
+ return blocked;
}
void QuicFlowController::Disable() {
diff --git a/net/quic/quic_flow_controller.h b/net/quic/quic_flow_controller.h
index e5f5494..0df2b0e 100644
--- a/net/quic/quic_flow_controller.h
+++ b/net/quic/quic_flow_controller.h
@@ -47,8 +47,7 @@
void AddBytesSent(uint64 bytes_sent);
// Set a new send window offset.
- // Returns true if this changes send_window_offset_, and false in the case
- // where |new_send_window| is <= send_window_offset_.
+ // Returns true if this increases send_window_offset_ and is now blocked.
bool UpdateSendWindowOffset(uint64 new_send_window_offset);
// Returns the current available send window.
diff --git a/net/quic/quic_framer_test.cc b/net/quic/quic_framer_test.cc
index 535d31a..9ba0fd6 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -104,43 +104,43 @@
class TestEncrypter : public QuicEncrypter {
public:
virtual ~TestEncrypter() {}
- virtual bool SetKey(StringPiece key) OVERRIDE {
+ virtual bool SetKey(StringPiece key) override {
return true;
}
- virtual bool SetNoncePrefix(StringPiece nonce_prefix) OVERRIDE {
+ virtual bool SetNoncePrefix(StringPiece nonce_prefix) override {
return true;
}
virtual bool Encrypt(StringPiece nonce,
StringPiece associated_data,
StringPiece plaintext,
- unsigned char* output) OVERRIDE {
+ unsigned char* output) override {
CHECK(false) << "Not implemented";
return false;
}
virtual QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
StringPiece associated_data,
- StringPiece plaintext) OVERRIDE {
+ StringPiece plaintext) override {
sequence_number_ = sequence_number;
associated_data_ = associated_data.as_string();
plaintext_ = plaintext.as_string();
return new QuicData(plaintext.data(), plaintext.length());
}
- virtual size_t GetKeySize() const OVERRIDE {
+ virtual size_t GetKeySize() const override {
return 0;
}
- virtual size_t GetNoncePrefixSize() const OVERRIDE {
+ virtual size_t GetNoncePrefixSize() const override {
return 0;
}
- virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const OVERRIDE {
+ virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const override {
return ciphertext_size;
}
- virtual size_t GetCiphertextSize(size_t plaintext_size) const OVERRIDE {
+ virtual size_t GetCiphertextSize(size_t plaintext_size) const override {
return plaintext_size;
}
- virtual StringPiece GetKey() const OVERRIDE {
+ virtual StringPiece GetKey() const override {
return StringPiece();
}
- virtual StringPiece GetNoncePrefix() const OVERRIDE {
+ virtual StringPiece GetNoncePrefix() const override {
return StringPiece();
}
QuicPacketSequenceNumber sequence_number_;
@@ -151,32 +151,32 @@
class TestDecrypter : public QuicDecrypter {
public:
virtual ~TestDecrypter() {}
- virtual bool SetKey(StringPiece key) OVERRIDE {
+ virtual bool SetKey(StringPiece key) override {
return true;
}
- virtual bool SetNoncePrefix(StringPiece nonce_prefix) OVERRIDE {
+ virtual bool SetNoncePrefix(StringPiece nonce_prefix) override {
return true;
}
virtual bool Decrypt(StringPiece nonce,
StringPiece associated_data,
StringPiece ciphertext,
unsigned char* output,
- size_t* output_length) OVERRIDE {
+ size_t* output_length) override {
CHECK(false) << "Not implemented";
return false;
}
virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
StringPiece associated_data,
- StringPiece ciphertext) OVERRIDE {
+ StringPiece ciphertext) override {
sequence_number_ = sequence_number;
associated_data_ = associated_data.as_string();
ciphertext_ = ciphertext.as_string();
return new QuicData(ciphertext.data(), ciphertext.length());
}
- virtual StringPiece GetKey() const OVERRIDE {
+ virtual StringPiece GetKey() const override {
return StringPiece();
}
- virtual StringPiece GetNoncePrefix() const OVERRIDE {
+ virtual StringPiece GetNoncePrefix() const override {
return StringPiece();
}
QuicPacketSequenceNumber sequence_number_;
@@ -207,121 +207,121 @@
STLDeleteElements(&fec_data_);
}
- virtual void OnError(QuicFramer* f) OVERRIDE {
+ virtual void OnError(QuicFramer* f) override {
DVLOG(1) << "QuicFramer Error: " << QuicUtils::ErrorToString(f->error())
<< " (" << f->error() << ")";
++error_count_;
}
- virtual void OnPacket() OVERRIDE {}
+ virtual void OnPacket() override {}
virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) OVERRIDE {
+ const QuicPublicResetPacket& packet) override {
public_reset_packet_.reset(new QuicPublicResetPacket(packet));
}
virtual void OnVersionNegotiationPacket(
- const QuicVersionNegotiationPacket& packet) OVERRIDE {
+ const QuicVersionNegotiationPacket& packet) override {
version_negotiation_packet_.reset(new QuicVersionNegotiationPacket(packet));
}
- virtual void OnRevivedPacket() OVERRIDE {
+ virtual void OnRevivedPacket() override {
++revived_packets_;
}
- virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE {
+ virtual bool OnProtocolVersionMismatch(QuicVersion version) override {
DVLOG(1) << "QuicFramer Version Mismatch, version: " << version;
++version_mismatch_;
return true;
}
virtual bool OnUnauthenticatedPublicHeader(
- const QuicPacketPublicHeader& header) OVERRIDE {
+ const QuicPacketPublicHeader& header) override {
public_header_.reset(new QuicPacketPublicHeader(header));
return accept_public_header_;
}
virtual bool OnUnauthenticatedHeader(
- const QuicPacketHeader& header) OVERRIDE {
+ const QuicPacketHeader& header) override {
return true;
}
- virtual void OnDecryptedPacket(EncryptionLevel level) OVERRIDE {}
+ virtual void OnDecryptedPacket(EncryptionLevel level) override {}
- virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE {
+ virtual bool OnPacketHeader(const QuicPacketHeader& header) override {
++packet_count_;
header_.reset(new QuicPacketHeader(header));
return accept_packet_;
}
- virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE {
+ virtual bool OnStreamFrame(const QuicStreamFrame& frame) override {
++frame_count_;
stream_frames_.push_back(new QuicStreamFrame(frame));
return true;
}
- virtual void OnFecProtectedPayload(StringPiece payload) OVERRIDE {
+ virtual void OnFecProtectedPayload(StringPiece payload) override {
fec_protected_payload_ = payload.as_string();
}
- virtual bool OnAckFrame(const QuicAckFrame& frame) OVERRIDE {
+ virtual bool OnAckFrame(const QuicAckFrame& frame) override {
++frame_count_;
ack_frames_.push_back(new QuicAckFrame(frame));
return true;
}
virtual bool OnCongestionFeedbackFrame(
- const QuicCongestionFeedbackFrame& frame) OVERRIDE {
+ const QuicCongestionFeedbackFrame& frame) override {
++frame_count_;
congestion_feedback_frames_.push_back(
new QuicCongestionFeedbackFrame(frame));
return true;
}
- virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) OVERRIDE {
+ virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override {
++frame_count_;
stop_waiting_frames_.push_back(new QuicStopWaitingFrame(frame));
return true;
}
- virtual bool OnPingFrame(const QuicPingFrame& frame) OVERRIDE {
+ virtual bool OnPingFrame(const QuicPingFrame& frame) override {
++frame_count_;
ping_frames_.push_back(new QuicPingFrame(frame));
return true;
}
- virtual void OnFecData(const QuicFecData& fec) OVERRIDE {
+ virtual void OnFecData(const QuicFecData& fec) override {
++fec_count_;
fec_data_.push_back(new QuicFecData(fec));
}
- virtual void OnPacketComplete() OVERRIDE {
+ virtual void OnPacketComplete() override {
++complete_packets_;
}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE {
+ virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override {
rst_stream_frame_ = frame;
return true;
}
virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) OVERRIDE {
+ const QuicConnectionCloseFrame& frame) override {
connection_close_frame_ = frame;
return true;
}
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE {
+ virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override {
goaway_frame_ = frame;
return true;
}
virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame)
- OVERRIDE {
+ override {
window_update_frame_ = frame;
return true;
}
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE {
+ virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
blocked_frame_ = frame;
return true;
}
diff --git a/net/quic/quic_headers_stream.cc b/net/quic/quic_headers_stream.cc
index 35dac3f..56b700e 100644
--- a/net/quic/quic_headers_stream.cc
+++ b/net/quic/quic_headers_stream.cc
@@ -30,7 +30,7 @@
SpdyStreamId associated_stream_id,
SpdyPriority priority,
bool fin,
- bool unidirectional) OVERRIDE {
+ bool unidirectional) override {
if (!stream_->IsConnected()) {
return;
}
@@ -48,7 +48,7 @@
stream_->OnSynStream(stream_id, priority, fin);
}
- virtual void OnSynReply(SpdyStreamId stream_id, bool fin) OVERRIDE {
+ virtual void OnSynReply(SpdyStreamId stream_id, bool fin) override {
if (!stream_->IsConnected()) {
return;
}
@@ -58,7 +58,7 @@
virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id,
const char* header_data,
- size_t len) OVERRIDE {
+ size_t len) override {
if (!stream_->IsConnected()) {
return false;
}
@@ -69,7 +69,7 @@
virtual void OnStreamFrameData(SpdyStreamId stream_id,
const char* data,
size_t len,
- bool fin) OVERRIDE {
+ bool fin) override {
if (fin && len == 0) {
// The framer invokes OnStreamFrameData with zero-length data and
// fin = true after processing a SYN_STREAM or SYN_REPLY frame
@@ -79,65 +79,65 @@
CloseConnection("SPDY DATA frame received.");
}
- virtual void OnError(SpdyFramer* framer) OVERRIDE {
+ virtual void OnError(SpdyFramer* framer) override {
CloseConnection("SPDY framing error.");
}
virtual void OnDataFrameHeader(SpdyStreamId stream_id,
size_t length,
- bool fin) OVERRIDE {
+ bool fin) override {
CloseConnection("SPDY DATA frame received.");
}
virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) OVERRIDE {
+ SpdyRstStreamStatus status) override {
CloseConnection("SPDY RST_STREAM frame received.");
}
virtual void OnSetting(SpdySettingsIds id,
uint8 flags,
- uint32 value) OVERRIDE {
+ uint32 value) override {
CloseConnection("SPDY SETTINGS frame received.");
}
- virtual void OnSettingsAck() OVERRIDE {
+ virtual void OnSettingsAck() override {
CloseConnection("SPDY SETTINGS frame received.");
}
- virtual void OnSettingsEnd() OVERRIDE {
+ virtual void OnSettingsEnd() override {
CloseConnection("SPDY SETTINGS frame received.");
}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) OVERRIDE {
+ virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {
CloseConnection("SPDY PING frame received.");
}
virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) OVERRIDE {
+ SpdyGoAwayStatus status) override {
CloseConnection("SPDY GOAWAY frame received.");
}
- virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) OVERRIDE {
+ virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override {
CloseConnection("SPDY HEADERS frame received.");
}
virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) OVERRIDE {
+ uint32 delta_window_size) override {
CloseConnection("SPDY WINDOW_UPDATE frame received.");
}
virtual void OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- bool end) OVERRIDE {
+ bool end) override {
LOG(DFATAL) << "PUSH_PROMISE frame received from a SPDY/3 framer";
CloseConnection("SPDY PUSH_PROMISE frame received.");
}
- virtual void OnContinuation(SpdyStreamId stream_id, bool end) OVERRIDE {
+ virtual void OnContinuation(SpdyStreamId stream_id, bool end) override {
CloseConnection("SPDY CONTINUATION frame received.");
}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) OVERRIDE {
+ virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
CloseConnection("SPDY unknown frame received.");
return false;
}
@@ -146,11 +146,11 @@
virtual void OnSendCompressedFrame(SpdyStreamId stream_id,
SpdyFrameType type,
size_t payload_len,
- size_t frame_len) OVERRIDE {}
+ size_t frame_len) override {}
virtual void OnReceiveCompressedFrame(SpdyStreamId stream_id,
SpdyFrameType type,
- size_t frame_len) OVERRIDE {
+ size_t frame_len) override {
if (stream_->IsConnected()) {
stream_->OnCompressedFrameSize(frame_len);
}
diff --git a/net/quic/quic_headers_stream.h b/net/quic/quic_headers_stream.h
index c3ccbda..fb96ec7 100644
--- a/net/quic/quic_headers_stream.h
+++ b/net/quic/quic_headers_stream.h
@@ -34,8 +34,8 @@
QuicAckNotifier::DelegateInterface* ack_notifier_delegate);
// ReliableQuicStream implementation
- virtual uint32 ProcessRawData(const char* data, uint32 data_len) OVERRIDE;
- virtual QuicPriority EffectivePriority() const OVERRIDE;
+ virtual uint32 ProcessRawData(const char* data, uint32 data_len) override;
+ virtual QuicPriority EffectivePriority() const override;
private:
class SpdyFramerVisitor;
diff --git a/net/quic/quic_http_stream.h b/net/quic/quic_http_stream.h
index 5c60822..44e98e8 100644
--- a/net/quic/quic_http_stream.h
+++ b/net/quic/quic_http_stream.h
@@ -35,41 +35,41 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int SendRequest(const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE;
- virtual UploadProgress GetUploadProgress() const OVERRIDE;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual UploadProgress GetUploadProgress() const override;
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
virtual int ReadResponseBody(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Close(bool not_reusable) OVERRIDE;
- virtual HttpStream* RenewStreamForAuth() OVERRIDE;
- virtual bool IsResponseBodyComplete() const OVERRIDE;
- virtual bool CanFindEndOfResponse() const OVERRIDE;
- virtual bool IsConnectionReused() const OVERRIDE;
- virtual void SetConnectionReused() OVERRIDE;
- virtual bool IsConnectionReusable() const OVERRIDE;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void Close(bool not_reusable) override;
+ virtual HttpStream* RenewStreamForAuth() override;
+ virtual bool IsResponseBodyComplete() const override;
+ virtual bool CanFindEndOfResponse() const override;
+ virtual bool IsConnectionReused() const override;
+ virtual void SetConnectionReused() override;
+ virtual bool IsConnectionReusable() const override;
+ virtual int64 GetTotalReceivedBytes() const override;
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override;
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE;
- virtual bool IsSpdyHttpStream() const OVERRIDE;
- virtual void Drain(HttpNetworkSession* session) OVERRIDE;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
+ SSLCertRequestInfo* cert_request_info) override;
+ virtual bool IsSpdyHttpStream() const override;
+ virtual void Drain(HttpNetworkSession* session) override;
+ virtual void SetPriority(RequestPriority priority) override;
// QuicReliableClientStream::Delegate implementation
- virtual int OnDataReceived(const char* data, int length) OVERRIDE;
- virtual void OnClose(QuicErrorCode error) OVERRIDE;
- virtual void OnError(int error) OVERRIDE;
- virtual bool HasSendHeadersComplete() OVERRIDE;
+ virtual int OnDataReceived(const char* data, int length) override;
+ virtual void OnClose(QuicErrorCode error) override;
+ virtual void OnError(int error) override;
+ virtual bool HasSendHeadersComplete() override;
// QuicClientSession::Observer implementation
- virtual void OnCryptoHandshakeConfirmed() OVERRIDE;
- virtual void OnSessionClosed(int error) OVERRIDE;
+ virtual void OnCryptoHandshakeConfirmed() override;
+ virtual void OnSessionClosed(int error) override;
private:
friend class test::QuicHttpStreamPeer;
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index 313e7f5..b6ecc77 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -6,10 +6,11 @@
#include <vector>
+#include "net/base/chunked_upload_data_stream.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_data_stream.h"
#include "net/http/http_response_headers.h"
#include "net/http/transport_security_state.h"
#include "net/quic/congestion_control/receive_algorithm_interface.h"
@@ -97,7 +98,7 @@
: QuicHttpStream(session) {
}
- virtual int OnDataReceived(const char* data, int length) OVERRIDE {
+ virtual int OnDataReceived(const char* data, int length) override {
Close(false);
return OK;
}
@@ -109,7 +110,7 @@
: socket_(socket) {}
virtual ~TestPacketWriterFactory() {}
- virtual QuicPacketWriter* Create(QuicConnection* connection) const OVERRIDE {
+ virtual QuicPacketWriter* Create(QuicConnection* connection) const override {
return new QuicDefaultPacketWriter(socket_);
}
@@ -224,7 +225,6 @@
connection_->set_visitor(&visitor_);
connection_->SetSendAlgorithm(send_algorithm_);
connection_->SetReceiveAlgorithm(receive_algorithm_);
- crypto_config_.SetDefaults();
session_.reset(
new QuicClientSession(connection_,
scoped_ptr<DatagramClientSocket>(socket),
@@ -489,7 +489,7 @@
ScopedVector<UploadElementReader> element_readers;
element_readers.push_back(
new UploadBytesElementReader(kUploadData, strlen(kUploadData)));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
request_.method = "POST";
request_.url = GURL("http://www.google.com/");
request_.upload_data_stream = &upload_data_stream;
@@ -535,20 +535,21 @@
AddWrite(ConstructAckPacket(4, 3, 1));
Initialize();
- UploadDataStream upload_data_stream(UploadDataStream::CHUNKED, 0);
- upload_data_stream.AppendChunk(kUploadData, chunk_size, false);
+ ChunkedUploadDataStream upload_data_stream(0);
+ upload_data_stream.AppendData(kUploadData, chunk_size, false);
request_.method = "POST";
request_.url = GURL("http://www.google.com/");
request_.upload_data_stream = &upload_data_stream;
- ASSERT_EQ(OK, request_.upload_data_stream->Init(CompletionCallback()));
+ ASSERT_EQ(OK, request_.upload_data_stream->Init(
+ TestCompletionCallback().callback()));
ASSERT_EQ(OK, stream_->InitializeStream(&request_, DEFAULT_PRIORITY,
net_log_, callback_.callback()));
ASSERT_EQ(ERR_IO_PENDING, stream_->SendRequest(headers_, &response_,
callback_.callback()));
- upload_data_stream.AppendChunk(kUploadData, chunk_size, true);
+ upload_data_stream.AppendData(kUploadData, chunk_size, true);
// Ack both packets in the request.
ProcessPacket(ConstructAckPacket(1, 0, 0));
@@ -586,20 +587,21 @@
AddWrite(ConstructAckPacket(4, 3, 1));
Initialize();
- UploadDataStream upload_data_stream(UploadDataStream::CHUNKED, 0);
- upload_data_stream.AppendChunk(kUploadData, chunk_size, false);
+ ChunkedUploadDataStream upload_data_stream(0);
+ upload_data_stream.AppendData(kUploadData, chunk_size, false);
request_.method = "POST";
request_.url = GURL("http://www.google.com/");
request_.upload_data_stream = &upload_data_stream;
- ASSERT_EQ(OK, request_.upload_data_stream->Init(CompletionCallback()));
+ ASSERT_EQ(OK, request_.upload_data_stream->Init(
+ TestCompletionCallback().callback()));
ASSERT_EQ(OK, stream_->InitializeStream(&request_, DEFAULT_PRIORITY,
net_log_, callback_.callback()));
ASSERT_EQ(ERR_IO_PENDING, stream_->SendRequest(headers_, &response_,
callback_.callback()));
- upload_data_stream.AppendChunk(nullptr, 0, true);
+ upload_data_stream.AppendData(nullptr, 0, true);
ProcessPacket(ConstructAckPacket(1, 0, 0));
@@ -634,19 +636,20 @@
AddWrite(ConstructAckPacket(3, 3, 1));
Initialize();
- UploadDataStream upload_data_stream(UploadDataStream::CHUNKED, 0);
+ ChunkedUploadDataStream upload_data_stream(0);
request_.method = "POST";
request_.url = GURL("http://www.google.com/");
request_.upload_data_stream = &upload_data_stream;
- ASSERT_EQ(OK, request_.upload_data_stream->Init(CompletionCallback()));
+ ASSERT_EQ(OK, request_.upload_data_stream->Init(
+ TestCompletionCallback().callback()));
ASSERT_EQ(OK, stream_->InitializeStream(&request_, DEFAULT_PRIORITY,
net_log_, callback_.callback()));
ASSERT_EQ(ERR_IO_PENDING, stream_->SendRequest(headers_, &response_,
callback_.callback()));
- upload_data_stream.AppendChunk(nullptr, 0, true);
+ upload_data_stream.AppendData(nullptr, 0, true);
ProcessPacket(ConstructAckPacket(1, 0, 0));
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index 313632e..cb4cb05 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -38,7 +38,7 @@
// QuicFecBuilderInterface
virtual void OnBuiltFecProtectedPayload(const QuicPacketHeader& header,
- base::StringPiece payload) OVERRIDE;
+ base::StringPiece payload) override;
// Turn on FEC protection for subsequently created packets. FEC should be
// enabled first (max_packets_per_fec_group should be non-zero) for FEC
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index c8d5686..0872762 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -75,7 +75,7 @@
server_framer_.set_visitor(&framer_visitor_);
}
- virtual ~QuicPacketCreatorTest() OVERRIDE {
+ virtual ~QuicPacketCreatorTest() override {
}
void ProcessPacket(QuicPacket* packet) {
diff --git a/net/quic/quic_packet_generator_test.cc b/net/quic/quic_packet_generator_test.cc
index 703fd64..190e8a7 100644
--- a/net/quic/quic_packet_generator_test.cc
+++ b/net/quic/quic_packet_generator_test.cc
@@ -33,7 +33,7 @@
class MockDelegate : public QuicPacketGenerator::DelegateInterface {
public:
MockDelegate() {}
- virtual ~MockDelegate() OVERRIDE {}
+ virtual ~MockDelegate() override {}
MOCK_METHOD3(ShouldGeneratePacket,
bool(TransmissionType transmission_type,
@@ -116,7 +116,7 @@
packet6_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr),
packet7_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr) {}
- virtual ~QuicPacketGeneratorTest() OVERRIDE {
+ virtual ~QuicPacketGeneratorTest() override {
delete packet_.packet;
delete packet_.retransmittable_frames;
delete packet2_.packet;
diff --git a/net/quic/quic_per_connection_packet_writer.h b/net/quic/quic_per_connection_packet_writer.h
index 9b9b912..4e5e8c8 100644
--- a/net/quic/quic_per_connection_packet_writer.h
+++ b/net/quic/quic_per_connection_packet_writer.h
@@ -32,10 +32,10 @@
virtual WriteResult WritePacket(const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
- virtual bool IsWriteBlockedDataBuffered() const OVERRIDE;
- virtual bool IsWriteBlocked() const OVERRIDE;
- virtual void SetWritable() OVERRIDE;
+ const IPEndPoint& peer_address) override;
+ virtual bool IsWriteBlockedDataBuffered() const override;
+ virtual bool IsWriteBlocked() const override;
+ virtual void SetWritable() override;
private:
void OnWriteComplete(WriteResult result);
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index 6a1bec5..47be63c 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -106,7 +106,7 @@
const QuicStreamId kHeadersStreamId = 3;
// Maximum delayed ack time, in ms.
-const int kMaxDelayedAckTimeMs = 25;
+const int64 kMaxDelayedAckTimeMs = 25;
// The timeout before the handshake succeeds.
const int64 kInitialIdleTimeoutSecs = 5;
@@ -117,6 +117,10 @@
// The default timeout for a connection until the crypto handshake succeeds.
const int64 kMaxTimeForCryptoHandshakeSecs = 10; // 10 secs.
+// Default limit on the number of undecryptable packets the connection buffers
+// before the CHLO/SHLO arrive.
+const size_t kDefaultMaxUndecryptablePackets = 10;
+
// Default ping timeout.
const int64 kPingTimeoutSecs = 15; // 15 secs.
diff --git a/net/quic/quic_received_packet_manager.cc b/net/quic/quic_received_packet_manager.cc
index 255ce4d..187f8e0 100644
--- a/net/quic/quic_received_packet_manager.cc
+++ b/net/quic/quic_received_packet_manager.cc
@@ -167,7 +167,7 @@
uint32 sequence_gap = ack_frame_.largest_observed - sequence_number;
stats_->max_sequence_reordering =
max(stats_->max_sequence_reordering, sequence_gap);
- uint32 reordering_time_us =
+ int64 reordering_time_us =
receipt_time.Subtract(time_largest_observed_).ToMicroseconds();
stats_->max_time_reordering_us = max(stats_->max_time_reordering_us,
reordering_time_us);
@@ -229,14 +229,11 @@
return;
}
- if (approximate_now < time_largest_observed_) {
- // Approximate now may well be "in the past".
- ack_frame->delta_time_largest_observed = QuicTime::Delta::Zero();
- return;
- }
-
+ // Ensure the delta is zero if approximate now is "in the past".
ack_frame->delta_time_largest_observed =
- approximate_now.Subtract(time_largest_observed_);
+ approximate_now < time_largest_observed_ ?
+ QuicTime::Delta::Zero() :
+ approximate_now.Subtract(time_largest_observed_);
// Remove all packets that are too far from largest_observed to express.
received_packet_times_.remove_if(isTooLarge(ack_frame_.largest_observed));
diff --git a/net/quic/quic_received_packet_manager.h b/net/quic/quic_received_packet_manager.h
index 1231891..9eccfe0 100644
--- a/net/quic/quic_received_packet_manager.h
+++ b/net/quic/quic_received_packet_manager.h
@@ -129,7 +129,7 @@
// Called by QuicFramer, when the outgoing ack gets truncated, to recalculate
// the received entropy hash for the truncated ack frame.
virtual QuicPacketEntropyHash EntropyHash(
- QuicPacketSequenceNumber sequence_number) const OVERRIDE;
+ QuicPacketSequenceNumber sequence_number) const override;
// Updates internal state based on |stop_waiting|.
void UpdatePacketInformationSentByPeer(
diff --git a/net/quic/quic_received_packet_manager_test.cc b/net/quic/quic_received_packet_manager_test.cc
index 9e8c128..b64025b 100644
--- a/net/quic/quic_received_packet_manager_test.cc
+++ b/net/quic/quic_received_packet_manager_test.cc
@@ -238,7 +238,7 @@
}
// Reorder by 5 when 2 is received after 7.
EXPECT_EQ(5u, stats_.max_sequence_reordering);
- EXPECT_EQ(0u, stats_.max_time_reordering_us);
+ EXPECT_EQ(0, stats_.max_time_reordering_us);
EXPECT_EQ(2u, stats_.packets_reordered);
}
@@ -285,7 +285,7 @@
// No reordering.
EXPECT_EQ(0u, stats_.max_sequence_reordering);
- EXPECT_EQ(0u, stats_.max_time_reordering_us);
+ EXPECT_EQ(0, stats_.max_time_reordering_us);
EXPECT_EQ(0u, stats_.packets_reordered);
}
@@ -314,6 +314,7 @@
// When UpdateReceivedPacketInfo with a time earlier than the time of the
// largest observed packet, make sure that the delta is 0, not negative.
EXPECT_EQ(QuicTime::Delta::Zero(), ack.delta_time_largest_observed);
+ EXPECT_FALSE(ack.received_packet_times.empty());
QuicTime four_ms = QuicTime::Zero().Add(QuicTime::Delta::FromMilliseconds(4));
received_manager_.UpdateReceivedPacketInfo(&ack, four_ms);
@@ -330,7 +331,7 @@
2, 0, QuicTime::Zero().Add(QuicTime::Delta::FromMilliseconds(1)));
EXPECT_EQ(4u, stats_.max_sequence_reordering);
- EXPECT_EQ(1000u, stats_.max_time_reordering_us);
+ EXPECT_EQ(1000, stats_.max_time_reordering_us);
EXPECT_EQ(1u, stats_.packets_reordered);
}
diff --git a/net/quic/quic_reliable_client_stream.h b/net/quic/quic_reliable_client_stream.h
index 2d5b818..065db9e 100644
--- a/net/quic/quic_reliable_client_stream.h
+++ b/net/quic/quic_reliable_client_stream.h
@@ -54,10 +54,10 @@
virtual ~QuicReliableClientStream();
// QuicDataStream
- virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE;
- virtual void OnFinRead() OVERRIDE;
- virtual void OnCanWrite() OVERRIDE;
- virtual QuicPriority EffectivePriority() const OVERRIDE;
+ virtual uint32 ProcessData(const char* data, uint32 data_len) override;
+ virtual void OnFinRead() override;
+ virtual void OnCanWrite() override;
+ virtual QuicPriority EffectivePriority() const override;
// While the server's set_priority shouldn't be called externally, the creator
// of client-side streams should be able to set the priority.
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index a062827..3e81e74 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -26,17 +26,17 @@
int32 FLAGS_quic_recent_min_rtt_window_s = 60;
namespace {
-static const int kDefaultRetransmissionTimeMs = 500;
+static const int64 kDefaultRetransmissionTimeMs = 500;
// TCP RFC calls for 1 second RTO however Linux differs from this default and
// define the minimum RTO to 200ms, we will use the same until we have data to
// support a higher or lower value.
-static const int kMinRetransmissionTimeMs = 200;
-static const int kMaxRetransmissionTimeMs = 60000;
+static const int64 kMinRetransmissionTimeMs = 200;
+static const int64 kMaxRetransmissionTimeMs = 60000;
static const size_t kMaxRetransmissions = 10;
// Only exponentially back off the handshake timer 5 times due to a timeout.
static const size_t kMaxHandshakeRetransmissionBackoffs = 5;
-static const size_t kMinHandshakeTimeoutMs = 10;
+static const int64 kMinHandshakeTimeoutMs = 10;
// Sends up to two tail loss probes before firing an RTO,
// per draft RFC draft-dukkipati-tcpm-tcp-loss-probe.
@@ -452,7 +452,7 @@
QuicTime::Delta delta_largest_observed) {
QuicPacketSequenceNumber newest_transmission =
info.all_transmissions == nullptr ? sequence_number
- : *info.all_transmissions->rbegin();
+ : *info.all_transmissions->rbegin();
// Remove the most recent packet, if it is pending retransmission.
pending_retransmissions_.erase(newest_transmission);
@@ -503,13 +503,6 @@
DCHECK_LT(0u, sequence_number);
DCHECK(!unacked_packets_.IsUnacked(sequence_number));
LOG_IF(DFATAL, bytes == 0) << "Cannot send empty packets.";
- if (debug_delegate_ != nullptr) {
- debug_delegate_->OnSentPacket(*serialized_packet,
- original_sequence_number,
- sent_time,
- bytes,
- transmission_type);
- }
if (original_sequence_number == 0) {
if (serialized_packet->retransmittable_frames) {
@@ -765,7 +758,7 @@
// of (likely, tail) latency, then consider such a mechanism.
const QuicTime::Delta QuicSentPacketManager::DelayedAckTime() const {
return QuicTime::Delta::FromMilliseconds(min(kMaxDelayedAckTimeMs,
- kMinRetransmissionTimeMs/2));
+ kMinRetransmissionTimeMs / 2));
}
const QuicTime QuicSentPacketManager::GetRetransmissionTime() const {
@@ -808,8 +801,9 @@
const {
// This is equivalent to the TailLossProbeDelay, but slightly more aggressive
// because crypto handshake messages don't incur a delayed ack time.
- int64 delay_ms = max<int64>(kMinHandshakeTimeoutMs,
- 1.5 * rtt_stats_.SmoothedRtt().ToMilliseconds());
+ int64 delay_ms =
+ max(kMinHandshakeTimeoutMs,
+ static_cast<int64>(1.5 * rtt_stats_.SmoothedRtt().ToMilliseconds()));
return QuicTime::Delta::FromMilliseconds(
delay_ms << consecutive_crypto_retransmission_count_);
}
@@ -818,8 +812,9 @@
QuicTime::Delta srtt = rtt_stats_.SmoothedRtt();
if (!unacked_packets_.HasMultipleInFlightPackets()) {
return QuicTime::Delta::Max(
- srtt.Multiply(2), srtt.Multiply(1.5)
- .Add(QuicTime::Delta::FromMilliseconds(kMinRetransmissionTimeMs/2)));
+ srtt.Multiply(2),
+ srtt.Multiply(1.5).Add(
+ QuicTime::Delta::FromMilliseconds(kMinRetransmissionTimeMs / 2)));
}
return QuicTime::Delta::FromMilliseconds(
max(kMinTailLossProbeTimeoutMs,
diff --git a/net/quic/quic_sent_packet_manager.h b/net/quic/quic_sent_packet_manager.h
index 2b5f738..f5be3fd 100644
--- a/net/quic/quic_sent_packet_manager.h
+++ b/net/quic/quic_sent_packet_manager.h
@@ -51,13 +51,6 @@
TransmissionType transmission_type,
QuicByteCount byte_size) {}
- virtual void OnSentPacket(
- const SerializedPacket& packet,
- QuicPacketSequenceNumber original_sequence_number,
- QuicTime sent_time,
- QuicByteCount bytes,
- TransmissionType transmission_type) {}
-
virtual void OnIncomingAck(
const QuicAckFrame& ack_frame,
QuicTime ack_receive_time,
diff --git a/net/quic/quic_sent_packet_manager_test.cc b/net/quic/quic_sent_packet_manager_test.cc
index 42c9a6f..3260ab1 100644
--- a/net/quic/quic_sent_packet_manager_test.cc
+++ b/net/quic/quic_sent_packet_manager_test.cc
@@ -63,7 +63,7 @@
EXPECT_CALL(*send_algorithm_, InRecovery()).Times(AnyNumber());
}
- virtual ~QuicSentPacketManagerTest() OVERRIDE {
+ virtual ~QuicSentPacketManagerTest() override {
STLDeleteElements(&packets_);
}
diff --git a/net/quic/quic_server_bin.cc b/net/quic/quic_server_bin.cc
index 63b85a7..320f3da 100644
--- a/net/quic/quic_server_bin.cc
+++ b/net/quic/quic_server_bin.cc
@@ -55,15 +55,12 @@
}
base::AtExitManager exit_manager;
-
base::MessageLoopForIO message_loop;
net::IPAddressNumber ip;
CHECK(net::ParseIPLiteralToNumber("::", &ip));
net::QuicConfig config;
- config.SetDefaults();
-
net::QuicServer server(config, net::QuicSupportedVersions());
int rc = server.Listen(net::IPEndPoint(ip, FLAGS_port));
diff --git a/net/quic/quic_server_packet_writer.h b/net/quic/quic_server_packet_writer.h
index 417ea8d..15c946b 100644
--- a/net/quic/quic_server_packet_writer.h
+++ b/net/quic/quic_server_packet_writer.h
@@ -41,16 +41,16 @@
void OnWriteComplete(int rv);
// QuicPacketWriter implementation:
- virtual bool IsWriteBlockedDataBuffered() const OVERRIDE;
- virtual bool IsWriteBlocked() const OVERRIDE;
- virtual void SetWritable() OVERRIDE;
+ virtual bool IsWriteBlockedDataBuffered() const override;
+ virtual bool IsWriteBlocked() const override;
+ virtual void SetWritable() override;
protected:
// Do not call WritePacket on its own -- use WritePacketWithCallback
virtual WriteResult WritePacket(const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
+ const IPEndPoint& peer_address) override;
private:
UDPServerSocket* socket_;
diff --git a/net/quic/quic_server_session.cc b/net/quic/quic_server_session.cc
index bacd59e..f2967a5 100644
--- a/net/quic/quic_server_session.cc
+++ b/net/quic/quic_server_session.cc
@@ -13,10 +13,9 @@
namespace net {
-QuicServerSession::QuicServerSession(
- const QuicConfig& config,
- QuicConnection* connection,
- QuicServerSessionVisitor* visitor)
+QuicServerSession::QuicServerSession(const QuicConfig& config,
+ QuicConnection* connection,
+ QuicServerSessionVisitor* visitor)
: QuicSession(connection, config),
visitor_(visitor),
bandwidth_estimate_sent_to_client_(QuicBandwidth::Zero()),
@@ -134,7 +133,7 @@
cached_network_params.set_serving_region(serving_region_);
}
- crypto_stream_->SendServerConfigUpdate(&cached_network_params);
+ crypto_stream_->SendServerConfigUpdate(&cached_network_params, false);
last_server_config_update_time_ = now;
}
diff --git a/net/quic/quic_server_session.h b/net/quic/quic_server_session.h
index a2e4feb..80b6443 100644
--- a/net/quic/quic_server_session.h
+++ b/net/quic/quic_server_session.h
@@ -49,12 +49,12 @@
QuicServerSessionVisitor* visitor);
// Override the base class to notify the owner of the connection close.
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE;
- virtual void OnWriteBlocked() OVERRIDE;
+ virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
+ virtual void OnWriteBlocked() override;
// Sends a server config update to the client, containing new bandwidth
// estimate.
- virtual void OnCongestionWindowChange(QuicTime now) OVERRIDE;
+ virtual void OnCongestionWindowChange(QuicTime now) override;
virtual ~QuicServerSession();
@@ -65,7 +65,7 @@
}
// Override base class to process FEC config received from client.
- virtual void OnConfigNegotiated() OVERRIDE;
+ virtual void OnConfigNegotiated() override;
void set_serving_region(string serving_region) {
serving_region_ = serving_region;
@@ -73,9 +73,9 @@
protected:
// QuicSession methods:
- virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE;
- virtual QuicDataStream* CreateOutgoingDataStream() OVERRIDE;
- virtual QuicCryptoServerStream* GetCryptoStream() OVERRIDE;
+ virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
+ virtual QuicDataStream* CreateOutgoingDataStream() override;
+ virtual QuicCryptoServerStream* GetCryptoStream() override;
// If we should create an incoming stream, returns true. Otherwise
// does error handling, including communicating the error to the client and
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index cef5656..3299e71 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -34,65 +34,65 @@
public:
explicit VisitorShim(QuicSession* session) : session_(session) {}
- virtual void OnStreamFrames(const vector<QuicStreamFrame>& frames) OVERRIDE {
+ virtual void OnStreamFrames(const vector<QuicStreamFrame>& frames) override {
session_->OnStreamFrames(frames);
session_->PostProcessAfterData();
}
- virtual void OnRstStream(const QuicRstStreamFrame& frame) OVERRIDE {
+ virtual void OnRstStream(const QuicRstStreamFrame& frame) override {
session_->OnRstStream(frame);
session_->PostProcessAfterData();
}
- virtual void OnGoAway(const QuicGoAwayFrame& frame) OVERRIDE {
+ virtual void OnGoAway(const QuicGoAwayFrame& frame) override {
session_->OnGoAway(frame);
session_->PostProcessAfterData();
}
virtual void OnWindowUpdateFrames(const vector<QuicWindowUpdateFrame>& frames)
- OVERRIDE {
+ override {
session_->OnWindowUpdateFrames(frames);
session_->PostProcessAfterData();
}
virtual void OnBlockedFrames(const vector<QuicBlockedFrame>& frames)
- OVERRIDE {
+ override {
session_->OnBlockedFrames(frames);
session_->PostProcessAfterData();
}
- virtual void OnCanWrite() OVERRIDE {
+ virtual void OnCanWrite() override {
session_->OnCanWrite();
session_->PostProcessAfterData();
}
- virtual void OnCongestionWindowChange(QuicTime now) OVERRIDE {
+ virtual void OnCongestionWindowChange(QuicTime now) override {
session_->OnCongestionWindowChange(now);
}
virtual void OnSuccessfulVersionNegotiation(
- const QuicVersion& version) OVERRIDE {
+ const QuicVersion& version) override {
session_->OnSuccessfulVersionNegotiation(version);
}
virtual void OnConnectionClosed(
- QuicErrorCode error, bool from_peer) OVERRIDE {
+ QuicErrorCode error, bool from_peer) override {
session_->OnConnectionClosed(error, from_peer);
// The session will go away, so don't bother with cleanup.
}
- virtual void OnWriteBlocked() OVERRIDE {
+ virtual void OnWriteBlocked() override {
session_->OnWriteBlocked();
}
- virtual bool WillingAndAbleToWrite() const OVERRIDE {
+ virtual bool WillingAndAbleToWrite() const override {
return session_->WillingAndAbleToWrite();
}
- virtual bool HasPendingHandshake() const OVERRIDE {
+ virtual bool HasPendingHandshake() const override {
return session_->HasPendingHandshake();
}
- virtual bool HasOpenDataStreams() const OVERRIDE {
+ virtual bool HasOpenDataStreams() const override {
return session_->HasOpenDataStreams();
}
@@ -528,12 +528,12 @@
// Inform all existing streams about the new window.
if (connection_->version() >= QUIC_VERSION_21) {
- GetCryptoStream()->flow_controller()->UpdateSendWindowOffset(new_window);
- headers_stream_->flow_controller()->UpdateSendWindowOffset(new_window);
+ GetCryptoStream()->UpdateSendWindowOffset(new_window);
+ headers_stream_->UpdateSendWindowOffset(new_window);
}
for (DataStreamMap::iterator it = stream_map_.begin();
it != stream_map_.end(); ++it) {
- it->second->flow_controller()->UpdateSendWindowOffset(new_window);
+ it->second->UpdateSendWindowOffset(new_window);
}
}
@@ -782,4 +782,22 @@
}
}
+bool QuicSession::IsConnectionFlowControlBlocked() const {
+ return flow_controller_->IsBlocked();
+}
+
+bool QuicSession::IsStreamFlowControlBlocked() {
+ if (headers_stream_->flow_controller()->IsBlocked() ||
+ GetCryptoStream()->flow_controller()->IsBlocked()) {
+ return true;
+ }
+ for (DataStreamMap::iterator it = stream_map_.begin();
+ it != stream_map_.end(); ++it) {
+ if (it->second->flow_controller()->IsBlocked()) {
+ return true;
+ }
+ }
+ return false;
+}
+
} // namespace net
diff --git a/net/quic/quic_session.h b/net/quic/quic_session.h
index 7a52fba..6414b6d 100644
--- a/net/quic/quic_session.h
+++ b/net/quic/quic_session.h
@@ -59,22 +59,22 @@
// QuicConnectionVisitorInterface methods:
virtual void OnStreamFrames(
- const std::vector<QuicStreamFrame>& frames) OVERRIDE;
- virtual void OnRstStream(const QuicRstStreamFrame& frame) OVERRIDE;
- virtual void OnGoAway(const QuicGoAwayFrame& frame) OVERRIDE;
+ const std::vector<QuicStreamFrame>& frames) override;
+ virtual void OnRstStream(const QuicRstStreamFrame& frame) override;
+ virtual void OnGoAway(const QuicGoAwayFrame& frame) override;
virtual void OnWindowUpdateFrames(
- const std::vector<QuicWindowUpdateFrame>& frames) OVERRIDE;
+ const std::vector<QuicWindowUpdateFrame>& frames) override;
virtual void OnBlockedFrames(
- const std::vector<QuicBlockedFrame>& frames) OVERRIDE;
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE;
- virtual void OnWriteBlocked() OVERRIDE {}
+ const std::vector<QuicBlockedFrame>& frames) override;
+ virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
+ virtual void OnWriteBlocked() override {}
virtual void OnSuccessfulVersionNegotiation(
- const QuicVersion& version) OVERRIDE;
- virtual void OnCanWrite() OVERRIDE;
- virtual void OnCongestionWindowChange(QuicTime now) OVERRIDE {}
- virtual bool WillingAndAbleToWrite() const OVERRIDE;
- virtual bool HasPendingHandshake() const OVERRIDE;
- virtual bool HasOpenDataStreams() const OVERRIDE;
+ const QuicVersion& version) override;
+ virtual void OnCanWrite() override;
+ virtual void OnCongestionWindowChange(QuicTime now) override {}
+ virtual bool WillingAndAbleToWrite() const override;
+ virtual bool HasPendingHandshake() const override;
+ virtual bool HasOpenDataStreams() const override;
// Called by the headers stream when headers have been received for a stream.
virtual void OnStreamHeaders(QuicStreamId stream_id,
@@ -206,6 +206,12 @@
QuicFlowController* flow_controller() { return flow_controller_.get(); }
+ // Returns true if connection is flow controller blocked.
+ bool IsConnectionFlowControlBlocked() const;
+
+ // Returns true if any stream is flow controller blocked.
+ bool IsStreamFlowControlBlocked();
+
size_t get_max_open_streams() const { return max_open_streams_; }
protected:
diff --git a/net/quic/quic_session_test.cc b/net/quic/quic_session_test.cc
index a36b77c..770a564 100644
--- a/net/quic/quic_session_test.cc
+++ b/net/quic/quic_session_test.cc
@@ -9,6 +9,8 @@
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
+#include "base/rand_util.h"
+#include "base/strings/string_number_conversions.h"
#include "net/quic/crypto/crypto_protocol.h"
#include "net/quic/quic_crypto_stream.h"
#include "net/quic/quic_flags.h"
@@ -52,7 +54,7 @@
}
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE {
+ const CryptoHandshakeMessage& message) override {
encryption_established_ = true;
handshake_confirmed_ = true;
CryptoHandshakeMessage msg;
@@ -91,7 +93,7 @@
using ReliableQuicStream::CloseWriteSide;
- virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE {
+ virtual uint32 ProcessData(const char* data, uint32 data_len) override {
return data_len;
}
@@ -129,17 +131,17 @@
InitializeSession();
}
- virtual TestCryptoStream* GetCryptoStream() OVERRIDE {
+ virtual TestCryptoStream* GetCryptoStream() override {
return &crypto_stream_;
}
- virtual TestStream* CreateOutgoingDataStream() OVERRIDE {
+ virtual TestStream* CreateOutgoingDataStream() override {
TestStream* stream = new TestStream(GetNextStreamId(), this);
ActivateStream(stream);
return stream;
}
- virtual TestStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE {
+ virtual TestStream* CreateIncomingDataStream(QuicStreamId id) override {
return new TestStream(id, this);
}
@@ -157,7 +159,7 @@
QuicStreamOffset offset,
bool fin,
FecProtection fec_protection,
- QuicAckNotifier::DelegateInterface* ack_notifier_delegate) OVERRIDE {
+ QuicAckNotifier::DelegateInterface* ack_notifier_delegate) override {
// Always consumes everything.
if (writev_consumes_all_data_) {
return QuicConsumedData(data.TotalBufferSize(), fin);
@@ -534,6 +536,8 @@
// Ensure connection level flow control blockage.
QuicFlowControllerPeer::SetSendWindowOffset(session_.flow_controller(), 0);
EXPECT_TRUE(session_.flow_controller()->IsBlocked());
+ EXPECT_TRUE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
// Mark the crypto and headers streams as write blocked, we expect them to be
// allowed to write later.
@@ -579,11 +583,11 @@
TEST_P(QuicSessionTest, IncreasedTimeoutAfterCryptoHandshake) {
EXPECT_EQ((FLAGS_quic_unified_timeouts ?
- kInitialIdleTimeoutSecs : kDefaultIdleTimeoutSecs) + 1,
+ kInitialIdleTimeoutSecs : kDefaultIdleTimeoutSecs) + 3,
QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds());
CryptoHandshakeMessage msg;
session_.GetCryptoStream()->OnHandshakeMessage(msg);
- EXPECT_EQ(kMaximumIdleTimeoutSecs + 1,
+ EXPECT_EQ(kMaximumIdleTimeoutSecs + 3,
QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds());
}
@@ -641,9 +645,16 @@
TestStream* stream2 = session_.CreateOutgoingDataStream();
string body(kDefaultFlowControlSendWindow, '.');
EXPECT_FALSE(stream2->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
stream2->SendBody(body, false);
EXPECT_TRUE(stream2->flow_controller()->IsBlocked());
+ EXPECT_TRUE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_TRUE(session_.IsStreamFlowControlBlocked());
+ // The handshake message will call OnCanWrite, so the stream can resume
+ // writing.
+ EXPECT_CALL(*stream2, OnCanWrite());
// Now complete the crypto handshake, resulting in an increased flow control
// send window.
CryptoHandshakeMessage msg;
@@ -651,6 +662,103 @@
// Stream is now unblocked.
EXPECT_FALSE(stream2->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+}
+
+TEST_P(QuicSessionTest, HandshakeUnblocksFlowControlBlockedCryptoStream) {
+ if (version() <= QUIC_VERSION_19) {
+ return;
+ }
+ // Test that if the crypto stream is flow control blocked, then if the SHLO
+ // contains a larger send window offset, the stream becomes unblocked.
+ session_.set_writev_consumes_all_data(true);
+ TestCryptoStream* crypto_stream = session_.GetCryptoStream();
+ EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+ QuicHeadersStream* headers_stream =
+ QuicSessionPeer::GetHeadersStream(&session_);
+ EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+ // Write until the crypto stream is flow control blocked.
+ int i = 0;
+ while (!crypto_stream->flow_controller()->IsBlocked() && i < 1000) {
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+ QuicConfig config;
+ CryptoHandshakeMessage crypto_message;
+ config.ToHandshakeMessage(&crypto_message);
+ crypto_stream->SendHandshakeMessage(crypto_message);
+ ++i;
+ }
+ EXPECT_TRUE(crypto_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_TRUE(session_.IsStreamFlowControlBlocked());
+ EXPECT_FALSE(session_.HasDataToWrite());
+ EXPECT_TRUE(crypto_stream->HasBufferedData());
+
+ // The handshake message will call OnCanWrite, so the stream can
+ // resume writing.
+ EXPECT_CALL(*crypto_stream, OnCanWrite());
+ // Now complete the crypto handshake, resulting in an increased flow control
+ // send window.
+ CryptoHandshakeMessage msg;
+ session_.GetCryptoStream()->OnHandshakeMessage(msg);
+
+ // Stream is now unblocked and will no longer have buffered data.
+ EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+}
+
+TEST_P(QuicSessionTest, HandshakeUnblocksFlowControlBlockedHeadersStream) {
+ if (version() <= QUIC_VERSION_19) {
+ return;
+ }
+ // Test that if the header stream is flow control blocked, then if the SHLO
+ // contains a larger send window offset, the stream becomes unblocked.
+ session_.set_writev_consumes_all_data(true);
+ TestCryptoStream* crypto_stream = session_.GetCryptoStream();
+ EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+ QuicHeadersStream* headers_stream =
+ QuicSessionPeer::GetHeadersStream(&session_);
+ EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+ QuicStreamId stream_id = 5;
+ // Write until the header stream is flow control blocked.
+ while (!headers_stream->flow_controller()->IsBlocked() && stream_id < 2000) {
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+ SpdyHeaderBlock headers;
+ headers["header"] = base::Uint64ToString(base::RandUint64()) +
+ base::Uint64ToString(base::RandUint64()) +
+ base::Uint64ToString(base::RandUint64());
+ headers_stream->WriteHeaders(stream_id, headers, true, nullptr);
+ stream_id += 2;
+ }
+ EXPECT_TRUE(headers_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_TRUE(session_.IsStreamFlowControlBlocked());
+ EXPECT_FALSE(session_.HasDataToWrite());
+ EXPECT_TRUE(headers_stream->HasBufferedData());
+
+ // Now complete the crypto handshake, resulting in an increased flow control
+ // send window.
+ CryptoHandshakeMessage msg;
+ session_.GetCryptoStream()->OnHandshakeMessage(msg);
+
+ // Stream is now unblocked and will no longer have buffered data.
+ EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
+ EXPECT_FALSE(headers_stream->HasBufferedData());
}
TEST_P(QuicSessionTest, InvalidFlowControlWindowInHandshake) {
@@ -906,6 +1014,8 @@
QuicFlowControllerPeer::SetSendWindowOffset(headers_stream->flow_controller(),
0);
EXPECT_TRUE(headers_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_TRUE(session_.IsStreamFlowControlBlocked());
// Unblock the headers stream by supplying a WINDOW_UPDATE.
QuicWindowUpdateFrame window_update_frame(headers_stream->id(),
@@ -914,6 +1024,8 @@
frames.push_back(window_update_frame);
session_.OnWindowUpdateFrames(frames);
EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked());
+ EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
+ EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
}
TEST_P(QuicSessionTest, TooManyUnfinishedStreamsCauseConnectionClose) {
diff --git a/net/quic/quic_spdy_server_stream.h b/net/quic/quic_spdy_server_stream.h
index 3cecb6b..afd1291 100644
--- a/net/quic/quic_spdy_server_stream.h
+++ b/net/quic/quic_spdy_server_stream.h
@@ -31,8 +31,8 @@
// ReliableQuicStream implementation called by the session when there's
// data for us.
- virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE;
- virtual void OnFinRead() OVERRIDE;
+ virtual uint32 ProcessData(const char* data, uint32 data_len) override;
+ virtual void OnFinRead() override;
void ParseRequestHeaders();
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index ccbca64..687ea4c 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -70,6 +70,8 @@
const int32 kServerSecureInitialCongestionWindow = 32;
// Be conservative, and just use double a typical TCP ICWND for HTTP.
const int32 kServerInecureInitialCongestionWindow = 20;
+// Set the maximum number of undecryptable packets the connection will store.
+const int32 kMaxUndecryptablePackets = 100;
const char kDummyHostname[] = "quic.global.props";
const uint16 kDummyPort = 0;
@@ -90,7 +92,6 @@
QuicConfig InitializeQuicConfig(const QuicTagVector& connection_options) {
QuicConfig config;
- config.SetDefaults();
config.SetIdleConnectionStateLifetime(
QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds),
QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds));
@@ -104,7 +105,7 @@
: socket_(socket) {}
virtual ~DefaultPacketWriterFactory() {}
- virtual QuicPacketWriter* Create(QuicConnection* connection) const OVERRIDE;
+ virtual QuicPacketWriter* Create(QuicConnection* connection) const override;
private:
DatagramClientSocket* socket_;
@@ -511,7 +512,6 @@
check_persisted_supports_quic_(true),
weak_factory_(this) {
DCHECK(transport_security_state_);
- crypto_config_.SetDefaults();
crypto_config_.set_user_agent_id(user_agent_id);
crypto_config_.AddCanonicalSuffix(".c.youtube.com");
crypto_config_.AddCanonicalSuffix(".googlevideo.com");
@@ -902,6 +902,7 @@
config.SetInitialCongestionWindowToSend(
server_id.is_https() ? kServerSecureInitialCongestionWindow
: kServerInecureInitialCongestionWindow);
+ config.set_max_undecryptable_packets(kMaxUndecryptablePackets);
config.SetInitialFlowControlWindowToSend(kInitialReceiveWindowSize);
config.SetInitialStreamFlowControlWindowToSend(kInitialReceiveWindowSize);
config.SetInitialSessionFlowControlWindowToSend(kInitialReceiveWindowSize);
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index f4aa77e..f962699 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -147,13 +147,13 @@
// Until the servers support roaming, close all connections when the local
// IP address changes.
- virtual void OnIPAddressChanged() OVERRIDE;
+ virtual void OnIPAddressChanged() override;
// CertDatabase::Observer methods:
// We close all sessions when certificate database is changed.
- virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE;
- virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE;
+ virtual void OnCertAdded(const X509Certificate* cert) override;
+ virtual void OnCACertChanged(const X509Certificate* cert) override;
bool require_confirmation() const {
return require_confirmation_;
diff --git a/net/quic/quic_stream_sequencer_test.cc b/net/quic/quic_stream_sequencer_test.cc
index c553fe5..8c90c9f 100644
--- a/net/quic/quic_stream_sequencer_test.cc
+++ b/net/quic/quic_stream_sequencer_test.cc
@@ -44,7 +44,7 @@
const string& details));
MOCK_METHOD1(Reset, void(QuicRstStreamErrorCode error));
MOCK_METHOD0(OnCanWrite, void());
- virtual QuicPriority EffectivePriority() const OVERRIDE {
+ virtual QuicPriority EffectivePriority() const override {
return QuicUtils::HighestPriority();
}
virtual bool IsFlowControlEnabled() const {
diff --git a/net/quic/quic_time_wait_list_manager.cc b/net/quic/quic_time_wait_list_manager.cc
index d1f3419..4e069d5 100644
--- a/net/quic/quic_time_wait_list_manager.cc
+++ b/net/quic/quic_time_wait_list_manager.cc
@@ -41,7 +41,7 @@
QuicTimeWaitListManager* time_wait_list_manager)
: time_wait_list_manager_(time_wait_list_manager) {}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
time_wait_list_manager_->CleanUpOldConnectionIds();
// Let the time wait manager register the alarm at appropriate time.
return QuicTime::Zero();
diff --git a/net/quic/quic_time_wait_list_manager.h b/net/quic/quic_time_wait_list_manager.h
index 4d7b0c5..13544b7 100644
--- a/net/quic/quic_time_wait_list_manager.h
+++ b/net/quic/quic_time_wait_list_manager.h
@@ -79,7 +79,7 @@
// Called by the dispatcher when the underlying socket becomes writable again,
// since we might need to send pending public reset packets which we didn't
// send because the underlying socket was write blocked.
- virtual void OnCanWrite() OVERRIDE;
+ virtual void OnCanWrite() override;
// Used to delete connection_id entries that have outlived their time wait
// period.
diff --git a/net/quic/reliable_quic_stream.cc b/net/quic/reliable_quic_stream.cc
index a10b0ab..a65203b 100644
--- a/net/quic/reliable_quic_stream.cc
+++ b/net/quic/reliable_quic_stream.cc
@@ -81,7 +81,7 @@
int num_retransmitted_packets,
int num_retransmitted_bytes,
QuicTime::Delta delta_largest_observed)
- OVERRIDE {
+ override {
DCHECK_LT(0, pending_acks_);
--pending_acks_;
num_original_packets_ += num_original_packets;
@@ -106,7 +106,7 @@
protected:
// Delegates are ref counted.
- virtual ~ProxyAckNotifierDelegate() OVERRIDE {
+ virtual ~ProxyAckNotifierDelegate() override {
}
private:
@@ -479,7 +479,6 @@
DLOG(DFATAL) << "Flow control not enabled! " << version();
return;
}
-
if (flow_controller_.UpdateSendWindowOffset(frame.byte_offset)) {
// We can write again!
// TODO(rjshade): This does not respect priorities (e.g. multiple
@@ -533,6 +532,12 @@
}
}
+void ReliableQuicStream::UpdateSendWindowOffset(uint64 new_window) {
+ if (flow_controller_.UpdateSendWindowOffset(new_window)) {
+ OnCanWrite();
+ }
+}
+
bool ReliableQuicStream::IsFlowControlBlocked() {
if (flow_controller_.IsBlocked()) {
return true;
diff --git a/net/quic/reliable_quic_stream.h b/net/quic/reliable_quic_stream.h
index 5b5ae0f..24bc349 100644
--- a/net/quic/reliable_quic_stream.h
+++ b/net/quic/reliable_quic_stream.h
@@ -111,6 +111,10 @@
// WINDOW_UPDATE frame.
void AddBytesConsumed(uint64 bytes);
+ // Updates the flow controller's send window offset and calls OnCanWrite if
+ // it was blocked before.
+ void UpdateSendWindowOffset(uint64 new_offset);
+
// Returns true if the stream is flow control blocked, by the stream flow
// control window or the connection flow control window.
bool IsFlowControlBlocked();
@@ -123,6 +127,9 @@
return fin_received_ || rst_received_;
}
+ // Returns true if the stream has queued data waiting to write.
+ bool HasBufferedData() const;
+
protected:
// Sends as much of 'data' to the connection as the connection will consume,
// and then buffers any remaining data in queued_data_.
@@ -151,8 +158,6 @@
// Close the write side of the socket. Further writes will fail.
void CloseWriteSide();
- bool HasBufferedData() const;
-
bool fin_buffered() const { return fin_buffered_; }
const QuicSession* session() const { return session_; }
diff --git a/net/quic/reliable_quic_stream_test.cc b/net/quic/reliable_quic_stream_test.cc
index 336ea53..713d0e3 100644
--- a/net/quic/reliable_quic_stream_test.cc
+++ b/net/quic/reliable_quic_stream_test.cc
@@ -48,14 +48,14 @@
: ReliableQuicStream(id, session),
should_process_data_(should_process_data) {}
- virtual uint32 ProcessRawData(const char* data, uint32 data_len) OVERRIDE {
+ virtual uint32 ProcessRawData(const char* data, uint32 data_len) override {
EXPECT_NE(0u, data_len);
DVLOG(1) << "ProcessData data_len: " << data_len;
data_ += string(data, data_len);
return should_process_data_ ? data_len : 0;
}
- virtual QuicPriority EffectivePriority() const OVERRIDE {
+ virtual QuicPriority EffectivePriority() const override {
return QuicUtils::HighestPriority();
}
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc
index cf8df9a..9f4dc8b 100644
--- a/net/quic/test_tools/crypto_test_utils.cc
+++ b/net/quic/test_tools/crypto_test_utils.cc
@@ -41,10 +41,10 @@
: error_(false) {
}
- virtual void OnError(CryptoFramer* framer) OVERRIDE { error_ = true; }
+ virtual void OnError(CryptoFramer* framer) override { error_ = true; }
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE {
+ const CryptoHandshakeMessage& message) override {
messages_.push_back(message);
}
@@ -143,7 +143,7 @@
virtual QuicAsyncStatus GetChannelIDKey(
const string& hostname,
scoped_ptr<ChannelIDKey>* channel_id_key,
- ChannelIDSourceCallback* callback) OVERRIDE {
+ ChannelIDSourceCallback* callback) override {
// Synchronous mode.
if (!callback) {
return sync_source_->GetChannelIDKey(hostname, channel_id_key, nullptr);
@@ -160,7 +160,7 @@
}
// CallbackSource implementation.
- virtual void RunPendingCallbacks() OVERRIDE {
+ virtual void RunPendingCallbacks() override {
if (callback_.get()) {
callback_->Run(&channel_id_key_);
callback_.reset();
@@ -219,8 +219,6 @@
TestClientSession client_session(client_conn, DefaultQuicConfig());
QuicCryptoClientConfig crypto_config;
- client_session.config()->SetDefaults();
- crypto_config.SetDefaults();
if (!options.dont_verify_certs) {
// TODO(wtc): replace this with ProofVerifierForTesting() when we have
// a working ProofSourceForTesting().
@@ -273,7 +271,6 @@
QuicRandom* rand,
QuicConfig* config,
QuicCryptoServerConfig* crypto_config) {
- config->SetDefaults();
QuicCryptoServerConfig::ConfigOptions options;
options.channel_id_enabled = true;
scoped_ptr<CryptoHandshakeMessage> scfg(
@@ -356,12 +353,12 @@
index_(index) {
}
- virtual StringPiece GetCommonHashes() const OVERRIDE {
+ virtual StringPiece GetCommonHashes() const override {
CHECK(false) << "not implemented";
return StringPiece();
}
- virtual StringPiece GetCert(uint64 hash, uint32 index) const OVERRIDE {
+ virtual StringPiece GetCert(uint64 hash, uint32 index) const override {
if (hash == hash_ && index == index_) {
return cert_;
}
@@ -371,7 +368,7 @@
virtual bool MatchCert(StringPiece cert,
StringPiece common_set_hashes,
uint64* out_hash,
- uint32* out_index) const OVERRIDE {
+ uint32* out_index) const override {
if (cert != cert_) {
return false;
}
diff --git a/net/quic/test_tools/crypto_test_utils_chromium.cc b/net/quic/test_tools/crypto_test_utils_chromium.cc
index e475e56..d5edc6c 100644
--- a/net/quic/test_tools/crypto_test_utils_chromium.cc
+++ b/net/quic/test_tools/crypto_test_utils_chromium.cc
@@ -59,7 +59,7 @@
const std::string& server_config,
bool ecdsa_ok,
const std::vector<std::string>** out_certs,
- std::string* out_signature) OVERRIDE {
+ std::string* out_signature) override {
*out_certs = &certs_;
*out_signature = kSignature;
return true;
@@ -84,7 +84,7 @@
const ProofVerifyContext* verify_context,
std::string* error_details,
scoped_ptr<ProofVerifyDetails>* verify_details,
- ProofVerifierCallback* callback) OVERRIDE {
+ ProofVerifierCallback* callback) override {
error_details->clear();
scoped_ptr<ProofVerifyDetailsChromium> verify_details_chromium(
new ProofVerifyDetailsChromium);
diff --git a/net/quic/test_tools/crypto_test_utils_nss.cc b/net/quic/test_tools/crypto_test_utils_nss.cc
index eaf0ecd..96fdd31 100644
--- a/net/quic/test_tools/crypto_test_utils_nss.cc
+++ b/net/quic/test_tools/crypto_test_utils_nss.cc
@@ -29,7 +29,7 @@
virtual QuicAsyncStatus GetChannelIDKey(
const string& hostname,
scoped_ptr<ChannelIDKey>* channel_id_key,
- ChannelIDSourceCallback* /*callback*/) OVERRIDE {
+ ChannelIDSourceCallback* /*callback*/) override {
channel_id_key->reset(new ChannelIDKeyChromium(HostnameToKey(hostname)));
return QUIC_SUCCESS;
}
diff --git a/net/quic/test_tools/crypto_test_utils_openssl.cc b/net/quic/test_tools/crypto_test_utils_openssl.cc
index 15babd4..4db57b5 100644
--- a/net/quic/test_tools/crypto_test_utils_openssl.cc
+++ b/net/quic/test_tools/crypto_test_utils_openssl.cc
@@ -26,12 +26,12 @@
class TestChannelIDKey : public ChannelIDKey {
public:
explicit TestChannelIDKey(EVP_PKEY* ecdsa_key) : ecdsa_key_(ecdsa_key) {}
- virtual ~TestChannelIDKey() OVERRIDE {}
+ virtual ~TestChannelIDKey() override {}
// ChannelIDKey implementation.
virtual bool Sign(StringPiece signed_data,
- string* out_signature) const OVERRIDE {
+ string* out_signature) const override {
crypto::ScopedEVP_MD_CTX md_ctx(EVP_MD_CTX_create());
if (!md_ctx ||
EVP_DigestSignInit(md_ctx.get(), nullptr, EVP_sha256(), nullptr,
@@ -75,7 +75,7 @@
return true;
}
- virtual string SerializeKey() const OVERRIDE {
+ virtual string SerializeKey() const override {
// i2d_PublicKey will produce an ANSI X9.62 public key which, for a P-256
// key, is 0x04 (meaning uncompressed) followed by the x and y field
// elements as 32-byte, big-endian numbers.
@@ -106,7 +106,7 @@
virtual QuicAsyncStatus GetChannelIDKey(
const string& hostname,
scoped_ptr<ChannelIDKey>* channel_id_key,
- ChannelIDSourceCallback* /*callback*/) OVERRIDE {
+ ChannelIDSourceCallback* /*callback*/) override {
channel_id_key->reset(new TestChannelIDKey(HostnameToKey(hostname)));
return QUIC_SUCCESS;
}
diff --git a/net/quic/test_tools/delayed_verify_strike_register_client.h b/net/quic/test_tools/delayed_verify_strike_register_client.h
index 6ae7ba1..479647b 100644
--- a/net/quic/test_tools/delayed_verify_strike_register_client.h
+++ b/net/quic/test_tools/delayed_verify_strike_register_client.h
@@ -27,7 +27,7 @@
virtual void VerifyNonceIsValidAndUnique(base::StringPiece nonce,
QuicWallTime now,
- ResultCallback* cb) OVERRIDE;
+ ResultCallback* cb) override;
// Start queueing verifications instead of executing them immediately.
void StartDelayingVerification() {
diff --git a/net/quic/test_tools/mock_clock.h b/net/quic/test_tools/mock_clock.h
index d6e490f..4a2a28c 100644
--- a/net/quic/test_tools/mock_clock.h
+++ b/net/quic/test_tools/mock_clock.h
@@ -20,11 +20,11 @@
void AdvanceTime(QuicTime::Delta delta);
- virtual QuicTime Now() const OVERRIDE;
+ virtual QuicTime Now() const override;
- virtual QuicTime ApproximateNow() const OVERRIDE;
+ virtual QuicTime ApproximateNow() const override;
- virtual QuicWallTime WallNow() const OVERRIDE;
+ virtual QuicWallTime WallNow() const override;
base::TimeTicks NowInTicks() const;
diff --git a/net/quic/test_tools/mock_crypto_client_stream.h b/net/quic/test_tools/mock_crypto_client_stream.h
index e940a1e..10803e8 100644
--- a/net/quic/test_tools/mock_crypto_client_stream.h
+++ b/net/quic/test_tools/mock_crypto_client_stream.h
@@ -46,10 +46,10 @@
// CryptoFramerVisitorInterface implementation.
virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) OVERRIDE;
+ const CryptoHandshakeMessage& message) override;
// QuicCryptoClientStream implementation.
- virtual bool CryptoConnect() OVERRIDE;
+ virtual bool CryptoConnect() override;
// Invokes the sessions's CryptoHandshakeEvent method with the specified
// event.
diff --git a/net/quic/test_tools/mock_crypto_client_stream_factory.h b/net/quic/test_tools/mock_crypto_client_stream_factory.h
index 721ec25..5add188 100644
--- a/net/quic/test_tools/mock_crypto_client_stream_factory.h
+++ b/net/quic/test_tools/mock_crypto_client_stream_factory.h
@@ -23,7 +23,7 @@
virtual QuicCryptoClientStream* CreateQuicCryptoClientStream(
const QuicServerId& server_id,
QuicClientSession* session,
- QuicCryptoClientConfig* crypto_config) OVERRIDE;
+ QuicCryptoClientConfig* crypto_config) override;
void set_handshake_mode(
MockCryptoClientStream::HandshakeMode handshake_mode) {
diff --git a/net/quic/test_tools/mock_random.h b/net/quic/test_tools/mock_random.h
index 53b24b7..b04f170 100644
--- a/net/quic/test_tools/mock_random.h
+++ b/net/quic/test_tools/mock_random.h
@@ -18,12 +18,12 @@
// QuicRandom:
// Fills the |data| buffer with a repeating byte, initially 'r'.
- virtual void RandBytes(void* data, size_t len) OVERRIDE;
+ virtual void RandBytes(void* data, size_t len) override;
// Returns base + the current increment.
- virtual uint64 RandUint64() OVERRIDE;
+ virtual uint64 RandUint64() override;
// Does nothing.
virtual void Reseed(const void* additional_entropy,
- size_t entropy_len) OVERRIDE;
+ size_t entropy_len) override;
// ChangeValue increments |increment_|. This causes the value returned by
// |RandUint64| and the byte that |RandBytes| fills with, to change.
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index 0cf13e1..6cdd02a 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -37,8 +37,8 @@
: QuicAlarm(delegate) {
}
- virtual void SetImpl() OVERRIDE {}
- virtual void CancelImpl() OVERRIDE {}
+ virtual void SetImpl() override {}
+ virtual void CancelImpl() override {}
};
} // namespace
@@ -229,7 +229,7 @@
virtual ~NiceMockPacketWriterFactory() {}
virtual QuicPacketWriter* Create(
- QuicConnection* /*connection*/) const OVERRIDE {
+ QuicConnection* /*connection*/) const override {
return new testing::NiceMock<MockPacketWriter>();
}
@@ -609,7 +609,6 @@
QuicConfig DefaultQuicConfig() {
QuicConfig config;
- config.SetDefaults();
config.SetInitialFlowControlWindowToSend(
kInitialSessionFlowControlWindowForTest);
config.SetInitialStreamFlowControlWindowToSend(
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h
index 4c57a9b..f009641 100644
--- a/net/quic/test_tools/quic_test_utils.h
+++ b/net/quic/test_tools/quic_test_utils.h
@@ -190,35 +190,35 @@
public:
NoOpFramerVisitor() {}
- virtual void OnError(QuicFramer* framer) OVERRIDE {}
- virtual void OnPacket() OVERRIDE {}
+ virtual void OnError(QuicFramer* framer) override {}
+ virtual void OnPacket() override {}
virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) OVERRIDE {}
+ const QuicPublicResetPacket& packet) override {}
virtual void OnVersionNegotiationPacket(
- const QuicVersionNegotiationPacket& packet) OVERRIDE {}
- virtual void OnRevivedPacket() OVERRIDE {}
- virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE;
- virtual bool OnUnauthenticatedHeader(const QuicPacketHeader& header) OVERRIDE;
+ const QuicVersionNegotiationPacket& packet) override {}
+ virtual void OnRevivedPacket() override {}
+ virtual bool OnProtocolVersionMismatch(QuicVersion version) override;
+ virtual bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
virtual bool OnUnauthenticatedPublicHeader(
- const QuicPacketPublicHeader& header) OVERRIDE;
- virtual void OnDecryptedPacket(EncryptionLevel level) OVERRIDE {}
- virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE;
- virtual void OnFecProtectedPayload(base::StringPiece payload) OVERRIDE {}
- virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE;
- virtual bool OnAckFrame(const QuicAckFrame& frame) OVERRIDE;
+ const QuicPacketPublicHeader& header) override;
+ virtual void OnDecryptedPacket(EncryptionLevel level) override {}
+ virtual bool OnPacketHeader(const QuicPacketHeader& header) override;
+ virtual void OnFecProtectedPayload(base::StringPiece payload) override {}
+ virtual bool OnStreamFrame(const QuicStreamFrame& frame) override;
+ virtual bool OnAckFrame(const QuicAckFrame& frame) override;
virtual bool OnCongestionFeedbackFrame(
- const QuicCongestionFeedbackFrame& frame) OVERRIDE;
+ const QuicCongestionFeedbackFrame& frame) override;
virtual bool OnStopWaitingFrame(
- const QuicStopWaitingFrame& frame) OVERRIDE;
- virtual bool OnPingFrame(const QuicPingFrame& frame) OVERRIDE;
- virtual void OnFecData(const QuicFecData& fec) OVERRIDE {}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE;
+ const QuicStopWaitingFrame& frame) override;
+ virtual bool OnPingFrame(const QuicPingFrame& frame) override;
+ virtual void OnFecData(const QuicFecData& fec) override {}
+ virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) OVERRIDE;
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE;
- virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) OVERRIDE;
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE;
- virtual void OnPacketComplete() OVERRIDE {}
+ const QuicConnectionCloseFrame& frame) override;
+ virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
+ virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
+ virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override;
+ virtual void OnPacketComplete() override {}
private:
DISALLOW_COPY_AND_ASSIGN(NoOpFramerVisitor);
@@ -255,9 +255,9 @@
public:
MockHelper();
virtual ~MockHelper();
- virtual const QuicClock* GetClock() const OVERRIDE;
- virtual QuicRandom* GetRandomGenerator() OVERRIDE;
- virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) OVERRIDE;
+ virtual const QuicClock* GetClock() const override;
+ virtual QuicRandom* GetRandomGenerator() override;
+ virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
void AdvanceTime(QuicTime::Delta delta);
private:
@@ -312,7 +312,7 @@
QuicConnection::ProcessUdpPacket(self_address, peer_address, packet);
}
- virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE {
+ virtual bool OnProtocolVersionMismatch(QuicVersion version) override {
return false;
}
@@ -331,7 +331,7 @@
virtual ~PacketSavingConnection();
- virtual void SendOrQueuePacket(QueuedPacket packet) OVERRIDE;
+ virtual void SendOrQueuePacket(QueuedPacket packet) override;
std::vector<QuicPacket*> packets_;
std::vector<QuicEncryptedPacket*> encrypted_packets_;
@@ -383,7 +383,7 @@
void SetCryptoStream(QuicCryptoStream* stream);
- virtual QuicCryptoStream* GetCryptoStream() OVERRIDE;
+ virtual QuicCryptoStream* GetCryptoStream() override;
private:
QuicCryptoStream* crypto_stream_;
@@ -408,7 +408,7 @@
void SetCryptoStream(QuicCryptoStream* stream);
- virtual QuicCryptoStream* GetCryptoStream() OVERRIDE;
+ virtual QuicCryptoStream* GetCryptoStream() override;
private:
QuicCryptoStream* crypto_stream_;
@@ -496,7 +496,7 @@
virtual ~TestEntropyCalculator();
virtual QuicPacketEntropyHash EntropyHash(
- QuicPacketSequenceNumber sequence_number) const OVERRIDE;
+ QuicPacketSequenceNumber sequence_number) const override;
private:
DISALLOW_COPY_AND_ASSIGN(TestEntropyCalculator);
@@ -554,7 +554,7 @@
virtual ~TestWriterFactory();
virtual QuicPacketWriter* Create(QuicServerPacketWriter* writer,
- QuicConnection* connection) OVERRIDE;
+ QuicConnection* connection) override;
// Calls OnPacketSent on the last QuicConnection to write through one of the
// packet writers created by this factory.
@@ -572,7 +572,7 @@
const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
+ const IPEndPoint& peer_address) override;
private:
TestWriterFactory* factory_;
diff --git a/net/quic/test_tools/simple_quic_framer.cc b/net/quic/test_tools/simple_quic_framer.cc
index a08d555..6999cf5 100644
--- a/net/quic/test_tools/simple_quic_framer.cc
+++ b/net/quic/test_tools/simple_quic_framer.cc
@@ -22,48 +22,48 @@
: error_(QUIC_NO_ERROR) {
}
- virtual ~SimpleFramerVisitor() OVERRIDE {
+ virtual ~SimpleFramerVisitor() override {
STLDeleteElements(&stream_data_);
}
- virtual void OnError(QuicFramer* framer) OVERRIDE {
+ virtual void OnError(QuicFramer* framer) override {
error_ = framer->error();
}
- virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE {
+ virtual bool OnProtocolVersionMismatch(QuicVersion version) override {
return false;
}
- virtual void OnPacket() OVERRIDE {}
+ virtual void OnPacket() override {}
virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) OVERRIDE {
+ const QuicPublicResetPacket& packet) override {
public_reset_packet_.reset(new QuicPublicResetPacket(packet));
}
virtual void OnVersionNegotiationPacket(
- const QuicVersionNegotiationPacket& packet) OVERRIDE {
+ const QuicVersionNegotiationPacket& packet) override {
version_negotiation_packet_.reset(
new QuicVersionNegotiationPacket(packet));
}
- virtual void OnRevivedPacket() OVERRIDE {}
+ virtual void OnRevivedPacket() override {}
virtual bool OnUnauthenticatedPublicHeader(
- const QuicPacketPublicHeader& header) OVERRIDE {
+ const QuicPacketPublicHeader& header) override {
return true;
}
virtual bool OnUnauthenticatedHeader(
- const QuicPacketHeader& header) OVERRIDE {
+ const QuicPacketHeader& header) override {
return true;
}
- virtual void OnDecryptedPacket(EncryptionLevel level) OVERRIDE {}
- virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE {
+ virtual void OnDecryptedPacket(EncryptionLevel level) override {}
+ virtual bool OnPacketHeader(const QuicPacketHeader& header) override {
has_header_ = true;
header_ = header;
return true;
}
- virtual void OnFecProtectedPayload(StringPiece payload) OVERRIDE {}
+ virtual void OnFecProtectedPayload(StringPiece payload) override {}
- virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE {
+ virtual bool OnStreamFrame(const QuicStreamFrame& frame) override {
// Save a copy of the data so it is valid after the packet is processed.
stream_data_.push_back(frame.GetDataAsString());
QuicStreamFrame stream_frame(frame);
@@ -75,61 +75,61 @@
return true;
}
- virtual bool OnAckFrame(const QuicAckFrame& frame) OVERRIDE {
+ virtual bool OnAckFrame(const QuicAckFrame& frame) override {
ack_frames_.push_back(frame);
return true;
}
virtual bool OnCongestionFeedbackFrame(
- const QuicCongestionFeedbackFrame& frame) OVERRIDE {
+ const QuicCongestionFeedbackFrame& frame) override {
feedback_frames_.push_back(frame);
return true;
}
- virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) OVERRIDE {
+ virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override {
stop_waiting_frames_.push_back(frame);
return true;
}
- virtual bool OnPingFrame(const QuicPingFrame& frame) OVERRIDE {
+ virtual bool OnPingFrame(const QuicPingFrame& frame) override {
ping_frames_.push_back(frame);
return true;
}
- virtual void OnFecData(const QuicFecData& fec) OVERRIDE {
+ virtual void OnFecData(const QuicFecData& fec) override {
fec_data_ = fec;
fec_redundancy_ = fec_data_.redundancy.as_string();
fec_data_.redundancy = fec_redundancy_;
}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE {
+ virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override {
rst_stream_frames_.push_back(frame);
return true;
}
virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) OVERRIDE {
+ const QuicConnectionCloseFrame& frame) override {
connection_close_frames_.push_back(frame);
return true;
}
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE {
+ virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override {
goaway_frames_.push_back(frame);
return true;
}
virtual bool OnWindowUpdateFrame(
- const QuicWindowUpdateFrame& frame) OVERRIDE {
+ const QuicWindowUpdateFrame& frame) override {
window_update_frames_.push_back(frame);
return true;
}
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE {
+ virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
blocked_frames_.push_back(frame);
return true;
}
- virtual void OnPacketComplete() OVERRIDE {}
+ virtual void OnPacketComplete() override {}
const QuicPacketHeader& header() const { return header_; }
const vector<QuicAckFrame>& ack_frames() const { return ack_frames_; }
diff --git a/net/quic/test_tools/test_task_runner.h b/net/quic/test_tools/test_task_runner.h
index e25bf2a..ea6793f 100644
--- a/net/quic/test_tools/test_task_runner.h
+++ b/net/quic/test_tools/test_task_runner.h
@@ -28,8 +28,8 @@
// base::TaskRunner implementation.
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
- base::TimeDelta delay) OVERRIDE;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ base::TimeDelta delay) override;
+ virtual bool RunsTasksOnCurrentThread() const override;
const std::vector<PostedTask>& GetPostedTasks() const;
diff --git a/net/server/http_server_unittest.cc b/net/server/http_server_unittest.cc
index 216cb03..be0e271 100644
--- a/net/server/http_server_unittest.cc
+++ b/net/server/http_server_unittest.cc
@@ -181,7 +181,7 @@
public:
HttpServerTest() : quit_after_request_count_(0) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
scoped_ptr<ServerSocket> server_socket(
new TCPServerSocket(NULL, net::NetLog::Source()));
server_socket->ListenWithAddressAndPort("127.0.0.1", 0, 1);
@@ -189,26 +189,26 @@
ASSERT_EQ(OK, server_->GetLocalAddress(&server_address_));
}
- virtual void OnConnect(int connection_id) OVERRIDE {}
+ virtual void OnConnect(int connection_id) override {}
virtual void OnHttpRequest(int connection_id,
- const HttpServerRequestInfo& info) OVERRIDE {
+ const HttpServerRequestInfo& info) override {
requests_.push_back(std::make_pair(info, connection_id));
if (requests_.size() == quit_after_request_count_)
run_loop_quit_func_.Run();
}
virtual void OnWebSocketRequest(int connection_id,
- const HttpServerRequestInfo& info) OVERRIDE {
+ const HttpServerRequestInfo& info) override {
NOTREACHED();
}
virtual void OnWebSocketMessage(int connection_id,
- const std::string& data) OVERRIDE {
+ const std::string& data) override {
NOTREACHED();
}
- virtual void OnClose(int connection_id) OVERRIDE {}
+ virtual void OnClose(int connection_id) override {}
bool RunUntilRequestsReceived(size_t count) {
quit_after_request_count_ = count;
@@ -249,17 +249,17 @@
class WebSocketTest : public HttpServerTest {
virtual void OnHttpRequest(int connection_id,
- const HttpServerRequestInfo& info) OVERRIDE {
+ const HttpServerRequestInfo& info) override {
NOTREACHED();
}
virtual void OnWebSocketRequest(int connection_id,
- const HttpServerRequestInfo& info) OVERRIDE {
+ const HttpServerRequestInfo& info) override {
HttpServerTest::OnHttpRequest(connection_id, info);
}
virtual void OnWebSocketMessage(int connection_id,
- const std::string& data) OVERRIDE {
+ const std::string& data) override {
}
};
@@ -409,7 +409,7 @@
: quit_loop_func_(quit_loop_func) {}
virtual ~TestURLFetcherDelegate() {}
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE {
+ virtual void OnURLFetchComplete(const URLFetcher* source) override {
EXPECT_EQ(HTTP_INTERNAL_SERVER_ERROR, source->GetResponseCode());
quit_loop_func_.Run();
}
@@ -473,10 +473,10 @@
read_buf_len_(0) {}
// StreamSocket
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
return ERR_NOT_IMPLEMENTED;
}
- virtual void Disconnect() OVERRIDE {
+ virtual void Disconnect() override {
connected_ = false;
if (!read_callback_.is_null()) {
read_buf_ = NULL;
@@ -484,28 +484,28 @@
base::ResetAndReturn(&read_callback_).Run(ERR_CONNECTION_CLOSED);
}
}
- virtual bool IsConnected() const OVERRIDE { return connected_; }
- virtual bool IsConnectedAndIdle() const OVERRIDE { return IsConnected(); }
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE {
+ virtual bool IsConnected() const override { return connected_; }
+ virtual bool IsConnectedAndIdle() const override { return IsConnected(); }
+ virtual int GetPeerAddress(IPEndPoint* address) const override {
return ERR_NOT_IMPLEMENTED;
}
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* address) const override {
return ERR_NOT_IMPLEMENTED;
}
- virtual const BoundNetLog& NetLog() const OVERRIDE { return net_log_; }
- virtual void SetSubresourceSpeculation() OVERRIDE {}
- virtual void SetOmniboxSpeculation() OVERRIDE {}
- virtual bool WasEverUsed() const OVERRIDE { return true; }
- virtual bool UsingTCPFastOpen() const OVERRIDE { return false; }
- virtual bool WasNpnNegotiated() const OVERRIDE { return false; }
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual const BoundNetLog& NetLog() const override { return net_log_; }
+ virtual void SetSubresourceSpeculation() override {}
+ virtual void SetOmniboxSpeculation() override {}
+ virtual bool WasEverUsed() const override { return true; }
+ virtual bool UsingTCPFastOpen() const override { return false; }
+ virtual bool WasNpnNegotiated() const override { return false; }
+ virtual NextProto GetNegotiatedProtocol() const override {
return kProtoUnknown;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE { return false; }
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
if (!connected_) {
return ERR_SOCKET_NOT_CONNECTED;
}
@@ -523,13 +523,13 @@
return read_len;
}
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_NOT_IMPLEMENTED;
}
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE {
+ virtual int SetReceiveBufferSize(int32 size) override {
return ERR_NOT_IMPLEMENTED;
}
- virtual int SetSendBufferSize(int32 size) OVERRIDE {
+ virtual int SetSendBufferSize(int32 size) override {
return ERR_NOT_IMPLEMENTED;
}
@@ -621,7 +621,7 @@
class CloseOnConnectHttpServerTest : public HttpServerTest {
public:
- virtual void OnConnect(int connection_id) OVERRIDE {
+ virtual void OnConnect(int connection_id) override {
connection_ids_.push_back(connection_id);
server_->Close(connection_id);
}
diff --git a/net/server/web_socket.cc b/net/server/web_socket.cc
index ec0fdac..118cdf8 100644
--- a/net/server/web_socket.cc
+++ b/net/server/web_socket.cc
@@ -54,7 +54,7 @@
return new WebSocketHixie76(server, connection, request, pos);
}
- virtual void Accept(const HttpServerRequestInfo& request) OVERRIDE {
+ virtual void Accept(const HttpServerRequestInfo& request) override {
std::string key1 = request.GetHeaderValue("sec-websocket-key1");
std::string key2 = request.GetHeaderValue("sec-websocket-key2");
@@ -86,7 +86,7 @@
std::string(reinterpret_cast<char*>(digest.a), 16));
}
- virtual ParseResult Read(std::string* message) OVERRIDE {
+ virtual ParseResult Read(std::string* message) override {
DCHECK(message);
HttpConnection::ReadIOBuffer* read_buf = connection_->read_buf();
if (read_buf->StartOfBuffer()[0])
@@ -103,7 +103,7 @@
return FRAME_OK;
}
- virtual void Send(const std::string& message) OVERRIDE {
+ virtual void Send(const std::string& message) override {
char message_start = 0;
char message_end = -1;
server_->SendRaw(connection_->id(), std::string(1, message_start));
@@ -199,7 +199,7 @@
return new WebSocketHybi17(server, connection, request, pos);
}
- virtual void Accept(const HttpServerRequestInfo& request) OVERRIDE {
+ virtual void Accept(const HttpServerRequestInfo& request) override {
static const char* const kWebSocketGuid =
"258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
std::string key = request.GetHeaderValue("sec-websocket-key");
@@ -217,7 +217,7 @@
encoded_hash.c_str()));
}
- virtual ParseResult Read(std::string* message) OVERRIDE {
+ virtual ParseResult Read(std::string* message) override {
HttpConnection::ReadIOBuffer* read_buf = connection_->read_buf();
base::StringPiece frame(read_buf->StartOfBuffer(), read_buf->GetSize());
int bytes_consumed = 0;
@@ -230,7 +230,7 @@
return result;
}
- virtual void Send(const std::string& message) OVERRIDE {
+ virtual void Send(const std::string& message) override {
if (closed_)
return;
server_->SendRaw(connection_->id(),
diff --git a/net/socket/client_socket_factory.cc b/net/socket/client_socket_factory.cc
index 9539145..f372aff 100644
--- a/net/socket/client_socket_factory.cc
+++ b/net/socket/client_socket_factory.cc
@@ -56,11 +56,11 @@
CertDatabase::GetInstance()->RemoveObserver(this);
}
- virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE {
+ virtual void OnCertAdded(const X509Certificate* cert) override {
ClearSSLSessionCache();
}
- virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE {
+ virtual void OnCACertChanged(const X509Certificate* cert) override {
// Per wtc, we actually only need to flush when trust is reduced.
// Always flush now because OnCACertChanged does not tell us this.
// See comments in ClientSocketPoolManager::OnCACertChanged.
@@ -71,7 +71,7 @@
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
- const NetLog::Source& source) OVERRIDE {
+ const NetLog::Source& source) override {
return scoped_ptr<DatagramClientSocket>(
new UDPClientSocket(bind_type, rand_int_cb, net_log, source));
}
@@ -79,7 +79,7 @@
virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* net_log,
- const NetLog::Source& source) OVERRIDE {
+ const NetLog::Source& source) override {
return scoped_ptr<StreamSocket>(
new TCPClientSocket(addresses, net_log, source));
}
@@ -88,7 +88,7 @@
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
- const SSLClientSocketContext& context) OVERRIDE {
+ const SSLClientSocketContext& context) override {
// nss_thread_task_runner_ may be NULL if g_use_dedicated_nss_thread is
// false or if the dedicated NSS thread failed to start. If so, cause NSS
// functions to execute on the current task runner.
@@ -120,7 +120,7 @@
#endif
}
- virtual void ClearSSLSessionCache() OVERRIDE {
+ virtual void ClearSSLSessionCache() override {
SSLClientSocket::ClearSessionCache();
}
diff --git a/net/socket/client_socket_pool.cc b/net/socket/client_socket_pool.cc
index 0eebd11..261e87f 100644
--- a/net/socket/client_socket_pool.cc
+++ b/net/socket/client_socket_pool.cc
@@ -12,10 +12,10 @@
// alive.
// TODO(ziadh): Change this timeout after getting histogram data on how long it
// should be.
-int g_unused_idle_socket_timeout_s = 10;
+int64 g_unused_idle_socket_timeout_s = 10;
// The maximum duration, in seconds, to keep used idle persistent sockets alive.
-int g_used_idle_socket_timeout_s = 300; // 5 minutes
+int64 g_used_idle_socket_timeout_s = 300; // 5 minutes
} // namespace
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 8079cd4..e2fde00 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -327,10 +327,10 @@
void EnableConnectBackupJobs();
// ConnectJob::Delegate methods:
- virtual void OnConnectJobComplete(int result, ConnectJob* job) OVERRIDE;
+ virtual void OnConnectJobComplete(int result, ConnectJob* job) override;
// NetworkChangeNotifier::IPAddressObserver methods:
- virtual void OnIPAddressChanged() OVERRIDE;
+ virtual void OnIPAddressChanged() override;
private:
friend class base::RefCounted<ClientSocketPoolBaseHelper>;
@@ -856,7 +856,7 @@
virtual scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const internal::ClientSocketPoolBaseHelper::Request& request,
- ConnectJob::Delegate* delegate) const OVERRIDE {
+ ConnectJob::Delegate* delegate) const override {
const Request& casted_request = static_cast<const Request&>(request);
return connect_job_factory_->NewConnectJob(
group_name, casted_request, delegate);
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index 5a672b4..3cafc89 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -130,7 +130,7 @@
// Socket implementation.
virtual int Read(
IOBuffer* /* buf */, int len,
- const CompletionCallback& /* callback */) OVERRIDE {
+ const CompletionCallback& /* callback */) override {
if (has_unread_data_ && len > 0) {
has_unread_data_ = false;
was_used_to_convey_data_ = true;
@@ -141,50 +141,50 @@
virtual int Write(
IOBuffer* /* buf */, int len,
- const CompletionCallback& /* callback */) OVERRIDE {
+ const CompletionCallback& /* callback */) override {
was_used_to_convey_data_ = true;
return len;
}
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE { return OK; }
- virtual int SetSendBufferSize(int32 size) OVERRIDE { return OK; }
+ virtual int SetReceiveBufferSize(int32 size) override { return OK; }
+ virtual int SetSendBufferSize(int32 size) override { return OK; }
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
connected_ = true;
return OK;
}
- virtual void Disconnect() OVERRIDE { connected_ = false; }
- virtual bool IsConnected() const OVERRIDE { return connected_; }
- virtual bool IsConnectedAndIdle() const OVERRIDE {
+ virtual void Disconnect() override { connected_ = false; }
+ virtual bool IsConnected() const override { return connected_; }
+ virtual bool IsConnectedAndIdle() const override {
return connected_ && !has_unread_data_;
}
- virtual int GetPeerAddress(IPEndPoint* /* address */) const OVERRIDE {
+ virtual int GetPeerAddress(IPEndPoint* /* address */) const override {
return ERR_UNEXPECTED;
}
- virtual int GetLocalAddress(IPEndPoint* /* address */) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* /* address */) const override {
return ERR_UNEXPECTED;
}
- virtual const BoundNetLog& NetLog() const OVERRIDE {
+ virtual const BoundNetLog& NetLog() const override {
return net_log_;
}
- virtual void SetSubresourceSpeculation() OVERRIDE {}
- virtual void SetOmniboxSpeculation() OVERRIDE {}
- virtual bool WasEverUsed() const OVERRIDE {
+ virtual void SetSubresourceSpeculation() override {}
+ virtual void SetOmniboxSpeculation() override {}
+ virtual bool WasEverUsed() const override {
return was_used_to_convey_data_;
}
- virtual bool UsingTCPFastOpen() const OVERRIDE { return false; }
- virtual bool WasNpnNegotiated() const OVERRIDE {
+ virtual bool UsingTCPFastOpen() const override { return false; }
+ virtual bool WasNpnNegotiated() const override {
return false;
}
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual NextProto GetNegotiatedProtocol() const override {
return kProtoUnknown;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override {
return false;
}
@@ -207,7 +207,7 @@
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
- const NetLog::Source& source) OVERRIDE {
+ const NetLog::Source& source) override {
NOTREACHED();
return scoped_ptr<DatagramClientSocket>();
}
@@ -215,7 +215,7 @@
virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* /* net_log */,
- const NetLog::Source& /*source*/) OVERRIDE {
+ const NetLog::Source& /*source*/) override {
allocation_count_++;
return scoped_ptr<StreamSocket>();
}
@@ -224,12 +224,12 @@
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
- const SSLClientSocketContext& context) OVERRIDE {
+ const SSLClientSocketContext& context) override {
NOTIMPLEMENTED();
return scoped_ptr<SSLClientSocket>();
}
- virtual void ClearSSLSessionCache() OVERRIDE {
+ virtual void ClearSSLSessionCache() override {
NOTIMPLEMENTED();
}
@@ -291,9 +291,9 @@
// From ConnectJob:
- virtual LoadState GetLoadState() const OVERRIDE { return load_state_; }
+ virtual LoadState GetLoadState() const override { return load_state_; }
- virtual void GetAdditionalErrorState(ClientSocketHandle* handle) OVERRIDE {
+ virtual void GetAdditionalErrorState(ClientSocketHandle* handle) override {
if (store_additional_error_state_) {
// Set all of the additional error state fields in some way.
handle->set_is_ssl_error(true);
@@ -306,7 +306,7 @@
private:
// From ConnectJob:
- virtual int ConnectInternal() OVERRIDE {
+ virtual int ConnectInternal() override {
AddressList ignored;
client_socket_factory_->CreateTransportClientSocket(
ignored, NULL, net::NetLog::Source());
@@ -457,7 +457,7 @@
virtual scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const TestClientSocketPoolBase::Request& request,
- ConnectJob::Delegate* delegate) const OVERRIDE {
+ ConnectJob::Delegate* delegate) const override {
EXPECT_TRUE(!job_types_ || !job_types_->empty());
TestConnectJob::JobType job_type = job_type_;
if (job_types_ && !job_types_->empty()) {
@@ -473,7 +473,7 @@
net_log_));
}
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE {
+ virtual base::TimeDelta ConnectionTimeout() const override {
return timeout_duration_;
}
@@ -510,7 +510,7 @@
net::RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
const scoped_refptr<TestSocketParams>* casted_socket_params =
static_cast<const scoped_refptr<TestSocketParams>*>(params);
return base_.RequestSocket(group_name, *casted_socket_params, priority,
@@ -520,7 +520,7 @@
virtual void RequestSockets(const std::string& group_name,
const void* params,
int num_sockets,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
const scoped_refptr<TestSocketParams>* casted_params =
static_cast<const scoped_refptr<TestSocketParams>*>(params);
@@ -529,65 +529,65 @@
virtual void CancelRequest(
const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE {
+ ClientSocketHandle* handle) override {
base_.CancelRequest(group_name, handle);
}
virtual void ReleaseSocket(
const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE {
+ int id) override {
base_.ReleaseSocket(group_name, socket.Pass(), id);
}
- virtual void FlushWithError(int error) OVERRIDE {
+ virtual void FlushWithError(int error) override {
base_.FlushWithError(error);
}
- virtual bool IsStalled() const OVERRIDE {
+ virtual bool IsStalled() const override {
return base_.IsStalled();
}
- virtual void CloseIdleSockets() OVERRIDE {
+ virtual void CloseIdleSockets() override {
base_.CloseIdleSockets();
}
- virtual int IdleSocketCount() const OVERRIDE {
+ virtual int IdleSocketCount() const override {
return base_.idle_socket_count();
}
virtual int IdleSocketCountInGroup(
- const std::string& group_name) const OVERRIDE {
+ const std::string& group_name) const override {
return base_.IdleSocketCountInGroup(group_name);
}
virtual LoadState GetLoadState(
const std::string& group_name,
- const ClientSocketHandle* handle) const OVERRIDE {
+ const ClientSocketHandle* handle) const override {
return base_.GetLoadState(group_name, handle);
}
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE {
+ virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override {
base_.AddHigherLayeredPool(higher_pool);
}
virtual void RemoveHigherLayeredPool(
- HigherLayeredPool* higher_pool) OVERRIDE {
+ HigherLayeredPool* higher_pool) override {
base_.RemoveHigherLayeredPool(higher_pool);
}
virtual base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
- bool include_nested_pools) const OVERRIDE {
+ bool include_nested_pools) const override {
return base_.GetInfoAsValue(name, type);
}
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE {
+ virtual base::TimeDelta ConnectionTimeout() const override {
return base_.ConnectionTimeout();
}
- virtual ClientSocketPoolHistograms* histograms() const OVERRIDE {
+ virtual ClientSocketPoolHistograms* histograms() const override {
return base_.histograms();
}
@@ -653,7 +653,7 @@
: have_result_(false), waiting_for_result_(false), result_(OK) {}
virtual ~TestConnectJobDelegate() {}
- virtual void OnConnectJobComplete(int result, ConnectJob* job) OVERRIDE {
+ virtual void OnConnectJobComplete(int result, ConnectJob* job) override {
result_ = result;
scoped_ptr<ConnectJob> owned_job(job);
scoped_ptr<StreamSocket> socket = owned_job->PassSocket();
diff --git a/net/socket/client_socket_pool_manager_impl.h b/net/socket/client_socket_pool_manager_impl.h
index 22afbfa..94fd55d 100644
--- a/net/socket/client_socket_pool_manager_impl.h
+++ b/net/socket/client_socket_pool_manager_impl.h
@@ -73,29 +73,29 @@
HttpNetworkSession::SocketPoolType pool_type);
virtual ~ClientSocketPoolManagerImpl();
- virtual void FlushSocketPoolsWithError(int error) OVERRIDE;
- virtual void CloseIdleSockets() OVERRIDE;
+ virtual void FlushSocketPoolsWithError(int error) override;
+ virtual void CloseIdleSockets() override;
- virtual TransportClientSocketPool* GetTransportSocketPool() OVERRIDE;
+ virtual TransportClientSocketPool* GetTransportSocketPool() override;
- virtual SSLClientSocketPool* GetSSLSocketPool() OVERRIDE;
+ virtual SSLClientSocketPool* GetSSLSocketPool() override;
virtual SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy(
- const HostPortPair& socks_proxy) OVERRIDE;
+ const HostPortPair& socks_proxy) override;
virtual HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy(
- const HostPortPair& http_proxy) OVERRIDE;
+ const HostPortPair& http_proxy) override;
virtual SSLClientSocketPool* GetSocketPoolForSSLWithProxy(
- const HostPortPair& proxy_server) OVERRIDE;
+ const HostPortPair& proxy_server) override;
// Creates a Value summary of the state of the socket pools. The caller is
// responsible for deleting the returned value.
- virtual base::Value* SocketPoolInfoToValue() const OVERRIDE;
+ virtual base::Value* SocketPoolInfoToValue() const override;
// CertDatabase::Observer methods:
- virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE;
- virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE;
+ virtual void OnCertAdded(const X509Certificate* cert) override;
+ virtual void OnCACertChanged(const X509Certificate* cert) override;
private:
typedef internal::OwnedPoolMap<HostPortPair, TransportClientSocketPool*>
diff --git a/net/socket/mock_client_socket_pool_manager.h b/net/socket/mock_client_socket_pool_manager.h
index c2c3792..03930e3 100644
--- a/net/socket/mock_client_socket_pool_manager.h
+++ b/net/socket/mock_client_socket_pool_manager.h
@@ -27,17 +27,17 @@
SSLClientSocketPool* pool);
// ClientSocketPoolManager methods:
- virtual void FlushSocketPoolsWithError(int error) OVERRIDE;
- virtual void CloseIdleSockets() OVERRIDE;
- virtual TransportClientSocketPool* GetTransportSocketPool() OVERRIDE;
- virtual SSLClientSocketPool* GetSSLSocketPool() OVERRIDE;
+ virtual void FlushSocketPoolsWithError(int error) override;
+ virtual void CloseIdleSockets() override;
+ virtual TransportClientSocketPool* GetTransportSocketPool() override;
+ virtual SSLClientSocketPool* GetSSLSocketPool() override;
virtual SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy(
- const HostPortPair& socks_proxy) OVERRIDE;
+ const HostPortPair& socks_proxy) override;
virtual HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy(
- const HostPortPair& http_proxy) OVERRIDE;
+ const HostPortPair& http_proxy) override;
virtual SSLClientSocketPool* GetSocketPoolForSSLWithProxy(
- const HostPortPair& proxy_server) OVERRIDE;
- virtual base::Value* SocketPoolInfoToValue() const OVERRIDE;
+ const HostPortPair& proxy_server) override;
+ virtual base::Value* SocketPoolInfoToValue() const override;
private:
typedef internal::OwnedPoolMap<HostPortPair, TransportClientSocketPool*>
diff --git a/net/socket/next_proto.h b/net/socket/next_proto.h
index 08e6801..e715aca 100644
--- a/net/socket/next_proto.h
+++ b/net/socket/next_proto.h
@@ -14,8 +14,10 @@
// Next Protocol Negotiation (NPN), if successful, results in agreement on an
// application-level string that specifies the application level protocol to
// use over the TLS connection. NextProto enumerates the application level
-// protocols that we recognise. Do not change or reuse values, because they
-// are used to collect statistics on UMA.
+// protocols that we recognize. Do not change or reuse values, because they
+// are used to collect statistics on UMA. Also, values must be in [0,499),
+// because of the way TLS protocol negotiation extension information is added to
+// UMA histogram.
enum NextProto {
kProtoUnknown = 0,
kProtoHTTP11 = 1,
diff --git a/net/socket/socket_libevent.h b/net/socket/socket_libevent.h
index 5950951..a072738 100644
--- a/net/socket/socket_libevent.h
+++ b/net/socket/socket_libevent.h
@@ -81,8 +81,8 @@
private:
// base::MessageLoopForIO::Watcher methods.
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override;
int DoAccept(scoped_ptr<SocketLibevent>* socket);
void AcceptCompleted();
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index 50d28ec..1496aec 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -262,9 +262,9 @@
virtual void CompleteRead() {}
// SocketDataProvider implementation.
- virtual MockRead GetNextRead() OVERRIDE;
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE;
- virtual void Reset() OVERRIDE;
+ virtual MockRead GetNextRead() override;
+ virtual MockWriteResult OnWrite(const std::string& data) override;
+ virtual void Reset() override;
private:
MockRead* reads_;
@@ -292,9 +292,9 @@
void allow_unconsumed_reads(bool allow) { allow_unconsumed_reads_ = allow; }
// SocketDataProvider implementation.
- virtual MockRead GetNextRead() OVERRIDE;
+ virtual MockRead GetNextRead() override;
virtual MockWriteResult OnWrite(const std::string& data) = 0;
- virtual void Reset() OVERRIDE;
+ virtual void Reset() override;
protected:
// The next time there is a read from this socket, it will return |data|.
@@ -376,10 +376,10 @@
void ForceNextRead();
// StaticSocketDataProvider:
- virtual MockRead GetNextRead() OVERRIDE;
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE;
- virtual void Reset() OVERRIDE;
- virtual void CompleteRead() OVERRIDE;
+ virtual MockRead GetNextRead() override;
+ virtual MockWriteResult OnWrite(const std::string& data) override;
+ virtual void Reset() override;
+ virtual void CompleteRead() override;
private:
int write_delay_;
@@ -430,10 +430,10 @@
void EndLoop();
// StaticSocketDataProvider:
- virtual MockRead GetNextRead() OVERRIDE;
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE;
- virtual void Reset() OVERRIDE;
- virtual void CompleteRead() OVERRIDE;
+ virtual MockRead GetNextRead() override;
+ virtual MockWriteResult OnWrite(const std::string& data) override;
+ virtual void Reset() override;
+ virtual void CompleteRead() override;
private:
int sequence_number_;
@@ -560,14 +560,14 @@
// When the socket calls Read(), that calls GetNextRead(), and expects either
// ERR_IO_PENDING or data.
- virtual MockRead GetNextRead() OVERRIDE;
+ virtual MockRead GetNextRead() override;
// When the socket calls Write(), it always completes synchronously. OnWrite()
// checks to make sure the written data matches the expected data. The
// callback will not be invoked until its sequence number is reached.
- virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE;
- virtual void Reset() OVERRIDE;
- virtual void CompleteRead() OVERRIDE {}
+ virtual MockWriteResult OnWrite(const std::string& data) override;
+ virtual void Reset() override;
+ virtual void CompleteRead() override {}
private:
// Invoke the read and write callbacks, if the timing is appropriate.
@@ -654,17 +654,17 @@
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
- const NetLog::Source& source) OVERRIDE;
+ const NetLog::Source& source) override;
virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* net_log,
- const NetLog::Source& source) OVERRIDE;
+ const NetLog::Source& source) override;
virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
- const SSLClientSocketContext& context) OVERRIDE;
- virtual void ClearSSLSessionCache() OVERRIDE;
+ const SSLClientSocketContext& context) override;
+ virtual void ClearSSLSessionCache() override;
private:
SocketDataProviderArray<SocketDataProvider> mock_data_;
@@ -688,34 +688,34 @@
virtual int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) = 0;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
// StreamSocket implementation.
virtual int Connect(const CompletionCallback& callback) = 0;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE {}
- virtual void SetOmniboxSpeculation() OVERRIDE {}
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override {}
+ virtual void SetOmniboxSpeculation() override {}
// SSLClientSocket implementation.
- virtual std::string GetSessionCacheKey() const OVERRIDE;
- virtual bool InSessionCache() const OVERRIDE;
- virtual void SetHandshakeCompletionCallback(const base::Closure& cb) OVERRIDE;
+ virtual std::string GetSessionCacheKey() const override;
+ virtual bool InSessionCache() const override;
+ virtual void SetHandshakeCompletionCallback(const base::Closure& cb) override;
virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info)
- OVERRIDE;
+ override;
virtual int ExportKeyingMaterial(const base::StringPiece& label,
bool has_context,
const base::StringPiece& context,
unsigned char* out,
- unsigned int outlen) OVERRIDE;
- virtual int GetTLSUniqueChannelBinding(std::string* out) OVERRIDE;
- virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE;
- virtual ChannelIDService* GetChannelIDService() const OVERRIDE;
+ unsigned int outlen) override;
+ virtual int GetTLSUniqueChannelBinding(std::string* out) override;
+ virtual NextProtoStatus GetNextProto(std::string* proto) override;
+ virtual ChannelIDService* GetChannelIDService() const override;
protected:
virtual ~MockClientSocket();
@@ -724,7 +724,7 @@
// SSLClientSocket implementation.
virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain()
- const OVERRIDE;
+ const override;
// True if Connect completed successfully and Disconnect hasn't been called.
bool connected_;
@@ -752,25 +752,25 @@
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// AsyncSocket:
- virtual void OnReadComplete(const MockRead& data) OVERRIDE;
- virtual void OnConnectComplete(const MockConnect& data) OVERRIDE;
+ virtual void OnReadComplete(const MockRead& data) override;
+ virtual void OnConnectComplete(const MockConnect& data) override;
private:
int CompleteRead();
@@ -854,33 +854,33 @@
virtual ~DeterministicMockUDPClientSocket();
// DeterministicSocketData::Delegate:
- virtual bool WritePending() const OVERRIDE;
- virtual bool ReadPending() const OVERRIDE;
- virtual void CompleteWrite() OVERRIDE;
- virtual int CompleteRead() OVERRIDE;
+ virtual bool WritePending() const override;
+ virtual bool ReadPending() const override;
+ virtual void CompleteWrite() override;
+ virtual int CompleteRead() override;
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
// DatagramSocket implementation.
- virtual void Close() OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
+ virtual void Close() override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
// DatagramClientSocket implementation.
- virtual int Connect(const IPEndPoint& address) OVERRIDE;
+ virtual int Connect(const IPEndPoint& address) override;
// AsyncSocket implementation.
- virtual void OnReadComplete(const MockRead& data) OVERRIDE;
- virtual void OnConnectComplete(const MockConnect& data) OVERRIDE;
+ virtual void OnReadComplete(const MockRead& data) override;
+ virtual void OnConnectComplete(const MockConnect& data) override;
void set_source_port(int port) { source_port_ = port; }
@@ -905,32 +905,32 @@
virtual ~DeterministicMockTCPClientSocket();
// DeterministicSocketData::Delegate:
- virtual bool WritePending() const OVERRIDE;
- virtual bool ReadPending() const OVERRIDE;
- virtual void CompleteWrite() OVERRIDE;
- virtual int CompleteRead() OVERRIDE;
+ virtual bool WritePending() const override;
+ virtual bool ReadPending() const override;
+ virtual void CompleteWrite() override;
+ virtual int CompleteRead() override;
// Socket:
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// StreamSocket:
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// AsyncSocket:
- virtual void OnReadComplete(const MockRead& data) OVERRIDE;
- virtual void OnConnectComplete(const MockConnect& data) OVERRIDE;
+ virtual void OnReadComplete(const MockRead& data) override;
+ virtual void OnConnectComplete(const MockConnect& data) override;
private:
DeterministicSocketHelper helper_;
@@ -949,39 +949,39 @@
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// SSLClientSocket implementation.
- virtual std::string GetSessionCacheKey() const OVERRIDE;
- virtual bool InSessionCache() const OVERRIDE;
- virtual void SetHandshakeCompletionCallback(const base::Closure& cb) OVERRIDE;
+ virtual std::string GetSessionCacheKey() const override;
+ virtual bool InSessionCache() const override;
+ virtual void SetHandshakeCompletionCallback(const base::Closure& cb) override;
virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info)
- OVERRIDE;
- virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE;
- virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE;
- virtual void set_protocol_negotiated(NextProto protocol_negotiated) OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
+ override;
+ virtual NextProtoStatus GetNextProto(std::string* proto) override;
+ virtual bool set_was_npn_negotiated(bool negotiated) override;
+ virtual void set_protocol_negotiated(NextProto protocol_negotiated) override;
+ virtual NextProto GetNegotiatedProtocol() const override;
// This MockSocket does not implement the manual async IO feature.
- virtual void OnReadComplete(const MockRead& data) OVERRIDE;
- virtual void OnConnectComplete(const MockConnect& data) OVERRIDE;
+ virtual void OnReadComplete(const MockRead& data) override;
+ virtual void OnConnectComplete(const MockConnect& data) override;
- virtual bool WasChannelIDSent() const OVERRIDE;
- virtual void set_channel_id_sent(bool channel_id_sent) OVERRIDE;
- virtual ChannelIDService* GetChannelIDService() const OVERRIDE;
+ virtual bool WasChannelIDSent() const override;
+ virtual void set_channel_id_sent(bool channel_id_sent) override;
+ virtual ChannelIDService* GetChannelIDService() const override;
bool reached_connect() const { return reached_connect_; }
@@ -1033,25 +1033,25 @@
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
// DatagramSocket implementation.
- virtual void Close() OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
+ virtual void Close() override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
// DatagramClientSocket implementation.
- virtual int Connect(const IPEndPoint& address) OVERRIDE;
+ virtual int Connect(const IPEndPoint& address) override;
// AsyncSocket implementation.
- virtual void OnReadComplete(const MockRead& data) OVERRIDE;
- virtual void OnConnectComplete(const MockConnect& data) OVERRIDE;
+ virtual void OnReadComplete(const MockRead& data) override;
+ virtual void OnConnectComplete(const MockConnect& data) override;
void set_source_port(int port) { source_port_ = port;}
@@ -1221,13 +1221,13 @@
RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE;
+ ClientSocketHandle* handle) override;
virtual void ReleaseSocket(const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE;
+ int id) override;
private:
ClientSocketFactory* client_socket_factory_;
@@ -1267,17 +1267,17 @@
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
- const NetLog::Source& source) OVERRIDE;
+ const NetLog::Source& source) override;
virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* net_log,
- const NetLog::Source& source) OVERRIDE;
+ const NetLog::Source& source) override;
virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
- const SSLClientSocketContext& context) OVERRIDE;
- virtual void ClearSSLSessionCache() OVERRIDE;
+ const SSLClientSocketContext& context) override;
+ virtual void ClearSSLSessionCache() override;
private:
SocketDataProviderArray<DeterministicSocketData> mock_data_;
@@ -1306,13 +1306,13 @@
RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE;
+ ClientSocketHandle* handle) override;
virtual void ReleaseSocket(const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE;
+ int id) override;
private:
TransportClientSocketPool* const transport_pool_;
diff --git a/net/socket/socks5_client_socket.h b/net/socket/socks5_client_socket.h
index 8da0b4d..5d4e060 100644
--- a/net/socket/socks5_client_socket.h
+++ b/net/socket/socks5_client_socket.h
@@ -43,32 +43,32 @@
// StreamSocket implementation.
// Does the SOCKS handshake and completes the protocol.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
private:
enum State {
diff --git a/net/socket/socks_client_socket.h b/net/socket/socks_client_socket.h
index 26da332..d480de4 100644
--- a/net/socket/socks_client_socket.h
+++ b/net/socket/socks_client_socket.h
@@ -40,32 +40,32 @@
// StreamSocket implementation.
// Does the SOCKS handshake and completes the protocol.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
private:
FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, CompleteHandshake);
diff --git a/net/socket/socks_client_socket_pool.h b/net/socket/socks_client_socket_pool.h
index c6d5c8d..d324f0a 100644
--- a/net/socket/socks_client_socket_pool.h
+++ b/net/socket/socks_client_socket_pool.h
@@ -66,7 +66,7 @@
virtual ~SOCKSConnectJob();
// ConnectJob methods.
- virtual LoadState GetLoadState() const OVERRIDE;
+ virtual LoadState GetLoadState() const override;
private:
enum State {
@@ -90,7 +90,7 @@
// Begins the transport connection and the SOCKS handshake. Returns OK on
// success and ERR_IO_PENDING if it cannot immediately service the request.
// Otherwise, it returns a net error code.
- virtual int ConnectInternal() OVERRIDE;
+ virtual int ConnectInternal() override;
scoped_refptr<SOCKSSocketParams> socks_params_;
TransportClientSocketPool* const transport_pool_;
@@ -125,51 +125,51 @@
RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void RequestSockets(const std::string& group_name,
const void* params,
int num_sockets,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE;
+ ClientSocketHandle* handle) override;
virtual void ReleaseSocket(const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE;
+ int id) override;
- virtual void FlushWithError(int error) OVERRIDE;
+ virtual void FlushWithError(int error) override;
- virtual void CloseIdleSockets() OVERRIDE;
+ virtual void CloseIdleSockets() override;
- virtual int IdleSocketCount() const OVERRIDE;
+ virtual int IdleSocketCount() const override;
virtual int IdleSocketCountInGroup(
- const std::string& group_name) const OVERRIDE;
+ const std::string& group_name) const override;
virtual LoadState GetLoadState(
const std::string& group_name,
- const ClientSocketHandle* handle) const OVERRIDE;
+ const ClientSocketHandle* handle) const override;
virtual base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
- bool include_nested_pools) const OVERRIDE;
+ bool include_nested_pools) const override;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
+ virtual base::TimeDelta ConnectionTimeout() const override;
- virtual ClientSocketPoolHistograms* histograms() const OVERRIDE;
+ virtual ClientSocketPoolHistograms* histograms() const override;
// LowerLayeredPool implementation.
- virtual bool IsStalled() const OVERRIDE;
+ virtual bool IsStalled() const override;
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
+ virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
- virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
+ virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
// HigherLayeredPool implementation.
- virtual bool CloseOneIdleConnection() OVERRIDE;
+ virtual bool CloseOneIdleConnection() override;
private:
typedef ClientSocketPoolBase<SOCKSSocketParams> PoolBase;
@@ -189,9 +189,9 @@
virtual scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
- ConnectJob::Delegate* delegate) const OVERRIDE;
+ ConnectJob::Delegate* delegate) const override;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
+ virtual base::TimeDelta ConnectionTimeout() const override;
private:
TransportClientSocketPool* const transport_pool_;
diff --git a/net/socket/socks_client_socket_unittest.cc b/net/socket/socks_client_socket_unittest.cc
index c8032e6..e3dc359 100644
--- a/net/socket/socks_client_socket_unittest.cc
+++ b/net/socket/socks_client_socket_unittest.cc
@@ -101,7 +101,7 @@
AddressList* addresses,
const CompletionCallback& callback,
RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
DCHECK(addresses);
DCHECK_EQ(false, callback.is_null());
EXPECT_FALSE(HasOutstandingRequest());
@@ -112,12 +112,12 @@
virtual int ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
- const BoundNetLog& net_log) OVERRIDE {
+ const BoundNetLog& net_log) override {
NOTIMPLEMENTED();
return ERR_UNEXPECTED;
}
- virtual void CancelRequest(RequestHandle req) OVERRIDE {
+ virtual void CancelRequest(RequestHandle req) override {
EXPECT_TRUE(HasOutstandingRequest());
EXPECT_EQ(outstanding_request_, req);
outstanding_request_ = NULL;
diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc
index 4aacbc8..da2d6ba 100644
--- a/net/socket/ssl_client_socket.cc
+++ b/net/socket/ssl_client_socket.cc
@@ -5,6 +5,7 @@
#include "net/socket/ssl_client_socket.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/strings/string_util.h"
#include "crypto/ec_private_key.h"
#include "net/base/host_port_pair.h"
@@ -19,7 +20,8 @@
protocol_negotiated_(kProtoUnknown),
channel_id_sent_(false),
signed_cert_timestamps_received_(false),
- stapled_ocsp_response_received_(false) {
+ stapled_ocsp_response_received_(false),
+ negotiation_extension_(kExtensionUnknown) {
}
// static
@@ -124,6 +126,11 @@
protocol_negotiated_ = protocol_negotiated;
}
+void SSLClientSocket::set_negotiation_extension(
+ SSLNegotiationExtension negotiation_extension) {
+ negotiation_extension_ = negotiation_extension;
+}
+
bool SSLClientSocket::WasChannelIDSent() const {
return channel_id_sent_;
}
@@ -232,4 +239,30 @@
return wire_protos;
}
+void SSLClientSocket::RecordNegotiationExtension() {
+ if (negotiation_extension_ == kExtensionUnknown)
+ return;
+ std::string proto;
+ SSLClientSocket::NextProtoStatus status = GetNextProto(&proto);
+ if (status == kNextProtoUnsupported)
+ return;
+ // Convert protocol into numerical value for histogram.
+ NextProto protocol_negotiated = SSLClientSocket::NextProtoFromString(proto);
+ base::HistogramBase::Sample sample =
+ static_cast<base::HistogramBase::Sample>(protocol_negotiated);
+ // In addition to the protocol negotiated, we want to record which TLS
+ // extension was used, and in case of NPN, whether there was overlap between
+ // server and client list of supported protocols.
+ if (negotiation_extension_ == kExtensionNPN) {
+ if (status == kNextProtoNoOverlap) {
+ sample += 1000;
+ } else {
+ sample += 500;
+ }
+ } else {
+ DCHECK_EQ(kExtensionALPN, negotiation_extension_);
+ }
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolNegotiation", sample);
+}
+
} // namespace net
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h
index 0e32ed6..8f40f84 100644
--- a/net/socket/ssl_client_socket.h
+++ b/net/socket/ssl_client_socket.h
@@ -79,9 +79,16 @@
// the first protocol in our list.
};
+ // TLS extension used to negotiate protocol.
+ enum SSLNegotiationExtension {
+ kExtensionUnknown,
+ kExtensionALPN,
+ kExtensionNPN,
+ };
+
// StreamSocket:
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
// Computes a unique key string for the SSL session cache.
virtual std::string GetSessionCacheKey() const = 0;
@@ -150,6 +157,8 @@
virtual void set_protocol_negotiated(NextProto protocol_negotiated);
+ void set_negotiation_extension(SSLNegotiationExtension negotiation_extension);
+
// Returns the ChannelIDService used by this socket, or NULL if
// channel ids are not supported.
virtual ChannelIDService* GetChannelIDService() const = 0;
@@ -162,6 +171,10 @@
// Public for ssl_client_socket_openssl_unittest.cc.
virtual bool WasChannelIDSent() const;
+ // Record which TLS extension was used to negotiate protocol and protocol
+ // chosen in a UMA histogram.
+ void RecordNegotiationExtension();
+
protected:
virtual void set_channel_id_sent(bool channel_id_sent);
@@ -219,6 +232,8 @@
bool signed_cert_timestamps_received_;
// True if a stapled OCSP response was received.
bool stapled_ocsp_response_received_;
+ // Protocol negotiation extension used.
+ SSLNegotiationExtension negotiation_extension_;
};
} // namespace net
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index c5869fc..92660d8 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -71,6 +71,7 @@
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "base/metrics/histogram.h"
+#include "base/profiler/scoped_profile.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
@@ -407,6 +408,7 @@
void Reset() {
next_proto_status = SSLClientSocket::kNextProtoUnsupported;
next_proto.clear();
+ negotiation_extension_ = SSLClientSocket::kExtensionUnknown;
channel_id_sent = false;
server_cert_chain.Reset(NULL);
server_cert = NULL;
@@ -421,6 +423,9 @@
SSLClientSocket::NextProtoStatus next_proto_status;
std::string next_proto;
+ // TLS extension used for protocol negotiation.
+ SSLClientSocket::SSLNegotiationExtension negotiation_extension_;
+
// True if a channel ID was sent.
bool channel_id_sent;
@@ -759,6 +764,8 @@
// UpdateNextProto gets any application-layer protocol that may have been
// negotiated by the TLS connection.
void UpdateNextProto();
+ // Record TLS extension used for protocol negotiation (NPN or ALPN).
+ void UpdateExtensionUsed();
////////////////////////////////////////////////////////////////////////////
// Methods that are ONLY called on the network task runner:
@@ -1640,6 +1647,7 @@
UpdateStapledOCSPResponse();
UpdateConnectionStatus();
UpdateNextProto();
+ UpdateExtensionUsed();
// Update the network task runners view of the handshake state whenever
// a handshake has completed.
@@ -2213,6 +2221,10 @@
PostOrRunCallback(
FROM_HERE,
base::Bind(&Core::DidNSSRead, this, rv));
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "SSLClientSocketNSS::Core::DoReadCallback"));
PostOrRunCallback(
FROM_HERE,
base::Bind(base::ResetAndReturn(&user_read_callback_), rv));
@@ -2491,6 +2503,23 @@
}
}
+void SSLClientSocketNSS::Core::UpdateExtensionUsed() {
+ PRBool negotiated_extension;
+ SECStatus rv = SSL_HandshakeNegotiatedExtension(nss_fd_,
+ ssl_app_layer_protocol_xtn,
+ &negotiated_extension);
+ if (rv == SECSuccess && negotiated_extension) {
+ nss_handshake_state_.negotiation_extension_ = kExtensionALPN;
+ } else {
+ rv = SSL_HandshakeNegotiatedExtension(nss_fd_,
+ ssl_next_proto_nego_xtn,
+ &negotiated_extension);
+ if (rv == SECSuccess && negotiated_extension) {
+ nss_handshake_state_.negotiation_extension_ = kExtensionNPN;
+ }
+ }
+}
+
void SSLClientSocketNSS::Core::RecordChannelIDSupportOnNSSTaskRunner() {
DCHECK(OnNSSTaskRunner());
if (nss_handshake_state_.resumed_handshake)
@@ -2623,6 +2652,11 @@
}
void SSLClientSocketNSS::Core::BufferSendComplete(int result) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "418183 DidCompleteReadWrite => Core::BufferSendComplete"));
+
if (!OnNSSTaskRunner()) {
if (detached_)
return;
@@ -2666,6 +2700,11 @@
void SSLClientSocketNSS::Core::BufferRecvComplete(
IOBuffer* read_buffer,
int result) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "418183 DidCompleteReadWrite => SSLClientSocketNSS::Core::..."));
+
DCHECK(read_buffer);
if (!OnNSSTaskRunner()) {
@@ -3314,6 +3353,11 @@
EnterFunction(result);
if (result == OK) {
+ if (ssl_config_.version_fallback &&
+ ssl_config_.version_max < ssl_config_.version_fallback_min) {
+ return ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION;
+ }
+
// SSL handshake is completed. Let's verify the certificate.
GotoState(STATE_VERIFY_CERT);
// Done!
@@ -3323,6 +3367,7 @@
!core_->state().sct_list_from_tls_extension.empty());
set_stapled_ocsp_response_received(
!core_->state().stapled_ocsp_response.empty());
+ set_negotiation_extension(core_->state().negotiation_extension_);
LeaveFunction(result);
return result;
diff --git a/net/socket/ssl_client_socket_nss.h b/net/socket/ssl_client_socket_nss.h
index a2dc610..ccdbb81 100644
--- a/net/socket/ssl_client_socket_nss.h
+++ b/net/socket/ssl_client_socket_nss.h
@@ -68,51 +68,51 @@
virtual ~SSLClientSocketNSS();
// SSLClientSocket implementation.
- virtual std::string GetSessionCacheKey() const OVERRIDE;
- virtual bool InSessionCache() const OVERRIDE;
+ virtual std::string GetSessionCacheKey() const override;
+ virtual bool InSessionCache() const override;
virtual void SetHandshakeCompletionCallback(
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE;
- virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE;
+ SSLCertRequestInfo* cert_request_info) override;
+ virtual NextProtoStatus GetNextProto(std::string* proto) override;
// SSLSocket implementation.
virtual int ExportKeyingMaterial(const base::StringPiece& label,
bool has_context,
const base::StringPiece& context,
unsigned char* out,
- unsigned int outlen) OVERRIDE;
- virtual int GetTLSUniqueChannelBinding(std::string* out) OVERRIDE;
+ unsigned int outlen) override;
+ virtual int GetTLSUniqueChannelBinding(std::string* out) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
- virtual ChannelIDService* GetChannelIDService() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
+ virtual ChannelIDService* GetChannelIDService() const override;
protected:
// SSLClientSocket implementation.
virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain()
- const OVERRIDE;
+ const override;
private:
// Helper class to handle marshalling any NSS interaction to and from the
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index f341a9f..04be988 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -907,6 +907,11 @@
<< " is: " << (SSL_session_reused(ssl_) ? "Success" : "Fail");
}
+ if (ssl_config_.version_fallback &&
+ ssl_config_.version_max < ssl_config_.version_fallback_min) {
+ return ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION;
+ }
+
// SSL handshake is completed. If NPN wasn't negotiated, see if ALPN was.
if (npn_status_ == kNextProtoUnsupported) {
const uint8_t* alpn_proto = NULL;
@@ -915,6 +920,7 @@
if (alpn_len > 0) {
npn_proto_.assign(reinterpret_cast<const char*>(alpn_proto), alpn_len);
npn_status_ = kNextProtoNegotiated;
+ set_negotiation_extension(kExtensionALPN);
}
}
@@ -1669,6 +1675,7 @@
npn_proto_.assign(reinterpret_cast<const char*>(*out), *outlen);
DVLOG(2) << "next protocol: '" << npn_proto_ << "' status: " << npn_status_;
+ set_negotiation_extension(kExtensionNPN);
return SSL_TLSEXT_ERR_OK;
}
diff --git a/net/socket/ssl_client_socket_openssl.h b/net/socket/ssl_client_socket_openssl.h
index 1465f84..dff457b 100644
--- a/net/socket/ssl_client_socket_openssl.h
+++ b/net/socket/ssl_client_socket_openssl.h
@@ -59,49 +59,49 @@
}
// SSLClientSocket implementation.
- virtual std::string GetSessionCacheKey() const OVERRIDE;
- virtual bool InSessionCache() const OVERRIDE;
+ virtual std::string GetSessionCacheKey() const override;
+ virtual bool InSessionCache() const override;
virtual void SetHandshakeCompletionCallback(
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE;
- virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE;
- virtual ChannelIDService* GetChannelIDService() const OVERRIDE;
+ SSLCertRequestInfo* cert_request_info) override;
+ virtual NextProtoStatus GetNextProto(std::string* proto) override;
+ virtual ChannelIDService* GetChannelIDService() const override;
// SSLSocket implementation.
virtual int ExportKeyingMaterial(const base::StringPiece& label,
bool has_context,
const base::StringPiece& context,
unsigned char* out,
- unsigned int outlen) OVERRIDE;
- virtual int GetTLSUniqueChannelBinding(std::string* out) OVERRIDE;
+ unsigned int outlen) override;
+ virtual int GetTLSUniqueChannelBinding(std::string* out) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
protected:
// SSLClientSocket implementation.
virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain()
- const OVERRIDE;
+ const override;
private:
class PeerCertificateChain;
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index 6356783..a866b6c 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -452,8 +452,10 @@
// GetNextProto will fail and and trigger a NOTREACHED if we pass in a socket
// that hasn't had SSL_ImportFD called on it. If we get a certificate error
// here, then we know that we called SSL_ImportFD.
- if (result == OK || IsCertificateError(result))
+ if (result == OK || IsCertificateError(result)) {
status = ssl_socket_->GetNextProto(&proto);
+ ssl_socket_->RecordNegotiationExtension();
+ }
// If we want spdy over npn, make sure it succeeded.
if (status == SSLClientSocket::kNextProtoNegotiated) {
diff --git a/net/socket/ssl_client_socket_pool.h b/net/socket/ssl_client_socket_pool.h
index efcce77..5854015 100644
--- a/net/socket/ssl_client_socket_pool.h
+++ b/net/socket/ssl_client_socket_pool.h
@@ -197,9 +197,9 @@
virtual ~SSLConnectJob();
// ConnectJob methods.
- virtual LoadState GetLoadState() const OVERRIDE;
+ virtual LoadState GetLoadState() const override;
- virtual void GetAdditionalErrorState(ClientSocketHandle * handle) OVERRIDE;
+ virtual void GetAdditionalErrorState(ClientSocketHandle * handle) override;
private:
enum State {
@@ -242,7 +242,7 @@
// Starts the SSL connection process. Returns OK on success and
// ERR_IO_PENDING if it cannot immediately service the request.
// Otherwise, it returns a net error code.
- virtual int ConnectInternal() OVERRIDE;
+ virtual int ConnectInternal() override;
scoped_refptr<SSLSocketParams> params_;
TransportClientSocketPool* const transport_pool_;
@@ -302,51 +302,51 @@
RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void RequestSockets(const std::string& group_name,
const void* params,
int num_sockets,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE;
+ ClientSocketHandle* handle) override;
virtual void ReleaseSocket(const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE;
+ int id) override;
- virtual void FlushWithError(int error) OVERRIDE;
+ virtual void FlushWithError(int error) override;
- virtual void CloseIdleSockets() OVERRIDE;
+ virtual void CloseIdleSockets() override;
- virtual int IdleSocketCount() const OVERRIDE;
+ virtual int IdleSocketCount() const override;
virtual int IdleSocketCountInGroup(
- const std::string& group_name) const OVERRIDE;
+ const std::string& group_name) const override;
virtual LoadState GetLoadState(
const std::string& group_name,
- const ClientSocketHandle* handle) const OVERRIDE;
+ const ClientSocketHandle* handle) const override;
virtual base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
- bool include_nested_pools) const OVERRIDE;
+ bool include_nested_pools) const override;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
+ virtual base::TimeDelta ConnectionTimeout() const override;
- virtual ClientSocketPoolHistograms* histograms() const OVERRIDE;
+ virtual ClientSocketPoolHistograms* histograms() const override;
// LowerLayeredPool implementation.
- virtual bool IsStalled() const OVERRIDE;
+ virtual bool IsStalled() const override;
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
+ virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
- virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
+ virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
// HigherLayeredPool implementation.
- virtual bool CloseOneIdleConnection() OVERRIDE;
+ virtual bool CloseOneIdleConnection() override;
// Gets the SSLConnectJobMessenger for the given ssl session |cache_key|. If
// none exits, it creates one and stores it in |messenger_map_|.
@@ -363,7 +363,7 @@
// When the user changes the SSL config, we flush all idle sockets so they
// won't get re-used.
- virtual void OnSSLConfigChanged() OVERRIDE;
+ virtual void OnSSLConfigChanged() override;
class SSLConnectJobFactory : public PoolBase::ConnectJobFactory {
public:
@@ -383,9 +383,9 @@
virtual scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
- ConnectJob::Delegate* delegate) const OVERRIDE;
+ ConnectJob::Delegate* delegate) const override;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
+ virtual base::TimeDelta ConnectionTimeout() const override;
private:
TransportClientSocketPool* const transport_pool_;
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
index 4e844cd..40a4d3c 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -60,62 +60,62 @@
virtual ~WrappedStreamSocket() {}
// StreamSocket implementation:
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
return transport_->Connect(callback);
}
- virtual void Disconnect() OVERRIDE { transport_->Disconnect(); }
- virtual bool IsConnected() const OVERRIDE {
+ virtual void Disconnect() override { transport_->Disconnect(); }
+ virtual bool IsConnected() const override {
return transport_->IsConnected();
}
- virtual bool IsConnectedAndIdle() const OVERRIDE {
+ virtual bool IsConnectedAndIdle() const override {
return transport_->IsConnectedAndIdle();
}
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetPeerAddress(IPEndPoint* address) const override {
return transport_->GetPeerAddress(address);
}
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* address) const override {
return transport_->GetLocalAddress(address);
}
- virtual const BoundNetLog& NetLog() const OVERRIDE {
+ virtual const BoundNetLog& NetLog() const override {
return transport_->NetLog();
}
- virtual void SetSubresourceSpeculation() OVERRIDE {
+ virtual void SetSubresourceSpeculation() override {
transport_->SetSubresourceSpeculation();
}
- virtual void SetOmniboxSpeculation() OVERRIDE {
+ virtual void SetOmniboxSpeculation() override {
transport_->SetOmniboxSpeculation();
}
- virtual bool WasEverUsed() const OVERRIDE {
+ virtual bool WasEverUsed() const override {
return transport_->WasEverUsed();
}
- virtual bool UsingTCPFastOpen() const OVERRIDE {
+ virtual bool UsingTCPFastOpen() const override {
return transport_->UsingTCPFastOpen();
}
- virtual bool WasNpnNegotiated() const OVERRIDE {
+ virtual bool WasNpnNegotiated() const override {
return transport_->WasNpnNegotiated();
}
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual NextProto GetNegotiatedProtocol() const override {
return transport_->GetNegotiatedProtocol();
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override {
return transport_->GetSSLInfo(ssl_info);
}
// Socket implementation:
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return transport_->Read(buf, buf_len, callback);
}
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return transport_->Write(buf, buf_len, callback);
}
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE {
+ virtual int SetReceiveBufferSize(int32 size) override {
return transport_->SetReceiveBufferSize(size);
}
- virtual int SetSendBufferSize(int32 size) OVERRIDE {
+ virtual int SetSendBufferSize(int32 size) override {
return transport_->SetSendBufferSize(size);
}
@@ -137,7 +137,7 @@
// Socket implementation:
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// Sets the internal buffer to |size|. This must not be greater than
// the largest value supplied to Read() - that is, it does not handle
@@ -267,10 +267,10 @@
// Socket implementation:
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// Sets the next Read() call and all future calls to return |error|.
// If there is already a pending asynchronous read, the configured error
@@ -338,10 +338,10 @@
// Socket implementation:
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// Blocks read results on the socket. Reads will not complete until
// UnblockReadResult() has been called and a result is ready from the
@@ -554,13 +554,13 @@
// Socket implementation:
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
read_count_++;
return transport_->Read(buf, buf_len, callback);
}
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
write_count_++;
return transport_->Write(buf, buf_len, callback);
}
@@ -609,26 +609,26 @@
base::Time* expiration_time,
std::string* private_key_result,
std::string* cert_result,
- const GetChannelIDCallback& callback) OVERRIDE {
+ const GetChannelIDCallback& callback) override {
return ERR_UNEXPECTED;
}
virtual void SetChannelID(const std::string& server_identifier,
base::Time creation_time,
base::Time expiration_time,
const std::string& private_key,
- const std::string& cert) OVERRIDE {}
+ const std::string& cert) override {}
virtual void DeleteChannelID(const std::string& server_identifier,
const base::Closure& completion_callback)
- OVERRIDE {}
+ override {}
virtual void DeleteAllCreatedBetween(base::Time delete_begin,
base::Time delete_end,
const base::Closure& completion_callback)
- OVERRIDE {}
- virtual void DeleteAll(const base::Closure& completion_callback) OVERRIDE {}
+ override {}
+ virtual void DeleteAll(const base::Closure& completion_callback) override {}
virtual void GetAllChannelIDs(const GetChannelIDListCallback& callback)
- OVERRIDE {}
- virtual int GetChannelIDCount() OVERRIDE { return 0; }
- virtual void SetForceKeepSessionState() OVERRIDE {}
+ override {}
+ virtual int GetChannelIDCount() override { return 0; }
+ virtual void SetForceKeepSessionState() override {}
};
// A ChannelIDStore that asynchronously returns an error when asked for a
@@ -638,7 +638,7 @@
base::Time* expiration_time,
std::string* private_key_result,
std::string* cert_result,
- const GetChannelIDCallback& callback) OVERRIDE {
+ const GetChannelIDCallback& callback) override {
base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(callback, ERR_UNEXPECTED,
server_identifier, base::Time(), "", ""));
@@ -648,19 +648,19 @@
base::Time creation_time,
base::Time expiration_time,
const std::string& private_key,
- const std::string& cert) OVERRIDE {}
+ const std::string& cert) override {}
virtual void DeleteChannelID(const std::string& server_identifier,
const base::Closure& completion_callback)
- OVERRIDE {}
+ override {}
virtual void DeleteAllCreatedBetween(base::Time delete_begin,
base::Time delete_end,
const base::Closure& completion_callback)
- OVERRIDE {}
- virtual void DeleteAll(const base::Closure& completion_callback) OVERRIDE {}
+ override {}
+ virtual void DeleteAll(const base::Closure& completion_callback) override {}
virtual void GetAllChannelIDs(const GetChannelIDListCallback& callback)
- OVERRIDE {}
- virtual int GetChannelIDCount() OVERRIDE { return 0; }
- virtual void SetForceKeepSessionState() OVERRIDE {}
+ override {}
+ virtual int GetChannelIDCount() override { return 0; }
+ virtual void SetForceKeepSessionState() override {}
};
// A mock CTVerifier that records every call to Verify but doesn't verify
diff --git a/net/socket/ssl_server_socket_nss.h b/net/socket/ssl_server_socket_nss.h
index bc5b65d..eddb543 100644
--- a/net/socket/ssl_server_socket_nss.h
+++ b/net/socket/ssl_server_socket_nss.h
@@ -31,39 +31,39 @@
virtual ~SSLServerSocketNSS();
// SSLServerSocket interface.
- virtual int Handshake(const CompletionCallback& callback) OVERRIDE;
+ virtual int Handshake(const CompletionCallback& callback) override;
// SSLSocket interface.
virtual int ExportKeyingMaterial(const base::StringPiece& label,
bool has_context,
const base::StringPiece& context,
unsigned char* out,
- unsigned int outlen) OVERRIDE;
- virtual int GetTLSUniqueChannelBinding(std::string* out) OVERRIDE;
+ unsigned int outlen) override;
+ virtual int GetTLSUniqueChannelBinding(std::string* out) override;
// Socket interface (via StreamSocket).
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
private:
enum State {
diff --git a/net/socket/ssl_server_socket_openssl.h b/net/socket/ssl_server_socket_openssl.h
index e1c8aad..379ca57 100644
--- a/net/socket/ssl_server_socket_openssl.h
+++ b/net/socket/ssl_server_socket_openssl.h
@@ -33,39 +33,39 @@
virtual ~SSLServerSocketOpenSSL();
// SSLServerSocket interface.
- virtual int Handshake(const CompletionCallback& callback) OVERRIDE;
+ virtual int Handshake(const CompletionCallback& callback) override;
// SSLSocket interface.
virtual int ExportKeyingMaterial(const base::StringPiece& label,
bool has_context,
const base::StringPiece& context,
unsigned char* out,
- unsigned int outlen) OVERRIDE;
- virtual int GetTLSUniqueChannelBinding(std::string* out) OVERRIDE;
+ unsigned int outlen) override;
+ virtual int GetTLSUniqueChannelBinding(std::string* out) override;
// Socket interface (via StreamSocket).
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
private:
enum State {
diff --git a/net/socket/ssl_server_socket_unittest.cc b/net/socket/ssl_server_socket_unittest.cc
index f28d51a..1d70258 100644
--- a/net/socket/ssl_server_socket_unittest.cc
+++ b/net/socket/ssl_server_socket_unittest.cc
@@ -171,81 +171,81 @@
}
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
// Read random number of bytes.
buf_len = rand() % buf_len + 1;
return incoming_->Read(buf, buf_len, callback);
}
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
// Write random number of bytes.
buf_len = rand() % buf_len + 1;
return outgoing_->Write(buf, buf_len, callback);
}
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE {
+ virtual int SetReceiveBufferSize(int32 size) override {
return OK;
}
- virtual int SetSendBufferSize(int32 size) OVERRIDE {
+ virtual int SetSendBufferSize(int32 size) override {
return OK;
}
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
return OK;
}
- virtual void Disconnect() OVERRIDE {
+ virtual void Disconnect() override {
incoming_->Close();
outgoing_->Close();
}
- virtual bool IsConnected() const OVERRIDE {
+ virtual bool IsConnected() const override {
return true;
}
- virtual bool IsConnectedAndIdle() const OVERRIDE {
+ virtual bool IsConnectedAndIdle() const override {
return true;
}
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetPeerAddress(IPEndPoint* address) const override {
IPAddressNumber ip_address(kIPv4AddressSize);
*address = IPEndPoint(ip_address, 0 /*port*/);
return OK;
}
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* address) const override {
IPAddressNumber ip_address(4);
*address = IPEndPoint(ip_address, 0);
return OK;
}
- virtual const BoundNetLog& NetLog() const OVERRIDE {
+ virtual const BoundNetLog& NetLog() const override {
return net_log_;
}
- virtual void SetSubresourceSpeculation() OVERRIDE {}
- virtual void SetOmniboxSpeculation() OVERRIDE {}
+ virtual void SetSubresourceSpeculation() override {}
+ virtual void SetOmniboxSpeculation() override {}
- virtual bool WasEverUsed() const OVERRIDE {
+ virtual bool WasEverUsed() const override {
return true;
}
- virtual bool UsingTCPFastOpen() const OVERRIDE {
+ virtual bool UsingTCPFastOpen() const override {
return false;
}
- virtual bool WasNpnNegotiated() const OVERRIDE {
+ virtual bool WasNpnNegotiated() const override {
return false;
}
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual NextProto GetNegotiatedProtocol() const override {
return kProtoUnknown;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override {
return false;
}
diff --git a/net/socket/stream_listen_socket.h b/net/socket/stream_listen_socket.h
index 813d96a..ead35c4 100644
--- a/net/socket/stream_listen_socket.h
+++ b/net/socket/stream_listen_socket.h
@@ -116,8 +116,8 @@
HANDLE socket_event_;
#elif defined(OS_POSIX)
// Called by MessagePumpLibevent when the socket is ready to do I/O.
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override;
WaitState wait_state_;
// The socket's libevent wrapper.
base::MessageLoopForIO::FileDescriptorWatcher watcher_;
diff --git a/net/socket/tcp_client_socket.cc b/net/socket/tcp_client_socket.cc
index a16e11e..96402fe 100644
--- a/net/socket/tcp_client_socket.cc
+++ b/net/socket/tcp_client_socket.cc
@@ -6,6 +6,7 @@
#include "base/callback_helpers.h"
#include "base/logging.h"
+#include "base/profiler/scoped_profile.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
@@ -306,6 +307,10 @@
if (result > 0)
use_history_.set_was_used_to_convey_data();
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "TCPClientSocket::DidCompleteReadWrite"));
callback.Run(result);
}
diff --git a/net/socket/tcp_client_socket.h b/net/socket/tcp_client_socket.h
index 9322624..1672a95 100644
--- a/net/socket/tcp_client_socket.h
+++ b/net/socket/tcp_client_socket.h
@@ -38,31 +38,31 @@
int Bind(const IPEndPoint& address);
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual void EnableTCPFastOpenIfSupported() OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual void EnableTCPFastOpenIfSupported() override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
// Multiple outstanding requests are not supported.
// Full duplex mode (reading and writing at the same time) is supported.
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
virtual bool SetKeepAlive(bool enable, int delay);
virtual bool SetNoDelay(bool no_delay);
diff --git a/net/socket/tcp_listen_socket.h b/net/socket/tcp_listen_socket.h
index 54a91de..d726dcc 100644
--- a/net/socket/tcp_listen_socket.h
+++ b/net/socket/tcp_listen_socket.h
@@ -34,7 +34,7 @@
TCPListenSocket(SocketDescriptor s, StreamListenSocket::Delegate* del);
// Implements StreamListenSocket::Accept.
- virtual void Accept() OVERRIDE;
+ virtual void Accept() override;
private:
DISALLOW_COPY_AND_ASSIGN(TCPListenSocket);
@@ -48,7 +48,7 @@
// StreamListenSocketFactory overrides.
virtual scoped_ptr<StreamListenSocket> CreateAndListen(
- StreamListenSocket::Delegate* delegate) const OVERRIDE;
+ StreamListenSocket::Delegate* delegate) const override;
private:
const std::string ip_;
diff --git a/net/socket/tcp_listen_socket_unittest.h b/net/socket/tcp_listen_socket_unittest.h
index 1bc31a8..9393370 100644
--- a/net/socket/tcp_listen_socket_unittest.h
+++ b/net/socket/tcp_listen_socket_unittest.h
@@ -91,10 +91,10 @@
// StreamListenSocket::Delegate:
virtual void DidAccept(StreamListenSocket* server,
- scoped_ptr<StreamListenSocket> connection) OVERRIDE;
+ scoped_ptr<StreamListenSocket> connection) override;
virtual void DidRead(StreamListenSocket* connection, const char* data,
- int len) OVERRIDE;
- virtual void DidClose(StreamListenSocket* sock) OVERRIDE;
+ int len) override;
+ virtual void DidClose(StreamListenSocket* sock) override;
scoped_ptr<base::Thread> thread_;
base::MessageLoopForIO* loop_;
diff --git a/net/socket/tcp_server_socket.h b/net/socket/tcp_server_socket.h
index faff9ad..9fc719a 100644
--- a/net/socket/tcp_server_socket.h
+++ b/net/socket/tcp_server_socket.h
@@ -22,10 +22,10 @@
virtual ~TCPServerSocket();
// net::ServerSocket implementation.
- virtual int Listen(const IPEndPoint& address, int backlog) OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
+ virtual int Listen(const IPEndPoint& address, int backlog) override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
virtual int Accept(scoped_ptr<StreamSocket>* socket,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
private:
// Converts |accepted_socket_| and stores the result in
diff --git a/net/socket/tcp_socket_win.cc b/net/socket/tcp_socket_win.cc
index 62966ec..1598948 100644
--- a/net/socket/tcp_socket_win.cc
+++ b/net/socket/tcp_socket_win.cc
@@ -1035,6 +1035,9 @@
core_->read_buffer_length_ = 0;
DCHECK_NE(rv, ERR_IO_PENDING);
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("TCPSocketWin::DidSignalRead"));
base::ResetAndReturn(&read_callback_).Run(rv);
}
diff --git a/net/socket/tcp_socket_win.h b/net/socket/tcp_socket_win.h
index a5eed41..80174ad 100644
--- a/net/socket/tcp_socket_win.h
+++ b/net/socket/tcp_socket_win.h
@@ -101,7 +101,7 @@
class Core;
// base::ObjectWatcher::Delegate implementation.
- virtual void OnObjectSignaled(HANDLE object) OVERRIDE;
+ virtual void OnObjectSignaled(HANDLE object) override;
int AcceptInternal(scoped_ptr<TCPSocketWin>* socket,
IPEndPoint* address);
diff --git a/net/socket/transport_client_socket_pool.h b/net/socket/transport_client_socket_pool.h
index fce5432..14af726 100644
--- a/net/socket/transport_client_socket_pool.h
+++ b/net/socket/transport_client_socket_pool.h
@@ -167,7 +167,7 @@
virtual ~TransportConnectJob();
// ConnectJob methods.
- virtual LoadState GetLoadState() const OVERRIDE;
+ virtual LoadState GetLoadState() const override;
// Rolls |addrlist| forward until the first IPv4 address, if any.
// WARNING: this method should only be used to implement the prefer-IPv4 hack.
@@ -194,7 +194,7 @@
// Begins the host resolution and the TCP connect. Returns OK on success
// and ERR_IO_PENDING if it cannot immediately service the request.
// Otherwise, it returns a net error code.
- virtual int ConnectInternal() OVERRIDE;
+ virtual int ConnectInternal() override;
TransportConnectJobHelper helper_;
@@ -231,35 +231,35 @@
RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void RequestSockets(const std::string& group_name,
const void* params,
int num_sockets,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE;
+ ClientSocketHandle* handle) override;
virtual void ReleaseSocket(const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE;
- virtual void FlushWithError(int error) OVERRIDE;
- virtual void CloseIdleSockets() OVERRIDE;
- virtual int IdleSocketCount() const OVERRIDE;
+ int id) override;
+ virtual void FlushWithError(int error) override;
+ virtual void CloseIdleSockets() override;
+ virtual int IdleSocketCount() const override;
virtual int IdleSocketCountInGroup(
- const std::string& group_name) const OVERRIDE;
+ const std::string& group_name) const override;
virtual LoadState GetLoadState(
const std::string& group_name,
- const ClientSocketHandle* handle) const OVERRIDE;
+ const ClientSocketHandle* handle) const override;
virtual base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
- bool include_nested_pools) const OVERRIDE;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
- virtual ClientSocketPoolHistograms* histograms() const OVERRIDE;
+ bool include_nested_pools) const override;
+ virtual base::TimeDelta ConnectionTimeout() const override;
+ virtual ClientSocketPoolHistograms* histograms() const override;
// HigherLayeredPool implementation.
- virtual bool IsStalled() const OVERRIDE;
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
- virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
+ virtual bool IsStalled() const override;
+ virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
protected:
// Methods shared with WebSocketTransportClientSocketPool
@@ -287,9 +287,9 @@
virtual scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
- ConnectJob::Delegate* delegate) const OVERRIDE;
+ ConnectJob::Delegate* delegate) const override;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
+ virtual base::TimeDelta ConnectionTimeout() const override;
private:
ClientSocketFactory* const client_socket_factory_;
diff --git a/net/socket/transport_client_socket_pool_test_util.cc b/net/socket/transport_client_socket_pool_test_util.cc
index 98a615d..a56c6b1 100644
--- a/net/socket/transport_client_socket_pool_test_util.cc
+++ b/net/socket/transport_client_socket_pool_test_util.cc
@@ -38,19 +38,19 @@
use_tcp_fastopen_(false) {}
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
connected_ = true;
return OK;
}
- virtual void Disconnect() OVERRIDE { connected_ = false; }
- virtual bool IsConnected() const OVERRIDE { return connected_; }
- virtual bool IsConnectedAndIdle() const OVERRIDE { return connected_; }
+ virtual void Disconnect() override { connected_ = false; }
+ virtual bool IsConnected() const override { return connected_; }
+ virtual bool IsConnectedAndIdle() const override { return connected_; }
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetPeerAddress(IPEndPoint* address) const override {
*address = addrlist_.front();
return OK;
}
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* address) const override {
if (!connected_)
return ERR_SOCKET_NOT_CONNECTED;
if (addrlist_.front().GetFamily() == ADDRESS_FAMILY_IPV4)
@@ -59,34 +59,34 @@
SetIPv6Address(address);
return OK;
}
- virtual const BoundNetLog& NetLog() const OVERRIDE { return net_log_; }
+ virtual const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() OVERRIDE {}
- virtual void SetOmniboxSpeculation() OVERRIDE {}
- virtual bool WasEverUsed() const OVERRIDE { return false; }
- virtual void EnableTCPFastOpenIfSupported() OVERRIDE {
+ virtual void SetSubresourceSpeculation() override {}
+ virtual void SetOmniboxSpeculation() override {}
+ virtual bool WasEverUsed() const override { return false; }
+ virtual void EnableTCPFastOpenIfSupported() override {
use_tcp_fastopen_ = true;
}
- virtual bool UsingTCPFastOpen() const OVERRIDE { return use_tcp_fastopen_; }
- virtual bool WasNpnNegotiated() const OVERRIDE { return false; }
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
+ virtual bool WasNpnNegotiated() const override { return false; }
+ virtual NextProto GetNegotiatedProtocol() const override {
return kProtoUnknown;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE { return false; }
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE { return OK; }
- virtual int SetSendBufferSize(int32 size) OVERRIDE { return OK; }
+ virtual int SetReceiveBufferSize(int32 size) override { return OK; }
+ virtual int SetSendBufferSize(int32 size) override { return OK; }
private:
bool connected_;
@@ -105,49 +105,49 @@
use_tcp_fastopen_(false) {}
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
return ERR_CONNECTION_FAILED;
}
- virtual void Disconnect() OVERRIDE {}
+ virtual void Disconnect() override {}
- virtual bool IsConnected() const OVERRIDE { return false; }
- virtual bool IsConnectedAndIdle() const OVERRIDE { return false; }
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE {
+ virtual bool IsConnected() const override { return false; }
+ virtual bool IsConnectedAndIdle() const override { return false; }
+ virtual int GetPeerAddress(IPEndPoint* address) const override {
return ERR_UNEXPECTED;
}
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* address) const override {
return ERR_UNEXPECTED;
}
- virtual const BoundNetLog& NetLog() const OVERRIDE { return net_log_; }
+ virtual const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() OVERRIDE {}
- virtual void SetOmniboxSpeculation() OVERRIDE {}
- virtual bool WasEverUsed() const OVERRIDE { return false; }
- virtual void EnableTCPFastOpenIfSupported() OVERRIDE {
+ virtual void SetSubresourceSpeculation() override {}
+ virtual void SetOmniboxSpeculation() override {}
+ virtual bool WasEverUsed() const override { return false; }
+ virtual void EnableTCPFastOpenIfSupported() override {
use_tcp_fastopen_ = true;
}
- virtual bool UsingTCPFastOpen() const OVERRIDE { return use_tcp_fastopen_; }
- virtual bool WasNpnNegotiated() const OVERRIDE { return false; }
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
+ virtual bool WasNpnNegotiated() const override { return false; }
+ virtual NextProto GetNegotiatedProtocol() const override {
return kProtoUnknown;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE { return false; }
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE { return OK; }
- virtual int SetSendBufferSize(int32 size) OVERRIDE { return OK; }
+ virtual int SetReceiveBufferSize(int32 size) override { return OK; }
+ virtual int SetSendBufferSize(int32 size) override { return OK; }
private:
const AddressList addrlist_;
@@ -211,21 +211,21 @@
}
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
DCHECK(callback_.is_null());
callback_ = callback;
return ERR_IO_PENDING;
}
- virtual void Disconnect() OVERRIDE {}
+ virtual void Disconnect() override {}
- virtual bool IsConnected() const OVERRIDE { return is_connected_; }
- virtual bool IsConnectedAndIdle() const OVERRIDE { return is_connected_; }
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE {
+ virtual bool IsConnected() const override { return is_connected_; }
+ virtual bool IsConnectedAndIdle() const override { return is_connected_; }
+ virtual int GetPeerAddress(IPEndPoint* address) const override {
*address = addrlist_.front();
return OK;
}
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* address) const override {
if (!is_connected_)
return ERR_SOCKET_NOT_CONNECTED;
if (addrlist_.front().GetFamily() == ADDRESS_FAMILY_IPV4)
@@ -234,35 +234,35 @@
SetIPv6Address(address);
return OK;
}
- virtual const BoundNetLog& NetLog() const OVERRIDE { return net_log_; }
+ virtual const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() OVERRIDE {}
- virtual void SetOmniboxSpeculation() OVERRIDE {}
- virtual bool WasEverUsed() const OVERRIDE { return false; }
- virtual void EnableTCPFastOpenIfSupported() OVERRIDE {
+ virtual void SetSubresourceSpeculation() override {}
+ virtual void SetOmniboxSpeculation() override {}
+ virtual bool WasEverUsed() const override { return false; }
+ virtual void EnableTCPFastOpenIfSupported() override {
use_tcp_fastopen_ = true;
}
- virtual bool UsingTCPFastOpen() const OVERRIDE { return use_tcp_fastopen_; }
- virtual bool WasNpnNegotiated() const OVERRIDE { return false; }
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
+ virtual bool WasNpnNegotiated() const override { return false; }
+ virtual NextProto GetNegotiatedProtocol() const override {
return kProtoUnknown;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE { return false; }
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE { return OK; }
- virtual int SetSendBufferSize(int32 size) OVERRIDE { return OK; }
+ virtual int SetReceiveBufferSize(int32 size) override { return OK; }
+ virtual int SetSendBufferSize(int32 size) override { return OK; }
private:
void DoCallback() {
diff --git a/net/socket/transport_client_socket_pool_test_util.h b/net/socket/transport_client_socket_pool_test_util.h
index 40ed1d1..b4adb71 100644
--- a/net/socket/transport_client_socket_pool_test_util.h
+++ b/net/socket/transport_client_socket_pool_test_util.h
@@ -73,20 +73,20 @@
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
- const NetLog::Source& source) OVERRIDE;
+ const NetLog::Source& source) override;
virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* /* net_log */,
- const NetLog::Source& /* source */) OVERRIDE;
+ const NetLog::Source& /* source */) override;
virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
- const SSLClientSocketContext& context) OVERRIDE;
+ const SSLClientSocketContext& context) override;
- virtual void ClearSSLSessionCache() OVERRIDE;
+ virtual void ClearSSLSessionCache() override;
int allocation_count() const { return allocation_count_; }
diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc
index 5548b27..8bfb674 100644
--- a/net/socket/transport_client_socket_unittest.cc
+++ b/net/socket/transport_client_socket_unittest.cc
@@ -48,18 +48,18 @@
// Implement StreamListenSocket::Delegate methods
virtual void DidAccept(StreamListenSocket* server,
- scoped_ptr<StreamListenSocket> connection) OVERRIDE {
+ scoped_ptr<StreamListenSocket> connection) override {
connected_sock_.reset(
static_cast<TCPListenSocket*>(connection.release()));
}
- virtual void DidRead(StreamListenSocket*, const char* str, int len) OVERRIDE {
+ virtual void DidRead(StreamListenSocket*, const char* str, int len) override {
// TODO(dkegel): this might not be long enough to tickle some bugs.
connected_sock_->Send(kServerReply, arraysize(kServerReply) - 1,
false /* Don't append line feed */);
if (close_server_socket_on_next_send_)
CloseServerSocket();
}
- virtual void DidClose(StreamListenSocket* sock) OVERRIDE {}
+ virtual void DidClose(StreamListenSocket* sock) override {}
// Testcase hooks
virtual void SetUp();
diff --git a/net/socket/unix_domain_client_socket_posix.h b/net/socket/unix_domain_client_socket_posix.h
index d6f2445..e70694a 100644
--- a/net/socket/unix_domain_client_socket_posix.h
+++ b/net/socket/unix_domain_client_socket_posix.h
@@ -41,28 +41,28 @@
SockaddrStorage* address);
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
// Releases ownership of underlying SocketDescriptor to caller.
// Internal state is reset so that this object can be used again.
diff --git a/net/socket/unix_domain_listen_socket_posix.h b/net/socket/unix_domain_listen_socket_posix.h
index bbdbf5f..8b9ba8e 100644
--- a/net/socket/unix_domain_listen_socket_posix.h
+++ b/net/socket/unix_domain_listen_socket_posix.h
@@ -64,7 +64,7 @@
bool use_abstract_namespace);
// StreamListenSocket:
- virtual void Accept() OVERRIDE;
+ virtual void Accept() override;
AuthCallback auth_callback_;
@@ -83,7 +83,7 @@
// StreamListenSocketFactory:
virtual scoped_ptr<StreamListenSocket> CreateAndListen(
- StreamListenSocket::Delegate* delegate) const OVERRIDE;
+ StreamListenSocket::Delegate* delegate) const override;
protected:
const std::string path_;
@@ -107,7 +107,7 @@
// UnixDomainListenSocketFactory:
virtual scoped_ptr<StreamListenSocket> CreateAndListen(
- StreamListenSocket::Delegate* delegate) const OVERRIDE;
+ StreamListenSocket::Delegate* delegate) const override;
private:
std::string fallback_path_;
diff --git a/net/socket/unix_domain_listen_socket_posix_unittest.cc b/net/socket/unix_domain_listen_socket_posix_unittest.cc
index 117c5c5..bea60c6 100644
--- a/net/socket/unix_domain_listen_socket_posix_unittest.cc
+++ b/net/socket/unix_domain_listen_socket_posix_unittest.cc
@@ -95,7 +95,7 @@
: event_manager_(event_manager) {}
virtual void DidAccept(StreamListenSocket* server,
- scoped_ptr<StreamListenSocket> connection) OVERRIDE {
+ scoped_ptr<StreamListenSocket> connection) override {
LOG(ERROR) << __PRETTY_FUNCTION__;
connection_ = connection.Pass();
Notify(EVENT_ACCEPT);
@@ -103,7 +103,7 @@
virtual void DidRead(StreamListenSocket* connection,
const char* data,
- int len) OVERRIDE {
+ int len) override {
{
base::AutoLock lock(mutex_);
DCHECK(len);
@@ -112,7 +112,7 @@
Notify(EVENT_READ);
}
- virtual void DidClose(StreamListenSocket* sock) OVERRIDE {
+ virtual void DidClose(StreamListenSocket* sock) override {
Notify(EVENT_CLOSE);
}
@@ -169,12 +169,12 @@
return temp_dir_.path().Append(socket_name);
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
event_manager_ = new EventManager();
socket_delegate_.reset(new TestListenSocketDelegate(event_manager_));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
socket_.reset();
socket_delegate_.reset();
event_manager_ = NULL;
diff --git a/net/socket/unix_domain_server_socket_posix.h b/net/socket/unix_domain_server_socket_posix.h
index 65b3fa1..8fd8b34 100644
--- a/net/socket/unix_domain_server_socket_posix.h
+++ b/net/socket/unix_domain_server_socket_posix.h
@@ -51,13 +51,13 @@
Credentials* credentials);
// ServerSocket implementation.
- virtual int Listen(const IPEndPoint& address, int backlog) OVERRIDE;
+ virtual int Listen(const IPEndPoint& address, int backlog) override;
virtual int ListenWithAddressAndPort(const std::string& unix_domain_path,
int port_unused,
- int backlog) OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
+ int backlog) override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
virtual int Accept(scoped_ptr<StreamSocket>* socket,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
// Accepts an incoming connection on |listen_socket_|, but passes back
// a raw SocketDescriptor instead of a StreamSocket.
diff --git a/net/socket/websocket_endpoint_lock_manager_unittest.cc b/net/socket/websocket_endpoint_lock_manager_unittest.cc
index cfc6cc6..cafd1aa 100644
--- a/net/socket/websocket_endpoint_lock_manager_unittest.cc
+++ b/net/socket/websocket_endpoint_lock_manager_unittest.cc
@@ -22,57 +22,57 @@
FakeStreamSocket() {}
// StreamSocket implementation
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual void Disconnect() OVERRIDE { return; }
+ virtual void Disconnect() override { return; }
- virtual bool IsConnected() const OVERRIDE { return false; }
+ virtual bool IsConnected() const override { return false; }
- virtual bool IsConnectedAndIdle() const OVERRIDE { return false; }
+ virtual bool IsConnectedAndIdle() const override { return false; }
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetPeerAddress(IPEndPoint* address) const override {
return ERR_FAILED;
}
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE {
+ virtual int GetLocalAddress(IPEndPoint* address) const override {
return ERR_FAILED;
}
- virtual const BoundNetLog& NetLog() const OVERRIDE { return bound_net_log_; }
+ virtual const BoundNetLog& NetLog() const override { return bound_net_log_; }
- virtual void SetSubresourceSpeculation() OVERRIDE { return; }
- virtual void SetOmniboxSpeculation() OVERRIDE { return; }
+ virtual void SetSubresourceSpeculation() override { return; }
+ virtual void SetOmniboxSpeculation() override { return; }
- virtual bool WasEverUsed() const OVERRIDE { return false; }
+ virtual bool WasEverUsed() const override { return false; }
- virtual bool UsingTCPFastOpen() const OVERRIDE { return false; }
+ virtual bool UsingTCPFastOpen() const override { return false; }
- virtual bool WasNpnNegotiated() const OVERRIDE { return false; }
+ virtual bool WasNpnNegotiated() const override { return false; }
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual NextProto GetNegotiatedProtocol() const override {
return kProtoUnknown;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE { return false; }
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket implementation
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE { return ERR_FAILED; }
+ virtual int SetReceiveBufferSize(int32 size) override { return ERR_FAILED; }
- virtual int SetSendBufferSize(int32 size) OVERRIDE { return ERR_FAILED; }
+ virtual int SetSendBufferSize(int32 size) override { return ERR_FAILED; }
private:
BoundNetLog bound_net_log_;
@@ -84,7 +84,7 @@
public:
FakeWaiter() : called_(false) {}
- virtual void GotEndpointLock() OVERRIDE {
+ virtual void GotEndpointLock() override {
CHECK(!called_);
called_ = true;
}
diff --git a/net/socket/websocket_transport_client_socket_pool.h b/net/socket/websocket_transport_client_socket_pool.h
index 74b8f78..e918354 100644
--- a/net/socket/websocket_transport_client_socket_pool.h
+++ b/net/socket/websocket_transport_client_socket_pool.h
@@ -65,7 +65,7 @@
const BoundNetLog& request_net_log() const { return request_net_log_; }
// ConnectJob methods.
- virtual LoadState GetLoadState() const OVERRIDE;
+ virtual LoadState GetLoadState() const override;
private:
friend class WebSocketTransportConnectSubJob;
@@ -90,7 +90,7 @@
// Begins the host resolution and the TCP connect. Returns OK on success
// and ERR_IO_PENDING if it cannot immediately service the request.
// Otherwise, it returns a net error code.
- virtual int ConnectInternal() OVERRIDE;
+ virtual int ConnectInternal() override;
TransportConnectJobHelper helper_;
@@ -138,33 +138,33 @@
RequestPriority priority,
ClientSocketHandle* handle,
const CompletionCallback& callback,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void RequestSockets(const std::string& group_name,
const void* params,
int num_sockets,
- const BoundNetLog& net_log) OVERRIDE;
+ const BoundNetLog& net_log) override;
virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) OVERRIDE;
+ ClientSocketHandle* handle) override;
virtual void ReleaseSocket(const std::string& group_name,
scoped_ptr<StreamSocket> socket,
- int id) OVERRIDE;
- virtual void FlushWithError(int error) OVERRIDE;
- virtual void CloseIdleSockets() OVERRIDE;
- virtual int IdleSocketCount() const OVERRIDE;
+ int id) override;
+ virtual void FlushWithError(int error) override;
+ virtual void CloseIdleSockets() override;
+ virtual int IdleSocketCount() const override;
virtual int IdleSocketCountInGroup(
- const std::string& group_name) const OVERRIDE;
+ const std::string& group_name) const override;
virtual LoadState GetLoadState(
const std::string& group_name,
- const ClientSocketHandle* handle) const OVERRIDE;
+ const ClientSocketHandle* handle) const override;
virtual base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
- bool include_nested_pools) const OVERRIDE;
- virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
- virtual ClientSocketPoolHistograms* histograms() const OVERRIDE;
+ bool include_nested_pools) const override;
+ virtual base::TimeDelta ConnectionTimeout() const override;
+ virtual ClientSocketPoolHistograms* histograms() const override;
// HigherLayeredPool implementation.
- virtual bool IsStalled() const OVERRIDE;
+ virtual bool IsStalled() const override;
private:
class ConnectJobDelegate : public ConnectJob::Delegate {
@@ -172,7 +172,7 @@
explicit ConnectJobDelegate(WebSocketTransportClientSocketPool* owner);
virtual ~ConnectJobDelegate();
- virtual void OnConnectJobComplete(int result, ConnectJob* job) OVERRIDE;
+ virtual void OnConnectJobComplete(int result, ConnectJob* job) override;
private:
WebSocketTransportClientSocketPool* owner_;
diff --git a/net/socket/websocket_transport_connect_sub_job.h b/net/socket/websocket_transport_connect_sub_job.h
index 79980d2..e6f81e8 100644
--- a/net/socket/websocket_transport_connect_sub_job.h
+++ b/net/socket/websocket_transport_connect_sub_job.h
@@ -47,7 +47,7 @@
scoped_ptr<StreamSocket> PassSocket() { return transport_socket_.Pass(); }
// Implementation of WebSocketEndpointLockManager::EndpointWaiter.
- virtual void GotEndpointLock() OVERRIDE;
+ virtual void GotEndpointLock() override;
private:
enum State {
diff --git a/net/socket_stream/socket_stream_unittest.cc b/net/socket_stream/socket_stream_unittest.cc
index 069f92e..7c4b50e 100644
--- a/net/socket_stream/socket_stream_unittest.cc
+++ b/net/socket_stream/socket_stream_unittest.cc
@@ -90,7 +90,7 @@
virtual int OnStartOpenConnection(
SocketStream* socket,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
connection_callback_ = callback;
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_START_OPEN_CONNECTION,
@@ -100,7 +100,7 @@
return OK;
}
virtual void OnConnected(SocketStream* socket,
- int num_pending_send_allowed) OVERRIDE {
+ int num_pending_send_allowed) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_CONNECTED,
socket, num_pending_send_allowed, std::string(),
@@ -109,7 +109,7 @@
on_connected_.Run(&events_.back());
}
virtual void OnSentData(SocketStream* socket,
- int amount_sent) OVERRIDE {
+ int amount_sent) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_SENT_DATA, socket,
amount_sent, std::string(), NULL, OK));
@@ -117,14 +117,14 @@
on_sent_data_.Run(&events_.back());
}
virtual void OnReceivedData(SocketStream* socket,
- const char* data, int len) OVERRIDE {
+ const char* data, int len) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_RECEIVED_DATA, socket, len,
std::string(data, len), NULL, OK));
if (!on_received_data_.is_null())
on_received_data_.Run(&events_.back());
}
- virtual void OnClose(SocketStream* socket) OVERRIDE {
+ virtual void OnClose(SocketStream* socket) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_CLOSE, socket, 0,
std::string(), NULL, OK));
@@ -134,14 +134,14 @@
callback_.Run(OK);
}
virtual void OnAuthRequired(SocketStream* socket,
- AuthChallengeInfo* auth_info) OVERRIDE {
+ AuthChallengeInfo* auth_info) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_AUTH_REQUIRED, socket, 0,
std::string(), auth_info, OK));
if (!on_auth_required_.is_null())
on_auth_required_.Run(&events_.back());
}
- virtual void OnError(const SocketStream* socket, int error) OVERRIDE {
+ virtual void OnError(const SocketStream* socket, int error) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_ERROR, NULL, 0,
std::string(), NULL, error));
@@ -198,7 +198,7 @@
virtual ~SelfDeletingDelegate() {}
// Call DetachDelegate(), delete |this|, then run the callback.
- virtual void OnError(const SocketStream* socket, int error) OVERRIDE {
+ virtual void OnError(const SocketStream* socket, int error) override {
// callback_ will be deleted when we delete |this|, so copy it to call it
// afterwards.
CompletionCallback callback = callback_;
@@ -215,17 +215,17 @@
}
virtual void OnConnected(SocketStream* socket, int max_pending_send_allowed)
- OVERRIDE {
+ override {
ADD_FAILURE() << "OnConnected() should not be called";
}
- virtual void OnSentData(SocketStream* socket, int amount_sent) OVERRIDE {
+ virtual void OnSentData(SocketStream* socket, int amount_sent) override {
ADD_FAILURE() << "OnSentData() should not be called";
}
virtual void OnReceivedData(SocketStream* socket, const char* data, int len)
- OVERRIDE {
+ override {
ADD_FAILURE() << "OnReceivedData() should not be called";
}
- virtual void OnClose(SocketStream* socket) OVERRIDE {
+ virtual void OnClose(SocketStream* socket) override {
ADD_FAILURE() << "OnClose() should not be called";
}
@@ -254,7 +254,7 @@
virtual int OnBeforeSocketStreamConnect(
SocketStream* stream,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return before_connect_result_;
}
diff --git a/net/spdy/buffered_spdy_framer.h b/net/spdy/buffered_spdy_framer.h
index 426bc5f..fba98d7 100644
--- a/net/spdy/buffered_spdy_framer.h
+++ b/net/spdy/buffered_spdy_framer.h
@@ -135,41 +135,41 @@
void set_debug_visitor(SpdyFramerDebugVisitorInterface* debug_visitor);
// SpdyFramerVisitorInterface
- virtual void OnError(SpdyFramer* spdy_framer) OVERRIDE;
+ virtual void OnError(SpdyFramer* spdy_framer) override;
virtual void OnSynStream(SpdyStreamId stream_id,
SpdyStreamId associated_stream_id,
SpdyPriority priority,
bool fin,
- bool unidirectional) OVERRIDE;
- virtual void OnSynReply(SpdyStreamId stream_id, bool fin) OVERRIDE;
- virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) OVERRIDE;
+ bool unidirectional) override;
+ virtual void OnSynReply(SpdyStreamId stream_id, bool fin) override;
+ virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override;
virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id,
const char* header_data,
- size_t len) OVERRIDE;
+ size_t len) override;
virtual void OnStreamFrameData(SpdyStreamId stream_id,
const char* data,
size_t len,
- bool fin) OVERRIDE;
- virtual void OnSettings(bool clear_persisted) OVERRIDE;
+ bool fin) override;
+ virtual void OnSettings(bool clear_persisted) override;
virtual void OnSetting(
- SpdySettingsIds id, uint8 flags, uint32 value) OVERRIDE;
- virtual void OnSettingsAck() OVERRIDE;
- virtual void OnSettingsEnd() OVERRIDE;
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) OVERRIDE;
+ SpdySettingsIds id, uint8 flags, uint32 value) override;
+ virtual void OnSettingsAck() override;
+ virtual void OnSettingsEnd() override;
+ virtual void OnPing(SpdyPingId unique_id, bool is_ack) override;
virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) OVERRIDE;
+ SpdyRstStreamStatus status) override;
virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) OVERRIDE;
+ SpdyGoAwayStatus status) override;
virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) OVERRIDE;
+ uint32 delta_window_size) override;
virtual void OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- bool end) OVERRIDE;
+ bool end) override;
virtual void OnDataFrameHeader(SpdyStreamId stream_id,
size_t length,
- bool fin) OVERRIDE;
- virtual void OnContinuation(SpdyStreamId stream_id, bool end) OVERRIDE;
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) OVERRIDE;
+ bool fin) override;
+ virtual void OnContinuation(SpdyStreamId stream_id, bool end) override;
+ virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override;
// SpdyFramer methods.
size_t ProcessInput(const char* data, size_t len);
diff --git a/net/spdy/buffered_spdy_framer_unittest.cc b/net/spdy/buffered_spdy_framer_unittest.cc
index 3e106f9..0fc758b 100644
--- a/net/spdy/buffered_spdy_framer_unittest.cc
+++ b/net/spdy/buffered_spdy_framer_unittest.cc
@@ -25,14 +25,14 @@
promised_stream_id_(static_cast<SpdyStreamId>(-1)) {
}
- virtual void OnError(SpdyFramer::SpdyError error_code) OVERRIDE {
+ virtual void OnError(SpdyFramer::SpdyError error_code) override {
LOG(INFO) << "SpdyFramer Error: " << error_code;
error_count_++;
}
virtual void OnStreamError(
SpdyStreamId stream_id,
- const std::string& description) OVERRIDE {
+ const std::string& description) override {
LOG(INFO) << "SpdyFramer Error on stream: " << stream_id << " "
<< description;
error_count_++;
@@ -43,7 +43,7 @@
SpdyPriority priority,
bool fin,
bool unidirectional,
- const SpdyHeaderBlock& headers) OVERRIDE {
+ const SpdyHeaderBlock& headers) override {
header_stream_id_ = stream_id;
EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
syn_frame_count_++;
@@ -52,7 +52,7 @@
virtual void OnSynReply(SpdyStreamId stream_id,
bool fin,
- const SpdyHeaderBlock& headers) OVERRIDE {
+ const SpdyHeaderBlock& headers) override {
header_stream_id_ = stream_id;
EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
syn_reply_frame_count_++;
@@ -61,7 +61,7 @@
virtual void OnHeaders(SpdyStreamId stream_id,
bool fin,
- const SpdyHeaderBlock& headers) OVERRIDE {
+ const SpdyHeaderBlock& headers) override {
header_stream_id_ = stream_id;
EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
headers_frame_count_++;
@@ -70,33 +70,33 @@
virtual void OnDataFrameHeader(SpdyStreamId stream_id,
size_t length,
- bool fin) OVERRIDE {
+ bool fin) override {
ADD_FAILURE() << "Unexpected OnDataFrameHeader call.";
}
virtual void OnStreamFrameData(SpdyStreamId stream_id,
const char* data,
size_t len,
- bool fin) OVERRIDE {
+ bool fin) override {
LOG(FATAL) << "Unexpected OnStreamFrameData call.";
}
- virtual void OnSettings(bool clear_persisted) OVERRIDE {}
+ virtual void OnSettings(bool clear_persisted) override {}
virtual void OnSetting(SpdySettingsIds id,
uint8 flags,
- uint32 value) OVERRIDE {
+ uint32 value) override {
setting_count_++;
}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) OVERRIDE {}
+ virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {}
virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) OVERRIDE {
+ SpdyRstStreamStatus status) override {
}
virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) OVERRIDE {
+ SpdyGoAwayStatus status) override {
}
bool OnCredentialFrameData(const char*, size_t) {
@@ -112,11 +112,11 @@
void OnGoAway(const SpdyFrame& frame) {}
void OnPing(const SpdyFrame& frame) {}
virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) OVERRIDE {}
+ uint32 delta_window_size) override {}
virtual void OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- const SpdyHeaderBlock& headers) OVERRIDE {
+ const SpdyHeaderBlock& headers) override {
header_stream_id_ = stream_id;
EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
push_promise_frame_count_++;
@@ -125,7 +125,7 @@
headers_ = headers;
}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) OVERRIDE {
+ virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
return true;
}
diff --git a/net/spdy/spdy_buffer_producer.h b/net/spdy/spdy_buffer_producer.h
index fe82b1a..d8777af 100644
--- a/net/spdy/spdy_buffer_producer.h
+++ b/net/spdy/spdy_buffer_producer.h
@@ -37,7 +37,7 @@
virtual ~SimpleBufferProducer();
- virtual scoped_ptr<SpdyBuffer> ProduceBuffer() OVERRIDE;
+ virtual scoped_ptr<SpdyBuffer> ProduceBuffer() override;
private:
scoped_ptr<SpdyBuffer> buffer_;
diff --git a/net/spdy/spdy_frame_builder.cc b/net/spdy/spdy_frame_builder.cc
index b491e8b..0b85211 100644
--- a/net/spdy/spdy_frame_builder.cc
+++ b/net/spdy/spdy_frame_builder.cc
@@ -63,8 +63,8 @@
SpdyFrameType type,
uint8 flags) {
DCHECK_GE(SPDY3, version_);
- DCHECK_NE(-1,
- SpdyConstants::SerializeFrameType(version_, type));
+ DCHECK(SpdyConstants::IsValidFrameType(
+ version_, SpdyConstants::SerializeFrameType(version_, type)));
bool success = true;
FlagsAndLength flags_length = CreateFlagsAndLength(
flags, capacity_ - framer.GetControlFrameHeaderSize());
@@ -101,10 +101,10 @@
SpdyFrameType type,
uint8 flags,
SpdyStreamId stream_id) {
- DCHECK(SpdyConstants::IsValidFrameType(version_,
- SpdyConstants::SerializeFrameType(version_, type)));
+ DCHECK(SpdyConstants::IsValidFrameType(
+ version_, SpdyConstants::SerializeFrameType(version_, type)));
DCHECK_EQ(0u, stream_id & ~kStreamIdMask);
- DCHECK_LT(SPDY3, framer.protocol_version());
+ DCHECK_GT(framer.protocol_version(), SPDY3);
bool success = true;
if (length_ > 0) {
// Update length field for previous frame.
@@ -136,7 +136,7 @@
return false;
}
- if (!WriteUInt16(static_cast<int>(value.size())))
+ if (!WriteUInt16(static_cast<uint16>(value.size())))
return false;
return WriteBytes(value.data(), static_cast<uint16>(value.size()));
@@ -168,17 +168,17 @@
bool SpdyFrameBuilder::OverwriteLength(const SpdyFramer& framer,
size_t length) {
- if (version_ <= SPDY3) {
- DCHECK_GE(SpdyConstants::GetFrameMaximumSize(version_) -
- framer.GetFrameMinimumSize(),
- length);
+ if (version_ < SPDY4) {
+ DCHECK_LE(length,
+ SpdyConstants::GetFrameMaximumSize(version_) -
+ framer.GetFrameMinimumSize());
} else {
- DCHECK_GE(SpdyConstants::GetFrameMaximumSize(version_), length);
+ DCHECK_LE(length, SpdyConstants::GetFrameMaximumSize(version_));
}
bool success = false;
const size_t old_length = length_;
- if (version_ <= SPDY3) {
+ if (version_ < SPDY4) {
FlagsAndLength flags_length = CreateFlagsAndLength(
0, // We're not writing over the flags value anyway.
length);
@@ -198,7 +198,7 @@
bool SpdyFrameBuilder::OverwriteFlags(const SpdyFramer& framer,
uint8 flags) {
- DCHECK_LT(SPDY3, framer.protocol_version());
+ DCHECK_GT(framer.protocol_version(), SPDY3);
bool success = false;
const size_t old_length = length_;
// Flags are the fifth octet in the frame prefix.
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index edcc82e..fbe3675 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -675,15 +675,15 @@
new SpdyFrameReader(current_frame_buffer_.get(),
current_frame_buffer_length_));
- uint16 version = 0;
bool is_control_frame = false;
uint16 control_frame_type_field =
- SpdyConstants::DataFrameType(protocol_version());
+ SpdyConstants::DataFrameType(protocol_version());
// ProcessControlFrameHeader() will set current_frame_type_ to the
// correct value if this is a valid control frame.
current_frame_type_ = DATA;
if (protocol_version() <= SPDY3) {
+ uint16 version = 0;
bool successful_read = reader->ReadUInt16(&version);
DCHECK(successful_read);
is_control_frame = (version & kControlFlagMask) != 0;
@@ -700,9 +700,6 @@
<< " (expected " << protocol_version() << ")";
set_error(SPDY_UNSUPPORTED_VERSION);
return 0;
- } else {
- // Convert version from wire format to SpdyMajorVersion.
- version = SpdyConstants::ParseMajorVersion(version);
}
// We check control_frame_type_field's validity in
// ProcessControlFrameHeader().
@@ -722,7 +719,6 @@
remaining_data_length_ = length_field;
current_frame_length_ = remaining_data_length_ + reader->GetBytesConsumed();
} else {
- version = protocol_version();
uint32 length_field = 0;
bool successful_read = reader->ReadUInt24(&length_field);
DCHECK(successful_read);
@@ -1173,9 +1169,9 @@
const SpdyMajorVersion spdy_version,
const SpdyHeaderBlock* headers) {
if (spdy_version < SPDY3) {
- frame->WriteUInt16(headers->size()); // Number of headers.
+ frame->WriteUInt16(headers->size());
} else {
- frame->WriteUInt32(headers->size()); // Number of headers.
+ frame->WriteUInt32(headers->size());
}
SpdyHeaderBlock::const_iterator it;
for (it = headers->begin(); it != headers->end(); ++it) {
@@ -2847,49 +2843,49 @@
SpdySerializedFrame* ReleaseSerializedFrame() { return frame_.release(); }
- virtual void VisitData(const SpdyDataIR& data) OVERRIDE {
+ virtual void VisitData(const SpdyDataIR& data) override {
frame_.reset(framer_->SerializeData(data));
}
- virtual void VisitSynStream(const SpdySynStreamIR& syn_stream) OVERRIDE {
+ virtual void VisitSynStream(const SpdySynStreamIR& syn_stream) override {
frame_.reset(framer_->SerializeSynStream(syn_stream));
}
- virtual void VisitSynReply(const SpdySynReplyIR& syn_reply) OVERRIDE {
+ virtual void VisitSynReply(const SpdySynReplyIR& syn_reply) override {
frame_.reset(framer_->SerializeSynReply(syn_reply));
}
- virtual void VisitRstStream(const SpdyRstStreamIR& rst_stream) OVERRIDE {
+ virtual void VisitRstStream(const SpdyRstStreamIR& rst_stream) override {
frame_.reset(framer_->SerializeRstStream(rst_stream));
}
- virtual void VisitSettings(const SpdySettingsIR& settings) OVERRIDE {
+ virtual void VisitSettings(const SpdySettingsIR& settings) override {
frame_.reset(framer_->SerializeSettings(settings));
}
- virtual void VisitPing(const SpdyPingIR& ping) OVERRIDE {
+ virtual void VisitPing(const SpdyPingIR& ping) override {
frame_.reset(framer_->SerializePing(ping));
}
- virtual void VisitGoAway(const SpdyGoAwayIR& goaway) OVERRIDE {
+ virtual void VisitGoAway(const SpdyGoAwayIR& goaway) override {
frame_.reset(framer_->SerializeGoAway(goaway));
}
- virtual void VisitHeaders(const SpdyHeadersIR& headers) OVERRIDE {
+ virtual void VisitHeaders(const SpdyHeadersIR& headers) override {
frame_.reset(framer_->SerializeHeaders(headers));
}
virtual void VisitWindowUpdate(
- const SpdyWindowUpdateIR& window_update) OVERRIDE {
+ const SpdyWindowUpdateIR& window_update) override {
frame_.reset(framer_->SerializeWindowUpdate(window_update));
}
- virtual void VisitBlocked(const SpdyBlockedIR& blocked) OVERRIDE {
+ virtual void VisitBlocked(const SpdyBlockedIR& blocked) override {
frame_.reset(framer_->SerializeBlocked(blocked));
}
virtual void VisitPushPromise(
- const SpdyPushPromiseIR& push_promise) OVERRIDE {
+ const SpdyPushPromiseIR& push_promise) override {
frame_.reset(framer_->SerializePushPromise(push_promise));
}
virtual void VisitContinuation(
- const SpdyContinuationIR& continuation) OVERRIDE {
+ const SpdyContinuationIR& continuation) override {
frame_.reset(framer_->SerializeContinuation(continuation));
}
- virtual void VisitAltSvc(const SpdyAltSvcIR& altsvc) OVERRIDE {
+ virtual void VisitAltSvc(const SpdyAltSvcIR& altsvc) override {
frame_.reset(framer_->SerializeAltSvc(altsvc));
}
- virtual void VisitPriority(const SpdyPriorityIR& priority) OVERRIDE {
+ virtual void VisitPriority(const SpdyPriorityIR& priority) override {
frame_.reset(framer_->SerializePriority(priority));
}
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc
index 2676b4d..07b23ac 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -82,22 +82,22 @@
buffer_.reset(new char[kMaxDecompressedSize]);
}
- virtual void OnError(SpdyFramer* framer) OVERRIDE { LOG(FATAL); }
+ virtual void OnError(SpdyFramer* framer) override { LOG(FATAL); }
virtual void OnDataFrameHeader(SpdyStreamId stream_id,
size_t length,
- bool fin) OVERRIDE {
+ bool fin) override {
LOG(FATAL) << "Unexpected data frame header";
}
virtual void OnStreamFrameData(SpdyStreamId stream_id,
const char* data,
size_t len,
- bool fin) OVERRIDE {
+ bool fin) override {
LOG(FATAL);
}
virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id,
const char* header_data,
- size_t len) OVERRIDE {
+ size_t len) override {
CHECK(buffer_.get() != NULL);
CHECK_GE(kMaxDecompressedSize, size_ + len);
CHECK(!finished_);
@@ -115,7 +115,7 @@
SpdyStreamId associated_stream_id,
SpdyPriority priority,
bool fin,
- bool unidirectional) OVERRIDE {
+ bool unidirectional) override {
SpdyFramer framer(version_);
framer.set_enable_compression(false);
SpdySynStreamIR syn_stream(stream_id);
@@ -129,7 +129,7 @@
size_ += framer.GetSynStreamMinimumSize();
}
- virtual void OnSynReply(SpdyStreamId stream_id, bool fin) OVERRIDE {
+ virtual void OnSynReply(SpdyStreamId stream_id, bool fin) override {
SpdyFramer framer(version_);
framer.set_enable_compression(false);
SpdyHeadersIR headers(stream_id);
@@ -141,26 +141,26 @@
}
virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) OVERRIDE {
+ SpdyRstStreamStatus status) override {
LOG(FATAL);
}
virtual void OnSetting(SpdySettingsIds id,
uint8 flags,
- uint32 value) OVERRIDE {
+ uint32 value) override {
LOG(FATAL);
}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) OVERRIDE {
+ virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {
LOG(FATAL);
}
- virtual void OnSettingsEnd() OVERRIDE { LOG(FATAL); }
+ virtual void OnSettingsEnd() override { LOG(FATAL); }
virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) OVERRIDE {
+ SpdyGoAwayStatus status) override {
LOG(FATAL);
}
virtual void OnHeaders(SpdyStreamId stream_id,
bool fin,
- bool end) OVERRIDE {
+ bool end) override {
SpdyFramer framer(version_);
framer.set_enable_compression(false);
SpdyHeadersIR headers(stream_id);
@@ -177,7 +177,7 @@
virtual void OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- bool end) OVERRIDE {
+ bool end) override {
SpdyFramer framer(version_);
framer.set_enable_compression(false);
SpdyPushPromiseIR push_promise(stream_id, promised_stream_id);
@@ -187,19 +187,19 @@
size_ += framer.GetPushPromiseMinimumSize();
}
- virtual void OnContinuation(SpdyStreamId stream_id, bool end) OVERRIDE {
+ virtual void OnContinuation(SpdyStreamId stream_id, bool end) override {
LOG(FATAL);
}
virtual void OnPriority(SpdyStreamId stream_id,
SpdyStreamId parent_stream_id,
uint8 weight,
- bool exclusive) OVERRIDE {
+ bool exclusive) override {
// Do nothing.
}
virtual bool OnUnknownFrame(SpdyStreamId stream_id,
- int frame_type) OVERRIDE {
+ int frame_type) override {
LOG(FATAL);
return false;
}
@@ -210,7 +210,7 @@
}
virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) OVERRIDE {
+ uint32 delta_window_size) override {
LOG(FATAL);
}
@@ -277,7 +277,7 @@
header_control_type_(DATA),
header_buffer_valid_(false) {}
- virtual void OnError(SpdyFramer* f) OVERRIDE {
+ virtual void OnError(SpdyFramer* f) override {
LOG(INFO) << "SpdyFramer Error: "
<< SpdyFramer::ErrorCodeToString(f->error_code());
++error_count_;
@@ -285,7 +285,7 @@
virtual void OnDataFrameHeader(SpdyStreamId stream_id,
size_t length,
- bool fin) OVERRIDE {
+ bool fin) override {
++data_frame_count_;
header_stream_id_ = stream_id;
}
@@ -293,7 +293,7 @@
virtual void OnStreamFrameData(SpdyStreamId stream_id,
const char* data,
size_t len,
- bool fin) OVERRIDE {
+ bool fin) override {
EXPECT_EQ(header_stream_id_, stream_id);
if (len == 0)
++zero_length_data_frame_count_;
@@ -310,7 +310,7 @@
virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id,
const char* header_data,
- size_t len) OVERRIDE {
+ size_t len) override {
++control_frame_header_data_count_;
CHECK_EQ(header_stream_id_, stream_id);
if (len == 0) {
@@ -339,7 +339,7 @@
SpdyStreamId associated_stream_id,
SpdyPriority priority,
bool fin,
- bool unidirectional) OVERRIDE {
+ bool unidirectional) override {
++syn_frame_count_;
if (framer_.protocol_version() > SPDY3) {
InitHeaderStreaming(HEADERS, stream_id);
@@ -351,7 +351,7 @@
}
}
- virtual void OnSynReply(SpdyStreamId stream_id, bool fin) OVERRIDE {
+ virtual void OnSynReply(SpdyStreamId stream_id, bool fin) override {
++syn_reply_frame_count_;
if (framer_.protocol_version() > SPDY3) {
InitHeaderStreaming(HEADERS, stream_id);
@@ -364,12 +364,12 @@
}
virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) OVERRIDE {
+ SpdyRstStreamStatus status) override {
++fin_frame_count_;
}
virtual bool OnRstStreamFrameData(const char* rst_stream_data,
- size_t len) OVERRIDE {
+ size_t len) override {
if ((rst_stream_data != NULL) && (len > 0)) {
fin_opaque_data_ += std::string(rst_stream_data, len);
}
@@ -378,30 +378,30 @@
virtual void OnSetting(SpdySettingsIds id,
uint8 flags,
- uint32 value) OVERRIDE {
+ uint32 value) override {
++setting_count_;
}
- virtual void OnSettingsAck() OVERRIDE {
+ virtual void OnSettingsAck() override {
DCHECK_LT(SPDY3, framer_.protocol_version());
++settings_ack_received_;
}
- virtual void OnSettingsEnd() OVERRIDE {
+ virtual void OnSettingsEnd() override {
if (framer_.protocol_version() <= SPDY3) { return; }
++settings_ack_sent_;
}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) OVERRIDE {
+ virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {
DLOG(FATAL);
}
virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) OVERRIDE {
+ SpdyGoAwayStatus status) override {
++goaway_count_;
}
- virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) OVERRIDE {
+ virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override {
++headers_frame_count_;
InitHeaderStreaming(HEADERS, stream_id);
if (fin) {
@@ -410,21 +410,21 @@
}
virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) OVERRIDE {
+ uint32 delta_window_size) override {
last_window_update_stream_ = stream_id;
last_window_update_delta_ = delta_window_size;
}
virtual void OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- bool end) OVERRIDE {
+ bool end) override {
++push_promise_frame_count_;
InitHeaderStreaming(PUSH_PROMISE, stream_id);
last_push_promise_stream_ = stream_id;
last_push_promise_promised_stream_ = promised_stream_id;
}
- virtual void OnContinuation(SpdyStreamId stream_id, bool end) OVERRIDE {
+ virtual void OnContinuation(SpdyStreamId stream_id, bool end) override {
++continuation_count_;
}
@@ -433,7 +433,7 @@
uint16 port,
StringPiece protocol_id,
StringPiece host,
- StringPiece origin) OVERRIDE {
+ StringPiece origin) override {
test_altsvc_ir_.set_stream_id(stream_id);
test_altsvc_ir_.set_max_age(max_age);
test_altsvc_ir_.set_port(port);
@@ -448,11 +448,11 @@
virtual void OnPriority(SpdyStreamId stream_id,
SpdyStreamId parent_stream_id,
uint8 weight,
- bool exclusive) OVERRIDE {
+ bool exclusive) override {
++priority_count_;
}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) OVERRIDE {
+ virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
DLOG(INFO) << "Unknown frame type " << frame_type;
return on_unknown_frame_result_;
}
@@ -460,14 +460,14 @@
virtual void OnSendCompressedFrame(SpdyStreamId stream_id,
SpdyFrameType type,
size_t payload_len,
- size_t frame_len) OVERRIDE {
+ size_t frame_len) override {
last_payload_len_ = payload_len;
last_frame_len_ = frame_len;
}
virtual void OnReceiveCompressedFrame(SpdyStreamId stream_id,
SpdyFrameType type,
- size_t frame_len) OVERRIDE {
+ size_t frame_len) override {
last_frame_len_ = frame_len;
}
diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h
index 0f37c66..fe3c87d 100644
--- a/net/spdy/spdy_http_stream.h
+++ b/net/spdy/spdy_http_stream.h
@@ -44,44 +44,44 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int SendRequest(const HttpRequestHeaders& headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE;
- virtual UploadProgress GetUploadProgress() const OVERRIDE;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual UploadProgress GetUploadProgress() const override;
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
virtual int ReadResponseBody(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Close(bool not_reusable) OVERRIDE;
- virtual HttpStream* RenewStreamForAuth() OVERRIDE;
- virtual bool IsResponseBodyComplete() const OVERRIDE;
- virtual bool CanFindEndOfResponse() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void Close(bool not_reusable) override;
+ virtual HttpStream* RenewStreamForAuth() override;
+ virtual bool IsResponseBodyComplete() const override;
+ virtual bool CanFindEndOfResponse() const override;
// Must not be called if a NULL SpdySession was pssed into the
// constructor.
- virtual bool IsConnectionReused() const OVERRIDE;
+ virtual bool IsConnectionReused() const override;
- virtual void SetConnectionReused() OVERRIDE;
- virtual bool IsConnectionReusable() const OVERRIDE;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
+ virtual void SetConnectionReused() override;
+ virtual bool IsConnectionReusable() const override;
+ virtual int64 GetTotalReceivedBytes() const override;
virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override;
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE;
- virtual bool IsSpdyHttpStream() const OVERRIDE;
- virtual void Drain(HttpNetworkSession* session) OVERRIDE;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
+ SSLCertRequestInfo* cert_request_info) override;
+ virtual bool IsSpdyHttpStream() const override;
+ virtual void Drain(HttpNetworkSession* session) override;
+ virtual void SetPriority(RequestPriority priority) override;
// SpdyStream::Delegate implementation.
- virtual void OnRequestHeadersSent() OVERRIDE;
+ virtual void OnRequestHeadersSent() override;
virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
- virtual void OnDataSent() OVERRIDE;
- virtual void OnClose(int status) OVERRIDE;
+ const SpdyHeaderBlock& response_headers) override;
+ virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ virtual void OnDataSent() override;
+ virtual void OnClose(int status) override;
private:
// Must be called only when |request_info_| is non-NULL.
diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc
index f51133f..f1c1de2 100644
--- a/net/spdy/spdy_http_stream_unittest.cc
+++ b/net/spdy/spdy_http_stream_unittest.cc
@@ -14,10 +14,10 @@
#include "crypto/ec_signature_creator.h"
#include "crypto/signature_creator.h"
#include "net/base/capturing_net_log.h"
+#include "net/base/chunked_upload_data_stream.h"
#include "net/base/load_timing_info.h"
#include "net/base/load_timing_info_test_util.h"
-#include "net/base/upload_data_stream.h"
-#include "net/base/upload_element_reader.h"
+#include "net/base/test_completion_callback.h"
#include "net/cert/asn1_util.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
@@ -79,7 +79,7 @@
OrderedSocketData* data() { return data_.get(); }
protected:
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
crypto::ECSignatureCreator::SetFactoryForTesting(NULL);
base::MessageLoop::current()->RunUntilIdle();
}
@@ -338,10 +338,10 @@
key);
EXPECT_EQ(spdy_util_.spdy_version(), session_->GetProtocolVersion());
- UploadDataStream upload_stream(UploadDataStream::CHUNKED, 0);
+ ChunkedUploadDataStream upload_stream(0);
const int kFirstChunkSize = kUploadDataSize/2;
- upload_stream.AppendChunk(kUploadData, kFirstChunkSize, false);
- upload_stream.AppendChunk(kUploadData + kFirstChunkSize,
+ upload_stream.AppendData(kUploadData, kFirstChunkSize, false);
+ upload_stream.AppendData(kUploadData + kFirstChunkSize,
kUploadDataSize - kFirstChunkSize, true);
HttpRequestInfo request;
@@ -349,7 +349,7 @@
request.url = GURL("http://www.google.com/");
request.upload_data_stream = &upload_stream;
- ASSERT_EQ(OK, upload_stream.Init(CompletionCallback()));
+ ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback()));
TestCompletionCallback callback;
HttpResponseInfo response;
@@ -413,15 +413,15 @@
writes, arraysize(writes),
key);
- UploadDataStream upload_stream(UploadDataStream::CHUNKED, 0);
+ ChunkedUploadDataStream upload_stream(0);
HttpRequestInfo request;
request.method = "POST";
request.url = GURL("http://www.google.com/");
request.upload_data_stream = &upload_stream;
- ASSERT_EQ(OK, upload_stream.Init(CompletionCallback()));
- upload_stream.AppendChunk(kUploadData, kUploadDataSize, false);
+ ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback()));
+ upload_stream.AppendData(kUploadData, kUploadDataSize, false);
BoundNetLog net_log;
scoped_ptr<SpdyHttpStream> http_stream(new SpdyHttpStream(session_, true));
@@ -443,8 +443,8 @@
EXPECT_EQ(OK, callback.WaitForResult());
// Now append the final two chunks which will enqueue two more writes.
- upload_stream.AppendChunk(kUploadData1, kUploadData1Size, false);
- upload_stream.AppendChunk(kUploadData, kUploadDataSize, true);
+ upload_stream.AppendData(kUploadData1, kUploadData1Size, false);
+ upload_stream.AppendData(kUploadData, kUploadDataSize, true);
// Finish writing all the chunks.
deterministic_data()->RunFor(2);
@@ -512,15 +512,15 @@
writes, arraysize(writes),
key);
- UploadDataStream upload_stream(UploadDataStream::CHUNKED, 0);
+ ChunkedUploadDataStream upload_stream(0);
HttpRequestInfo request;
request.method = "POST";
request.url = GURL("http://www.google.com/");
request.upload_data_stream = &upload_stream;
- ASSERT_EQ(OK, upload_stream.Init(CompletionCallback()));
- upload_stream.AppendChunk(kUploadData, kUploadDataSize, false);
+ ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback()));
+ upload_stream.AppendData(kUploadData, kUploadDataSize, false);
BoundNetLog net_log;
scoped_ptr<SpdyHttpStream> http_stream(new SpdyHttpStream(session_, true));
@@ -542,7 +542,7 @@
EXPECT_EQ(OK, callback.WaitForResult());
// Now end the stream with an empty data frame and the FIN set.
- upload_stream.AppendChunk(NULL, 0, true);
+ upload_stream.AppendData(NULL, 0, true);
// Finish writing the final frame.
deterministic_data()->RunFor(1);
@@ -597,15 +597,15 @@
writes, arraysize(writes),
key);
- UploadDataStream upload_stream(UploadDataStream::CHUNKED, 0);
+ ChunkedUploadDataStream upload_stream(0);
HttpRequestInfo request;
request.method = "POST";
request.url = GURL("http://www.google.com/");
request.upload_data_stream = &upload_stream;
- ASSERT_EQ(OK, upload_stream.Init(CompletionCallback()));
- upload_stream.AppendChunk("", 0, true);
+ ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback()));
+ upload_stream.AppendData("", 0, true);
BoundNetLog net_log;
scoped_ptr<SpdyHttpStream> http_stream(new SpdyHttpStream(session_, true));
@@ -727,15 +727,15 @@
writes, arraysize(writes),
key);
- UploadDataStream upload_stream(UploadDataStream::CHUNKED, 0);
+ ChunkedUploadDataStream upload_stream(0);
HttpRequestInfo request;
request.method = "POST";
request.url = GURL("http://www.google.com/");
request.upload_data_stream = &upload_stream;
- ASSERT_EQ(OK, upload_stream.Init(CompletionCallback()));
- upload_stream.AppendChunk(kUploadData, kUploadDataSize, true);
+ ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback()));
+ upload_stream.AppendData(kUploadData, kUploadDataSize, true);
BoundNetLog net_log;
scoped_ptr<SpdyHttpStream> http_stream(new SpdyHttpStream(session_, true));
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 59a2f1b..92188ac 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -15,10 +15,11 @@
#include "base/strings/string_piece.h"
#include "base/test/test_file_util.h"
#include "net/base/auth.h"
+#include "net/base/chunked_upload_data_stream.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/net_log_unittest.h"
#include "net/base/request_priority.h"
#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_data_stream.h"
#include "net/base/upload_file_element_reader.h"
#include "net/http/http_network_session_peer.h"
#include "net/http/http_network_transaction.h"
@@ -120,7 +121,7 @@
}
virtual ~SpdyNetworkTransactionTest() {
- // UploadDataStream posts deletion tasks back to the message loop on
+ // UploadDataStream may post a deletion tasks back to the message loop on
// destruction.
upload_data_stream_.reset();
base::RunLoop().RunUntilIdle();
@@ -456,7 +457,7 @@
element_readers.push_back(
new UploadBytesElementReader(kUploadData, kUploadDataSize));
upload_data_stream_.reset(
- new UploadDataStream(element_readers.Pass(), 0));
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
google_post_request_.method = "POST";
google_post_request_.url = GURL(kDefaultURL);
@@ -481,7 +482,7 @@
kUploadDataSize,
base::Time()));
upload_data_stream_.reset(
- new UploadDataStream(element_readers.Pass(), 0));
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
google_post_request_.method = "POST";
google_post_request_.url = GURL(kDefaultURL);
@@ -509,7 +510,7 @@
kUploadDataSize,
base::Time()));
upload_data_stream_.reset(
- new UploadDataStream(element_readers.Pass(), 0));
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
google_post_request_.method = "POST";
google_post_request_.url = GURL(kDefaultURL);
@@ -542,7 +543,7 @@
kUploadData + kFileRangeOffset + kFileRangeLength,
kUploadDataSize - (kFileRangeOffset + kFileRangeLength)));
upload_data_stream_.reset(
- new UploadDataStream(element_readers.Pass(), 0));
+ new ElementsUploadDataStream(element_readers.Pass(), 0));
google_post_request_.method = "POST";
google_post_request_.url = GURL(kDefaultURL);
@@ -554,12 +555,11 @@
const HttpRequestInfo& CreateChunkedPostRequest() {
if (!google_chunked_post_request_initialized_) {
- upload_data_stream_.reset(
- new UploadDataStream(UploadDataStream::CHUNKED, 0));
+ upload_chunked_data_stream_.reset(new ChunkedUploadDataStream(0));
google_chunked_post_request_.method = "POST";
google_chunked_post_request_.url = GURL(kDefaultURL);
google_chunked_post_request_.upload_data_stream =
- upload_data_stream_.get();
+ upload_chunked_data_stream_.get();
google_chunked_post_request_initialized_ = true;
}
return google_chunked_post_request_;
@@ -688,9 +688,14 @@
callback.WaitForResult();
}
+ ChunkedUploadDataStream* upload_chunked_data_stream() const {
+ return upload_chunked_data_stream_.get();
+ }
+
SpdyTestUtil spdy_util_;
private:
+ scoped_ptr<ChunkedUploadDataStream> upload_chunked_data_stream_;
scoped_ptr<UploadDataStream> upload_data_stream_;
bool google_get_request_initialized_;
bool google_post_request_initialized_;
@@ -774,7 +779,7 @@
// SpdyFramer::ConvertRequestPriorityToSpdyPriority to make
// sure it's being done right.
if (spdy_util_.spdy_version() < SPDY3) {
- switch(p) {
+ switch (p) {
case HIGHEST:
EXPECT_EQ(0, spdy_prio);
break;
@@ -1858,9 +1863,8 @@
// These chunks get merged into a single frame when being sent.
const int kFirstChunkSize = kUploadDataSize/2;
- helper.request().upload_data_stream->AppendChunk(
- kUploadData, kFirstChunkSize, false);
- helper.request().upload_data_stream->AppendChunk(
+ upload_chunked_data_stream()->AppendData(kUploadData, kFirstChunkSize, false);
+ upload_chunked_data_stream()->AppendData(
kUploadData + kFirstChunkSize, kUploadDataSize - kFirstChunkSize, true);
helper.RunToCompletion(&data);
@@ -1898,19 +1902,16 @@
DEFAULT_PRIORITY,
BoundNetLog(), GetParam(), NULL);
- helper.request().upload_data_stream->AppendChunk(
- kUploadData, kUploadDataSize, false);
+ upload_chunked_data_stream()->AppendData(kUploadData, kUploadDataSize, false);
helper.RunPreTestSetup();
helper.AddData(&data);
ASSERT_TRUE(helper.StartDefaultTest());
base::RunLoop().RunUntilIdle();
- helper.request().upload_data_stream->AppendChunk(
- kUploadData, kUploadDataSize, false);
+ upload_chunked_data_stream()->AppendData(kUploadData, kUploadDataSize, false);
base::RunLoop().RunUntilIdle();
- helper.request().upload_data_stream->AppendChunk(
- kUploadData, kUploadDataSize, true);
+ upload_chunked_data_stream()->AppendData(kUploadData, kUploadDataSize, true);
helper.FinishDefaultTest();
helper.VerifyDataConsumed();
@@ -1972,7 +1973,7 @@
BufferedSpdyFramer framer(spdy_util_.spdy_version(), false);
// Create an empty UploadDataStream.
ScopedVector<UploadElementReader> element_readers;
- UploadDataStream stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream stream(element_readers.Pass(), 0);
// Setup the request
HttpRequestInfo request;
@@ -2046,8 +2047,7 @@
EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
// Finish sending the request body.
- helper.request().upload_data_stream->AppendChunk(
- kUploadData, kUploadDataSize, true);
+ upload_chunked_data_stream()->AppendData(kUploadData, kUploadDataSize, true);
data.RunFor(2);
std::string response_body;
@@ -4442,7 +4442,7 @@
writes.push_back(CreateMockWrite(*initial_settings_frame));
if (GetParam().protocol >= kProtoSPDY31) {
writes.push_back(CreateMockWrite(*initial_window_update));
- };
+ }
writes.push_back(CreateMockWrite(*settings_frame));
writes.push_back(CreateMockWrite(*req));
@@ -4608,7 +4608,7 @@
};
scoped_ptr<OrderedSocketData> data;
- switch(GetParam().ssl_type) {
+ switch (GetParam().ssl_type) {
case SPDYNOSSL:
data.reset(new OrderedSocketData(reads_SPDYNOSSL,
arraysize(reads_SPDYNOSSL),
@@ -4768,7 +4768,7 @@
};
scoped_ptr<OrderedSocketData> data_proxy;
- switch(GetParam().ssl_type) {
+ switch (GetParam().ssl_type) {
case SPDYNPN:
data_proxy.reset(new OrderedSocketData(reads_SPDYNPN,
arraysize(reads_SPDYNPN),
@@ -5888,7 +5888,7 @@
element_readers.push_back(
new UploadBytesElementReader(content->c_str(), content->size()));
}
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
// Setup the request
HttpRequestInfo request;
@@ -6053,7 +6053,7 @@
element_readers.push_back(
new UploadBytesElementReader(content->c_str(), content->size()));
}
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
// Setup the request
HttpRequestInfo request;
@@ -6169,7 +6169,7 @@
upload_data_string.append(kUploadData, kUploadDataSize);
element_readers.push_back(new UploadBytesElementReader(
upload_data_string.c_str(), upload_data_string.size()));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -6286,7 +6286,7 @@
upload_data_string.append(kUploadData, kUploadDataSize);
element_readers.push_back(new UploadBytesElementReader(
upload_data_string.c_str(), upload_data_string.size()));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
@@ -6413,7 +6413,7 @@
upload_data_string.append(kUploadData, kUploadDataSize);
element_readers.push_back(new UploadBytesElementReader(
upload_data_string.c_str(), upload_data_string.size()));
- UploadDataStream upload_data_stream(element_readers.Pass(), 0);
+ ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0);
HttpRequestInfo request;
request.method = "POST";
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index 296ff0a..cb9bdfe 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -663,7 +663,7 @@
data_ = data;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
// Used to store data that this SpdyDataIR should own.
@@ -698,7 +698,7 @@
unidirectional_ = unidirectional;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyStreamId associated_to_stream_id_;
@@ -713,7 +713,7 @@
explicit SpdySynReplyIR(SpdyStreamId stream_id)
: SpdyFrameWithNameValueBlockIR(stream_id) {}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
DISALLOW_COPY_AND_ASSIGN(SpdySynReplyIR);
@@ -739,7 +739,7 @@
description_ = description;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyRstStreamStatus status_;
@@ -785,7 +785,7 @@
is_ack_ = is_ack;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
ValueMap values_;
@@ -804,7 +804,7 @@
bool is_ack() const { return is_ack_; }
void set_is_ack(bool is_ack) { is_ack_ = is_ack; }
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyPingId id_;
@@ -832,7 +832,7 @@
const base::StringPiece& description() const;
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyStreamId last_good_stream_id_;
@@ -849,7 +849,7 @@
has_priority_(false),
priority_(0) {}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
bool has_priority() const { return has_priority_; }
void set_has_priority(bool has_priority) { has_priority_ = has_priority; }
@@ -876,7 +876,7 @@
delta_ = delta;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
int32 delta_;
@@ -890,7 +890,7 @@
explicit SpdyBlockedIR(SpdyStreamId stream_id)
: SpdyFrameWithStreamIdIR(stream_id) {}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
DISALLOW_COPY_AND_ASSIGN(SpdyBlockedIR);
@@ -905,7 +905,7 @@
SpdyStreamId promised_stream_id() const { return promised_stream_id_; }
void set_promised_stream_id(SpdyStreamId id) { promised_stream_id_ = id; }
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyStreamId promised_stream_id_;
@@ -921,7 +921,7 @@
: SpdyFrameWithNameValueBlockIR(stream_id),
end_headers_(false) {}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
bool end_headers() const { return end_headers_; }
void set_end_headers(bool end_headers) {end_headers_ = end_headers;}
@@ -955,7 +955,7 @@
origin_ = origin;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
uint32 max_age_;
@@ -980,7 +980,7 @@
bool exclusive() const { return exclusive_; }
void set_exclusive(bool exclusive) { exclusive_ = exclusive; }
- virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+ virtual void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyStreamId parent_stream_id_;
diff --git a/net/spdy/spdy_proxy_client_socket.h b/net/spdy/spdy_proxy_client_socket.h
index 7a293a0..3b0736c 100644
--- a/net/spdy/spdy_proxy_client_socket.h
+++ b/net/spdy/spdy_proxy_client_socket.h
@@ -57,47 +57,47 @@
virtual ~SpdyProxyClientSocket();
// ProxyClientSocket methods:
- virtual const HttpResponseInfo* GetConnectResponseInfo() const OVERRIDE;
- virtual HttpStream* CreateConnectResponseStream() OVERRIDE;
+ virtual const HttpResponseInfo* GetConnectResponseInfo() const override;
+ virtual HttpStream* CreateConnectResponseStream() override;
virtual const scoped_refptr<HttpAuthController>& GetAuthController() const
- OVERRIDE;
- virtual int RestartWithAuth(const CompletionCallback& callback) OVERRIDE;
- virtual bool IsUsingSpdy() const OVERRIDE;
- virtual NextProto GetProtocolNegotiated() const OVERRIDE;
+ override;
+ virtual int RestartWithAuth(const CompletionCallback& callback) override;
+ virtual bool IsUsingSpdy() const override;
+ virtual NextProto GetProtocolNegotiated() const override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual bool IsConnected() const OVERRIDE;
- virtual bool IsConnectedAndIdle() const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void SetSubresourceSpeculation() OVERRIDE;
- virtual void SetOmniboxSpeculation() OVERRIDE;
- virtual bool WasEverUsed() const OVERRIDE;
- virtual bool UsingTCPFastOpen() const OVERRIDE;
- virtual bool WasNpnNegotiated() const OVERRIDE;
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ virtual int Connect(const CompletionCallback& callback) override;
+ virtual void Disconnect() override;
+ virtual bool IsConnected() const override;
+ virtual bool IsConnectedAndIdle() const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void SetSubresourceSpeculation() override;
+ virtual void SetOmniboxSpeculation() override;
+ virtual bool WasEverUsed() const override;
+ virtual bool UsingTCPFastOpen() const override;
+ virtual bool WasNpnNegotiated() const override;
+ virtual NextProto GetNegotiatedProtocol() const override;
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
virtual int Read(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
// SpdyStream::Delegate implementation.
- virtual void OnRequestHeadersSent() OVERRIDE;
+ virtual void OnRequestHeadersSent() override;
virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
- virtual void OnDataSent() OVERRIDE;
- virtual void OnClose(int status) OVERRIDE;
+ const SpdyHeaderBlock& response_headers) override;
+ virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ virtual void OnDataSent() override;
+ virtual void OnClose(int status) override;
private:
enum State {
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index d5f04ad..6afa427 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -16,6 +16,7 @@
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
#include "base/metrics/stats_counters.h"
+#include "base/profiler/scoped_profile.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -1336,6 +1337,11 @@
}
void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "418183 DoReadCallback => SpdySession::PumpReadLoop"));
+
CHECK(!in_io_loop_);
if (availability_state_ == STATE_DRAINING) {
return;
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 519d07b..293ed2b 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -517,7 +517,7 @@
base::WeakPtr<SpdySession> GetWeakPtr();
// HigherLayeredPool implementation:
- virtual bool CloseOneIdleConnection() OVERRIDE;
+ virtual bool CloseOneIdleConnection() override;
private:
friend class base::RefCounted<SpdySession>;
@@ -813,55 +813,55 @@
void DeleteExpiredPushedStreams();
// BufferedSpdyFramerVisitorInterface:
- virtual void OnError(SpdyFramer::SpdyError error_code) OVERRIDE;
+ virtual void OnError(SpdyFramer::SpdyError error_code) override;
virtual void OnStreamError(SpdyStreamId stream_id,
- const std::string& description) OVERRIDE;
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) OVERRIDE;
+ const std::string& description) override;
+ virtual void OnPing(SpdyPingId unique_id, bool is_ack) override;
virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) OVERRIDE;
+ SpdyRstStreamStatus status) override;
virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) OVERRIDE;
+ SpdyGoAwayStatus status) override;
virtual void OnDataFrameHeader(SpdyStreamId stream_id,
size_t length,
- bool fin) OVERRIDE;
+ bool fin) override;
virtual void OnStreamFrameData(SpdyStreamId stream_id,
const char* data,
size_t len,
- bool fin) OVERRIDE;
- virtual void OnSettings(bool clear_persisted) OVERRIDE;
+ bool fin) override;
+ virtual void OnSettings(bool clear_persisted) override;
virtual void OnSetting(
- SpdySettingsIds id, uint8 flags, uint32 value) OVERRIDE;
+ SpdySettingsIds id, uint8 flags, uint32 value) override;
virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) OVERRIDE;
+ uint32 delta_window_size) override;
virtual void OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- const SpdyHeaderBlock& headers) OVERRIDE;
+ const SpdyHeaderBlock& headers) override;
virtual void OnSynStream(SpdyStreamId stream_id,
SpdyStreamId associated_stream_id,
SpdyPriority priority,
bool fin,
bool unidirectional,
- const SpdyHeaderBlock& headers) OVERRIDE;
+ const SpdyHeaderBlock& headers) override;
virtual void OnSynReply(
SpdyStreamId stream_id,
bool fin,
- const SpdyHeaderBlock& headers) OVERRIDE;
+ const SpdyHeaderBlock& headers) override;
virtual void OnHeaders(
SpdyStreamId stream_id,
bool fin,
- const SpdyHeaderBlock& headers) OVERRIDE;
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) OVERRIDE;
+ const SpdyHeaderBlock& headers) override;
+ virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override;
// SpdyFramerDebugVisitorInterface
virtual void OnSendCompressedFrame(
SpdyStreamId stream_id,
SpdyFrameType type,
size_t payload_len,
- size_t frame_len) OVERRIDE;
+ size_t frame_len) override;
virtual void OnReceiveCompressedFrame(
SpdyStreamId stream_id,
SpdyFrameType type,
- size_t frame_len) OVERRIDE;
+ size_t frame_len) override;
// Called when bytes are consumed from a SpdyBuffer for a DATA frame
// that is to be written or is being written. Increases the send
diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h
index 2fbb030..de2ddfa 100644
--- a/net/spdy/spdy_session_pool.h
+++ b/net/spdy/spdy_session_pool.h
@@ -133,19 +133,19 @@
// We flush all idle sessions and release references to the active ones so
// they won't get re-used. The active ones will either complete successfully
// or error out due to the IP address change.
- virtual void OnIPAddressChanged() OVERRIDE;
+ virtual void OnIPAddressChanged() override;
// SSLConfigService::Observer methods:
// We perform the same flushing as described above when SSL settings change.
- virtual void OnSSLConfigChanged() OVERRIDE;
+ virtual void OnSSLConfigChanged() override;
// CertDatabase::Observer methods:
// We perform the same flushing as described above when certificate database
// is changed.
- virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE;
- virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE;
+ virtual void OnCertAdded(const X509Certificate* cert) override;
+ virtual void OnCACertChanged(const X509Certificate* cert) override;
private:
friend class SpdySessionPoolPeer; // For testing.
diff --git a/net/spdy/spdy_session_pool_unittest.cc b/net/spdy/spdy_session_pool_unittest.cc
index 16a624b..ece5d34 100644
--- a/net/spdy/spdy_session_pool_unittest.cc
+++ b/net/spdy/spdy_session_pool_unittest.cc
@@ -64,18 +64,18 @@
virtual ~SessionOpeningDelegate() {}
- virtual void OnRequestHeadersSent() OVERRIDE {}
+ virtual void OnRequestHeadersSent() override {}
virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE {
+ const SpdyHeaderBlock& response_headers) override {
return RESPONSE_HEADERS_ARE_COMPLETE;
}
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE {}
+ virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override {}
- virtual void OnDataSent() OVERRIDE {}
+ virtual void OnDataSent() override {}
- virtual void OnClose(int status) OVERRIDE {
+ virtual void OnClose(int status) override {
ignore_result(CreateFakeSpdySession(spdy_session_pool_, key_));
}
diff --git a/net/spdy/spdy_session_test_util.h b/net/spdy/spdy_session_test_util.h
index 08a82ee..cc3f136 100644
--- a/net/spdy/spdy_session_test_util.h
+++ b/net/spdy/spdy_session_test_util.h
@@ -29,8 +29,8 @@
virtual ~SpdySessionTestTaskObserver();
// Implements MessageLoop::TaskObserver.
- virtual void WillProcessTask(const base::PendingTask& pending_task) OVERRIDE;
- virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE;
+ virtual void WillProcessTask(const base::PendingTask& pending_task) override;
+ virtual void DidProcessTask(const base::PendingTask& pending_task) override;
// Returns the number of tasks posted by the given function and file.
uint16 executed_count() const { return executed_count_; }
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index 938f6e5..914f6fe 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -121,7 +121,7 @@
HttpNetworkSession::NORMAL_SOCKET_POOL, old_max_group_sockets_);
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
g_time_delta = base::TimeDelta();
}
@@ -885,7 +885,7 @@
session->CheckPingStatus(before_ping_time);
EXPECT_EQ(0, session->pings_in_flight());
- EXPECT_GE(session->next_ping_id(), static_cast<uint32>(1));
+ EXPECT_GE(session->next_ping_id(), 1U);
EXPECT_FALSE(session->check_ping_status_pending());
EXPECT_GE(session->last_activity_time(), before_ping_time);
@@ -1302,7 +1302,7 @@
// Send a PING frame.
session->WritePingFrame(1, false);
EXPECT_LT(0, session->pings_in_flight());
- EXPECT_GE(session->next_ping_id(), static_cast<uint32>(1));
+ EXPECT_GE(session->next_ping_id(), 1U);
EXPECT_TRUE(session->check_ping_status_pending());
// Assert session is not closed.
@@ -2305,7 +2305,7 @@
virtual ~SessionClosingDelegate() {}
- virtual void OnClose(int status) OVERRIDE {
+ virtual void OnClose(int status) override {
session_to_close_->CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Error");
}
@@ -3381,7 +3381,7 @@
virtual ~StreamCreatingDelegate() {}
- virtual void OnClose(int status) OVERRIDE {
+ virtual void OnClose(int status) override {
GURL url(kDefaultURL);
ignore_result(
CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM,
@@ -3661,7 +3661,7 @@
virtual ~DropReceivedDataDelegate() {}
// Drop any received data.
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE {}
+ virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override {}
};
// Send data back and forth but use a delegate that drops its received
@@ -4249,7 +4249,7 @@
stream_to_close_ = stream_to_close;
}
- virtual void OnDataSent() OVERRIDE {
+ virtual void OnDataSent() override {
test::StreamDelegateWithBody::OnDataSent();
if (stream_to_close_.get()) {
stream_to_close_->Close();
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index 3a0d988..6de0a39 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -63,7 +63,7 @@
virtual ~SynStreamBufferProducer() {}
- virtual scoped_ptr<SpdyBuffer> ProduceBuffer() OVERRIDE {
+ virtual scoped_ptr<SpdyBuffer> ProduceBuffer() override {
if (!stream_.get()) {
NOTREACHED();
return scoped_ptr<SpdyBuffer>();
diff --git a/net/spdy/spdy_stream_test_util.h b/net/spdy/spdy_stream_test_util.h
index 0c0497e..7df12e8 100644
--- a/net/spdy/spdy_stream_test_util.h
+++ b/net/spdy/spdy_stream_test_util.h
@@ -26,12 +26,12 @@
virtual ~ClosingDelegate();
// SpdyStream::Delegate implementation.
- virtual void OnRequestHeadersSent() OVERRIDE;
+ virtual void OnRequestHeadersSent() override;
virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
- virtual void OnDataSent() OVERRIDE;
- virtual void OnClose(int status) OVERRIDE;
+ const SpdyHeaderBlock& response_headers) override;
+ virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ virtual void OnDataSent() override;
+ virtual void OnClose(int status) override;
// Returns whether or not the stream is closed.
bool StreamIsClosed() const { return !stream_.get(); }
@@ -47,12 +47,12 @@
explicit StreamDelegateBase(const base::WeakPtr<SpdyStream>& stream);
virtual ~StreamDelegateBase();
- virtual void OnRequestHeadersSent() OVERRIDE;
+ virtual void OnRequestHeadersSent() override;
virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
- virtual void OnDataSent() OVERRIDE;
- virtual void OnClose(int status) OVERRIDE;
+ const SpdyHeaderBlock& response_headers) override;
+ virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ virtual void OnDataSent() override;
+ virtual void OnClose(int status) override;
// Waits for the stream to be closed and returns the status passed
// to OnClose().
@@ -101,7 +101,7 @@
virtual ~StreamDelegateSendImmediate();
virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE;
+ const SpdyHeaderBlock& response_headers) override;
private:
base::StringPiece data_;
@@ -114,7 +114,7 @@
base::StringPiece data);
virtual ~StreamDelegateWithBody();
- virtual void OnRequestHeadersSent() OVERRIDE;
+ virtual void OnRequestHeadersSent() override;
private:
scoped_refptr<StringIOBuffer> buf_;
@@ -127,7 +127,7 @@
virtual ~StreamDelegateCloseOnHeaders();
virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE;
+ const SpdyHeaderBlock& response_headers) override;
};
} // namespace test
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 5de58d6..2e1aba5 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -214,44 +214,44 @@
return priority_;
}
- virtual void OnError(SpdyFramer::SpdyError error_code) OVERRIDE {}
+ virtual void OnError(SpdyFramer::SpdyError error_code) override {}
virtual void OnStreamError(SpdyStreamId stream_id,
- const std::string& description) OVERRIDE {}
+ const std::string& description) override {}
virtual void OnSynStream(SpdyStreamId stream_id,
SpdyStreamId associated_stream_id,
SpdyPriority priority,
bool fin,
bool unidirectional,
- const SpdyHeaderBlock& headers) OVERRIDE {
+ const SpdyHeaderBlock& headers) override {
priority_ = priority;
}
virtual void OnSynReply(SpdyStreamId stream_id,
bool fin,
- const SpdyHeaderBlock& headers) OVERRIDE {}
+ const SpdyHeaderBlock& headers) override {}
virtual void OnHeaders(SpdyStreamId stream_id,
bool fin,
- const SpdyHeaderBlock& headers) OVERRIDE {}
+ const SpdyHeaderBlock& headers) override {}
virtual void OnDataFrameHeader(SpdyStreamId stream_id,
size_t length,
- bool fin) OVERRIDE {}
+ bool fin) override {}
virtual void OnStreamFrameData(SpdyStreamId stream_id,
const char* data,
size_t len,
- bool fin) OVERRIDE {}
- virtual void OnSettings(bool clear_persisted) OVERRIDE {}
+ bool fin) override {}
+ virtual void OnSettings(bool clear_persisted) override {}
virtual void OnSetting(
- SpdySettingsIds id, uint8 flags, uint32 value) OVERRIDE {}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) OVERRIDE {}
+ SpdySettingsIds id, uint8 flags, uint32 value) override {}
+ virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {}
virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) OVERRIDE {}
+ SpdyRstStreamStatus status) override {}
virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) OVERRIDE {}
+ SpdyGoAwayStatus status) override {}
virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) OVERRIDE {}
+ uint32 delta_window_size) override {}
virtual void OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- const SpdyHeaderBlock& headers) OVERRIDE {}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) OVERRIDE {
+ const SpdyHeaderBlock& headers) override {}
+ virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
return false;
}
@@ -616,43 +616,43 @@
virtual ~FakeSpdySessionClientSocket() {}
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return read_result_;
}
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
// Return kProtoUnknown to use the pool's default protocol.
- virtual NextProto GetNegotiatedProtocol() const OVERRIDE {
+ virtual NextProto GetNegotiatedProtocol() const override {
return kProtoUnknown;
}
// The functions below are not expected to be called.
- virtual int Connect(const CompletionCallback& callback) OVERRIDE {
+ virtual int Connect(const CompletionCallback& callback) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual bool WasEverUsed() const OVERRIDE {
+ virtual bool WasEverUsed() const override {
ADD_FAILURE();
return false;
}
- virtual bool UsingTCPFastOpen() const OVERRIDE {
+ virtual bool UsingTCPFastOpen() const override {
ADD_FAILURE();
return false;
}
- virtual bool WasNpnNegotiated() const OVERRIDE {
+ virtual bool WasNpnNegotiated() const override {
ADD_FAILURE();
return false;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {
+ virtual bool GetSSLInfo(SSLInfo* ssl_info) override {
ADD_FAILURE();
return false;
}
diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h
index 108e278..897f670 100644
--- a/net/spdy/spdy_test_util_common.h
+++ b/net/spdy/spdy_test_util_common.h
@@ -159,9 +159,9 @@
// crypto::ECSignatureCreator
virtual bool Sign(const uint8* data,
int data_len,
- std::vector<uint8>* signature) OVERRIDE;
+ std::vector<uint8>* signature) override;
virtual bool DecodeSignature(const std::vector<uint8>& signature,
- std::vector<uint8>* out_raw_sig) OVERRIDE;
+ std::vector<uint8>* out_raw_sig) override;
private:
crypto::ECPrivateKey* key_;
@@ -177,7 +177,7 @@
// crypto::ECSignatureCreatorFactory
virtual crypto::ECSignatureCreator* Create(
- crypto::ECPrivateKey* key) OVERRIDE;
+ crypto::ECPrivateKey* key) override;
private:
DISALLOW_COPY_AND_ASSIGN(MockECSignatureCreatorFactory);
diff --git a/net/spdy/spdy_websocket_stream.h b/net/spdy/spdy_websocket_stream.h
index 6998134..66a89e8 100644
--- a/net/spdy/spdy_websocket_stream.h
+++ b/net/spdy/spdy_websocket_stream.h
@@ -75,12 +75,12 @@
void Close();
// SpdyStream::Delegate
- virtual void OnRequestHeadersSent() OVERRIDE;
+ virtual void OnRequestHeadersSent() override;
virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
- virtual void OnDataSent() OVERRIDE;
- virtual void OnClose(int status) OVERRIDE;
+ const SpdyHeaderBlock& response_headers) override;
+ virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ virtual void OnDataSent() override;
+ virtual void OnClose(int status) override;
private:
friend class SpdyWebSocketStreamTest;
diff --git a/net/spdy/spdy_websocket_stream_unittest.cc b/net/spdy/spdy_websocket_stream_unittest.cc
index 5720675..5941bdf 100644
--- a/net/spdy/spdy_websocket_stream_unittest.cc
+++ b/net/spdy/spdy_websocket_stream_unittest.cc
@@ -74,7 +74,7 @@
on_close_ = callback;
}
- virtual void OnCreatedSpdyStream(int result) OVERRIDE {
+ virtual void OnCreatedSpdyStream(int result) override {
events_.push_back(
SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_CREATED,
SpdyHeaderBlock(),
@@ -83,7 +83,7 @@
if (!on_created_.is_null())
on_created_.Run(&events_.back());
}
- virtual void OnSentSpdyHeaders() OVERRIDE {
+ virtual void OnSentSpdyHeaders() override {
events_.push_back(
SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_SENT_HEADERS,
SpdyHeaderBlock(),
@@ -93,7 +93,7 @@
on_sent_data_.Run(&events_.back());
}
virtual void OnSpdyResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE {
+ const SpdyHeaderBlock& response_headers) override {
events_.push_back(
SpdyWebSocketStreamEvent(
SpdyWebSocketStreamEvent::EVENT_RECEIVED_HEADER,
@@ -103,7 +103,7 @@
if (!on_received_header_.is_null())
on_received_header_.Run(&events_.back());
}
- virtual void OnSentSpdyData(size_t bytes_sent) OVERRIDE {
+ virtual void OnSentSpdyData(size_t bytes_sent) override {
events_.push_back(
SpdyWebSocketStreamEvent(
SpdyWebSocketStreamEvent::EVENT_SENT_DATA,
@@ -113,7 +113,7 @@
if (!on_sent_data_.is_null())
on_sent_data_.Run(&events_.back());
}
- virtual void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) OVERRIDE {
+ virtual void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) override {
std::string buffer_data;
size_t buffer_len = 0;
if (buffer) {
@@ -129,7 +129,7 @@
if (!on_received_data_.is_null())
on_received_data_.Run(&events_.back());
}
- virtual void OnCloseSpdyStream() OVERRIDE {
+ virtual void OnCloseSpdyStream() override {
events_.push_back(
SpdyWebSocketStreamEvent(
SpdyWebSocketStreamEvent::EVENT_CLOSE,
diff --git a/net/spdy/spdy_write_queue_unittest.cc b/net/spdy/spdy_write_queue_unittest.cc
index 2ab415a..cb24d12 100644
--- a/net/spdy/spdy_write_queue_unittest.cc
+++ b/net/spdy/spdy_write_queue_unittest.cc
@@ -59,7 +59,7 @@
base::Bind(RequeingBufferProducer::ConsumeCallback, queue));
}
- virtual scoped_ptr<SpdyBuffer> ProduceBuffer() OVERRIDE {
+ virtual scoped_ptr<SpdyBuffer> ProduceBuffer() override {
return buffer_.Pass();
}
diff --git a/net/ssl/channel_id_service_unittest.cc b/net/ssl/channel_id_service_unittest.cc
index e5f084d..52083e8 100644
--- a/net/ssl/channel_id_service_unittest.cc
+++ b/net/ssl/channel_id_service_unittest.cc
@@ -37,11 +37,11 @@
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
- base::TimeDelta delay) OVERRIDE {
+ base::TimeDelta delay) override {
return false;
}
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE { return true; }
+ virtual bool RunsTasksOnCurrentThread() const override { return true; }
protected:
virtual ~FailingTaskRunner() {}
@@ -60,17 +60,17 @@
base::Time* expiration_time,
std::string* private_key_result,
std::string* cert_result,
- const GetChannelIDCallback& callback) OVERRIDE;
+ const GetChannelIDCallback& callback) override;
virtual void SetChannelID(const std::string& server_identifier,
base::Time creation_time,
base::Time expiration_time,
const std::string& private_key,
- const std::string& cert) OVERRIDE {
+ const std::string& cert) override {
channel_id_count_ = 1;
}
- virtual int GetChannelIDCount() OVERRIDE { return channel_id_count_; }
+ virtual int GetChannelIDCount() override { return channel_id_count_; }
void CallGetChannelIDCallbackWithResult(int err,
base::Time expiration_time,
diff --git a/net/ssl/client_cert_store_chromeos.h b/net/ssl/client_cert_store_chromeos.h
index 940888d..f14619a 100644
--- a/net/ssl/client_cert_store_chromeos.h
+++ b/net/ssl/client_cert_store_chromeos.h
@@ -27,14 +27,14 @@
// ClientCertStoreNSS:
virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info,
CertificateList* selected_certs,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
protected:
// ClientCertStoreNSS:
virtual void GetClientCertsImpl(CERTCertList* cert_list,
const SSLCertRequestInfo& request,
bool query_nssdb,
- CertificateList* selected_certs) OVERRIDE;
+ CertificateList* selected_certs) override;
private:
void DidGetSystemAndPrivateSlot(const SSLCertRequestInfo* request,
diff --git a/net/ssl/client_cert_store_mac.h b/net/ssl/client_cert_store_mac.h
index b3f7ef3..5c697db 100644
--- a/net/ssl/client_cert_store_mac.h
+++ b/net/ssl/client_cert_store_mac.h
@@ -22,7 +22,7 @@
// ClientCertStore:
virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info,
CertificateList* selected_certs,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
private:
friend class ClientCertStoreMacTest;
diff --git a/net/ssl/client_cert_store_nss.h b/net/ssl/client_cert_store_nss.h
index 4e2e1c4..38895aa 100644
--- a/net/ssl/client_cert_store_nss.h
+++ b/net/ssl/client_cert_store_nss.h
@@ -32,7 +32,7 @@
// ClientCertStore:
virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info,
CertificateList* selected_certs,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
protected:
// Examines the certificates in |cert_list| to find all certificates that
diff --git a/net/ssl/client_cert_store_win.h b/net/ssl/client_cert_store_win.h
index 785603d..567c267 100644
--- a/net/ssl/client_cert_store_win.h
+++ b/net/ssl/client_cert_store_win.h
@@ -22,7 +22,7 @@
// ClientCertStore:
virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info,
CertificateList* selected_certs,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
private:
friend class ClientCertStoreWinTestDelegate;
diff --git a/net/ssl/default_channel_id_store.cc b/net/ssl/default_channel_id_store.cc
index 1dec6c1..4f43fbc 100644
--- a/net/ssl/default_channel_id_store.cc
+++ b/net/ssl/default_channel_id_store.cc
@@ -42,7 +42,7 @@
GetChannelIDTask(const std::string& server_identifier,
const GetChannelIDCallback& callback);
virtual ~GetChannelIDTask();
- virtual void Run(DefaultChannelIDStore* store) OVERRIDE;
+ virtual void Run(DefaultChannelIDStore* store) override;
private:
std::string server_identifier_;
@@ -84,7 +84,7 @@
const std::string& private_key,
const std::string& cert);
virtual ~SetChannelIDTask();
- virtual void Run(DefaultChannelIDStore* store) OVERRIDE;
+ virtual void Run(DefaultChannelIDStore* store) override;
private:
std::string server_identifier_;
@@ -124,7 +124,7 @@
DeleteChannelIDTask(const std::string& server_identifier,
const base::Closure& callback);
virtual ~DeleteChannelIDTask();
- virtual void Run(DefaultChannelIDStore* store) OVERRIDE;
+ virtual void Run(DefaultChannelIDStore* store) override;
private:
std::string server_identifier_;
@@ -159,7 +159,7 @@
base::Time delete_end,
const base::Closure& callback);
virtual ~DeleteAllCreatedBetweenTask();
- virtual void Run(DefaultChannelIDStore* store) OVERRIDE;
+ virtual void Run(DefaultChannelIDStore* store) override;
private:
base::Time delete_begin_;
@@ -195,7 +195,7 @@
public:
explicit GetAllChannelIDsTask(const GetChannelIDListCallback& callback);
virtual ~GetAllChannelIDsTask();
- virtual void Run(DefaultChannelIDStore* store) OVERRIDE;
+ virtual void Run(DefaultChannelIDStore* store) override;
private:
std::string server_identifier_;
diff --git a/net/ssl/default_channel_id_store.h b/net/ssl/default_channel_id_store.h
index 9c307e8..3882c1f 100644
--- a/net/ssl/default_channel_id_store.h
+++ b/net/ssl/default_channel_id_store.h
@@ -49,25 +49,25 @@
base::Time* expiration_time,
std::string* private_key_result,
std::string* cert_result,
- const GetChannelIDCallback& callback) OVERRIDE;
+ const GetChannelIDCallback& callback) override;
virtual void SetChannelID(
const std::string& server_identifier,
base::Time creation_time,
base::Time expiration_time,
const std::string& private_key,
- const std::string& cert) OVERRIDE;
+ const std::string& cert) override;
virtual void DeleteChannelID(
const std::string& server_identifier,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void DeleteAllCreatedBetween(
base::Time delete_begin,
base::Time delete_end,
- const base::Closure& callback) OVERRIDE;
- virtual void DeleteAll(const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
+ virtual void DeleteAll(const base::Closure& callback) override;
virtual void GetAllChannelIDs(
- const GetChannelIDListCallback& callback) OVERRIDE;
- virtual int GetChannelIDCount() OVERRIDE;
- virtual void SetForceKeepSessionState() OVERRIDE;
+ const GetChannelIDListCallback& callback) override;
+ virtual int GetChannelIDCount() override;
+ virtual void SetForceKeepSessionState() override;
private:
class Task;
diff --git a/net/ssl/default_channel_id_store_unittest.cc b/net/ssl/default_channel_id_store_unittest.cc
index b1fe873..9429753 100644
--- a/net/ssl/default_channel_id_store_unittest.cc
+++ b/net/ssl/default_channel_id_store_unittest.cc
@@ -69,12 +69,12 @@
MockPersistentStore();
// DefaultChannelIDStore::PersistentStore implementation.
- virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
+ virtual void Load(const LoadedCallback& loaded_callback) override;
virtual void AddChannelID(
- const DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE;
+ const DefaultChannelIDStore::ChannelID& channel_id) override;
virtual void DeleteChannelID(
- const DefaultChannelIDStore::ChannelID& channel_id) OVERRIDE;
- virtual void SetForceKeepSessionState() OVERRIDE;
+ const DefaultChannelIDStore::ChannelID& channel_id) override;
+ virtual void SetForceKeepSessionState() override;
protected:
virtual ~MockPersistentStore();
diff --git a/net/ssl/openssl_client_key_store.cc b/net/ssl/openssl_client_key_store.cc
index b0b5eb3..de65cd9 100644
--- a/net/ssl/openssl_client_key_store.cc
+++ b/net/ssl/openssl_client_key_store.cc
@@ -6,6 +6,7 @@
#include <openssl/evp.h>
#include <openssl/x509.h>
+#include <algorithm>
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
@@ -50,15 +51,14 @@
private_key(EVP_PKEY_dup(other.private_key.get())) {
}
-void OpenSSLClientKeyStore::KeyPair::operator=(const KeyPair& other) {
- // Use a temporary ScopedEVP_PKEY because scoped_ptr does not allow resetting
- // to the current value, even though it's safe here.
- crypto::ScopedEVP_PKEY public_key_tmp(EVP_PKEY_dup(other.public_key.get()));
- crypto::ScopedEVP_PKEY private_key_tmp(EVP_PKEY_dup(other.private_key.get()));
- public_key.reset();
- public_key = public_key_tmp.Pass();
- private_key.reset();
- private_key = private_key_tmp.Pass();
+void OpenSSLClientKeyStore::KeyPair::operator=(KeyPair other) {
+ swap(other);
+}
+
+void OpenSSLClientKeyStore::KeyPair::swap(KeyPair& other) {
+ using std::swap;
+ swap(public_key, other.public_key);
+ swap(private_key, other.private_key);
}
int OpenSSLClientKeyStore::FindKeyPairIndex(EVP_PKEY* public_key) {
diff --git a/net/ssl/openssl_client_key_store.h b/net/ssl/openssl_client_key_store.h
index 0cbb23a..6c06148 100644
--- a/net/ssl/openssl_client_key_store.h
+++ b/net/ssl/openssl_client_key_store.h
@@ -73,7 +73,9 @@
public:
explicit KeyPair(EVP_PKEY* pub_key, EVP_PKEY* priv_key);
KeyPair(const KeyPair& other);
- void operator=(const KeyPair& other);
+ // Intentionally pass by value, in order to use the copy-and-swap idiom.
+ void operator=(KeyPair other);
+ void swap(KeyPair& other);
~KeyPair();
crypto::ScopedEVP_PKEY public_key;
diff --git a/net/ssl/ssl_client_auth_cache.h b/net/ssl/ssl_client_auth_cache.h
index 93ad8c0..4ee47ed 100644
--- a/net/ssl/ssl_client_auth_cache.h
+++ b/net/ssl/ssl_client_auth_cache.h
@@ -48,7 +48,7 @@
void Remove(const HostPortPair& server);
// CertDatabase::Observer methods:
- virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE;
+ virtual void OnCertAdded(const X509Certificate* cert) override;
private:
typedef HostPortPair AuthCacheKey;
diff --git a/net/ssl/ssl_config.cc b/net/ssl/ssl_config.cc
index 269934b..b823f6b 100644
--- a/net/ssl/ssl_config.cc
+++ b/net/ssl/ssl_config.cc
@@ -10,6 +10,8 @@
const uint16 kDefaultSSLVersionMax = SSL_PROTOCOL_VERSION_TLS1_2;
+const uint16 kDefaultSSLVersionFallbackMin = SSL_PROTOCOL_VERSION_TLS1;
+
SSLConfig::CertAndStatus::CertAndStatus() : cert_status(0) {}
SSLConfig::CertAndStatus::~CertAndStatus() {}
@@ -19,6 +21,7 @@
rev_checking_required_local_anchors(false),
version_min(kDefaultSSLVersionMin),
version_max(kDefaultSSLVersionMax),
+ version_fallback_min(kDefaultSSLVersionFallbackMin),
channel_id_enabled(true),
false_start_enabled(true),
signed_cert_timestamps_enabled(true),
diff --git a/net/ssl/ssl_config.h b/net/ssl/ssl_config.h
index 2731214..1deaf6e 100644
--- a/net/ssl/ssl_config.h
+++ b/net/ssl/ssl_config.h
@@ -32,6 +32,9 @@
// Default maximum protocol version.
NET_EXPORT extern const uint16 kDefaultSSLVersionMax;
+// Default minimum protocol version that it's acceptable to fallback to.
+NET_EXPORT extern const uint16 kDefaultSSLVersionFallbackMin;
+
// A collection of SSL-related configuration settings.
struct NET_EXPORT SSLConfig {
// Default to revocation checking.
@@ -73,6 +76,12 @@
uint16 version_min;
uint16 version_max;
+ // version_fallback_min contains the minimum version that is acceptable to
+ // fallback to. Versions before this may be tried to see whether they would
+ // have succeeded and thus to give a better message to the user, but the
+ // resulting connection won't be used in these cases.
+ uint16 version_fallback_min;
+
// Presorted list of cipher suites which should be explicitly prevented from
// being used in addition to those disabled by the net built-in policy.
//
diff --git a/net/ssl/ssl_config_service_defaults.h b/net/ssl/ssl_config_service_defaults.h
index 85123da..ff58029 100644
--- a/net/ssl/ssl_config_service_defaults.h
+++ b/net/ssl/ssl_config_service_defaults.h
@@ -18,7 +18,7 @@
SSLConfigServiceDefaults();
// Store default SSL config settings in |config|.
- virtual void GetSSLConfig(SSLConfig* config) OVERRIDE;
+ virtual void GetSSLConfig(SSLConfig* config) override;
private:
virtual ~SSLConfigServiceDefaults();
diff --git a/net/ssl/ssl_config_service_unittest.cc b/net/ssl/ssl_config_service_unittest.cc
index e8a4c33..0d9659c 100644
--- a/net/ssl/ssl_config_service_unittest.cc
+++ b/net/ssl/ssl_config_service_unittest.cc
@@ -19,7 +19,7 @@
explicit MockSSLConfigService(const SSLConfig& config) : config_(config) {}
// SSLConfigService implementation
- virtual void GetSSLConfig(SSLConfig* config) OVERRIDE {
+ virtual void GetSSLConfig(SSLConfig* config) override {
*config = config_;
}
diff --git a/net/test/embedded_test_server/embedded_test_server.cc b/net/test/embedded_test_server/embedded_test_server.cc
index 3d609cc..b266c55 100644
--- a/net/test/embedded_test_server/embedded_test_server.cc
+++ b/net/test/embedded_test_server/embedded_test_server.cc
@@ -32,7 +32,7 @@
: headers_(headers), contents_(contents) {
}
- virtual std::string ToResponseString() const OVERRIDE {
+ virtual std::string ToResponseString() const override {
return headers_ + "\r\n" + contents_;
}
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h
index 82303e5..fc9f554 100644
--- a/net/test/embedded_test_server/embedded_test_server.h
+++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -167,11 +167,11 @@
// StreamListenSocket::Delegate overrides:
virtual void DidAccept(StreamListenSocket* server,
- scoped_ptr<StreamListenSocket> connection) OVERRIDE;
+ scoped_ptr<StreamListenSocket> connection) override;
virtual void DidRead(StreamListenSocket* connection,
const char* data,
- int length) OVERRIDE;
- virtual void DidClose(StreamListenSocket* connection) OVERRIDE;
+ int length) override;
+ virtual void DidClose(StreamListenSocket* connection) override;
HttpConnection* FindConnection(StreamListenSocket* socket);
diff --git a/net/test/embedded_test_server/embedded_test_server_unittest.cc b/net/test/embedded_test_server/embedded_test_server_unittest.cc
index 9823947..9da982c 100644
--- a/net/test/embedded_test_server/embedded_test_server_unittest.cc
+++ b/net/test/embedded_test_server/embedded_test_server_unittest.cc
@@ -49,7 +49,7 @@
io_thread_("io_thread") {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
base::Thread::Options thread_options;
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
ASSERT_TRUE(io_thread_.StartWithOptions(thread_options));
@@ -61,12 +61,12 @@
ASSERT_TRUE(server_->InitializeAndWaitUntilReady());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
ASSERT_TRUE(server_->ShutdownAndWaitUntilComplete());
}
// URLFetcherDelegate override.
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE {
+ virtual void OnURLFetchComplete(const URLFetcher* source) override {
++num_responses_received_;
if (num_responses_received_ == num_responses_expected_)
base::MessageLoop::current()->Quit();
@@ -260,7 +260,7 @@
message_loop_present_on_shutdown_(message_loop_present_on_shutdown) {}
// base::PlatformThread::Delegate:
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
scoped_refptr<base::SingleThreadTaskRunner> io_thread_runner;
base::Thread io_thread("io_thread");
base::Thread::Options thread_options;
@@ -298,7 +298,7 @@
}
// URLFetcherDelegate override.
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE {
+ virtual void OnURLFetchComplete(const URLFetcher* source) override {
base::MessageLoop::current()->Quit();
}
diff --git a/net/test/embedded_test_server/http_response.h b/net/test/embedded_test_server/http_response.h
index 422a525..2172354 100644
--- a/net/test/embedded_test_server/http_response.h
+++ b/net/test/embedded_test_server/http_response.h
@@ -54,7 +54,7 @@
}
// Generates and returns a http response string.
- virtual std::string ToResponseString() const OVERRIDE;
+ virtual std::string ToResponseString() const override;
private:
HttpStatusCode code_;
diff --git a/net/test/net_test_suite.cc b/net/test/net_test_suite.cc
index 175cec2..ed8a103 100644
--- a/net/test/net_test_suite.cc
+++ b/net/test/net_test_suite.cc
@@ -15,7 +15,7 @@
#endif
class StaticReset : public ::testing::EmptyTestEventListener {
- virtual void OnTestStart(const ::testing::TestInfo& test_info) OVERRIDE {
+ virtual void OnTestStart(const ::testing::TestInfo& test_info) override {
net::HttpStreamFactory::ResetStaticSettingsToInit();
}
};
diff --git a/net/test/net_test_suite.h b/net/test/net_test_suite.h
index c8479d7..1a400d4 100644
--- a/net/test/net_test_suite.h
+++ b/net/test/net_test_suite.h
@@ -23,9 +23,9 @@
NetTestSuite(int argc, char** argv);
virtual ~NetTestSuite();
- virtual void Initialize() OVERRIDE;
+ virtual void Initialize() override;
- virtual void Shutdown() OVERRIDE;
+ virtual void Shutdown() override;
protected:
// This constructor is only accessible to specialized net test
diff --git a/net/test/spawned_test_server/local_test_server_posix.cc b/net/test/spawned_test_server/local_test_server_posix.cc
index fdcfdab..64c9b44 100644
--- a/net/test/spawned_test_server/local_test_server_posix.cc
+++ b/net/test/spawned_test_server/local_test_server_posix.cc
@@ -34,7 +34,7 @@
: path_string_(path_string),
port_string_(port_string) {}
- virtual bool Includes(const base::ProcessEntry& entry) const OVERRIDE {
+ virtual bool Includes(const base::ProcessEntry& entry) const override {
if (entry.parent_pid() != 1)
return false;
bool found_path_string = false;
diff --git a/net/test/spawned_test_server/spawner_communicator.cc b/net/test/spawned_test_server/spawner_communicator.cc
index 9aadb87..53484ea 100644
--- a/net/test/spawned_test_server/spawner_communicator.cc
+++ b/net/test/spawned_test_server/spawner_communicator.cc
@@ -12,10 +12,10 @@
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/net_util.h"
#include "net/base/request_priority.h"
#include "net/base/upload_bytes_element_reader.h"
-#include "net/base/upload_data_stream.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_test_util.h"
#include "url/gurl.h"
@@ -188,10 +188,10 @@
cur_request_->set_method("POST");
scoped_ptr<UploadElementReader> reader(
UploadOwnedBytesElementReader::CreateWithString(post_data));
- cur_request_->set_upload(make_scoped_ptr(
- UploadDataStream::CreateWithReader(reader.Pass(), 0)));
- net::HttpRequestHeaders headers;
- headers.SetHeader(net::HttpRequestHeaders::kContentType,
+ cur_request_->set_upload(
+ ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
+ HttpRequestHeaders headers;
+ headers.SetHeader(HttpRequestHeaders::kContentType,
"application/json");
cur_request_->SetExtraRequestHeaders(headers);
}
diff --git a/net/test/spawned_test_server/spawner_communicator.h b/net/test/spawned_test_server/spawner_communicator.h
index b657ac3..549ad91 100644
--- a/net/test/spawned_test_server/spawner_communicator.h
+++ b/net/test/spawned_test_server/spawner_communicator.h
@@ -100,8 +100,8 @@
std::string* data_received);
// URLRequest::Delegate methods. Called on the IO thread.
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE;
- virtual void OnReadCompleted(URLRequest* request, int num_bytes) OVERRIDE;
+ virtual void OnResponseStarted(URLRequest* request) override;
+ virtual void OnReadCompleted(URLRequest* request, int num_bytes) override;
// Reads Result from the response. Called on the IO thread.
void ReadResult(URLRequest* request);
diff --git a/net/test/url_request/url_request_failed_job.h b/net/test/url_request/url_request_failed_job.h
index 6d3cf2d..ea35116 100644
--- a/net/test/url_request/url_request_failed_job.h
+++ b/net/test/url_request/url_request_failed_job.h
@@ -22,7 +22,7 @@
NetworkDelegate* network_delegate,
int net_error);
- virtual void Start() OVERRIDE;
+ virtual void Start() override;
// Adds the testing URLs to the URLRequestFilter.
static void AddUrlHandler();
diff --git a/net/test/url_request/url_request_mock_http_job.cc b/net/test/url_request/url_request_mock_http_job.cc
index 42af81f..c611f36 100644
--- a/net/test/url_request/url_request_mock_http_job.cc
+++ b/net/test/url_request/url_request_mock_http_job.cc
@@ -42,7 +42,7 @@
// net::URLRequestJobFactory::ProtocolHandler implementation
virtual net::URLRequestJob* MaybeInterceptRequest(
net::URLRequest* request,
- net::NetworkDelegate* network_delegate) const OVERRIDE {
+ net::NetworkDelegate* network_delegate) const override {
return new URLRequestMockHTTPJob(
request,
network_delegate,
diff --git a/net/test/url_request/url_request_mock_http_job.h b/net/test/url_request/url_request_mock_http_job.h
index cb93412..eb68a2d 100644
--- a/net/test/url_request/url_request_mock_http_job.h
+++ b/net/test/url_request/url_request_mock_http_job.h
@@ -34,13 +34,13 @@
const base::FilePath& file_path,
const scoped_refptr<base::TaskRunner>& task_runner);
- virtual void Start() OVERRIDE;
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
- virtual bool GetCharset(std::string* charset) OVERRIDE;
- virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE;
+ virtual void Start() override;
+ virtual bool GetMimeType(std::string* mime_type) const override;
+ virtual int GetResponseCode() const override;
+ virtual bool GetCharset(std::string* charset) override;
+ virtual void GetResponseInfo(HttpResponseInfo* info) override;
virtual bool IsRedirectResponse(GURL* location,
- int* http_status_code) OVERRIDE;
+ int* http_status_code) override;
// Adds the testing URLs to the URLRequestFilter.
static void AddUrlHandler(
diff --git a/net/tools/balsa/balsa_frame.h b/net/tools/balsa/balsa_frame.h
index 6178d79..73c3dd9 100644
--- a/net/tools/balsa/balsa_frame.h
+++ b/net/tools/balsa/balsa_frame.h
@@ -201,11 +201,11 @@
private:
class DoNothingBalsaVisitor : public BalsaVisitorInterface {
- virtual void ProcessBodyInput(const char *input, size_t size) OVERRIDE {}
- virtual void ProcessBodyData(const char *input, size_t size) OVERRIDE {}
- virtual void ProcessHeaderInput(const char *input, size_t size) OVERRIDE {}
- virtual void ProcessTrailerInput(const char *input, size_t size) OVERRIDE {}
- virtual void ProcessHeaders(const BalsaHeaders& headers) OVERRIDE {}
+ virtual void ProcessBodyInput(const char *input, size_t size) override {}
+ virtual void ProcessBodyData(const char *input, size_t size) override {}
+ virtual void ProcessHeaderInput(const char *input, size_t size) override {}
+ virtual void ProcessTrailerInput(const char *input, size_t size) override {}
+ virtual void ProcessHeaders(const BalsaHeaders& headers) override {}
virtual void ProcessRequestFirstLine(const char* line_input,
size_t line_length,
const char* method_input,
@@ -213,7 +213,7 @@
const char* request_uri_input,
size_t request_uri_length,
const char* version_input,
- size_t version_length) OVERRIDE {}
+ size_t version_length) override {}
virtual void ProcessResponseFirstLine(const char *line_input,
size_t line_length,
const char *version_input,
@@ -221,16 +221,16 @@
const char *status_input,
size_t status_length,
const char *reason_input,
- size_t reason_length) OVERRIDE {}
- virtual void ProcessChunkLength(size_t chunk_length) OVERRIDE {}
+ size_t reason_length) override {}
+ virtual void ProcessChunkLength(size_t chunk_length) override {}
virtual void ProcessChunkExtensions(const char *input,
- size_t size) OVERRIDE {}
- virtual void HeaderDone() OVERRIDE {}
- virtual void MessageDone() OVERRIDE {}
- virtual void HandleHeaderError(BalsaFrame* framer) OVERRIDE {}
- virtual void HandleHeaderWarning(BalsaFrame* framer) OVERRIDE {}
- virtual void HandleChunkingError(BalsaFrame* framer) OVERRIDE {}
- virtual void HandleBodyError(BalsaFrame* framer) OVERRIDE {}
+ size_t size) override {}
+ virtual void HeaderDone() override {}
+ virtual void MessageDone() override {}
+ virtual void HandleHeaderError(BalsaFrame* framer) override {}
+ virtual void HandleHeaderWarning(BalsaFrame* framer) override {}
+ virtual void HandleChunkingError(BalsaFrame* framer) override {}
+ virtual void HandleBodyError(BalsaFrame* framer) override {}
};
bool last_char_was_slash_r_;
diff --git a/net/tools/balsa/balsa_frame_test.cc b/net/tools/balsa/balsa_frame_test.cc
index 2582721..334f5ef 100644
--- a/net/tools/balsa/balsa_frame_test.cc
+++ b/net/tools/balsa/balsa_frame_test.cc
@@ -58,7 +58,7 @@
class BalsaFrameTest : public ::testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
frame_.reset(new BalsaFrame);
frame_headers_.reset(new BalsaHeaders);
visitor_.reset(new Visitor);
diff --git a/net/tools/balsa/balsa_headers_test.cc b/net/tools/balsa/balsa_headers_test.cc
index da2ad19..b1479c6 100644
--- a/net/tools/balsa/balsa_headers_test.cc
+++ b/net/tools/balsa/balsa_headers_test.cc
@@ -19,7 +19,7 @@
class BalsaBufferTest : public ::testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
buffer_.reset(new BalsaBuffer);
anotherBuffer_.reset(new BalsaBuffer);
}
@@ -33,7 +33,7 @@
class BalsaHeadersTest: public ::testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
headers_.reset(new BalsaHeaders);
}
diff --git a/net/tools/balsa/noop_balsa_visitor.h b/net/tools/balsa/noop_balsa_visitor.h
index c0136f1..c47b0b3 100644
--- a/net/tools/balsa/noop_balsa_visitor.h
+++ b/net/tools/balsa/noop_balsa_visitor.h
@@ -19,11 +19,11 @@
NoOpBalsaVisitor() { }
virtual ~NoOpBalsaVisitor() { }
- virtual void ProcessBodyInput(const char* input, size_t size) OVERRIDE { }
- virtual void ProcessBodyData(const char* input, size_t size) OVERRIDE { }
- virtual void ProcessHeaderInput(const char* input, size_t size) OVERRIDE { }
- virtual void ProcessTrailerInput(const char* input, size_t size) OVERRIDE { }
- virtual void ProcessHeaders(const BalsaHeaders& headers) OVERRIDE { }
+ virtual void ProcessBodyInput(const char* input, size_t size) override { }
+ virtual void ProcessBodyData(const char* input, size_t size) override { }
+ virtual void ProcessHeaderInput(const char* input, size_t size) override { }
+ virtual void ProcessTrailerInput(const char* input, size_t size) override { }
+ virtual void ProcessHeaders(const BalsaHeaders& headers) override { }
virtual void ProcessRequestFirstLine(const char* line_input,
size_t line_length,
@@ -32,7 +32,7 @@
const char* request_uri_input,
size_t request_uri_length,
const char* version_input,
- size_t version_length) OVERRIDE { }
+ size_t version_length) override { }
virtual void ProcessResponseFirstLine(const char* line_input,
size_t line_length,
const char* version_input,
@@ -40,16 +40,16 @@
const char* status_input,
size_t status_length,
const char* reason_input,
- size_t reason_length) OVERRIDE { }
- virtual void ProcessChunkLength(size_t chunk_length) OVERRIDE { }
- virtual void ProcessChunkExtensions(const char* input, size_t size) OVERRIDE {
+ size_t reason_length) override { }
+ virtual void ProcessChunkLength(size_t chunk_length) override { }
+ virtual void ProcessChunkExtensions(const char* input, size_t size) override {
}
- virtual void HeaderDone() OVERRIDE { }
- virtual void MessageDone() OVERRIDE { }
- virtual void HandleHeaderError(BalsaFrame* framer) OVERRIDE { }
- virtual void HandleHeaderWarning(BalsaFrame* framer) OVERRIDE { }
- virtual void HandleChunkingError(BalsaFrame* framer) OVERRIDE { }
- virtual void HandleBodyError(BalsaFrame* framer) OVERRIDE { }
+ virtual void HeaderDone() override { }
+ virtual void MessageDone() override { }
+ virtual void HandleHeaderError(BalsaFrame* framer) override { }
+ virtual void HandleHeaderWarning(BalsaFrame* framer) override { }
+ virtual void HandleChunkingError(BalsaFrame* framer) override { }
+ virtual void HandleBodyError(BalsaFrame* framer) override { }
private:
DISALLOW_COPY_AND_ASSIGN(NoOpBalsaVisitor);
diff --git a/net/tools/balsa/simple_buffer.h b/net/tools/balsa/simple_buffer.h
index a550617..d58894e 100644
--- a/net/tools/balsa/simple_buffer.h
+++ b/net/tools/balsa/simple_buffer.h
@@ -32,32 +32,32 @@
// The following functions all override pure virtual functions
// in BufferInterface. See buffer_interface.h for a description
// of what they do.
- virtual int ReadableBytes() const OVERRIDE;
- virtual int BufferSize() const OVERRIDE;
- virtual int BytesFree() const OVERRIDE;
+ virtual int ReadableBytes() const override;
+ virtual int BufferSize() const override;
+ virtual int BytesFree() const override;
- virtual bool Empty() const OVERRIDE;
- virtual bool Full() const OVERRIDE;
+ virtual bool Empty() const override;
+ virtual bool Full() const override;
- virtual int Write(const char* bytes, int size) OVERRIDE;
+ virtual int Write(const char* bytes, int size) override;
- virtual void GetWritablePtr(char **ptr, int* size) const OVERRIDE;
+ virtual void GetWritablePtr(char **ptr, int* size) const override;
- virtual void GetReadablePtr(char **ptr, int* size) const OVERRIDE;
+ virtual void GetReadablePtr(char **ptr, int* size) const override;
- virtual int Read(char* bytes, int size) OVERRIDE;
+ virtual int Read(char* bytes, int size) override;
- virtual void Clear() OVERRIDE;
+ virtual void Clear() override;
// This can be an expensive operation: costing a new/delete, and copying of
// all existing data. Even if the existing buffer does not need to be
// resized, unread data may still need to be non-destructively copied to
// consolidate fragmented free space.
- virtual bool Reserve(int size) OVERRIDE;
+ virtual bool Reserve(int size) override;
- virtual void AdvanceReadablePtr(int amount_to_advance) OVERRIDE;
+ virtual void AdvanceReadablePtr(int amount_to_advance) override;
- virtual void AdvanceWritablePtr(int amount_to_advance) OVERRIDE;
+ virtual void AdvanceWritablePtr(int amount_to_advance) override;
void Swap(SimpleBuffer* other) {
char* tmp = storage_;
diff --git a/net/tools/dump_cache/cache_dumper.h b/net/tools/dump_cache/cache_dumper.h
index 9c5837c..46c3eec 100644
--- a/net/tools/dump_cache/cache_dumper.h
+++ b/net/tools/dump_cache/cache_dumper.h
@@ -48,12 +48,12 @@
explicit CacheDumper(disk_cache::Backend* cache);
virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int WriteEntry(disk_cache::Entry* entry, int stream, int offset,
net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual void CloseEntry(disk_cache::Entry* entry, base::Time last_used,
- base::Time last_modified) OVERRIDE;
+ base::Time last_modified) override;
private:
disk_cache::Backend* cache_;
@@ -65,12 +65,12 @@
explicit DiskDumper(const base::FilePath& path);
virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual int WriteEntry(disk_cache::Entry* entry, int stream, int offset,
net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) OVERRIDE;
+ const net::CompletionCallback& callback) override;
virtual void CloseEntry(disk_cache::Entry* entry, base::Time last_used,
- base::Time last_modified) OVERRIDE;
+ base::Time last_modified) override;
private:
base::FilePath path_;
diff --git a/net/tools/epoll_server/epoll_server.cc b/net/tools/epoll_server/epoll_server.cc
index a382dba..7ccae1d 100644
--- a/net/tools/epoll_server/epoll_server.cc
+++ b/net/tools/epoll_server/epoll_server.cc
@@ -60,7 +60,7 @@
// Clears the pipe and returns. Used for waking the epoll server up.
class ReadPipeCallback : public EpollCallbackInterface {
public:
- virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE {
+ virtual void OnEvent(int fd, EpollEvent* event) override {
DCHECK(event->in_events == EPOLLIN);
int data;
int data_read = 1;
@@ -69,10 +69,10 @@
data_read = read(fd, &data, sizeof(data));
}
}
- virtual void OnShutdown(EpollServer *eps, int fd) OVERRIDE {}
- virtual void OnRegistration(EpollServer*, int, int) OVERRIDE {}
- virtual void OnModification(int, int) OVERRIDE {} // COV_NF_LINE
- virtual void OnUnregistration(int, bool) OVERRIDE {} // COV_NF_LINE
+ virtual void OnShutdown(EpollServer *eps, int fd) override {}
+ virtual void OnRegistration(EpollServer*, int, int) override {}
+ virtual void OnModification(int, int) override {} // COV_NF_LINE
+ virtual void OnUnregistration(int, bool) override {} // COV_NF_LINE
};
////////////////////////////////////////////////////////////////////////////////
diff --git a/net/tools/epoll_server/epoll_server.h b/net/tools/epoll_server/epoll_server.h
index 8822450..e8f1396 100644
--- a/net/tools/epoll_server/epoll_server.h
+++ b/net/tools/epoll_server/epoll_server.h
@@ -1023,17 +1023,17 @@
// Marks the alarm as unregistered and returns 0. The return value may be
// safely ignored by subclasses.
- virtual int64 OnAlarm() OVERRIDE;
+ virtual int64 OnAlarm() override;
// Marks the alarm as registered, and stores the token.
virtual void OnRegistration(const EpollServer::AlarmRegToken& token,
- EpollServer* eps) OVERRIDE;
+ EpollServer* eps) override;
// Marks the alarm as unregistered.
- virtual void OnUnregistration() OVERRIDE;
+ virtual void OnUnregistration() override;
// Marks the alarm as unregistered.
- virtual void OnShutdown(EpollServer* eps) OVERRIDE;
+ virtual void OnShutdown(EpollServer* eps) override;
// If the alarm was registered, unregister it.
void UnregisterIfRegistered();
diff --git a/net/tools/flip_server/acceptor_thread.h b/net/tools/flip_server/acceptor_thread.h
index bcaa43e..ecb4316 100644
--- a/net/tools/flip_server/acceptor_thread.h
+++ b/net/tools/flip_server/acceptor_thread.h
@@ -52,14 +52,14 @@
// EpollCallbackInteface interface
virtual void OnRegistration(EpollServer* eps,
int fd,
- int event_mask) OVERRIDE {}
- virtual void OnModification(int fd, int event_mask) OVERRIDE {}
- virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE;
- virtual void OnUnregistration(int fd, bool replaced) OVERRIDE {}
- virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE {}
+ int event_mask) override {}
+ virtual void OnModification(int fd, int event_mask) override {}
+ virtual void OnEvent(int fd, EpollEvent* event) override;
+ virtual void OnUnregistration(int fd, bool replaced) override {}
+ virtual void OnShutdown(EpollServer* eps, int fd) override {}
// SMConnectionPool interface
- virtual void SMConnectionDone(SMConnection* sc) OVERRIDE;
+ virtual void SMConnectionDone(SMConnection* sc) override;
// TODO(mbelshe): figure out if we can move these to private functions.
SMConnection* NewConnection();
@@ -75,7 +75,7 @@
// idle longer than the configured timeout.
void HandleConnectionIdleTimeout();
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
private:
EpollServer epoll_server_;
diff --git a/net/tools/flip_server/http_interface.h b/net/tools/flip_server/http_interface.h
index 30b7979..08a595e 100644
--- a/net/tools/flip_server/http_interface.h
+++ b/net/tools/flip_server/http_interface.h
@@ -32,11 +32,11 @@
private:
// BalsaVisitorInterface:
- virtual void ProcessBodyInput(const char* input, size_t size) OVERRIDE {}
- virtual void ProcessBodyData(const char* input, size_t size) OVERRIDE;
- virtual void ProcessHeaderInput(const char* input, size_t size) OVERRIDE {}
- virtual void ProcessTrailerInput(const char* input, size_t size) OVERRIDE {}
- virtual void ProcessHeaders(const BalsaHeaders& headers) OVERRIDE;
+ virtual void ProcessBodyInput(const char* input, size_t size) override {}
+ virtual void ProcessBodyData(const char* input, size_t size) override;
+ virtual void ProcessHeaderInput(const char* input, size_t size) override {}
+ virtual void ProcessTrailerInput(const char* input, size_t size) override {}
+ virtual void ProcessHeaders(const BalsaHeaders& headers) override;
virtual void ProcessRequestFirstLine(const char* line_input,
size_t line_length,
const char* method_input,
@@ -44,7 +44,7 @@
const char* request_uri_input,
size_t request_uri_length,
const char* version_input,
- size_t version_length) OVERRIDE {}
+ size_t version_length) override {}
virtual void ProcessResponseFirstLine(const char* line_input,
size_t line_length,
const char* version_input,
@@ -52,28 +52,28 @@
const char* status_input,
size_t status_length,
const char* reason_input,
- size_t reason_length) OVERRIDE {}
- virtual void ProcessChunkLength(size_t chunk_length) OVERRIDE {}
- virtual void ProcessChunkExtensions(const char* input, size_t size) OVERRIDE {
+ size_t reason_length) override {}
+ virtual void ProcessChunkLength(size_t chunk_length) override {}
+ virtual void ProcessChunkExtensions(const char* input, size_t size) override {
}
- virtual void HeaderDone() OVERRIDE {}
- virtual void MessageDone() OVERRIDE;
- virtual void HandleHeaderError(BalsaFrame* framer) OVERRIDE;
- virtual void HandleHeaderWarning(BalsaFrame* framer) OVERRIDE {}
- virtual void HandleChunkingError(BalsaFrame* framer) OVERRIDE;
- virtual void HandleBodyError(BalsaFrame* framer) OVERRIDE;
+ virtual void HeaderDone() override {}
+ virtual void MessageDone() override;
+ virtual void HandleHeaderError(BalsaFrame* framer) override;
+ virtual void HandleHeaderWarning(BalsaFrame* framer) override {}
+ virtual void HandleChunkingError(BalsaFrame* framer) override;
+ virtual void HandleBodyError(BalsaFrame* framer) override;
void HandleError();
public:
void AddToOutputOrder(const MemCacheIter& mci);
BalsaFrame* spdy_framer() { return http_framer_; }
- virtual void set_is_request() OVERRIDE {}
+ virtual void set_is_request() override {}
const OutputOrdering& output_ordering() const { return output_ordering_; }
// SMInterface:
virtual void InitSMInterface(SMInterface* sm_spdy_interface,
- int32 server_idx) OVERRIDE;
+ int32 server_idx) override;
virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool,
SMInterface* sm_interface,
EpollServer* epoll_server,
@@ -81,33 +81,33 @@
std::string server_ip,
std::string server_port,
std::string remote_ip,
- bool use_ssl) OVERRIDE;
- virtual size_t ProcessReadInput(const char* data, size_t len) OVERRIDE;
- virtual size_t ProcessWriteInput(const char* data, size_t len) OVERRIDE;
- virtual bool MessageFullyRead() const OVERRIDE;
- virtual void SetStreamID(uint32 stream_id) OVERRIDE;
- virtual bool Error() const OVERRIDE;
- virtual const char* ErrorAsString() const OVERRIDE;
- virtual void Reset() OVERRIDE;
- virtual void ResetForNewInterface(int32 server_idx) OVERRIDE {}
- virtual void ResetForNewConnection() OVERRIDE;
- virtual void Cleanup() OVERRIDE;
- virtual int PostAcceptHook() OVERRIDE;
+ bool use_ssl) override;
+ virtual size_t ProcessReadInput(const char* data, size_t len) override;
+ virtual size_t ProcessWriteInput(const char* data, size_t len) override;
+ virtual bool MessageFullyRead() const override;
+ virtual void SetStreamID(uint32 stream_id) override;
+ virtual bool Error() const override;
+ virtual const char* ErrorAsString() const override;
+ virtual void Reset() override;
+ virtual void ResetForNewInterface(int32 server_idx) override {}
+ virtual void ResetForNewConnection() override;
+ virtual void Cleanup() override;
+ virtual int PostAcceptHook() override;
virtual void NewStream(uint32 stream_id,
uint32 priority,
- const std::string& filename) OVERRIDE;
- virtual void SendEOF(uint32 stream_id) OVERRIDE;
- virtual void SendErrorNotFound(uint32 stream_id) OVERRIDE;
+ const std::string& filename) override;
+ virtual void SendEOF(uint32 stream_id) override;
+ virtual void SendErrorNotFound(uint32 stream_id) override;
virtual size_t SendSynStream(uint32 stream_id,
- const BalsaHeaders& headers) OVERRIDE;
+ const BalsaHeaders& headers) override;
virtual size_t SendSynReply(uint32 stream_id,
- const BalsaHeaders& headers) OVERRIDE;
+ const BalsaHeaders& headers) override;
virtual void SendDataFrame(uint32 stream_id,
const char* data,
int64 len,
uint32 flags,
- bool compress) OVERRIDE;
+ bool compress) override;
private:
void SendEOFImpl(uint32 stream_id);
@@ -121,7 +121,7 @@
uint32 flags,
bool compress);
void EnqueueDataFrame(DataFrame* df);
- virtual void GetOutput() OVERRIDE;
+ virtual void GetOutput() override;
private:
BalsaFrame* http_framer_;
diff --git a/net/tools/flip_server/http_interface_test.cc b/net/tools/flip_server/http_interface_test.cc
index 969607b..9e72279 100644
--- a/net/tools/flip_server/http_interface_test.cc
+++ b/net/tools/flip_server/http_interface_test.cc
@@ -86,7 +86,7 @@
acceptor_.get()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (acceptor_->listen_fd_ >= 0) {
epoll_server_->UnregisterFD(acceptor_->listen_fd_);
close(acceptor_->listen_fd_);
diff --git a/net/tools/flip_server/mem_cache.h b/net/tools/flip_server/mem_cache.h
index 76ffc95..63befee 100644
--- a/net/tools/flip_server/mem_cache.h
+++ b/net/tools/flip_server/mem_cache.h
@@ -21,11 +21,11 @@
void HandleError() { error_ = true; }
// BalsaVisitorInterface:
- virtual void ProcessBodyInput(const char* input, size_t size) OVERRIDE {}
- virtual void ProcessBodyData(const char* input, size_t size) OVERRIDE;
- virtual void ProcessHeaderInput(const char* input, size_t size) OVERRIDE {}
- virtual void ProcessTrailerInput(const char* input, size_t size) OVERRIDE {}
- virtual void ProcessHeaders(const BalsaHeaders& headers) OVERRIDE {
+ virtual void ProcessBodyInput(const char* input, size_t size) override {}
+ virtual void ProcessBodyData(const char* input, size_t size) override;
+ virtual void ProcessHeaderInput(const char* input, size_t size) override {}
+ virtual void ProcessTrailerInput(const char* input, size_t size) override {}
+ virtual void ProcessHeaders(const BalsaHeaders& headers) override {
// nothing to do here-- we're assuming that the BalsaFrame has
// been handed our headers.
}
@@ -36,7 +36,7 @@
const char* request_uri_input,
size_t request_uri_length,
const char* version_input,
- size_t version_length) OVERRIDE {}
+ size_t version_length) override {}
virtual void ProcessResponseFirstLine(const char* line_input,
size_t line_length,
const char* version_input,
@@ -44,16 +44,16 @@
const char* status_input,
size_t status_length,
const char* reason_input,
- size_t reason_length) OVERRIDE {}
- virtual void ProcessChunkLength(size_t chunk_length) OVERRIDE {}
- virtual void ProcessChunkExtensions(const char* input, size_t size) OVERRIDE {
+ size_t reason_length) override {}
+ virtual void ProcessChunkLength(size_t chunk_length) override {}
+ virtual void ProcessChunkExtensions(const char* input, size_t size) override {
}
- virtual void HeaderDone() OVERRIDE {}
- virtual void MessageDone() OVERRIDE {}
- virtual void HandleHeaderError(BalsaFrame* framer) OVERRIDE;
- virtual void HandleHeaderWarning(BalsaFrame* framer) OVERRIDE;
- virtual void HandleChunkingError(BalsaFrame* framer) OVERRIDE;
- virtual void HandleBodyError(BalsaFrame* framer) OVERRIDE;
+ virtual void HeaderDone() override {}
+ virtual void MessageDone() override {}
+ virtual void HandleHeaderError(BalsaFrame* framer) override;
+ virtual void HandleHeaderWarning(BalsaFrame* framer) override;
+ virtual void HandleChunkingError(BalsaFrame* framer) override;
+ virtual void HandleBodyError(BalsaFrame* framer) override;
BalsaHeaders headers;
std::string body;
diff --git a/net/tools/flip_server/mem_cache_test.cc b/net/tools/flip_server/mem_cache_test.cc
index 5e45bb5..bb01907 100644
--- a/net/tools/flip_server/mem_cache_test.cc
+++ b/net/tools/flip_server/mem_cache_test.cc
@@ -16,7 +16,7 @@
virtual ~MemoryCacheWithFakeReadToString() {}
virtual void ReadToString(const char* filename,
- std::string* output) OVERRIDE {
+ std::string* output) override {
*output = data_map_[filename];
}
diff --git a/net/tools/flip_server/output_ordering.h b/net/tools/flip_server/output_ordering.h
index 596f382..488d2e9 100644
--- a/net/tools/flip_server/output_ordering.h
+++ b/net/tools/flip_server/output_ordering.h
@@ -56,11 +56,11 @@
virtual ~BeginOutputtingAlarm();
// EpollAlarmCallbackInterface:
- virtual int64 OnAlarm() OVERRIDE;
+ virtual int64 OnAlarm() override;
virtual void OnRegistration(const EpollServer::AlarmRegToken& tok,
- EpollServer* eps) OVERRIDE;
- virtual void OnUnregistration() OVERRIDE;
- virtual void OnShutdown(EpollServer* eps) OVERRIDE;
+ EpollServer* eps) override;
+ virtual void OnUnregistration() override;
+ virtual void OnShutdown(EpollServer* eps) override;
private:
OutputOrdering* output_ordering_;
diff --git a/net/tools/flip_server/ring_buffer.h b/net/tools/flip_server/ring_buffer.h
index b129ee8..bb3b39f 100644
--- a/net/tools/flip_server/ring_buffer.h
+++ b/net/tools/flip_server/ring_buffer.h
@@ -38,32 +38,32 @@
// The following functions all override pure virtual functions
// in BufferInterface. See buffer_interface.h for a description
// of what they do if the function isn't documented here.
- virtual int ReadableBytes() const OVERRIDE;
- virtual int BufferSize() const OVERRIDE;
- virtual int BytesFree() const OVERRIDE;
+ virtual int ReadableBytes() const override;
+ virtual int BufferSize() const override;
+ virtual int BytesFree() const override;
- virtual bool Empty() const OVERRIDE;
- virtual bool Full() const OVERRIDE;
+ virtual bool Empty() const override;
+ virtual bool Full() const override;
// returns the number of characters written.
// appends up-to-'size' bytes to the ringbuffer.
- virtual int Write(const char* bytes, int size) OVERRIDE;
+ virtual int Write(const char* bytes, int size) override;
// Stores a pointer into the ring buffer in *ptr, and stores the number of
// characters which are allowed to be written in *size.
// If there are no writable bytes available, then *size will contain 0.
- virtual void GetWritablePtr(char** ptr, int* size) const OVERRIDE;
+ virtual void GetWritablePtr(char** ptr, int* size) const override;
// Stores a pointer into the ring buffer in *ptr, and stores the number of
// characters which are allowed to be read in *size.
// If there are no readable bytes available, then *size will contain 0.
- virtual void GetReadablePtr(char** ptr, int* size) const OVERRIDE;
+ virtual void GetReadablePtr(char** ptr, int* size) const override;
// Returns the number of bytes read into 'bytes'.
- virtual int Read(char* bytes, int size) OVERRIDE;
+ virtual int Read(char* bytes, int size) override;
// Removes all data from the ring buffer.
- virtual void Clear() OVERRIDE;
+ virtual void Clear() override;
// Reserves contiguous writable empty space in the buffer of size bytes.
// Since the point of this class is to have a fixed size buffer, be careful
@@ -76,15 +76,15 @@
// to consolidate fragmented free space. If the size requested is less than
// or equal to BytesFree(), it is guaranteed that the buffer size will not
// change.
- virtual bool Reserve(int size) OVERRIDE;
+ virtual bool Reserve(int size) override;
// Removes the oldest 'amount_to_advance' characters.
// If amount_to_consume > ReadableBytes(), this performs a Clear() instead.
- virtual void AdvanceReadablePtr(int amount_to_advance) OVERRIDE;
+ virtual void AdvanceReadablePtr(int amount_to_advance) override;
// Moves the internal pointers around such that the amount of data specified
// here is expected to already be resident (as if it was Written).
- virtual void AdvanceWritablePtr(int amount_to_advance) OVERRIDE;
+ virtual void AdvanceWritablePtr(int amount_to_advance) override;
protected:
int read_idx() const { return read_idx_; }
diff --git a/net/tools/flip_server/sm_connection.h b/net/tools/flip_server/sm_connection.h
index 2fe3228..5c5a5fd 100644
--- a/net/tools/flip_server/sm_connection.h
+++ b/net/tools/flip_server/sm_connection.h
@@ -57,10 +57,10 @@
std::string server_ip_;
std::string server_port_;
- virtual EpollServer* epoll_server() OVERRIDE;
+ virtual EpollServer* epoll_server() override;
OutputList* output_list() { return &output_list_; }
MemoryCache* memory_cache() { return memory_cache_; }
- virtual void ReadyToSend() OVERRIDE;
+ virtual void ReadyToSend() override;
void EnqueueDataFrame(DataFrame* df);
int fd() const { return fd_; }
@@ -84,14 +84,14 @@
// EpollCallbackInterface interface.
virtual void OnRegistration(EpollServer* eps,
int fd,
- int event_mask) OVERRIDE;
- virtual void OnModification(int fd, int event_mask) OVERRIDE {}
- virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE;
- virtual void OnUnregistration(int fd, bool replaced) OVERRIDE;
- virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE;
+ int event_mask) override;
+ virtual void OnModification(int fd, int event_mask) override {}
+ virtual void OnEvent(int fd, EpollEvent* event) override;
+ virtual void OnUnregistration(int fd, bool replaced) override;
+ virtual void OnShutdown(EpollServer* eps, int fd) override;
// NotifierInterface interface.
- virtual void Notify() OVERRIDE {}
+ virtual void Notify() override {}
void Cleanup(const char* cleanup);
diff --git a/net/tools/flip_server/spdy_interface.h b/net/tools/flip_server/spdy_interface.h
index 2174274..2d2437a 100644
--- a/net/tools/flip_server/spdy_interface.h
+++ b/net/tools/flip_server/spdy_interface.h
@@ -35,7 +35,7 @@
virtual ~SpdySM();
virtual void InitSMInterface(SMInterface* sm_http_interface,
- int32 server_idx) OVERRIDE {}
+ int32 server_idx) override {}
virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool,
SMInterface* sm_interface,
@@ -44,13 +44,13 @@
std::string server_ip,
std::string server_port,
std::string remote_ip,
- bool use_ssl) OVERRIDE;
+ bool use_ssl) override;
// Create new SPDY framer after reusing SpdySM and negotiating new version
void CreateFramer(SpdyMajorVersion spdy_version);
private:
- virtual void set_is_request() OVERRIDE {}
+ virtual void set_is_request() override {}
SMInterface* NewConnectionInterface();
// virtual for tests
virtual SMInterface* FindOrMakeNewSMConnectionInterface(
@@ -63,31 +63,31 @@
bool* is_https_scheme);
// BufferedSpdyFramerVisitorInterface:
- virtual void OnError(SpdyFramer::SpdyError error_code) OVERRIDE {}
+ virtual void OnError(SpdyFramer::SpdyError error_code) override {}
virtual void OnStreamError(SpdyStreamId stream_id,
- const std::string& description) OVERRIDE {}
+ const std::string& description) override {}
// Called after all the header data for SYN_STREAM control frame is received.
virtual void OnSynStream(SpdyStreamId stream_id,
SpdyStreamId associated_stream_id,
SpdyPriority priority,
bool fin,
bool unidirectional,
- const SpdyHeaderBlock& headers) OVERRIDE;
+ const SpdyHeaderBlock& headers) override;
// Called after all the header data for SYN_REPLY control frame is received.
virtual void OnSynReply(SpdyStreamId stream_id,
bool fin,
- const SpdyHeaderBlock& headers) OVERRIDE;
+ const SpdyHeaderBlock& headers) override;
// Called after all the header data for HEADERS control frame is received.
virtual void OnHeaders(SpdyStreamId stream_id,
bool fin,
- const SpdyHeaderBlock& headers) OVERRIDE;
+ const SpdyHeaderBlock& headers) override;
// Called when data frame header is received.
virtual void OnDataFrameHeader(SpdyStreamId stream_id,
size_t length,
- bool fin) OVERRIDE {}
+ bool fin) override {}
// Called when data is received.
// |stream_id| The stream receiving data.
@@ -98,73 +98,73 @@
virtual void OnStreamFrameData(SpdyStreamId stream_id,
const char* data,
size_t len,
- bool fin) OVERRIDE;
+ bool fin) override;
// Called when a SETTINGS frame is received.
// |clear_persisted| True if the respective flag is set on the SETTINGS frame.
- virtual void OnSettings(bool clear_persisted) OVERRIDE {}
+ virtual void OnSettings(bool clear_persisted) override {}
// Called when an individual setting within a SETTINGS frame has been parsed
// and validated.
virtual void OnSetting(SpdySettingsIds id,
uint8 flags,
- uint32 value) OVERRIDE {}
+ uint32 value) override {}
// Called when a PING frame has been parsed.
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) OVERRIDE {}
+ virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {}
// Called when a RST_STREAM frame has been parsed.
virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) OVERRIDE;
+ SpdyRstStreamStatus status) override;
// Called when a GOAWAY frame has been parsed.
virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) OVERRIDE {}
+ SpdyGoAwayStatus status) override {}
// Called when a WINDOW_UPDATE frame has been parsed.
virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) OVERRIDE {}
+ uint32 delta_window_size) override {}
// Called when a PUSH_PROMISE frame has been parsed.
virtual void OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- const SpdyHeaderBlock& headers) OVERRIDE {}
+ const SpdyHeaderBlock& headers) override {}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) OVERRIDE;
+ virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override;
public:
- virtual size_t ProcessReadInput(const char* data, size_t len) OVERRIDE;
- virtual size_t ProcessWriteInput(const char* data, size_t len) OVERRIDE;
- virtual bool MessageFullyRead() const OVERRIDE;
- virtual void SetStreamID(uint32 stream_id) OVERRIDE {}
- virtual bool Error() const OVERRIDE;
- virtual const char* ErrorAsString() const OVERRIDE;
- virtual void Reset() OVERRIDE {}
- virtual void ResetForNewInterface(int32 server_idx) OVERRIDE;
- virtual void ResetForNewConnection() OVERRIDE;
+ virtual size_t ProcessReadInput(const char* data, size_t len) override;
+ virtual size_t ProcessWriteInput(const char* data, size_t len) override;
+ virtual bool MessageFullyRead() const override;
+ virtual void SetStreamID(uint32 stream_id) override {}
+ virtual bool Error() const override;
+ virtual const char* ErrorAsString() const override;
+ virtual void Reset() override {}
+ virtual void ResetForNewInterface(int32 server_idx) override;
+ virtual void ResetForNewConnection() override;
// SMInterface's Cleanup is currently only called by SMConnection after a
// protocol message as been fully read. Spdy's SMInterface does not need
// to do any cleanup at this time.
// TODO(klindsay) This method is probably not being used properly and
// some logic review and method renaming is probably in order.
- virtual void Cleanup() OVERRIDE {}
+ virtual void Cleanup() override {}
// Send a settings frame
- virtual int PostAcceptHook() OVERRIDE;
+ virtual int PostAcceptHook() override;
virtual void NewStream(uint32 stream_id,
uint32 priority,
- const std::string& filename) OVERRIDE;
+ const std::string& filename) override;
void AddToOutputOrder(const MemCacheIter& mci);
- virtual void SendEOF(uint32 stream_id) OVERRIDE;
- virtual void SendErrorNotFound(uint32 stream_id) OVERRIDE;
+ virtual void SendEOF(uint32 stream_id) override;
+ virtual void SendErrorNotFound(uint32 stream_id) override;
virtual size_t SendSynStream(uint32 stream_id,
- const BalsaHeaders& headers) OVERRIDE;
+ const BalsaHeaders& headers) override;
virtual size_t SendSynReply(uint32 stream_id,
- const BalsaHeaders& headers) OVERRIDE;
+ const BalsaHeaders& headers) override;
virtual void SendDataFrame(uint32 stream_id,
const char* data,
int64 len,
uint32 flags,
- bool compress) OVERRIDE;
+ bool compress) override;
BufferedSpdyFramer* spdy_framer() { return buffered_spdy_framer_.get(); }
const OutputOrdering& output_ordering() const {
@@ -193,7 +193,7 @@
SpdyDataFlags flags,
bool compress);
void EnqueueDataFrame(DataFrame* df);
- virtual void GetOutput() OVERRIDE;
+ virtual void GetOutput() override;
private:
scoped_ptr<BufferedSpdyFramer> buffered_spdy_framer_;
diff --git a/net/tools/flip_server/streamer_interface.h b/net/tools/flip_server/streamer_interface.h
index 0114491..ca04f1e 100644
--- a/net/tools/flip_server/streamer_interface.h
+++ b/net/tools/flip_server/streamer_interface.h
@@ -31,7 +31,7 @@
void AddToOutputOrder(const MemCacheIter& mci) {}
virtual void InitSMInterface(SMInterface* sm_other_interface,
- int32 server_idx) OVERRIDE;
+ int32 server_idx) override;
virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool,
SMInterface* sm_interface,
EpollServer* epoll_server,
@@ -39,35 +39,35 @@
std::string server_ip,
std::string server_port,
std::string remote_ip,
- bool use_ssl) OVERRIDE;
+ bool use_ssl) override;
- virtual size_t ProcessReadInput(const char* data, size_t len) OVERRIDE;
- virtual size_t ProcessWriteInput(const char* data, size_t len) OVERRIDE;
- virtual bool MessageFullyRead() const OVERRIDE;
- virtual void SetStreamID(uint32 stream_id) OVERRIDE {}
- virtual bool Error() const OVERRIDE;
- virtual const char* ErrorAsString() const OVERRIDE;
- virtual void Reset() OVERRIDE;
- virtual void ResetForNewInterface(int32 server_idx) OVERRIDE {}
- virtual void ResetForNewConnection() OVERRIDE;
- virtual void Cleanup() OVERRIDE;
- virtual int PostAcceptHook() OVERRIDE;
+ virtual size_t ProcessReadInput(const char* data, size_t len) override;
+ virtual size_t ProcessWriteInput(const char* data, size_t len) override;
+ virtual bool MessageFullyRead() const override;
+ virtual void SetStreamID(uint32 stream_id) override {}
+ virtual bool Error() const override;
+ virtual const char* ErrorAsString() const override;
+ virtual void Reset() override;
+ virtual void ResetForNewInterface(int32 server_idx) override {}
+ virtual void ResetForNewConnection() override;
+ virtual void Cleanup() override;
+ virtual int PostAcceptHook() override;
virtual void NewStream(uint32 stream_id,
uint32 priority,
- const std::string& filename) OVERRIDE {}
- virtual void SendEOF(uint32 stream_id) OVERRIDE {}
- virtual void SendErrorNotFound(uint32 stream_id) OVERRIDE {}
+ const std::string& filename) override {}
+ virtual void SendEOF(uint32 stream_id) override {}
+ virtual void SendErrorNotFound(uint32 stream_id) override {}
virtual void SendOKResponse(uint32 stream_id, std::string output) {}
virtual size_t SendSynStream(uint32 stream_id,
- const BalsaHeaders& headers) OVERRIDE;
+ const BalsaHeaders& headers) override;
virtual size_t SendSynReply(uint32 stream_id,
- const BalsaHeaders& headers) OVERRIDE;
+ const BalsaHeaders& headers) override;
virtual void SendDataFrame(uint32 stream_id,
const char* data,
int64 len,
uint32 flags,
- bool compress) OVERRIDE {}
- virtual void set_is_request() OVERRIDE;
+ bool compress) override {}
+ virtual void set_is_request() override;
static std::string forward_ip_header() { return forward_ip_header_; }
static void set_forward_ip_header(std::string value) {
forward_ip_header_ = value;
@@ -88,14 +88,14 @@
int64 len,
uint32 flags,
bool compress) {}
- virtual void GetOutput() OVERRIDE {}
+ virtual void GetOutput() override {}
- virtual void ProcessBodyInput(const char* input, size_t size) OVERRIDE;
- virtual void MessageDone() OVERRIDE;
- virtual void ProcessHeaders(const BalsaHeaders& headers) OVERRIDE;
- virtual void ProcessBodyData(const char* input, size_t size) OVERRIDE {}
- virtual void ProcessHeaderInput(const char* input, size_t size) OVERRIDE {}
- virtual void ProcessTrailerInput(const char* input, size_t size) OVERRIDE {}
+ virtual void ProcessBodyInput(const char* input, size_t size) override;
+ virtual void MessageDone() override;
+ virtual void ProcessHeaders(const BalsaHeaders& headers) override;
+ virtual void ProcessBodyData(const char* input, size_t size) override {}
+ virtual void ProcessHeaderInput(const char* input, size_t size) override {}
+ virtual void ProcessTrailerInput(const char* input, size_t size) override {}
virtual void ProcessRequestFirstLine(const char* line_input,
size_t line_length,
const char* method_input,
@@ -103,7 +103,7 @@
const char* request_uri_input,
size_t request_uri_length,
const char* version_input,
- size_t version_length) OVERRIDE {}
+ size_t version_length) override {}
virtual void ProcessResponseFirstLine(const char* line_input,
size_t line_length,
const char* version_input,
@@ -111,15 +111,15 @@
const char* status_input,
size_t status_length,
const char* reason_input,
- size_t reason_length) OVERRIDE {}
- virtual void ProcessChunkLength(size_t chunk_length) OVERRIDE {}
- virtual void ProcessChunkExtensions(const char* input, size_t size) OVERRIDE {
+ size_t reason_length) override {}
+ virtual void ProcessChunkLength(size_t chunk_length) override {}
+ virtual void ProcessChunkExtensions(const char* input, size_t size) override {
}
- virtual void HeaderDone() OVERRIDE {}
- virtual void HandleHeaderError(BalsaFrame* framer) OVERRIDE;
- virtual void HandleHeaderWarning(BalsaFrame* framer) OVERRIDE {}
- virtual void HandleChunkingError(BalsaFrame* framer) OVERRIDE;
- virtual void HandleBodyError(BalsaFrame* framer) OVERRIDE;
+ virtual void HeaderDone() override {}
+ virtual void HandleHeaderError(BalsaFrame* framer) override;
+ virtual void HandleHeaderWarning(BalsaFrame* framer) override {}
+ virtual void HandleChunkingError(BalsaFrame* framer) override;
+ virtual void HandleBodyError(BalsaFrame* framer) override;
void HandleError();
SMConnection* connection_;
diff --git a/net/tools/gdig/file_net_log.h b/net/tools/gdig/file_net_log.h
index 0f858bb..005ea31 100644
--- a/net/tools/gdig/file_net_log.h
+++ b/net/tools/gdig/file_net_log.h
@@ -23,7 +23,7 @@
virtual ~FileNetLogObserver();
// NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
+ virtual void OnAddEntry(const net::NetLog::Entry& entry) override;
private:
FILE* const destination_;
diff --git a/net/tools/get_server_time/get_server_time.cc b/net/tools/get_server_time/get_server_time.cc
index ddc08b2..8ad907d 100644
--- a/net/tools/get_server_time/get_server_time.cc
+++ b/net/tools/get_server_time/get_server_time.cc
@@ -75,18 +75,18 @@
virtual ~QuitDelegate() {}
// net::URLFetcherDelegate implementation.
- virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE {
+ virtual void OnURLFetchComplete(const net::URLFetcher* source) override {
base::MessageLoop::current()->Quit();
}
virtual void OnURLFetchDownloadProgress(
const net::URLFetcher* source,
- int64 current, int64 total) OVERRIDE {
+ int64 current, int64 total) override {
NOTREACHED();
}
virtual void OnURLFetchUploadProgress(const net::URLFetcher* source,
- int64 current, int64 total) OVERRIDE {
+ int64 current, int64 total) override {
NOTREACHED();
}
@@ -106,7 +106,7 @@
}
// NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE {
+ virtual void OnAddEntry(const net::NetLog::Entry& entry) override {
// The log level of the entry is unknown, so just assume it maps
// to VLOG(1).
if (!VLOG_IS_ON(1))
diff --git a/net/tools/net_watcher/net_watcher.cc b/net/tools/net_watcher/net_watcher.cc
index 37c56a5..e9b3496 100644
--- a/net/tools/net_watcher/net_watcher.cc
+++ b/net/tools/net_watcher/net_watcher.cc
@@ -91,25 +91,25 @@
virtual ~NetWatcher() {}
// net::NetworkChangeNotifier::IPAddressObserver implementation.
- virtual void OnIPAddressChanged() OVERRIDE {
+ virtual void OnIPAddressChanged() override {
LOG(INFO) << "OnIPAddressChanged()";
}
// net::NetworkChangeNotifier::ConnectionTypeObserver implementation.
virtual void OnConnectionTypeChanged(
- net::NetworkChangeNotifier::ConnectionType type) OVERRIDE {
+ net::NetworkChangeNotifier::ConnectionType type) override {
LOG(INFO) << "OnConnectionTypeChanged("
<< ConnectionTypeToString(type) << ")";
}
// net::NetworkChangeNotifier::DNSObserver implementation.
- virtual void OnDNSChanged() OVERRIDE {
+ virtual void OnDNSChanged() override {
LOG(INFO) << "OnDNSChanged()";
}
// net::NetworkChangeNotifier::NetworkChangeObserver implementation.
virtual void OnNetworkChanged(
- net::NetworkChangeNotifier::ConnectionType type) OVERRIDE {
+ net::NetworkChangeNotifier::ConnectionType type) override {
LOG(INFO) << "OnNetworkChanged("
<< ConnectionTypeToString(type) << ")";
}
@@ -117,7 +117,7 @@
// net::ProxyConfigService::Observer implementation.
virtual void OnProxyConfigChanged(
const net::ProxyConfig& config,
- net::ProxyConfigService::ConfigAvailability availability) OVERRIDE {
+ net::ProxyConfigService::ConfigAvailability availability) override {
LOG(INFO) << "OnProxyConfigChanged("
<< ProxyConfigToString(config) << ", "
<< ConfigAvailabilityToString(availability) << ")";
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index b7d4c3d..f29af96 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -159,10 +159,10 @@
: writer_factory_(writer_factory),
dispatcher_(dispatcher) {}
virtual ~ServerDelegate() {}
- virtual void OnPacketSent(WriteResult result) OVERRIDE {
+ virtual void OnPacketSent(WriteResult result) override {
writer_factory_->OnPacketSent(result);
}
- virtual void OnCanWrite() OVERRIDE { dispatcher_->OnCanWrite(); }
+ virtual void OnCanWrite() override { dispatcher_->OnCanWrite(); }
private:
TestWriterFactory* writer_factory_;
QuicDispatcher* dispatcher_;
@@ -172,8 +172,8 @@
public:
explicit ClientDelegate(QuicClient* client) : client_(client) {}
virtual ~ClientDelegate() {}
- virtual void OnPacketSent(WriteResult result) OVERRIDE {}
- virtual void OnCanWrite() OVERRIDE {
+ virtual void OnPacketSent(WriteResult result) override {}
+ virtual void OnCanWrite() override {
EpollEvent event(EPOLLOUT, false);
client_->OnEvent(client_->fd(), &event);
}
@@ -198,9 +198,6 @@
VLOG(1) << "Using Configuration: " << GetParam();
- client_config_.SetDefaults();
- server_config_.SetDefaults();
-
// Use different flow control windows for client/server.
client_config_.SetInitialFlowControlWindowToSend(
2 * kInitialSessionFlowControlWindowForTest);
@@ -323,14 +320,14 @@
return client_->client()->connected();
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// The ownership of these gets transferred to the QuicPacketWriterWrapper
// and TestWriterFactory when Initialize() is executed.
client_writer_ = new PacketDroppingTestWriter();
server_writer_ = new PacketDroppingTestWriter();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
StopServer();
}
@@ -1107,13 +1104,13 @@
const char* buffer,
size_t buf_len,
const IPAddressNumber& real_self_address,
- const IPEndPoint& peer_address) OVERRIDE {
+ const IPEndPoint& peer_address) override {
// Use wrong address!
return QuicPacketWriterWrapper::WritePacket(
buffer, buf_len, self_address_.address(), peer_address);
}
- virtual bool IsWriteBlockedDataBuffered() const OVERRIDE {
+ virtual bool IsWriteBlockedDataBuffered() const override {
return false;
}
diff --git a/net/tools/quic/quic_client.cc b/net/tools/quic/quic_client.cc
index e70d8b8..7b2c994 100644
--- a/net/tools/quic/quic_client.cc
+++ b/net/tools/quic/quic_client.cc
@@ -49,7 +49,6 @@
overflow_supported_(false),
supported_versions_(supported_versions),
print_response_(print_response) {
- config_.SetDefaults();
}
QuicClient::QuicClient(IPEndPoint server_address,
@@ -86,7 +85,6 @@
DCHECK(!initialized_);
epoll_server_->set_timeout_in_us(50 * 1000);
- crypto_config_.SetDefaults();
if (!CreateUDPSocket()) {
return false;
diff --git a/net/tools/quic/quic_client.h b/net/tools/quic/quic_client.h
index 8b0f1fe..ae5c2d9 100644
--- a/net/tools/quic/quic_client.h
+++ b/net/tools/quic/quic_client.h
@@ -107,17 +107,17 @@
// From EpollCallbackInterface
virtual void OnRegistration(EpollServer* eps,
int fd,
- int event_mask) OVERRIDE {}
- virtual void OnModification(int fd, int event_mask) OVERRIDE {}
- virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE;
+ int event_mask) override {}
+ virtual void OnModification(int fd, int event_mask) override {}
+ virtual void OnEvent(int fd, EpollEvent* event) override;
// |fd_| can be unregistered without the client being disconnected. This
// happens in b3m QuicProber where we unregister |fd_| to feed in events to
// the client from the SelectServer.
- virtual void OnUnregistration(int fd, bool replaced) OVERRIDE {}
- virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE {}
+ virtual void OnUnregistration(int fd, bool replaced) override {}
+ virtual void OnShutdown(EpollServer* eps, int fd) override {}
// QuicDataStream::Visitor
- virtual void OnClose(QuicDataStream* stream) OVERRIDE;
+ virtual void OnClose(QuicDataStream* stream) override;
QuicClientSession* session() { return session_.get(); }
@@ -194,7 +194,7 @@
DummyPacketWriterFactory(QuicPacketWriter* writer);
virtual ~DummyPacketWriterFactory();
- virtual QuicPacketWriter* Create(QuicConnection* connection) const OVERRIDE;
+ virtual QuicPacketWriter* Create(QuicConnection* connection) const override;
private:
QuicPacketWriter* writer_;
diff --git a/net/tools/quic/quic_client_bin.cc b/net/tools/quic/quic_client_bin.cc
index 4f76624..0f5c746 100644
--- a/net/tools/quic/quic_client_bin.cc
+++ b/net/tools/quic/quic_client_bin.cc
@@ -118,7 +118,6 @@
<< QuicVersionVectorToString(versions);
net::EpollServer epoll_server;
net::QuicConfig config;
- config.SetDefaults();
// The default flow control window of 16 Kb is too small for practical
// purposes. Set it to the specified value, which has a large default.
diff --git a/net/tools/quic/quic_client_session.h b/net/tools/quic/quic_client_session.h
index bb64145..5e0624a 100644
--- a/net/tools/quic/quic_client_session.h
+++ b/net/tools/quic/quic_client_session.h
@@ -30,16 +30,16 @@
// QuicClientSessionBase methods:
virtual void OnProofValid(
- const QuicCryptoClientConfig::CachedState& cached) OVERRIDE;
+ const QuicCryptoClientConfig::CachedState& cached) override;
virtual void OnProofVerifyDetailsAvailable(
- const ProofVerifyDetails& verify_details) OVERRIDE;
+ const ProofVerifyDetails& verify_details) override;
void InitializeSession(const QuicServerId& server_id,
QuicCryptoClientConfig* config);
// QuicSession methods:
- virtual QuicSpdyClientStream* CreateOutgoingDataStream() OVERRIDE;
- virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE;
+ virtual QuicSpdyClientStream* CreateOutgoingDataStream() override;
+ virtual QuicCryptoClientStream* GetCryptoStream() override;
// Performs a crypto handshake with the server. Returns true if the crypto
// handshake is started successfully.
@@ -52,7 +52,7 @@
protected:
// QuicSession methods:
- virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE;
+ virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
private:
scoped_ptr<QuicCryptoClientStream> crypto_stream_;
diff --git a/net/tools/quic/quic_client_session_test.cc b/net/tools/quic/quic_client_session_test.cc
index 2bd4315..8a78878 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -40,14 +40,12 @@
: public ::testing::TestWithParam<QuicVersion> {
protected:
ToolsQuicClientSessionTest()
- : connection_(new PacketSavingConnection(false,
- SupportedVersions(GetParam()))) {
- crypto_config_.SetDefaults();
+ : connection_(
+ new PacketSavingConnection(false, SupportedVersions(GetParam()))) {
session_.reset(new QuicClientSession(DefaultQuicConfig(), connection_));
session_->InitializeSession(
QuicServerId(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED),
&crypto_config_);
- session_->config()->SetDefaults();
}
void CompleteCryptoHandshake() {
@@ -74,8 +72,7 @@
// Initialize crypto before the client session will create a stream.
CompleteCryptoHandshake();
- QuicSpdyClientStream* stream =
- session_->CreateOutgoingDataStream();
+ QuicSpdyClientStream* stream = session_->CreateOutgoingDataStream();
ASSERT_TRUE(stream);
EXPECT_FALSE(session_->CreateOutgoingDataStream());
diff --git a/net/tools/quic/quic_default_packet_writer.h b/net/tools/quic/quic_default_packet_writer.h
index 7b5a36b..47925c3 100644
--- a/net/tools/quic/quic_default_packet_writer.h
+++ b/net/tools/quic/quic_default_packet_writer.h
@@ -25,10 +25,10 @@
virtual WriteResult WritePacket(const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
- virtual bool IsWriteBlockedDataBuffered() const OVERRIDE;
- virtual bool IsWriteBlocked() const OVERRIDE;
- virtual void SetWritable() OVERRIDE;
+ const IPEndPoint& peer_address) override;
+ virtual bool IsWriteBlockedDataBuffered() const override;
+ virtual bool IsWriteBlocked() const override;
+ virtual void SetWritable() override;
void set_fd(int fd) { fd_ = fd; }
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
index 11272e5..5f0e2da 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -32,7 +32,7 @@
: dispatcher_(dispatcher) {
}
- virtual int64 OnAlarm() OVERRIDE {
+ virtual int64 OnAlarm() override {
EpollAlarm::OnAlarm();
dispatcher_->DeleteSessions();
return 0;
@@ -49,23 +49,23 @@
connection_id_(0) {}
// QuicFramerVisitorInterface implementation
- virtual void OnPacket() OVERRIDE {}
+ virtual void OnPacket() override {}
virtual bool OnUnauthenticatedPublicHeader(
- const QuicPacketPublicHeader& header) OVERRIDE {
+ const QuicPacketPublicHeader& header) override {
connection_id_ = header.connection_id;
return dispatcher_->OnUnauthenticatedPublicHeader(header);
}
virtual bool OnUnauthenticatedHeader(
- const QuicPacketHeader& header) OVERRIDE {
+ const QuicPacketHeader& header) override {
dispatcher_->OnUnauthenticatedHeader(header);
return false;
}
- virtual void OnError(QuicFramer* framer) OVERRIDE {
+ virtual void OnError(QuicFramer* framer) override {
DVLOG(1) << QuicUtils::ErrorToString(framer->error());
}
virtual bool OnProtocolVersionMismatch(
- QuicVersion /*received_version*/) OVERRIDE {
+ QuicVersion /*received_version*/) override {
if (dispatcher_->time_wait_list_manager()->IsConnectionIdInTimeWait(
connection_id_)) {
// Keep processing after protocol mismatch - this will be dealt with by
@@ -82,74 +82,74 @@
// false from OnUnauthenticatedHeader(). As a result, we never process the
// payload of the packet.
virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& /*packet*/) OVERRIDE {
+ const QuicPublicResetPacket& /*packet*/) override {
DCHECK(false);
}
virtual void OnVersionNegotiationPacket(
- const QuicVersionNegotiationPacket& /*packet*/) OVERRIDE {
+ const QuicVersionNegotiationPacket& /*packet*/) override {
DCHECK(false);
}
- virtual void OnDecryptedPacket(EncryptionLevel level) OVERRIDE {
+ virtual void OnDecryptedPacket(EncryptionLevel level) override {
DCHECK(false);
}
- virtual bool OnPacketHeader(const QuicPacketHeader& /*header*/) OVERRIDE {
+ virtual bool OnPacketHeader(const QuicPacketHeader& /*header*/) override {
DCHECK(false);
return false;
}
- virtual void OnRevivedPacket() OVERRIDE {
+ virtual void OnRevivedPacket() override {
DCHECK(false);
}
- virtual void OnFecProtectedPayload(StringPiece /*payload*/) OVERRIDE {
+ virtual void OnFecProtectedPayload(StringPiece /*payload*/) override {
DCHECK(false);
}
- virtual bool OnStreamFrame(const QuicStreamFrame& /*frame*/) OVERRIDE {
+ virtual bool OnStreamFrame(const QuicStreamFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnAckFrame(const QuicAckFrame& /*frame*/) OVERRIDE {
+ virtual bool OnAckFrame(const QuicAckFrame& /*frame*/) override {
DCHECK(false);
return false;
}
virtual bool OnCongestionFeedbackFrame(
- const QuicCongestionFeedbackFrame& /*frame*/) OVERRIDE {
+ const QuicCongestionFeedbackFrame& /*frame*/) override {
DCHECK(false);
return false;
}
virtual bool OnStopWaitingFrame(
- const QuicStopWaitingFrame& /*frame*/) OVERRIDE {
+ const QuicStopWaitingFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnPingFrame(const QuicPingFrame& /*frame*/) OVERRIDE {
+ virtual bool OnPingFrame(const QuicPingFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) OVERRIDE {
+ virtual bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) override {
DCHECK(false);
return false;
}
virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame & /*frame*/) OVERRIDE {
+ const QuicConnectionCloseFrame & /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) OVERRIDE {
+ virtual bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) override {
DCHECK(false);
return false;
}
virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/)
- OVERRIDE {
+ override {
DCHECK(false);
return false;
}
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE {
+ virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
DCHECK(false);
return false;
}
- virtual void OnFecData(const QuicFecData& /*fec*/) OVERRIDE {
+ virtual void OnFecData(const QuicFecData& /*fec*/) override {
DCHECK(false);
}
- virtual void OnPacketComplete() OVERRIDE {
+ virtual void OnPacketComplete() override {
DCHECK(false);
}
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h
index ab8417c..8b0ab6d 100644
--- a/net/tools/quic/quic_dispatcher.h
+++ b/net/tools/quic/quic_dispatcher.h
@@ -68,7 +68,7 @@
virtual QuicPacketWriter* Create(
QuicPacketWriter* writer,
- QuicConnection* connection) OVERRIDE;
+ QuicConnection* connection) override;
};
// Ideally we'd have a linked_hash_set: the boolean is unused.
@@ -92,7 +92,7 @@
// an existing session, or passing it to the TimeWaitListManager.
virtual void ProcessPacket(const IPEndPoint& server_address,
const IPEndPoint& client_address,
- const QuicEncryptedPacket& packet) OVERRIDE;
+ const QuicEncryptedPacket& packet) override;
// Called when the socket becomes writable to allow queued writes to happen.
virtual void OnCanWrite();
@@ -106,11 +106,11 @@
// QuicServerSessionVisitor interface implementation:
// Ensure that the closed connection is cleaned up asynchronously.
virtual void OnConnectionClosed(QuicConnectionId connection_id,
- QuicErrorCode error) OVERRIDE;
+ QuicErrorCode error) override;
// Queues the blocked writer for later resumption.
virtual void OnWriteBlocked(
- QuicBlockedWriterInterface* blocked_writer) OVERRIDE;
+ QuicBlockedWriterInterface* blocked_writer) override;
typedef base::hash_map<QuicConnectionId, QuicSession*> SessionMap;
@@ -193,7 +193,7 @@
PacketWriterFactoryAdapter(QuicDispatcher* dispatcher);
virtual ~PacketWriterFactoryAdapter ();
- virtual QuicPacketWriter* Create(QuicConnection* connection) const OVERRIDE;
+ virtual QuicPacketWriter* Create(QuicConnection* connection) const override;
private:
QuicDispatcher* dispatcher_;
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index ac6fa70..bcbeb6a 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -264,14 +264,14 @@
public:
BlockingWriter() : write_blocked_(false) {}
- virtual bool IsWriteBlocked() const OVERRIDE { return write_blocked_; }
- virtual void SetWritable() OVERRIDE { write_blocked_ = false; }
+ virtual bool IsWriteBlocked() const override { return write_blocked_; }
+ virtual void SetWritable() override { write_blocked_ = false; }
virtual WriteResult WritePacket(
const char* buffer,
size_t buf_len,
const IPAddressNumber& self_client_address,
- const IPEndPoint& peer_client_address) OVERRIDE {
+ const IPEndPoint& peer_client_address) override {
// It would be quite possible to actually implement this method here with
// the fake blocked status, but it would be significantly more work in
// Chromium, and since it's not called anyway, don't bother.
diff --git a/net/tools/quic/quic_epoll_clock.h b/net/tools/quic/quic_epoll_clock.h
index d96bff6..4eebefb 100644
--- a/net/tools/quic/quic_epoll_clock.h
+++ b/net/tools/quic/quic_epoll_clock.h
@@ -24,11 +24,11 @@
virtual ~QuicEpollClock();
// Returns the approximate current time as a QuicTime object.
- virtual QuicTime ApproximateNow() const OVERRIDE;
+ virtual QuicTime ApproximateNow() const override;
// Returns the current time as a QuicTime object.
// Note: this use significant resources please use only if needed.
- virtual QuicTime Now() const OVERRIDE;
+ virtual QuicTime Now() const override;
protected:
EpollServer* epoll_server_;
diff --git a/net/tools/quic/quic_epoll_connection_helper.cc b/net/tools/quic/quic_epoll_connection_helper.cc
index 78bfe97..a8321f8 100644
--- a/net/tools/quic/quic_epoll_connection_helper.cc
+++ b/net/tools/quic/quic_epoll_connection_helper.cc
@@ -28,14 +28,14 @@
epoll_alarm_impl_(this) {}
protected:
- virtual void SetImpl() OVERRIDE {
+ virtual void SetImpl() override {
DCHECK(deadline().IsInitialized());
epoll_server_->RegisterAlarm(
deadline().Subtract(QuicTime::Zero()).ToMicroseconds(),
&epoll_alarm_impl_);
}
- virtual void CancelImpl() OVERRIDE {
+ virtual void CancelImpl() override {
DCHECK(!deadline().IsInitialized());
epoll_alarm_impl_.UnregisterIfRegistered();
}
@@ -45,7 +45,7 @@
public:
explicit EpollAlarmImpl(QuicEpollAlarm* alarm) : alarm_(alarm) {}
- virtual int64 OnAlarm() OVERRIDE {
+ virtual int64 OnAlarm() override {
EpollAlarm::OnAlarm();
alarm_->Fire();
// Fire will take care of registering the alarm, if needed.
diff --git a/net/tools/quic/quic_epoll_connection_helper.h b/net/tools/quic/quic_epoll_connection_helper.h
index 3198a14..9ca2cf8 100644
--- a/net/tools/quic/quic_epoll_connection_helper.h
+++ b/net/tools/quic/quic_epoll_connection_helper.h
@@ -36,9 +36,9 @@
virtual ~QuicEpollConnectionHelper();
// QuicEpollConnectionHelperInterface
- virtual const QuicClock* GetClock() const OVERRIDE;
- virtual QuicRandom* GetRandomGenerator() OVERRIDE;
- virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) OVERRIDE;
+ virtual const QuicClock* GetClock() const override;
+ virtual QuicRandom* GetRandomGenerator() override;
+ virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
EpollServer* epoll_server() { return epoll_server_; }
diff --git a/net/tools/quic/quic_epoll_connection_helper_test.cc b/net/tools/quic/quic_epoll_connection_helper_test.cc
index 708bdd4..7234ecf 100644
--- a/net/tools/quic/quic_epoll_connection_helper_test.cc
+++ b/net/tools/quic/quic_epoll_connection_helper_test.cc
@@ -19,7 +19,7 @@
public:
TestDelegate() : fired_(false) {}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
fired_ = true;
return QuicTime::Zero();
}
diff --git a/net/tools/quic/quic_in_memory_cache.cc b/net/tools/quic/quic_in_memory_cache.cc
index 6754cf2..c90142c 100644
--- a/net/tools/quic/quic_in_memory_cache.cc
+++ b/net/tools/quic/quic_in_memory_cache.cc
@@ -29,22 +29,22 @@
class CachingBalsaVisitor : public NoOpBalsaVisitor {
public:
CachingBalsaVisitor() : done_framing_(false) {}
- virtual void ProcessBodyData(const char* input, size_t size) OVERRIDE {
+ virtual void ProcessBodyData(const char* input, size_t size) override {
AppendToBody(input, size);
}
- virtual void MessageDone() OVERRIDE {
+ virtual void MessageDone() override {
done_framing_ = true;
}
- virtual void HandleHeaderError(BalsaFrame* framer) OVERRIDE {
+ virtual void HandleHeaderError(BalsaFrame* framer) override {
UnhandledError();
}
- virtual void HandleHeaderWarning(BalsaFrame* framer) OVERRIDE {
+ virtual void HandleHeaderWarning(BalsaFrame* framer) override {
UnhandledError();
}
- virtual void HandleChunkingError(BalsaFrame* framer) OVERRIDE {
+ virtual void HandleChunkingError(BalsaFrame* framer) override {
UnhandledError();
}
- virtual void HandleBodyError(BalsaFrame* framer) OVERRIDE {
+ virtual void HandleBodyError(BalsaFrame* framer) override {
UnhandledError();
}
void UnhandledError() {
diff --git a/net/tools/quic/quic_in_memory_cache_test.cc b/net/tools/quic/quic_in_memory_cache_test.cc
index 9a75990..98a2b80 100644
--- a/net/tools/quic/quic_in_memory_cache_test.cc
+++ b/net/tools/quic/quic_in_memory_cache_test.cc
@@ -39,7 +39,7 @@
headers->ReplaceOrAppendHeader("host", host);
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
QuicInMemoryCachePeer::ResetForTests();
}
diff --git a/net/tools/quic/quic_packet_writer_wrapper.h b/net/tools/quic/quic_packet_writer_wrapper.h
index 9dafe77..a4db367 100644
--- a/net/tools/quic/quic_packet_writer_wrapper.h
+++ b/net/tools/quic/quic_packet_writer_wrapper.h
@@ -27,10 +27,10 @@
const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
- virtual bool IsWriteBlockedDataBuffered() const OVERRIDE;
- virtual bool IsWriteBlocked() const OVERRIDE;
- virtual void SetWritable() OVERRIDE;
+ const IPEndPoint& peer_address) override;
+ virtual bool IsWriteBlockedDataBuffered() const override;
+ virtual bool IsWriteBlocked() const override;
+ virtual void SetWritable() override;
// Takes ownership of |writer|.
void set_writer(QuicPacketWriter* writer);
diff --git a/net/tools/quic/quic_per_connection_packet_writer.h b/net/tools/quic/quic_per_connection_packet_writer.h
index a442a9a..390e43d 100644
--- a/net/tools/quic/quic_per_connection_packet_writer.h
+++ b/net/tools/quic/quic_per_connection_packet_writer.h
@@ -29,10 +29,10 @@
virtual WriteResult WritePacket(const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
- virtual bool IsWriteBlockedDataBuffered() const OVERRIDE;
- virtual bool IsWriteBlocked() const OVERRIDE;
- virtual void SetWritable() OVERRIDE;
+ const IPEndPoint& peer_address) override;
+ virtual bool IsWriteBlockedDataBuffered() const override;
+ virtual bool IsWriteBlocked() const override;
+ virtual void SetWritable() override;
private:
QuicPacketWriter* shared_writer_; // Not owned.
diff --git a/net/tools/quic/quic_server.cc b/net/tools/quic/quic_server.cc
index 34beb3f..9d36909 100644
--- a/net/tools/quic/quic_server.cc
+++ b/net/tools/quic/quic_server.cc
@@ -48,8 +48,6 @@
use_recvmmsg_(false),
crypto_config_(kSourceAddressTokenSecret, QuicRandom::GetInstance()),
supported_versions_(QuicSupportedVersions()) {
- // Use hardcoded crypto parameters for now.
- config_.SetDefaults();
Initialize();
}
diff --git a/net/tools/quic/quic_server.h b/net/tools/quic/quic_server.h
index 87c8bc7..a027a49 100644
--- a/net/tools/quic/quic_server.h
+++ b/net/tools/quic/quic_server.h
@@ -47,10 +47,10 @@
// From EpollCallbackInterface
virtual void OnRegistration(EpollServer* eps,
int fd,
- int event_mask) OVERRIDE {}
- virtual void OnModification(int fd, int event_mask) OVERRIDE {}
- virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE;
- virtual void OnUnregistration(int fd, bool replaced) OVERRIDE {}
+ int event_mask) override {}
+ virtual void OnModification(int fd, int event_mask) override {}
+ virtual void OnEvent(int fd, EpollEvent* event) override;
+ virtual void OnUnregistration(int fd, bool replaced) override {}
// Reads a packet from the given fd, and then passes it off to
// the QuicDispatcher. Returns true if a packet is read, false
@@ -62,7 +62,7 @@
ProcessPacketInterface* processor,
uint32* packets_dropped);
- virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE {}
+ virtual void OnShutdown(EpollServer* eps, int fd) override {}
void SetStrikeRegisterNoStartupPeriod() {
crypto_config_.set_strike_register_no_startup_period();
diff --git a/net/tools/quic/quic_server_session.cc b/net/tools/quic/quic_server_session.cc
index cb56329..842c6ef 100644
--- a/net/tools/quic/quic_server_session.cc
+++ b/net/tools/quic/quic_server_session.cc
@@ -134,7 +134,7 @@
cached_network_params.set_serving_region(serving_region_);
}
- crypto_stream_->SendServerConfigUpdate(&cached_network_params);
+ crypto_stream_->SendServerConfigUpdate(&cached_network_params, false);
last_server_config_update_time_ = now;
}
diff --git a/net/tools/quic/quic_server_session.h b/net/tools/quic/quic_server_session.h
index 87f82d9..eb0aab6 100644
--- a/net/tools/quic/quic_server_session.h
+++ b/net/tools/quic/quic_server_session.h
@@ -50,12 +50,12 @@
QuicServerSessionVisitor* visitor);
// Override the base class to notify the owner of the connection close.
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE;
- virtual void OnWriteBlocked() OVERRIDE;
+ virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
+ virtual void OnWriteBlocked() override;
// Sends a server config update to the client, containing new bandwidth
// estimate.
- virtual void OnCongestionWindowChange(QuicTime now) OVERRIDE;
+ virtual void OnCongestionWindowChange(QuicTime now) override;
virtual ~QuicServerSession();
@@ -66,7 +66,7 @@
}
// Override base class to process FEC config received from client.
- virtual void OnConfigNegotiated() OVERRIDE;
+ virtual void OnConfigNegotiated() override;
void set_serving_region(string serving_region) {
serving_region_ = serving_region;
@@ -74,9 +74,9 @@
protected:
// QuicSession methods:
- virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE;
- virtual QuicDataStream* CreateOutgoingDataStream() OVERRIDE;
- virtual QuicCryptoServerStream* GetCryptoStream() OVERRIDE;
+ virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
+ virtual QuicDataStream* CreateOutgoingDataStream() override;
+ virtual QuicCryptoServerStream* GetCryptoStream() override;
// If we should create an incoming stream, returns true. Otherwise
// does error handling, including communicating the error to the client and
diff --git a/net/tools/quic/quic_server_session_test.cc b/net/tools/quic/quic_server_session_test.cc
index 4fc4157..72c65a8 100644
--- a/net/tools/quic/quic_server_session_test.cc
+++ b/net/tools/quic/quic_server_session_test.cc
@@ -68,7 +68,6 @@
QuicServerSessionTest()
: crypto_config_(QuicCryptoServerConfig::TESTING,
QuicRandom::GetInstance()) {
- config_.SetDefaults();
config_.SetMaxStreamsPerConnection(kMaxStreamsForTest,
kMaxStreamsForTest);
config_.SetInitialFlowControlWindowToSend(
@@ -295,8 +294,10 @@
: QuicCryptoServerStream(crypto_config, session) {}
virtual ~MockQuicCryptoServerStream() {}
- MOCK_METHOD1(SendServerConfigUpdate,
- void(const CachedNetworkParameters* cached_network_parameters));
+ MOCK_METHOD2(SendServerConfigUpdate,
+ void(const CachedNetworkParameters* cached_network_parameters,
+ bool on_handshake_complete));
+
private:
DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStream);
};
@@ -365,7 +366,7 @@
expected_network_params.set_serving_region(serving_region);
EXPECT_CALL(*crypto_stream,
- SendServerConfigUpdate(EqualsProto(expected_network_params)))
+ SendServerConfigUpdate(EqualsProto(expected_network_params), _))
.Times(1);
session_->OnCongestionWindowChange(now);
}
diff --git a/net/tools/quic/quic_spdy_client_stream.h b/net/tools/quic/quic_spdy_client_stream.h
index 7bbdee6..8274164 100644
--- a/net/tools/quic/quic_spdy_client_stream.h
+++ b/net/tools/quic/quic_spdy_client_stream.h
@@ -32,16 +32,16 @@
// Override the base class to close the write side as soon as we get a
// response.
// SPDY/HTTP does not support bidirectional streaming.
- virtual void OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE;
+ virtual void OnStreamFrame(const QuicStreamFrame& frame) override;
// Override the base class to store the size of the headers.
- virtual void OnStreamHeadersComplete(bool fin, size_t frame_len) OVERRIDE;
+ virtual void OnStreamHeadersComplete(bool fin, size_t frame_len) override;
// ReliableQuicStream implementation called by the session when there's
// data for us.
- virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE;
+ virtual uint32 ProcessData(const char* data, uint32 data_len) override;
- virtual void OnFinRead() OVERRIDE;
+ virtual void OnFinRead() override;
// Serializes the headers and body, sends it to the server, and
// returns the number of bytes sent.
diff --git a/net/tools/quic/quic_spdy_client_stream_test.cc b/net/tools/quic/quic_spdy_client_stream_test.cc
index 058b204..090e2da 100644
--- a/net/tools/quic/quic_spdy_client_stream_test.cc
+++ b/net/tools/quic/quic_spdy_client_stream_test.cc
@@ -34,7 +34,6 @@
session_.InitializeSession(
QuicServerId("example.com", 80, false, PRIVACY_MODE_DISABLED),
&crypto_config_);
- crypto_config_.SetDefaults();
headers_.SetResponseFirstlineFromStringPieces("HTTP/1.1", "200", "Ok");
headers_.ReplaceOrAppendHeader("content-length", "11");
diff --git a/net/tools/quic/quic_spdy_server_stream.h b/net/tools/quic/quic_spdy_server_stream.h
index c8167d1..4c2cb41 100644
--- a/net/tools/quic/quic_spdy_server_stream.h
+++ b/net/tools/quic/quic_spdy_server_stream.h
@@ -32,8 +32,8 @@
// ReliableQuicStream implementation called by the session when there's
// data for us.
- virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE;
- virtual void OnFinRead() OVERRIDE;
+ virtual uint32 ProcessData(const char* data, uint32 data_len) override;
+ virtual void OnFinRead() override;
void ParseRequestHeaders();
diff --git a/net/tools/quic/quic_spdy_server_stream_test.cc b/net/tools/quic/quic_spdy_server_stream_test.cc
index f5bd17f..4f5484a 100644
--- a/net/tools/quic/quic_spdy_server_stream_test.cc
+++ b/net/tools/quic/quic_spdy_server_stream_test.cc
@@ -97,7 +97,7 @@
QuicInMemoryCachePeer::ResetForTests();
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance();
BalsaHeaders request_headers, response_headers;
diff --git a/net/tools/quic/quic_time_wait_list_manager.cc b/net/tools/quic/quic_time_wait_list_manager.cc
index 9744ff8..f99bf3f 100644
--- a/net/tools/quic/quic_time_wait_list_manager.cc
+++ b/net/tools/quic/quic_time_wait_list_manager.cc
@@ -43,7 +43,7 @@
: time_wait_list_manager_(time_wait_list_manager) {
}
- virtual int64 OnAlarm() OVERRIDE {
+ virtual int64 OnAlarm() override {
EpollAlarm::OnAlarm();
time_wait_list_manager_->CleanUpOldConnectionIds();
// Let the time wait manager register the alarm at appropriate time.
diff --git a/net/tools/quic/quic_time_wait_list_manager.h b/net/tools/quic/quic_time_wait_list_manager.h
index 1af9d56..d9a5f92 100644
--- a/net/tools/quic/quic_time_wait_list_manager.h
+++ b/net/tools/quic/quic_time_wait_list_manager.h
@@ -83,7 +83,7 @@
// Called by the dispatcher when the underlying socket becomes writable again,
// since we might need to send pending public reset packets which we didn't
// send because the underlying socket was write blocked.
- virtual void OnCanWrite() OVERRIDE;
+ virtual void OnCanWrite() override;
// Used to delete connection_id entries that have outlived their time wait
// period.
diff --git a/net/tools/quic/quic_time_wait_list_manager_test.cc b/net/tools/quic/quic_time_wait_list_manager_test.cc
index 5e964d6..335b22c 100644
--- a/net/tools/quic/quic_time_wait_list_manager_test.cc
+++ b/net/tools/quic/quic_time_wait_list_manager_test.cc
@@ -45,10 +45,10 @@
class FramerVisitorCapturingPublicReset : public NoOpFramerVisitor {
public:
FramerVisitorCapturingPublicReset() {}
- virtual ~FramerVisitorCapturingPublicReset() OVERRIDE {}
+ virtual ~FramerVisitorCapturingPublicReset() override {}
virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& public_reset) OVERRIDE {
+ const QuicPublicResetPacket& public_reset) override {
public_reset_packet_ = public_reset;
}
@@ -96,9 +96,9 @@
client_address_(net::test::TestPeerIPAddress(), kTestPort),
writer_is_blocked_(false) {}
- virtual ~QuicTimeWaitListManagerTest() OVERRIDE {}
+ virtual ~QuicTimeWaitListManagerTest() override {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
EXPECT_CALL(writer_, IsWriteBlocked())
.WillRepeatedly(ReturnPointee(&writer_is_blocked_));
EXPECT_CALL(writer_, IsWriteBlockedDataBuffered())
@@ -181,7 +181,7 @@
virtual bool MatchAndExplain(
const std::tr1::tuple<const char*, int> packet_buffer,
- testing::MatchResultListener* /* listener */) const OVERRIDE {
+ testing::MatchResultListener* /* listener */) const override {
FramerVisitorCapturingPublicReset visitor;
QuicFramer framer(QuicSupportedVersions(),
QuicTime::Zero(),
@@ -198,9 +198,9 @@
kTestPort == packet.client_address.port();
}
- virtual void DescribeTo(::std::ostream* os) const OVERRIDE {}
+ virtual void DescribeTo(::std::ostream* os) const override {}
- virtual void DescribeNegationTo(::std::ostream* os) const OVERRIDE {}
+ virtual void DescribeNegationTo(::std::ostream* os) const override {}
private:
QuicConnectionId connection_id_;
diff --git a/net/tools/quic/test_tools/mock_epoll_server.h b/net/tools/quic/test_tools/mock_epoll_server.h
index cdb6a36..b3b312e 100644
--- a/net/tools/quic/test_tools/mock_epoll_server.h
+++ b/net/tools/quic/test_tools/mock_epoll_server.h
@@ -22,7 +22,7 @@
virtual ~FakeTimeEpollServer();
// Replaces the EpollServer NowInUsec.
- virtual int64 NowInUsec() const OVERRIDE;
+ virtual int64 NowInUsec() const override;
void set_now_in_usec(int64 nius) { now_in_usec_ = nius; }
@@ -85,16 +85,16 @@
protected: // functions
// These functions do nothing here, as we're not actually
// using the epoll_* syscalls.
- virtual void DelFD(int fd) const OVERRIDE {}
- virtual void AddFD(int fd, int event_mask) const OVERRIDE {}
- virtual void ModFD(int fd, int event_mask) const OVERRIDE {}
+ virtual void DelFD(int fd) const override {}
+ virtual void AddFD(int fd, int event_mask) const override {}
+ virtual void ModFD(int fd, int event_mask) const override {}
// Replaces the epoll_server's epoll_wait_impl.
virtual int epoll_wait_impl(int epfd,
struct epoll_event* events,
int max_events,
- int timeout_in_ms) OVERRIDE;
- virtual void SetNonblocking (int fd) OVERRIDE {}
+ int timeout_in_ms) override;
+ virtual void SetNonblocking (int fd) override {}
private: // members
EventQueue event_queue_;
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.cc b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
index c7202d6..2571868 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.cc
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
@@ -21,7 +21,7 @@
explicit WriteUnblockedAlarm(PacketDroppingTestWriter* writer)
: writer_(writer) {}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
DVLOG(1) << "Unblocking socket.";
writer_->OnCanWrite();
return QuicTime::Zero();
@@ -37,7 +37,7 @@
public:
explicit DelayAlarm(PacketDroppingTestWriter* writer) : writer_(writer) {}
- virtual QuicTime OnAlarm() OVERRIDE {
+ virtual QuicTime OnAlarm() override {
return writer_->ReleaseOldPackets();
}
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.h b/net/tools/quic/test_tools/packet_dropping_test_writer.h
index b7babad..29a21a8 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.h
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.h
@@ -49,11 +49,11 @@
const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
+ const IPEndPoint& peer_address) override;
- virtual bool IsWriteBlocked() const OVERRIDE;
+ virtual bool IsWriteBlocked() const override;
- virtual void SetWritable() OVERRIDE;
+ virtual void SetWritable() override;
// Writes out any packet which should have been sent by now
// to the contained writer and returns the time
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc
index 68b8698..d53958d 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -49,7 +49,7 @@
const ProofVerifyContext* context,
string* error_details,
scoped_ptr<ProofVerifyDetails>* details,
- ProofVerifierCallback* callback) OVERRIDE {
+ ProofVerifierCallback* callback) override {
common_name_.clear();
if (certs.empty()) {
return QUIC_FAILURE;
diff --git a/net/tools/quic/test_tools/quic_test_client.h b/net/tools/quic/test_tools/quic_test_client.h
index 7ae3b74..c9fd22e 100644
--- a/net/tools/quic/test_tools/quic_test_client.h
+++ b/net/tools/quic/test_tools/quic_test_client.h
@@ -45,9 +45,9 @@
const QuicVersionVector& supported_versions,
EpollServer* epoll_server);
- virtual ~MockableQuicClient() OVERRIDE;
- virtual QuicPacketWriter* CreateQuicPacketWriter() OVERRIDE;
- virtual QuicConnectionId GenerateConnectionId() OVERRIDE;
+ virtual ~MockableQuicClient() override;
+ virtual QuicPacketWriter* CreateQuicPacketWriter() override;
+ virtual QuicConnectionId GenerateConnectionId() override;
void UseWriter(QuicPacketWriterWrapper* writer);
void UseConnectionId(QuicConnectionId connection_id);
@@ -91,45 +91,45 @@
// From SimpleClient
// Clears any outstanding state and sends a simple GET of 'uri' to the
// server. Returns 0 if the request failed and no bytes were written.
- virtual ssize_t SendRequest(const string& uri) OVERRIDE;
- virtual ssize_t SendMessage(const HTTPMessage& message) OVERRIDE;
+ virtual ssize_t SendRequest(const string& uri) override;
+ virtual ssize_t SendMessage(const HTTPMessage& message) override;
virtual string SendCustomSynchronousRequest(
- const HTTPMessage& message) OVERRIDE;
- virtual string SendSynchronousRequest(const string& uri) OVERRIDE;
- virtual void Connect() OVERRIDE;
- virtual void ResetConnection() OVERRIDE;
- virtual void Disconnect() OVERRIDE;
- virtual IPEndPoint LocalSocketAddress() const OVERRIDE;
- virtual void ClearPerRequestState() OVERRIDE;
- virtual void WaitForResponseForMs(int timeout_ms) OVERRIDE;
- virtual void WaitForInitialResponseForMs(int timeout_ms) OVERRIDE;
- virtual ssize_t Send(const void *buffer, size_t size) OVERRIDE;
- virtual bool response_complete() const OVERRIDE;
- virtual bool response_headers_complete() const OVERRIDE;
- virtual const BalsaHeaders* response_headers() const OVERRIDE;
- virtual int64 response_size() const OVERRIDE;
- virtual int response_header_size() const OVERRIDE;
- virtual int64 response_body_size() const OVERRIDE;
- virtual size_t bytes_read() const OVERRIDE;
- virtual size_t bytes_written() const OVERRIDE;
- virtual bool buffer_body() const OVERRIDE;
- virtual void set_buffer_body(bool buffer_body) OVERRIDE;
- virtual bool ServerInLameDuckMode() const OVERRIDE;
- virtual const string& response_body() OVERRIDE;
- virtual bool connected() const OVERRIDE;
+ const HTTPMessage& message) override;
+ virtual string SendSynchronousRequest(const string& uri) override;
+ virtual void Connect() override;
+ virtual void ResetConnection() override;
+ virtual void Disconnect() override;
+ virtual IPEndPoint LocalSocketAddress() const override;
+ virtual void ClearPerRequestState() override;
+ virtual void WaitForResponseForMs(int timeout_ms) override;
+ virtual void WaitForInitialResponseForMs(int timeout_ms) override;
+ virtual ssize_t Send(const void *buffer, size_t size) override;
+ virtual bool response_complete() const override;
+ virtual bool response_headers_complete() const override;
+ virtual const BalsaHeaders* response_headers() const override;
+ virtual int64 response_size() const override;
+ virtual int response_header_size() const override;
+ virtual int64 response_body_size() const override;
+ virtual size_t bytes_read() const override;
+ virtual size_t bytes_written() const override;
+ virtual bool buffer_body() const override;
+ virtual void set_buffer_body(bool buffer_body) override;
+ virtual bool ServerInLameDuckMode() const override;
+ virtual const string& response_body() override;
+ virtual bool connected() const override;
// These functions are all unimplemented functions from SimpleClient, and log
// DFATAL if called by users of SimpleClient.
virtual ssize_t SendAndWaitForResponse(const void *buffer,
- size_t size) OVERRIDE;
- virtual void Bind(IPEndPoint* local_address) OVERRIDE;
- virtual string SerializeMessage(const HTTPMessage& message) OVERRIDE;
- virtual IPAddressNumber bind_to_address() const OVERRIDE;
- virtual void set_bind_to_address(IPAddressNumber address) OVERRIDE;
- virtual const IPEndPoint& address() const OVERRIDE;
- virtual size_t requests_sent() const OVERRIDE;
+ size_t size) override;
+ virtual void Bind(IPEndPoint* local_address) override;
+ virtual string SerializeMessage(const HTTPMessage& message) override;
+ virtual IPAddressNumber bind_to_address() const override;
+ virtual void set_bind_to_address(IPAddressNumber address) override;
+ virtual const IPEndPoint& address() const override;
+ virtual size_t requests_sent() const override;
// From QuicDataStream::Visitor
- virtual void OnClose(QuicDataStream* stream) OVERRIDE;
+ virtual void OnClose(QuicDataStream* stream) override;
// Configures client_ to take ownership of and use the writer.
// Must be called before initial connect.
diff --git a/net/tools/quic/test_tools/quic_test_utils.cc b/net/tools/quic/test_tools/quic_test_utils.cc
index 8fdbe00..781b3c3 100644
--- a/net/tools/quic/test_tools/quic_test_utils.cc
+++ b/net/tools/quic/test_tools/quic_test_utils.cc
@@ -26,7 +26,7 @@
virtual ~NiceMockPacketWriterFactory() {}
virtual QuicPacketWriter* Create(
- QuicConnection* /*connection*/) const OVERRIDE {
+ QuicConnection* /*connection*/) const override {
return new testing::NiceMock<MockPacketWriter>();
}
diff --git a/net/tools/quic/test_tools/quic_test_utils.h b/net/tools/quic/test_tools/quic_test_utils.h
index 1211ff2..dc70e69 100644
--- a/net/tools/quic/test_tools/quic_test_utils.h
+++ b/net/tools/quic/test_tools/quic_test_utils.h
@@ -104,7 +104,7 @@
void SetCryptoStream(QuicCryptoStream* stream);
- virtual QuicCryptoStream* GetCryptoStream() OVERRIDE;
+ virtual QuicCryptoStream* GetCryptoStream() override;
private:
QuicCryptoStream* crypto_stream_;
@@ -169,7 +169,7 @@
virtual ~TestWriterFactory();
virtual QuicPacketWriter* Create(QuicPacketWriter* writer,
- QuicConnection* connection) OVERRIDE;
+ QuicConnection* connection) override;
// Calls OnPacketSent on the last QuicConnection to write through one of the
// packet writers created by this factory.
@@ -187,7 +187,7 @@
const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) OVERRIDE;
+ const IPEndPoint& peer_address) override;
private:
TestWriterFactory* factory_;
diff --git a/net/tools/quic/test_tools/server_thread.h b/net/tools/quic/test_tools/server_thread.h
index 6066d97..cb92b01 100644
--- a/net/tools/quic/test_tools/server_thread.h
+++ b/net/tools/quic/test_tools/server_thread.h
@@ -28,7 +28,7 @@
void Initialize();
// Runs the event loop. Will initialize if necessary.
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
// Waits for the handshake to be confirmed for the first session created.
void WaitForCryptoHandshakeConfirmed();
diff --git a/net/udp/udp_client_socket.h b/net/udp/udp_client_socket.h
index c5fc8c0..d689640 100644
--- a/net/udp/udp_client_socket.h
+++ b/net/udp/udp_client_socket.h
@@ -24,17 +24,17 @@
virtual ~UDPClientSocket();
// DatagramClientSocket implementation.
- virtual int Connect(const IPEndPoint& address) OVERRIDE;
+ virtual int Connect(const IPEndPoint& address) override;
virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void Close() override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
+ virtual const BoundNetLog& NetLog() const override;
private:
UDPSocket socket_;
diff --git a/net/udp/udp_server_socket.h b/net/udp/udp_server_socket.h
index 4ce7354..9801ff8 100644
--- a/net/udp/udp_server_socket.h
+++ b/net/udp/udp_server_socket.h
@@ -22,30 +22,30 @@
virtual ~UDPServerSocket();
// Implement DatagramServerSocket:
- virtual int Listen(const IPEndPoint& address) OVERRIDE;
+ virtual int Listen(const IPEndPoint& address) override;
virtual int RecvFrom(IOBuffer* buf,
int buf_len,
IPEndPoint* address,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int SendTo(IOBuffer* buf,
int buf_len,
const IPEndPoint& address,
- const CompletionCallback& callback) OVERRIDE;
- virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
- virtual int SetSendBufferSize(int32 size) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
- virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
- virtual const BoundNetLog& NetLog() const OVERRIDE;
- virtual void AllowAddressReuse() OVERRIDE;
- virtual void AllowBroadcast() OVERRIDE;
- virtual int JoinGroup(const IPAddressNumber& group_address) const OVERRIDE;
- virtual int LeaveGroup(const IPAddressNumber& group_address) const OVERRIDE;
- virtual int SetMulticastInterface(uint32 interface_index) OVERRIDE;
- virtual int SetMulticastTimeToLive(int time_to_live) OVERRIDE;
- virtual int SetMulticastLoopbackMode(bool loopback) OVERRIDE;
- virtual int SetDiffServCodePoint(DiffServCodePoint dscp) OVERRIDE;
- virtual void DetachFromThread() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int SetReceiveBufferSize(int32 size) override;
+ virtual int SetSendBufferSize(int32 size) override;
+ virtual void Close() override;
+ virtual int GetPeerAddress(IPEndPoint* address) const override;
+ virtual int GetLocalAddress(IPEndPoint* address) const override;
+ virtual const BoundNetLog& NetLog() const override;
+ virtual void AllowAddressReuse() override;
+ virtual void AllowBroadcast() override;
+ virtual int JoinGroup(const IPAddressNumber& group_address) const override;
+ virtual int LeaveGroup(const IPAddressNumber& group_address) const override;
+ virtual int SetMulticastInterface(uint32 interface_index) override;
+ virtual int SetMulticastTimeToLive(int time_to_live) override;
+ virtual int SetMulticastLoopbackMode(bool loopback) override;
+ virtual int SetDiffServCodePoint(DiffServCodePoint dscp) override;
+ virtual void DetachFromThread() override;
private:
UDPSocket socket_;
diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h
index 69e8ba3..292a42f 100644
--- a/net/udp/udp_socket_libevent.h
+++ b/net/udp/udp_socket_libevent.h
@@ -179,9 +179,9 @@
// MessageLoopForIO::Watcher methods
- virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int /* fd */) override;
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {}
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {}
private:
UDPSocketLibevent* const socket_;
@@ -195,9 +195,9 @@
// MessageLoopForIO::Watcher methods
- virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {}
+ virtual void OnFileCanReadWithoutBlocking(int /* fd */) override {}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE;
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override;
private:
UDPSocketLibevent* const socket_;
diff --git a/net/url_request/data_protocol_handler.h b/net/url_request/data_protocol_handler.h
index b7f7fef..3c2c4d4 100644
--- a/net/url_request/data_protocol_handler.h
+++ b/net/url_request/data_protocol_handler.h
@@ -19,8 +19,8 @@
public:
DataProtocolHandler();
virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE;
- virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE;
+ URLRequest* request, NetworkDelegate* network_delegate) const override;
+ virtual bool IsSafeRedirectTarget(const GURL& location) const override;
private:
DISALLOW_COPY_AND_ASSIGN(DataProtocolHandler);
diff --git a/net/url_request/file_protocol_handler.h b/net/url_request/file_protocol_handler.h
index 78956a9..02b5c9f 100644
--- a/net/url_request/file_protocol_handler.h
+++ b/net/url_request/file_protocol_handler.h
@@ -30,8 +30,8 @@
const scoped_refptr<base::TaskRunner>& file_task_runner);
virtual ~FileProtocolHandler();
virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE;
- virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE;
+ URLRequest* request, NetworkDelegate* network_delegate) const override;
+ virtual bool IsSafeRedirectTarget(const GURL& location) const override;
private:
const scoped_refptr<base::TaskRunner> file_task_runner_;
diff --git a/net/url_request/ftp_protocol_handler.h b/net/url_request/ftp_protocol_handler.h
index 7c2278a..c3091b9 100644
--- a/net/url_request/ftp_protocol_handler.h
+++ b/net/url_request/ftp_protocol_handler.h
@@ -24,7 +24,7 @@
explicit FtpProtocolHandler(FtpTransactionFactory* ftp_transaction_factory);
virtual ~FtpProtocolHandler();
virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE;
+ URLRequest* request, NetworkDelegate* network_delegate) const override;
private:
friend class FtpTestURLRequestContext;
diff --git a/net/url_request/static_http_user_agent_settings.h b/net/url_request/static_http_user_agent_settings.h
index 7406abc..4edb948 100644
--- a/net/url_request/static_http_user_agent_settings.h
+++ b/net/url_request/static_http_user_agent_settings.h
@@ -23,8 +23,8 @@
virtual ~StaticHttpUserAgentSettings();
// HttpUserAgentSettings implementation
- virtual std::string GetAcceptLanguage() const OVERRIDE;
- virtual std::string GetUserAgent() const OVERRIDE;
+ virtual std::string GetAcceptLanguage() const override;
+ virtual std::string GetUserAgent() const override;
private:
const std::string accept_language_;
diff --git a/net/url_request/test_url_fetcher_factory.h b/net/url_request/test_url_fetcher_factory.h
index 5d4f3d9..c004ce7 100644
--- a/net/url_request/test_url_fetcher_factory.h
+++ b/net/url_request/test_url_fetcher_factory.h
@@ -88,66 +88,66 @@
// URLFetcher implementation
virtual void SetUploadData(const std::string& upload_content_type,
- const std::string& upload_content) OVERRIDE;
+ const std::string& upload_content) override;
virtual void SetUploadFilePath(
const std::string& upload_content_type,
const base::FilePath& file_path,
uint64 range_offset,
uint64 range_length,
- scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::TaskRunner> file_task_runner) override;
virtual void SetChunkedUpload(
- const std::string& upload_content_type) OVERRIDE;
+ const std::string& upload_content_type) override;
// Overriden to cache the chunks uploaded. Caller can read back the uploaded
// chunks with the upload_chunks() accessor.
virtual void AppendChunkToUpload(const std::string& data,
- bool is_last_chunk) OVERRIDE;
- virtual void SetLoadFlags(int load_flags) OVERRIDE;
- virtual int GetLoadFlags() const OVERRIDE;
- virtual void SetReferrer(const std::string& referrer) OVERRIDE;
+ bool is_last_chunk) override;
+ virtual void SetLoadFlags(int load_flags) override;
+ virtual int GetLoadFlags() const override;
+ virtual void SetReferrer(const std::string& referrer) override;
virtual void SetReferrerPolicy(
- URLRequest::ReferrerPolicy referrer_policy) OVERRIDE;
+ URLRequest::ReferrerPolicy referrer_policy) override;
virtual void SetExtraRequestHeaders(
- const std::string& extra_request_headers) OVERRIDE;
- virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE;
+ const std::string& extra_request_headers) override;
+ virtual void AddExtraRequestHeader(const std::string& header_line) override;
virtual void SetRequestContext(
- URLRequestContextGetter* request_context_getter) OVERRIDE;
+ URLRequestContextGetter* request_context_getter) override;
virtual void SetFirstPartyForCookies(
- const GURL& first_party_for_cookies) OVERRIDE;
+ const GURL& first_party_for_cookies) override;
virtual void SetURLRequestUserData(
const void* key,
- const CreateDataCallback& create_data_callback) OVERRIDE;
- virtual void SetStopOnRedirect(bool stop_on_redirect) OVERRIDE;
- virtual void SetAutomaticallyRetryOn5xx(bool retry) OVERRIDE;
- virtual void SetMaxRetriesOn5xx(int max_retries) OVERRIDE;
- virtual int GetMaxRetriesOn5xx() const OVERRIDE;
- virtual base::TimeDelta GetBackoffDelay() const OVERRIDE;
- virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) OVERRIDE;
+ const CreateDataCallback& create_data_callback) override;
+ virtual void SetStopOnRedirect(bool stop_on_redirect) override;
+ virtual void SetAutomaticallyRetryOn5xx(bool retry) override;
+ virtual void SetMaxRetriesOn5xx(int max_retries) override;
+ virtual int GetMaxRetriesOn5xx() const override;
+ virtual base::TimeDelta GetBackoffDelay() const override;
+ virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) override;
virtual void SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::SequencedTaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) override;
virtual void SaveResponseToTemporaryFile(
- scoped_refptr<base::SequencedTaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) override;
virtual void SaveResponseWithWriter(
- scoped_ptr<URLFetcherResponseWriter> response_writer) OVERRIDE;
- virtual HttpResponseHeaders* GetResponseHeaders() const OVERRIDE;
- virtual HostPortPair GetSocketAddress() const OVERRIDE;
- virtual bool WasFetchedViaProxy() const OVERRIDE;
- virtual void Start() OVERRIDE;
+ scoped_ptr<URLFetcherResponseWriter> response_writer) override;
+ virtual HttpResponseHeaders* GetResponseHeaders() const override;
+ virtual HostPortPair GetSocketAddress() const override;
+ virtual bool WasFetchedViaProxy() const override;
+ virtual void Start() override;
// URL we were created with. Because of how we're using URLFetcher GetURL()
// always returns an empty URL. Chances are you'll want to use
// GetOriginalURL() in your tests.
- virtual const GURL& GetOriginalURL() const OVERRIDE;
- virtual const GURL& GetURL() const OVERRIDE;
- virtual const URLRequestStatus& GetStatus() const OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
- virtual const ResponseCookies& GetCookies() const OVERRIDE;
- virtual void ReceivedContentWasMalformed() OVERRIDE;
+ virtual const GURL& GetOriginalURL() const override;
+ virtual const GURL& GetURL() const override;
+ virtual const URLRequestStatus& GetStatus() const override;
+ virtual int GetResponseCode() const override;
+ virtual const ResponseCookies& GetCookies() const override;
+ virtual void ReceivedContentWasMalformed() override;
// Override response access functions to return fake data.
virtual bool GetResponseAsString(
- std::string* out_response_string) const OVERRIDE;
+ std::string* out_response_string) const override;
virtual bool GetResponseAsFilePath(
- bool take_ownership, base::FilePath* out_response_path) const OVERRIDE;
+ bool take_ownership, base::FilePath* out_response_path) const override;
void GetExtraRequestHeaders(HttpRequestHeaders* headers) const;
@@ -247,7 +247,7 @@
int id,
const GURL& url,
URLFetcher::RequestType request_type,
- URLFetcherDelegate* d) OVERRIDE;
+ URLFetcherDelegate* d) override;
TestURLFetcher* GetFetcherByID(int id) const;
void RemoveFetcherFromMap(int id);
void SetDelegateForTests(TestURLFetcherDelegateForTests* delegate_for_tests);
@@ -299,9 +299,9 @@
// Start the request. This will call the given delegate asynchronously
// with the pre-baked response as parameter.
- virtual void Start() OVERRIDE;
+ virtual void Start() override;
- virtual const GURL& GetURL() const OVERRIDE;
+ virtual const GURL& GetURL() const override;
virtual ~FakeURLFetcher();
@@ -407,7 +407,7 @@
int id,
const GURL& url,
URLFetcher::RequestType request_type,
- URLFetcherDelegate* d) OVERRIDE;
+ URLFetcherDelegate* d) override;
// Sets the fake response for a given URL. The |response_data| may be empty.
// The |response_code| may be any HttpStatusCode. For instance, HTTP_OK will
@@ -460,7 +460,7 @@
int id,
const GURL& url,
URLFetcher::RequestType request_type,
- URLFetcherDelegate* d) OVERRIDE;
+ URLFetcherDelegate* d) override;
};
} // namespace net
diff --git a/net/url_request/test_url_request_interceptor.cc b/net/url_request/test_url_request_interceptor.cc
index 69235d6..ec60e08 100644
--- a/net/url_request/test_url_request_interceptor.cc
+++ b/net/url_request/test_url_request_interceptor.cc
@@ -30,7 +30,7 @@
file_path,
worker_task_runner) {}
- virtual int GetResponseCode() const OVERRIDE { return 200; }
+ virtual int GetResponseCode() const override { return 200; }
private:
virtual ~TestURLRequestJob() {}
@@ -93,7 +93,7 @@
// When computing matches, this ignores the query parameters of the url.
virtual net::URLRequestJob* MaybeInterceptRequest(
net::URLRequest* request,
- net::NetworkDelegate* network_delegate) const OVERRIDE {
+ net::NetworkDelegate* network_delegate) const override {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
if (request->url().scheme() != scheme_ ||
request->url().host() != hostname_) {
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index f3e10fd..5ea3921 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -14,6 +14,7 @@
#include "base/stl_util.h"
#include "base/thread_task_runner_handle.h"
#include "base/tracked_objects.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -548,8 +549,8 @@
if (!upload_content_.empty()) {
scoped_ptr<UploadElementReader> reader(new UploadBytesElementReader(
upload_content_.data(), upload_content_.size()));
- request_->set_upload(make_scoped_ptr(
- UploadDataStream::CreateWithReader(reader.Pass(), 0)));
+ request_->set_upload(
+ ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
} else if (!upload_file_path_.empty()) {
scoped_ptr<UploadElementReader> reader(
new UploadFileElementReader(upload_file_task_runner_.get(),
@@ -557,8 +558,8 @@
upload_range_offset_,
upload_range_length_,
base::Time()));
- request_->set_upload(make_scoped_ptr(
- UploadDataStream::CreateWithReader(reader.Pass(), 0)));
+ request_->set_upload(
+ ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
}
current_upload_bytes_ = -1;
diff --git a/net/url_request/url_fetcher_core.h b/net/url_request/url_fetcher_core.h
index a69eb71..c064a42 100644
--- a/net/url_request/url_fetcher_core.h
+++ b/net/url_request/url_fetcher_core.h
@@ -124,13 +124,13 @@
// Overridden from URLRequest::Delegate:
virtual void OnReceivedRedirect(URLRequest* request,
const RedirectInfo& redirect_info,
- bool* defer_redirect) OVERRIDE;
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE;
+ bool* defer_redirect) override;
+ virtual void OnResponseStarted(URLRequest* request) override;
virtual void OnReadCompleted(URLRequest* request,
- int bytes_read) OVERRIDE;
+ int bytes_read) override;
virtual void OnCertificateRequested(
URLRequest* request,
- SSLCertRequestInfo* cert_request_info) OVERRIDE;
+ SSLCertRequestInfo* cert_request_info) override;
URLFetcherDelegate* delegate() const { return delegate_; }
static void CancelAll();
diff --git a/net/url_request/url_fetcher_impl.h b/net/url_request/url_fetcher_impl.h
index bc271b2..e534904 100644
--- a/net/url_request/url_fetcher_impl.h
+++ b/net/url_request/url_fetcher_impl.h
@@ -38,60 +38,60 @@
// URLFetcher implementation:
virtual void SetUploadData(const std::string& upload_content_type,
- const std::string& upload_content) OVERRIDE;
+ const std::string& upload_content) override;
virtual void SetUploadFilePath(
const std::string& upload_content_type,
const base::FilePath& file_path,
uint64 range_offset,
uint64 range_length,
- scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::TaskRunner> file_task_runner) override;
virtual void SetChunkedUpload(
- const std::string& upload_content_type) OVERRIDE;
+ const std::string& upload_content_type) override;
virtual void AppendChunkToUpload(const std::string& data,
- bool is_last_chunk) OVERRIDE;
- virtual void SetLoadFlags(int load_flags) OVERRIDE;
- virtual int GetLoadFlags() const OVERRIDE;
- virtual void SetReferrer(const std::string& referrer) OVERRIDE;
+ bool is_last_chunk) override;
+ virtual void SetLoadFlags(int load_flags) override;
+ virtual int GetLoadFlags() const override;
+ virtual void SetReferrer(const std::string& referrer) override;
virtual void SetReferrerPolicy(
- URLRequest::ReferrerPolicy referrer_policy) OVERRIDE;
+ URLRequest::ReferrerPolicy referrer_policy) override;
virtual void SetExtraRequestHeaders(
- const std::string& extra_request_headers) OVERRIDE;
- virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE;
+ const std::string& extra_request_headers) override;
+ virtual void AddExtraRequestHeader(const std::string& header_line) override;
virtual void SetRequestContext(
- URLRequestContextGetter* request_context_getter) OVERRIDE;
+ URLRequestContextGetter* request_context_getter) override;
virtual void SetFirstPartyForCookies(
- const GURL& first_party_for_cookies) OVERRIDE;
+ const GURL& first_party_for_cookies) override;
virtual void SetURLRequestUserData(
const void* key,
- const CreateDataCallback& create_data_callback) OVERRIDE;
- virtual void SetStopOnRedirect(bool stop_on_redirect) OVERRIDE;
- virtual void SetAutomaticallyRetryOn5xx(bool retry) OVERRIDE;
- virtual void SetMaxRetriesOn5xx(int max_retries) OVERRIDE;
- virtual int GetMaxRetriesOn5xx() const OVERRIDE;
- virtual base::TimeDelta GetBackoffDelay() const OVERRIDE;
- virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) OVERRIDE;
+ const CreateDataCallback& create_data_callback) override;
+ virtual void SetStopOnRedirect(bool stop_on_redirect) override;
+ virtual void SetAutomaticallyRetryOn5xx(bool retry) override;
+ virtual void SetMaxRetriesOn5xx(int max_retries) override;
+ virtual int GetMaxRetriesOn5xx() const override;
+ virtual base::TimeDelta GetBackoffDelay() const override;
+ virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) override;
virtual void SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::SequencedTaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) override;
virtual void SaveResponseToTemporaryFile(
- scoped_refptr<base::SequencedTaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) override;
virtual void SaveResponseWithWriter(
- scoped_ptr<URLFetcherResponseWriter> response_writer) OVERRIDE;
- virtual HttpResponseHeaders* GetResponseHeaders() const OVERRIDE;
- virtual HostPortPair GetSocketAddress() const OVERRIDE;
- virtual bool WasFetchedViaProxy() const OVERRIDE;
- virtual void Start() OVERRIDE;
- virtual const GURL& GetOriginalURL() const OVERRIDE;
- virtual const GURL& GetURL() const OVERRIDE;
- virtual const URLRequestStatus& GetStatus() const OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
- virtual const ResponseCookies& GetCookies() const OVERRIDE;
- virtual void ReceivedContentWasMalformed() OVERRIDE;
+ scoped_ptr<URLFetcherResponseWriter> response_writer) override;
+ virtual HttpResponseHeaders* GetResponseHeaders() const override;
+ virtual HostPortPair GetSocketAddress() const override;
+ virtual bool WasFetchedViaProxy() const override;
+ virtual void Start() override;
+ virtual const GURL& GetOriginalURL() const override;
+ virtual const GURL& GetURL() const override;
+ virtual const URLRequestStatus& GetStatus() const override;
+ virtual int GetResponseCode() const override;
+ virtual const ResponseCookies& GetCookies() const override;
+ virtual void ReceivedContentWasMalformed() override;
virtual bool GetResponseAsString(
- std::string* out_response_string) const OVERRIDE;
+ std::string* out_response_string) const override;
virtual bool GetResponseAsFilePath(
bool take_ownership,
- base::FilePath* out_response_path) const OVERRIDE;
+ base::FilePath* out_response_path) const override;
static void CancelAll();
diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc
index 2f1acce..5c97366 100644
--- a/net/url_request/url_fetcher_impl_unittest.cc
+++ b/net/url_request/url_fetcher_impl_unittest.cc
@@ -67,7 +67,7 @@
}
// TestURLRequestContextGetter:
- virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE {
+ virtual TestURLRequestContext* GetURLRequestContext() override {
return context_;
}
@@ -95,7 +95,7 @@
// Subclasses that override this should either call this function or
// CleanupAfterFetchComplete() at the end of their processing, depending on
// whether they want to check for a non-empty HTTP 200 response or not.
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
// Deletes |fetcher| and terminates the message loop.
void CleanupAfterFetchComplete();
@@ -110,7 +110,7 @@
protected:
// testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
testing::Test::SetUp();
context_.reset(new ThrottlingTestURLRequestContext());
@@ -122,7 +122,7 @@
#endif
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
#if defined(USE_NSS) || defined(OS_IOS)
ShutdownNSSHttpIO();
#endif
@@ -143,13 +143,13 @@
class URLFetcherMockDnsTest : public URLFetcherTest {
public:
// testing::Test:
- virtual void SetUp() OVERRIDE;
+ virtual void SetUp() override;
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
protected:
GURL test_url_;
@@ -231,10 +231,10 @@
class URLFetcherPostTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that does a POST of a file using
@@ -249,10 +249,10 @@
}
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
private:
base::FilePath path_;
@@ -264,10 +264,10 @@
class URLFetcherEmptyPostTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that tests download progress reports.
@@ -279,12 +279,12 @@
}
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
int64 current,
- int64 total) OVERRIDE;
+ int64 total) override;
protected:
// Download progress returned by the previous callback.
@@ -298,13 +298,13 @@
class URLFetcherDownloadProgressCancelTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
int64 current,
- int64 total) OVERRIDE;
+ int64 total) override;
protected:
bool cancelled_;
};
@@ -313,12 +313,12 @@
class URLFetcherUploadProgressTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
virtual void OnURLFetchUploadProgress(const URLFetcher* source,
int64 current,
- int64 total) OVERRIDE;
+ int64 total) override;
protected:
int64 previous_progress_;
std::string chunk_;
@@ -329,14 +329,14 @@
class URLFetcherHeadersTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that tests SocketAddress.
class URLFetcherSocketAddressTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
protected:
std::string expected_host_;
uint16 expected_port_;
@@ -349,10 +349,10 @@
virtual ~URLFetcherStopOnRedirectTest();
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
protected:
// The URL we should be redirected to.
@@ -365,10 +365,10 @@
class URLFetcherProtectTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
private:
Time start_time_;
};
@@ -378,10 +378,10 @@
class URLFetcherProtectTestPassedThrough : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
private:
Time start_time_;
};
@@ -392,7 +392,7 @@
URLFetcherBadHTTPSTest();
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
private:
base::FilePath cert_dir_;
@@ -402,10 +402,10 @@
class URLFetcherCancelTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ virtual void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
void CancelRequest();
};
@@ -439,7 +439,7 @@
}
// TestURLRequestContextGetter:
- virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE {
+ virtual TestURLRequestContext* GetURLRequestContext() override {
if (!context_.get()) {
context_.reset(new CancelTestURLRequestContext());
DCHECK(context_->throttler_manager());
@@ -487,7 +487,7 @@
class URLFetcherMultipleAttemptTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
private:
std::string data_;
};
@@ -501,7 +501,7 @@
void CreateFetcherForTempFile(const GURL& url);
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ virtual void OnURLFetchComplete(const URLFetcher* source) override;
protected:
base::FilePath expected_file_;
diff --git a/net/url_request/url_fetcher_response_writer.h b/net/url_request/url_fetcher_response_writer.h
index 428f441..3321f5c 100644
--- a/net/url_request/url_fetcher_response_writer.h
+++ b/net/url_request/url_fetcher_response_writer.h
@@ -65,12 +65,12 @@
const std::string& data() const { return data_; }
// URLFetcherResponseWriter overrides:
- virtual int Initialize(const CompletionCallback& callback) OVERRIDE;
+ virtual int Initialize(const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buffer,
int num_bytes,
- const CompletionCallback& callback) OVERRIDE;
- virtual int Finish(const CompletionCallback& callback) OVERRIDE;
- virtual URLFetcherStringWriter* AsStringWriter() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int Finish(const CompletionCallback& callback) override;
+ virtual URLFetcherStringWriter* AsStringWriter() override;
private:
std::string data_;
@@ -91,12 +91,12 @@
const base::FilePath& file_path() const { return file_path_; }
// URLFetcherResponseWriter overrides:
- virtual int Initialize(const CompletionCallback& callback) OVERRIDE;
+ virtual int Initialize(const CompletionCallback& callback) override;
virtual int Write(IOBuffer* buffer,
int num_bytes,
- const CompletionCallback& callback) OVERRIDE;
- virtual int Finish(const CompletionCallback& callback) OVERRIDE;
- virtual URLFetcherFileWriter* AsFileWriter() OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int Finish(const CompletionCallback& callback) override;
+ virtual URLFetcherFileWriter* AsFileWriter() override;
// Drops ownership of the file at |file_path_|.
// This class will not delete it or write to it again.
diff --git a/net/url_request/url_fetcher_response_writer_unittest.cc b/net/url_request/url_fetcher_response_writer_unittest.cc
index a2e00c8..71cb671 100644
--- a/net/url_request/url_fetcher_response_writer_unittest.cc
+++ b/net/url_request/url_fetcher_response_writer_unittest.cc
@@ -23,7 +23,7 @@
class URLFetcherStringWriterTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
writer_.reset(new URLFetcherStringWriter);
buf_ = new StringIOBuffer(kData);
}
@@ -54,7 +54,7 @@
class URLFetcherFileWriterTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
file_path_ = temp_dir_.path().AppendASCII("test.txt");
writer_.reset(new URLFetcherFileWriter(
@@ -144,7 +144,7 @@
class URLFetcherFileWriterTemporaryFileTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
writer_.reset(new URLFetcherFileWriter(
base::MessageLoopProxy::current(), base::FilePath()));
buf_ = new StringIOBuffer(kData);
diff --git a/net/url_request/url_range_request_job.h b/net/url_request/url_range_request_job.h
index 85f394c..190389d 100644
--- a/net/url_request/url_range_request_job.h
+++ b/net/url_request/url_range_request_job.h
@@ -25,7 +25,7 @@
NetworkDelegate* delegate);
virtual void SetExtraRequestHeaders(
- const HttpRequestHeaders& headers) OVERRIDE;
+ const HttpRequestHeaders& headers) override;
const std::vector<HttpByteRange>& ranges() const { return ranges_; }
int range_parse_result() const { return range_parse_result_; }
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 311bb20..7ae48e8 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -18,6 +18,7 @@
#include "base/synchronization/lock.h"
#include "base/values.h"
#include "net/base/auth.h"
+#include "net/base/chunked_upload_data_stream.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_flags.h"
#include "net/base/load_timing_info.h"
@@ -223,8 +224,8 @@
void URLRequest::EnableChunkedUpload() {
DCHECK(!upload_data_stream_ || upload_data_stream_->is_chunked());
if (!upload_data_stream_) {
- upload_data_stream_.reset(
- new UploadDataStream(UploadDataStream::CHUNKED, 0));
+ upload_chunked_data_stream_ = new ChunkedUploadDataStream(0);
+ upload_data_stream_.reset(upload_chunked_data_stream_);
}
}
@@ -234,7 +235,7 @@
DCHECK(upload_data_stream_);
DCHECK(upload_data_stream_->is_chunked());
DCHECK_GT(bytes_len, 0);
- upload_data_stream_->AppendChunk(bytes, bytes_len, is_last_chunk);
+ upload_chunked_data_stream_->AppendData(bytes, bytes_len, is_last_chunk);
}
void URLRequest::set_upload(scoped_ptr<UploadDataStream> upload) {
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index d8df8fe..a0d5789 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -48,6 +48,7 @@
namespace net {
+class ChunkedUploadDataStream;
class CookieOptions;
class HostPortPair;
class IOBuffer;
@@ -791,6 +792,10 @@
scoped_refptr<URLRequestJob> job_;
scoped_ptr<UploadDataStream> upload_data_stream_;
+ // TODO(mmenke): Make whether or not an upload is chunked transparent to the
+ // URLRequest.
+ ChunkedUploadDataStream* upload_chunked_data_stream_;
+
std::vector<GURL> url_chain_;
GURL first_party_for_cookies_;
GURL delegate_redirect_url_;
diff --git a/net/url_request/url_request_about_job.h b/net/url_request/url_request_about_job.h
index 66a888a..d4b4867 100644
--- a/net/url_request/url_request_about_job.h
+++ b/net/url_request/url_request_about_job.h
@@ -18,8 +18,8 @@
URLRequestAboutJob(URLRequest* request, NetworkDelegate* network_delegate);
// URLRequestJob:
- virtual void Start() OVERRIDE;
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
+ virtual void Start() override;
+ virtual bool GetMimeType(std::string* mime_type) const override;
private:
virtual ~URLRequestAboutJob();
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index a7f5a0b..2e2fcc4 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -56,68 +56,68 @@
private:
virtual int OnBeforeURLRequest(URLRequest* request,
const CompletionCallback& callback,
- GURL* new_url) OVERRIDE {
+ GURL* new_url) override {
return OK;
}
virtual int OnBeforeSendHeaders(URLRequest* request,
const CompletionCallback& callback,
- HttpRequestHeaders* headers) OVERRIDE {
+ HttpRequestHeaders* headers) override {
return OK;
}
virtual void OnSendHeaders(URLRequest* request,
- const HttpRequestHeaders& headers) OVERRIDE {}
+ const HttpRequestHeaders& headers) override {}
virtual int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
- GURL* allowed_unsafe_redirect_url) OVERRIDE {
+ GURL* allowed_unsafe_redirect_url) override {
return OK;
}
virtual void OnBeforeRedirect(URLRequest* request,
- const GURL& new_location) OVERRIDE {}
+ const GURL& new_location) override {}
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE {}
+ virtual void OnResponseStarted(URLRequest* request) override {}
virtual void OnRawBytesRead(const URLRequest& request,
- int bytes_read) OVERRIDE {}
+ int bytes_read) override {}
- virtual void OnCompleted(URLRequest* request, bool started) OVERRIDE {}
+ virtual void OnCompleted(URLRequest* request, bool started) override {}
- virtual void OnURLRequestDestroyed(URLRequest* request) OVERRIDE {}
+ virtual void OnURLRequestDestroyed(URLRequest* request) override {}
virtual void OnPACScriptError(int line_number,
- const base::string16& error) OVERRIDE {}
+ const base::string16& error) override {}
virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
- AuthCredentials* credentials) OVERRIDE {
+ AuthCredentials* credentials) override {
return NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION;
}
virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) OVERRIDE {
+ const CookieList& cookie_list) override {
return true;
}
virtual bool OnCanSetCookie(const URLRequest& request,
const std::string& cookie_line,
- CookieOptions* options) OVERRIDE {
+ CookieOptions* options) override {
return true;
}
virtual bool OnCanAccessFile(const net::URLRequest& request,
- const base::FilePath& path) const OVERRIDE {
+ const base::FilePath& path) const override {
return true;
}
- virtual bool OnCanThrottleRequest(const URLRequest& request) const OVERRIDE {
+ virtual bool OnCanThrottleRequest(const URLRequest& request) const override {
// Returning true will only enable throttling if there's also a
// URLRequestThrottlerManager, which there isn't, by default.
return true;
@@ -125,7 +125,7 @@
virtual int OnBeforeSocketStreamConnect(
SocketStream* stream,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return OK;
}
diff --git a/net/url_request/url_request_context_builder_unittest.cc b/net/url_request/url_request_context_builder_unittest.cc
index b5a3da2..f0f4b82 100644
--- a/net/url_request/url_request_context_builder_unittest.cc
+++ b/net/url_request/url_request_context_builder_unittest.cc
@@ -51,7 +51,7 @@
CreateReason reason,
int nonce_count,
const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) OVERRIDE {
+ scoped_ptr<HttpAuthHandler>* handler) override {
handler->reset();
return return_code_;
}
diff --git a/net/url_request/url_request_context_getter.h b/net/url_request/url_request_context_getter.h
index 1f56f70..aa2d64b 100644
--- a/net/url_request/url_request_context_getter.h
+++ b/net/url_request/url_request_context_getter.h
@@ -62,10 +62,10 @@
const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner);
// net::URLRequestContextGetter implementation:
- virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE;
+ virtual net::URLRequestContext* GetURLRequestContext() override;
virtual scoped_refptr<base::SingleThreadTaskRunner>
- GetNetworkTaskRunner() const OVERRIDE;
+ GetNetworkTaskRunner() const override;
private:
virtual ~TrivialURLRequestContextGetter();
diff --git a/net/url_request/url_request_data_job.h b/net/url_request/url_request_data_job.h
index f2e38aa..c39ae8d 100644
--- a/net/url_request/url_request_data_job.h
+++ b/net/url_request/url_request_data_job.h
@@ -33,7 +33,7 @@
virtual int GetData(std::string* mime_type,
std::string* charset,
std::string* data,
- const CompletionCallback& callback) const OVERRIDE;
+ const CompletionCallback& callback) const override;
private:
virtual ~URLRequestDataJob();
diff --git a/net/url_request/url_request_error_job.h b/net/url_request/url_request_error_job.h
index 7c162f0..0bb37ec 100644
--- a/net/url_request/url_request_error_job.h
+++ b/net/url_request/url_request_error_job.h
@@ -20,7 +20,7 @@
NetworkDelegate* network_delegate,
int error);
- virtual void Start() OVERRIDE;
+ virtual void Start() override;
private:
virtual ~URLRequestErrorJob();
diff --git a/net/url_request/url_request_file_dir_job.h b/net/url_request/url_request_file_dir_job.h
index f897493..b353697 100644
--- a/net/url_request/url_request_file_dir_job.h
+++ b/net/url_request/url_request_file_dir_job.h
@@ -27,18 +27,18 @@
virtual void StartAsync();
// Overridden from URLRequestJob:
- virtual void Start() OVERRIDE;
- virtual void Kill() OVERRIDE;
+ virtual void Start() override;
+ virtual void Kill() override;
virtual bool ReadRawData(IOBuffer* buf,
int buf_size,
- int* bytes_read) OVERRIDE;
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
- virtual bool GetCharset(std::string* charset) OVERRIDE;
+ int* bytes_read) override;
+ virtual bool GetMimeType(std::string* mime_type) const override;
+ virtual bool GetCharset(std::string* charset) override;
// Overridden from DirectoryLister::DirectoryListerDelegate:
virtual void OnListFile(
- const DirectoryLister::DirectoryListerData& data) OVERRIDE;
- virtual void OnListDone(int error) OVERRIDE;
+ const DirectoryLister::DirectoryListerData& data) override;
+ virtual void OnListDone(int error) override;
private:
virtual ~URLRequestFileDirJob();
diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h
index 15c1e4d..3a5aae7 100644
--- a/net/url_request/url_request_file_job.h
+++ b/net/url_request/url_request_file_job.h
@@ -36,17 +36,17 @@
const scoped_refptr<base::TaskRunner>& file_task_runner);
// URLRequestJob:
- virtual void Start() OVERRIDE;
- virtual void Kill() OVERRIDE;
+ virtual void Start() override;
+ virtual void Kill() override;
virtual bool ReadRawData(IOBuffer* buf,
int buf_size,
- int* bytes_read) OVERRIDE;
+ int* bytes_read) override;
virtual bool IsRedirectResponse(GURL* location,
- int* http_status_code) OVERRIDE;
- virtual Filter* SetupFilter() const OVERRIDE;
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
+ int* http_status_code) override;
+ virtual Filter* SetupFilter() const override;
+ virtual bool GetMimeType(std::string* mime_type) const override;
virtual void SetExtraRequestHeaders(
- const HttpRequestHeaders& headers) OVERRIDE;
+ const HttpRequestHeaders& headers) override;
// An interface for subclasses who wish to monitor read operations.
virtual void OnSeekComplete(int64 result);
diff --git a/net/url_request/url_request_file_job_unittest.cc b/net/url_request/url_request_file_job_unittest.cc
index 4f7984c..ba87766 100644
--- a/net/url_request/url_request_file_job_unittest.cc
+++ b/net/url_request/url_request_file_job_unittest.cc
@@ -41,12 +41,12 @@
protected:
virtual ~URLRequestFileJobWithCallbacks() {}
- virtual void OnSeekComplete(int64 result) OVERRIDE {
+ virtual void OnSeekComplete(int64 result) override {
ASSERT_EQ(seek_position_, 0);
seek_position_ = result;
}
- virtual void OnReadComplete(IOBuffer* buf, int result) OVERRIDE {
+ virtual void OnReadComplete(IOBuffer* buf, int result) override {
data_chunks_.push_back(std::string(buf->data(), result));
}
@@ -72,7 +72,7 @@
virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
- NetworkDelegate* network_delegate) const OVERRIDE {
+ NetworkDelegate* network_delegate) const override {
URLRequestFileJobWithCallbacks* job = new URLRequestFileJobWithCallbacks(
request,
network_delegate,
@@ -82,15 +82,15 @@
return job;
}
- virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE {
+ virtual bool IsHandledProtocol(const std::string& scheme) const override {
return scheme == "file";
}
- virtual bool IsHandledURL(const GURL& url) const OVERRIDE {
+ virtual bool IsHandledURL(const GURL& url) const override {
return IsHandledProtocol(url.scheme());
}
- virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE {
+ virtual bool IsSafeRedirectTarget(const GURL& location) const override {
return false;
}
@@ -116,7 +116,7 @@
class JobObserverImpl : public CallbacksJobFactory::JobObserver {
public:
- virtual void OnJobCreated(URLRequestFileJobWithCallbacks* job) OVERRIDE {
+ virtual void OnJobCreated(URLRequestFileJobWithCallbacks* job) override {
jobs_.push_back(job);
}
diff --git a/net/url_request/url_request_filter.cc b/net/url_request/url_request_filter.cc
index 842a54f..04d61cc 100644
--- a/net/url_request/url_request_filter.cc
+++ b/net/url_request/url_request_filter.cc
@@ -22,7 +22,7 @@
// URLRequestInterceptor implementation.
virtual URLRequestJob* MaybeInterceptRequest(
- URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE {
+ URLRequest* request, NetworkDelegate* network_delegate) const override {
return factory_(request, network_delegate, request->url().scheme());
}
diff --git a/net/url_request/url_request_filter.h b/net/url_request/url_request_filter.h
index 93baedb..3388d92 100644
--- a/net/url_request/url_request_filter.h
+++ b/net/url_request/url_request_filter.h
@@ -69,7 +69,7 @@
// URLRequestInterceptor implementation:
virtual URLRequestJob* MaybeInterceptRequest(
URLRequest* request,
- NetworkDelegate* network_delegate) const OVERRIDE;
+ NetworkDelegate* network_delegate) const override;
private:
// scheme,hostname -> URLRequestInterceptor
diff --git a/net/url_request/url_request_filter_unittest.cc b/net/url_request/url_request_filter_unittest.cc
index 0e1f2df..bd2a782 100644
--- a/net/url_request/url_request_filter_unittest.cc
+++ b/net/url_request/url_request_filter_unittest.cc
@@ -43,7 +43,7 @@
virtual ~TestURLRequestInterceptor() {}
virtual URLRequestJob* MaybeInterceptRequest(
- URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE {
+ URLRequest* request, NetworkDelegate* network_delegate) const override {
job_c = new URLRequestTestJob(request, network_delegate);
return job_c;
}
diff --git a/net/url_request/url_request_ftp_job.h b/net/url_request/url_request_ftp_job.h
index 6c40b65..61d4cff 100644
--- a/net/url_request/url_request_ftp_job.h
+++ b/net/url_request/url_request_ftp_job.h
@@ -37,13 +37,13 @@
virtual ~URLRequestFtpJob();
// Overridden from URLRequestJob:
- virtual bool IsSafeRedirect(const GURL& location) OVERRIDE;
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
- virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE;
- virtual HostPortPair GetSocketAddress() const OVERRIDE;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
- virtual void Start() OVERRIDE;
- virtual void Kill() OVERRIDE;
+ virtual bool IsSafeRedirect(const GURL& location) override;
+ virtual bool GetMimeType(std::string* mime_type) const override;
+ virtual void GetResponseInfo(HttpResponseInfo* info) override;
+ virtual HostPortPair GetSocketAddress() const override;
+ virtual void SetPriority(RequestPriority priority) override;
+ virtual void Start() override;
+ virtual void Kill() override;
RequestPriority priority() const { return priority_; }
@@ -62,18 +62,18 @@
void LogFtpServerType(char server_type);
// Overridden from URLRequestJob:
- virtual LoadState GetLoadState() const OVERRIDE;
- virtual bool NeedsAuth() OVERRIDE;
+ virtual LoadState GetLoadState() const override;
+ virtual bool NeedsAuth() override;
virtual void GetAuthChallengeInfo(
- scoped_refptr<AuthChallengeInfo>* auth_info) OVERRIDE;
- virtual void SetAuth(const AuthCredentials& credentials) OVERRIDE;
- virtual void CancelAuth() OVERRIDE;
+ scoped_refptr<AuthChallengeInfo>* auth_info) override;
+ virtual void SetAuth(const AuthCredentials& credentials) override;
+ virtual void CancelAuth() override;
// TODO(ibrar): Yet to give another look at this function.
- virtual UploadProgress GetUploadProgress() const OVERRIDE;
+ virtual UploadProgress GetUploadProgress() const override;
virtual bool ReadRawData(IOBuffer* buf,
int buf_size,
- int *bytes_read) OVERRIDE;
+ int *bytes_read) override;
void HandleAuthNeededResponse();
diff --git a/net/url_request/url_request_ftp_job_unittest.cc b/net/url_request/url_request_ftp_job_unittest.cc
index 3ecb97e..629613d 100644
--- a/net/url_request/url_request_ftp_job_unittest.cc
+++ b/net/url_request/url_request_ftp_job_unittest.cc
@@ -67,18 +67,18 @@
config_.proxy_rules().ParseFromString("ftp=localhost");
}
- virtual void AddObserver(Observer* observer) OVERRIDE {
+ virtual void AddObserver(Observer* observer) override {
observer_ = observer;
}
- virtual void RemoveObserver(Observer* observer) OVERRIDE {
+ virtual void RemoveObserver(Observer* observer) override {
if (observer_ == observer) {
observer_ = NULL;
}
}
virtual ConfigAvailability GetLatestProxyConfig(
- ProxyConfig* config) OVERRIDE {
+ ProxyConfig* config) override {
*config = config_;
return CONFIG_VALID;
}
@@ -113,11 +113,11 @@
class MockFtpTransactionFactory : public FtpTransactionFactory {
public:
- virtual FtpTransaction* CreateTransaction() OVERRIDE {
+ virtual FtpTransaction* CreateTransaction() override {
return NULL;
}
- virtual void Suspend(bool suspend) OVERRIDE {}
+ virtual void Suspend(bool suspend) override {}
};
// Fixture for priority-related tests. Priority matters when there is
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 2ebdd15..fc26e94 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -58,17 +58,17 @@
virtual ~HttpFilterContext();
// FilterContext implementation.
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
- virtual bool GetURL(GURL* gurl) const OVERRIDE;
- virtual bool GetContentDisposition(std::string* disposition) const OVERRIDE;
- virtual base::Time GetRequestTime() const OVERRIDE;
- virtual bool IsCachedContent() const OVERRIDE;
- virtual bool IsDownload() const OVERRIDE;
- virtual bool SdchResponseExpected() const OVERRIDE;
- virtual int64 GetByteReadCount() const OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
- virtual const URLRequestContext* GetURLRequestContext() const OVERRIDE;
- virtual void RecordPacketStats(StatisticSelector statistic) const OVERRIDE;
+ virtual bool GetMimeType(std::string* mime_type) const override;
+ virtual bool GetURL(GURL* gurl) const override;
+ virtual bool GetContentDisposition(std::string* disposition) const override;
+ virtual base::Time GetRequestTime() const override;
+ virtual bool IsCachedContent() const override;
+ virtual bool IsDownload() const override;
+ virtual bool SdchResponseExpected() const override;
+ virtual int64 GetByteReadCount() const override;
+ virtual int GetResponseCode() const override;
+ virtual const URLRequestContext* GetURLRequestContext() const override;
+ virtual void RecordPacketStats(StatisticSelector statistic) const override;
// Method to allow us to reset filter context for a response that should have
// been SDCH encoded when there is an update due to an explicit HTTP header.
diff --git a/net/url_request/url_request_http_job.h b/net/url_request/url_request_http_job.h
index 6f8dccc..4b0cc67 100644
--- a/net/url_request/url_request_http_job.h
+++ b/net/url_request/url_request_http_job.h
@@ -48,9 +48,9 @@
virtual ~URLRequestHttpJob();
// Overridden from URLRequestJob:
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
- virtual void Start() OVERRIDE;
- virtual void Kill() OVERRIDE;
+ virtual void SetPriority(RequestPriority priority) override;
+ virtual void Start() override;
+ virtual void Kill() override;
RequestPriority priority() const {
return priority_;
@@ -99,44 +99,44 @@
void RestartTransactionWithAuth(const AuthCredentials& credentials);
// Overridden from URLRequestJob:
- virtual void SetUpload(UploadDataStream* upload) OVERRIDE;
+ virtual void SetUpload(UploadDataStream* upload) override;
virtual void SetExtraRequestHeaders(
- const HttpRequestHeaders& headers) OVERRIDE;
- virtual LoadState GetLoadState() const OVERRIDE;
- virtual UploadProgress GetUploadProgress() const OVERRIDE;
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
- virtual bool GetCharset(std::string* charset) OVERRIDE;
- virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE;
+ const HttpRequestHeaders& headers) override;
+ virtual LoadState GetLoadState() const override;
+ virtual UploadProgress GetUploadProgress() const override;
+ virtual bool GetMimeType(std::string* mime_type) const override;
+ virtual bool GetCharset(std::string* charset) override;
+ virtual void GetResponseInfo(HttpResponseInfo* info) override;
virtual void GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
- virtual bool GetResponseCookies(std::vector<std::string>* cookies) OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
- virtual Filter* SetupFilter() const OVERRIDE;
- virtual bool CopyFragmentOnRedirect(const GURL& location) const OVERRIDE;
- virtual bool IsSafeRedirect(const GURL& location) OVERRIDE;
- virtual bool NeedsAuth() OVERRIDE;
- virtual void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) OVERRIDE;
- virtual void SetAuth(const AuthCredentials& credentials) OVERRIDE;
- virtual void CancelAuth() OVERRIDE;
- virtual void ContinueWithCertificate(X509Certificate* client_cert) OVERRIDE;
- virtual void ContinueDespiteLastError() OVERRIDE;
- virtual void ResumeNetworkStart() OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
+ virtual bool GetResponseCookies(std::vector<std::string>* cookies) override;
+ virtual int GetResponseCode() const override;
+ virtual Filter* SetupFilter() const override;
+ virtual bool CopyFragmentOnRedirect(const GURL& location) const override;
+ virtual bool IsSafeRedirect(const GURL& location) override;
+ virtual bool NeedsAuth() override;
+ virtual void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) override;
+ virtual void SetAuth(const AuthCredentials& credentials) override;
+ virtual void CancelAuth() override;
+ virtual void ContinueWithCertificate(X509Certificate* client_cert) override;
+ virtual void ContinueDespiteLastError() override;
+ virtual void ResumeNetworkStart() override;
virtual bool ReadRawData(IOBuffer* buf, int buf_size,
- int* bytes_read) OVERRIDE;
- virtual void StopCaching() OVERRIDE;
+ int* bytes_read) override;
+ virtual void StopCaching() override;
virtual bool GetFullRequestHeaders(
- HttpRequestHeaders* headers) const OVERRIDE;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
- virtual void DoneReading() OVERRIDE;
- virtual void DoneReadingRedirectResponse() OVERRIDE;
+ HttpRequestHeaders* headers) const override;
+ virtual int64 GetTotalReceivedBytes() const override;
+ virtual void DoneReading() override;
+ virtual void DoneReadingRedirectResponse() override;
- virtual HostPortPair GetSocketAddress() const OVERRIDE;
- virtual void NotifyURLRequestDestroyed() OVERRIDE;
+ virtual HostPortPair GetSocketAddress() const override;
+ virtual void NotifyURLRequestDestroyed() override;
void RecordTimer();
void ResetTimer();
- virtual void UpdatePacketReadTimes() OVERRIDE;
+ virtual void UpdatePacketReadTimes() override;
void RecordPacketStats(FilterContext::StatisticSelector statistic) const;
void RecordCompressionHistograms();
diff --git a/net/url_request/url_request_http_job_unittest.cc b/net/url_request/url_request_http_job_unittest.cc
index 5cb84d6..c6848d3 100644
--- a/net/url_request/url_request_http_job_unittest.cc
+++ b/net/url_request/url_request_http_job_unittest.cc
@@ -231,7 +231,7 @@
// scoped_ptr, so this forwarding method acts as a workaround.
virtual WebSocketHandshakeStreamBase* CreateBasicStream(
scoped_ptr<ClientSocketHandle> connection,
- bool using_proxy) OVERRIDE {
+ bool using_proxy) override {
// Discard the arguments since we don't need them anyway.
return CreateBasicStreamMock();
}
@@ -256,58 +256,58 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
initialize_stream_was_called_ = true;
return ERR_IO_PENDING;
}
virtual int SendRequest(const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE {
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
virtual int ReadResponseBody(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual void Close(bool not_reusable) OVERRIDE {}
+ virtual void Close(bool not_reusable) override {}
- virtual bool IsResponseBodyComplete() const OVERRIDE { return false; }
+ virtual bool IsResponseBodyComplete() const override { return false; }
- virtual bool CanFindEndOfResponse() const OVERRIDE { return false; }
+ virtual bool CanFindEndOfResponse() const override { return false; }
- virtual bool IsConnectionReused() const OVERRIDE { return false; }
- virtual void SetConnectionReused() OVERRIDE {}
+ virtual bool IsConnectionReused() const override { return false; }
+ virtual void SetConnectionReused() override {}
- virtual bool IsConnectionReusable() const OVERRIDE { return false; }
+ virtual bool IsConnectionReusable() const override { return false; }
- virtual int64 GetTotalReceivedBytes() const OVERRIDE { return 0; }
+ virtual int64 GetTotalReceivedBytes() const override { return 0; }
virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const
- OVERRIDE {
+ override {
return false;
}
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {}
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override {}
virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info)
- OVERRIDE {}
+ override {}
- virtual bool IsSpdyHttpStream() const OVERRIDE { return false; }
+ virtual bool IsSpdyHttpStream() const override { return false; }
- virtual void Drain(HttpNetworkSession* session) OVERRIDE {}
+ virtual void Drain(HttpNetworkSession* session) override {}
- virtual void SetPriority(RequestPriority priority) OVERRIDE {}
+ virtual void SetPriority(RequestPriority priority) override {}
// Fake implementation of WebSocketHandshakeStreamBase method(s)
- virtual scoped_ptr<WebSocketStream> Upgrade() OVERRIDE {
+ virtual scoped_ptr<WebSocketStream> Upgrade() override {
return scoped_ptr<WebSocketStream>();
}
diff --git a/net/url_request/url_request_intercepting_job_factory.h b/net/url_request/url_request_intercepting_job_factory.h
index b18af54..909a25c 100644
--- a/net/url_request/url_request_intercepting_job_factory.h
+++ b/net/url_request/url_request_intercepting_job_factory.h
@@ -41,10 +41,10 @@
virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
- NetworkDelegate* network_delegate) const OVERRIDE;
- virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE;
- virtual bool IsHandledURL(const GURL& url) const OVERRIDE;
- virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE;
+ NetworkDelegate* network_delegate) const override;
+ virtual bool IsHandledProtocol(const std::string& scheme) const override;
+ virtual bool IsHandledURL(const GURL& url) const override;
+ virtual bool IsSafeRedirectTarget(const GURL& location) const override;
private:
scoped_ptr<URLRequestJobFactory> job_factory_;
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h
index 2dcd67a..5b8760f 100644
--- a/net/url_request/url_request_job.h
+++ b/net/url_request/url_request_job.h
@@ -219,7 +219,7 @@
// base::PowerObserver methods:
// We invoke URLRequestJob::Kill on suspend (crbug.com/4606).
- virtual void OnSuspend() OVERRIDE;
+ virtual void OnSuspend() override;
// Called after a NetworkDelegate has been informed that the URLRequest
// will be destroyed. This is used to track that no pending callbacks
diff --git a/net/url_request/url_request_job_factory_impl.h b/net/url_request/url_request_job_factory_impl.h
index 8de514f..94112c1 100644
--- a/net/url_request/url_request_job_factory_impl.h
+++ b/net/url_request/url_request_job_factory_impl.h
@@ -32,10 +32,10 @@
virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
- NetworkDelegate* network_delegate) const OVERRIDE;
- virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE;
- virtual bool IsHandledURL(const GURL& url) const OVERRIDE;
- virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE;
+ NetworkDelegate* network_delegate) const override;
+ virtual bool IsHandledProtocol(const std::string& scheme) const override;
+ virtual bool IsHandledURL(const GURL& url) const override;
+ virtual bool IsSafeRedirectTarget(const GURL& location) const override;
private:
// For testing only.
diff --git a/net/url_request/url_request_job_factory_impl_unittest.cc b/net/url_request/url_request_job_factory_impl_unittest.cc
index 2c36976..61467f1 100644
--- a/net/url_request/url_request_job_factory_impl_unittest.cc
+++ b/net/url_request/url_request_job_factory_impl_unittest.cc
@@ -26,7 +26,7 @@
status_(status),
weak_factory_(this) {}
- virtual void Start() OVERRIDE {
+ virtual void Start() override {
// Start reading asynchronously so that all error reporting and data
// callbacks happen as they would for network requests.
base::MessageLoop::current()->PostTask(
@@ -50,7 +50,7 @@
class DummyProtocolHandler : public URLRequestJobFactory::ProtocolHandler {
public:
virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE {
+ URLRequest* request, NetworkDelegate* network_delegate) const override {
return new MockURLRequestJob(
request,
network_delegate,
diff --git a/net/url_request/url_request_redirect_job.h b/net/url_request/url_request_redirect_job.h
index 23fc811..54bc3f0 100644
--- a/net/url_request/url_request_redirect_job.h
+++ b/net/url_request/url_request_redirect_job.h
@@ -42,12 +42,12 @@
const std::string& redirect_reason);
// URLRequestJob implementation:
- virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE;
+ virtual void GetResponseInfo(HttpResponseInfo* info) override;
virtual void GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
- virtual void Start() OVERRIDE;
- virtual bool CopyFragmentOnRedirect(const GURL& location) const OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
+ virtual void Start() override;
+ virtual bool CopyFragmentOnRedirect(const GURL& location) const override;
+ virtual int GetResponseCode() const override;
private:
virtual ~URLRequestRedirectJob();
diff --git a/net/url_request/url_request_simple_job.cc b/net/url_request/url_request_simple_job.cc
index f266e3b..a02da27 100644
--- a/net/url_request/url_request_simple_job.cc
+++ b/net/url_request/url_request_simple_job.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/message_loop/message_loop.h"
+#include "base/profiler/scoped_profile.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
@@ -60,6 +61,11 @@
return;
if (ranges().size() > 1) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 1"));
+
NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
ERR_REQUEST_RANGE_NOT_SATISFIABLE));
return;
@@ -68,11 +74,29 @@
if (!ranges().empty() && range_parse_result() == OK)
byte_range_ = ranges().front();
- int result = GetData(&mime_type_, &charset_, &data_,
- base::Bind(&URLRequestSimpleJob::OnGetDataCompleted,
- weak_factory_.GetWeakPtr()));
- if (result != ERR_IO_PENDING)
+ int result;
+ {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ // Remove the block and assign 'result' in its declaration.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 2"));
+
+ result = GetData(&mime_type_,
+ &charset_,
+ &data_,
+ base::Bind(&URLRequestSimpleJob::OnGetDataCompleted,
+ weak_factory_.GetWeakPtr()));
+ }
+
+ if (result != ERR_IO_PENDING) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 3"));
+
OnGetDataCompleted(result);
+ }
}
void URLRequestSimpleJob::OnGetDataCompleted(int result) {
diff --git a/net/url_request/url_request_simple_job.h b/net/url_request/url_request_simple_job.h
index 633a2e7..01bd319 100644
--- a/net/url_request/url_request_simple_job.h
+++ b/net/url_request/url_request_simple_job.h
@@ -20,12 +20,12 @@
public:
URLRequestSimpleJob(URLRequest* request, NetworkDelegate* network_delegate);
- virtual void Start() OVERRIDE;
+ virtual void Start() override;
virtual bool ReadRawData(IOBuffer* buf,
int buf_size,
- int *bytes_read) OVERRIDE;
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
- virtual bool GetCharset(std::string* charset) OVERRIDE;
+ int *bytes_read) override;
+ virtual bool GetMimeType(std::string* mime_type) const override;
+ virtual bool GetCharset(std::string* charset) override;
protected:
virtual ~URLRequestSimpleJob();
diff --git a/net/url_request/url_request_simple_job_unittest.cc b/net/url_request/url_request_simple_job_unittest.cc
index 512833f..b75da80 100644
--- a/net/url_request/url_request_simple_job_unittest.cc
+++ b/net/url_request/url_request_simple_job_unittest.cc
@@ -35,7 +35,7 @@
virtual int GetData(std::string* mime_type,
std::string* charset,
std::string* data,
- const CompletionCallback& callback) const OVERRIDE {
+ const CompletionCallback& callback) const override {
mime_type->assign("text/plain");
charset->assign("US-ASCII");
data->assign(kTestData);
@@ -55,7 +55,7 @@
public:
virtual URLRequestJob* MaybeCreateJob(
URLRequest* request,
- NetworkDelegate* network_delegate) const OVERRIDE {
+ NetworkDelegate* network_delegate) const override {
return new MockSimpleJob(request, network_delegate);
}
};
diff --git a/net/url_request/url_request_test_job.cc b/net/url_request/url_request_test_job.cc
index 422e080..3806e25 100644
--- a/net/url_request/url_request_test_job.cc
+++ b/net/url_request/url_request_test_job.cc
@@ -28,7 +28,7 @@
public:
// URLRequestJobFactory::ProtocolHandler implementation:
virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE {
+ URLRequest* request, NetworkDelegate* network_delegate) const override {
return new URLRequestTestJob(request, network_delegate);
}
};
diff --git a/net/url_request/url_request_test_job.h b/net/url_request/url_request_test_job.h
index 1a85fb0..f0f26fd 100644
--- a/net/url_request/url_request_test_job.h
+++ b/net/url_request/url_request_test_job.h
@@ -108,19 +108,19 @@
static URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler();
// Job functions
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
- virtual void Start() OVERRIDE;
+ virtual void SetPriority(RequestPriority priority) override;
+ virtual void Start() override;
virtual bool ReadRawData(IOBuffer* buf,
int buf_size,
- int *bytes_read) OVERRIDE;
- virtual void Kill() OVERRIDE;
- virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
- virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE;
+ int *bytes_read) override;
+ virtual void Kill() override;
+ virtual bool GetMimeType(std::string* mime_type) const override;
+ virtual void GetResponseInfo(HttpResponseInfo* info) override;
virtual void GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
+ LoadTimingInfo* load_timing_info) const override;
+ virtual int GetResponseCode() const override;
virtual bool IsRedirectResponse(GURL* location,
- int* http_status_code) OVERRIDE;
+ int* http_status_code) override;
protected:
// Override to specify whether the next read done from this job will
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h
index cad472e..d301154 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -108,9 +108,9 @@
scoped_ptr<TestURLRequestContext> context);
// URLRequestContextGetter implementation.
- virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE;
+ virtual TestURLRequestContext* GetURLRequestContext() override;
virtual scoped_refptr<base::SingleThreadTaskRunner>
- GetNetworkTaskRunner() const OVERRIDE;
+ GetNetworkTaskRunner() const override;
protected:
virtual ~TestURLRequestContextGetter();
@@ -171,19 +171,19 @@
// URLRequest::Delegate:
virtual void OnReceivedRedirect(URLRequest* request,
const RedirectInfo& redirect_info,
- bool* defer_redirect) OVERRIDE;
- virtual void OnBeforeNetworkStart(URLRequest* request, bool* defer) OVERRIDE;
+ bool* defer_redirect) override;
+ virtual void OnBeforeNetworkStart(URLRequest* request, bool* defer) override;
virtual void OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info) OVERRIDE;
+ AuthChallengeInfo* auth_info) override;
// NOTE: |fatal| causes |certificate_errors_are_fatal_| to be set to true.
// (Unit tests use this as a post-condition.) But for policy, this method
// consults |allow_certificate_errors_|.
virtual void OnSSLCertificateError(URLRequest* request,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE;
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE;
+ bool fatal) override;
+ virtual void OnResponseStarted(URLRequest* request) override;
virtual void OnReadCompleted(URLRequest* request,
- int bytes_read) OVERRIDE;
+ int bytes_read) override;
private:
static const int kBufferSize = 4096;
@@ -286,52 +286,52 @@
// NetworkDelegate:
virtual int OnBeforeURLRequest(URLRequest* request,
const CompletionCallback& callback,
- GURL* new_url) OVERRIDE;
+ GURL* new_url) override;
virtual int OnBeforeSendHeaders(URLRequest* request,
const CompletionCallback& callback,
- HttpRequestHeaders* headers) OVERRIDE;
+ HttpRequestHeaders* headers) override;
virtual void OnBeforeSendProxyHeaders(
net::URLRequest* request,
const net::ProxyInfo& proxy_info,
- net::HttpRequestHeaders* headers) OVERRIDE;
+ net::HttpRequestHeaders* headers) override;
virtual void OnSendHeaders(URLRequest* request,
- const HttpRequestHeaders& headers) OVERRIDE;
+ const HttpRequestHeaders& headers) override;
virtual int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
- GURL* allowed_unsafe_redirect_url) OVERRIDE;
+ GURL* allowed_unsafe_redirect_url) override;
virtual void OnBeforeRedirect(URLRequest* request,
- const GURL& new_location) OVERRIDE;
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE;
+ const GURL& new_location) override;
+ virtual void OnResponseStarted(URLRequest* request) override;
virtual void OnRawBytesRead(const URLRequest& request,
- int bytes_read) OVERRIDE;
- virtual void OnCompleted(URLRequest* request, bool started) OVERRIDE;
- virtual void OnURLRequestDestroyed(URLRequest* request) OVERRIDE;
+ int bytes_read) override;
+ virtual void OnCompleted(URLRequest* request, bool started) override;
+ virtual void OnURLRequestDestroyed(URLRequest* request) override;
virtual void OnPACScriptError(int line_number,
- const base::string16& error) OVERRIDE;
+ const base::string16& error) override;
virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
- AuthCredentials* credentials) OVERRIDE;
+ AuthCredentials* credentials) override;
virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) OVERRIDE;
+ const CookieList& cookie_list) override;
virtual bool OnCanSetCookie(const URLRequest& request,
const std::string& cookie_line,
- CookieOptions* options) OVERRIDE;
+ CookieOptions* options) override;
virtual bool OnCanAccessFile(const URLRequest& request,
- const base::FilePath& path) const OVERRIDE;
+ const base::FilePath& path) const override;
virtual bool OnCanThrottleRequest(
- const URLRequest& request) const OVERRIDE;
+ const URLRequest& request) const override;
virtual int OnBeforeSocketStreamConnect(
SocketStream* stream,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
const URLRequest& request,
const GURL& target_url,
- const GURL& referrer_url) const OVERRIDE;
+ const GURL& referrer_url) const override;
void InitRequestStatesIfNew(int request_id);
@@ -408,7 +408,7 @@
virtual URLRequestJob* MaybeCreateJob(
URLRequest* request,
- NetworkDelegate* network_delegate) const OVERRIDE;
+ NetworkDelegate* network_delegate) const override;
void set_main_intercept_job(URLRequestJob* job);
private:
diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc
index 5d0c43a..b812de8 100644
--- a/net/url_request/url_request_throttler_entry.cc
+++ b/net/url_request/url_request_throttler_entry.cc
@@ -54,12 +54,13 @@
// Returns NetLog parameters when a request is rejected by throttling.
base::Value* NetLogRejectedRequestCallback(const std::string* url_id,
int num_failures,
- int release_after_ms,
+ const base::TimeDelta& release_after,
NetLog::LogLevel /* log_level */) {
base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetString("url", *url_id);
dict->SetInteger("num_failures", num_failures);
- dict->SetInteger("release_after_ms", release_after_ms);
+ dict->SetInteger("release_after_ms",
+ static_cast<int>(release_after.InMilliseconds()));
return dict;
}
@@ -156,15 +157,12 @@
if (!is_backoff_disabled_ && !ExplicitUserRequest(request.load_flags()) &&
(!network_delegate || network_delegate->CanThrottleRequest(request)) &&
GetBackoffEntry()->ShouldRejectRequest()) {
- int num_failures = GetBackoffEntry()->failure_count();
- int release_after_ms =
- GetBackoffEntry()->GetTimeUntilRelease().InMilliseconds();
-
net_log_.AddEvent(
NetLog::TYPE_THROTTLING_REJECTED_REQUEST,
base::Bind(&NetLogRejectedRequestCallback,
- &url_id_, num_failures, release_after_ms));
-
+ &url_id_,
+ GetBackoffEntry()->failure_count(),
+ GetBackoffEntry()->GetTimeUntilRelease()));
reject_request = true;
}
diff --git a/net/url_request/url_request_throttler_entry.h b/net/url_request/url_request_throttler_entry.h
index a7a0524..489eecb 100644
--- a/net/url_request/url_request_throttler_entry.h
+++ b/net/url_request/url_request_throttler_entry.h
@@ -95,14 +95,14 @@
// Implementation of URLRequestThrottlerEntryInterface.
virtual bool ShouldRejectRequest(
const URLRequest& request,
- NetworkDelegate* network_delegate) const OVERRIDE;
+ NetworkDelegate* network_delegate) const override;
virtual int64 ReserveSendingTimeForNextRequest(
- const base::TimeTicks& earliest_time) OVERRIDE;
- virtual base::TimeTicks GetExponentialBackoffReleaseTime() const OVERRIDE;
+ const base::TimeTicks& earliest_time) override;
+ virtual base::TimeTicks GetExponentialBackoffReleaseTime() const override;
virtual void UpdateWithResponse(
const std::string& host,
- const URLRequestThrottlerHeaderInterface* response) OVERRIDE;
- virtual void ReceivedContentWasMalformed(int response_code) OVERRIDE;
+ const URLRequestThrottlerHeaderInterface* response) override;
+ virtual void ReceivedContentWasMalformed(int response_code) override;
protected:
virtual ~URLRequestThrottlerEntry();
diff --git a/net/url_request/url_request_throttler_header_adapter.h b/net/url_request/url_request_throttler_header_adapter.h
index 17a13a1..ddf7865 100644
--- a/net/url_request/url_request_throttler_header_adapter.h
+++ b/net/url_request/url_request_throttler_header_adapter.h
@@ -23,8 +23,8 @@
virtual ~URLRequestThrottlerHeaderAdapter();
// Implementation of URLRequestThrottlerHeaderInterface
- virtual std::string GetNormalizedValue(const std::string& key) const OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
+ virtual std::string GetNormalizedValue(const std::string& key) const override;
+ virtual int GetResponseCode() const override;
private:
const scoped_refptr<HttpResponseHeaders> response_header_;
diff --git a/net/url_request/url_request_throttler_manager.h b/net/url_request/url_request_throttler_manager.h
index 31d28ef..10c6561 100644
--- a/net/url_request/url_request_throttler_manager.h
+++ b/net/url_request/url_request_throttler_manager.h
@@ -78,11 +78,11 @@
NetLog* net_log() const;
// IPAddressObserver interface.
- virtual void OnIPAddressChanged() OVERRIDE;
+ virtual void OnIPAddressChanged() override;
// ConnectionTypeObserver interface.
virtual void OnConnectionTypeChanged(
- NetworkChangeNotifier::ConnectionType type) OVERRIDE;
+ NetworkChangeNotifier::ConnectionType type) override;
// Method that allows us to transform a URL into an ID that can be used in our
// map. Resulting IDs will be lowercase and consist of the scheme, host, port
diff --git a/net/url_request/url_request_throttler_simulation_unittest.cc b/net/url_request/url_request_throttler_simulation_unittest.cc
index d806376..2f3abbf 100644
--- a/net/url_request/url_request_throttler_simulation_unittest.cc
+++ b/net/url_request/url_request_throttler_simulation_unittest.cc
@@ -135,11 +135,11 @@
end_downtime_ = start_time + duration;
}
- virtual void AdvanceTime(const TimeTicks& absolute_time) OVERRIDE {
+ virtual void AdvanceTime(const TimeTicks& absolute_time) override {
now_ = absolute_time;
}
- virtual void PerformAction() OVERRIDE {
+ virtual void PerformAction() override {
// We are inserted at the end of the actor's list, so all Requester
// instances have already done their bit.
if (num_current_tick_queries_ > max_experienced_queries_per_tick_)
@@ -306,15 +306,15 @@
: URLRequestThrottlerEntry(manager, std::string()),
mock_backoff_entry_(&backoff_policy_) {}
- virtual const BackoffEntry* GetBackoffEntry() const OVERRIDE {
+ virtual const BackoffEntry* GetBackoffEntry() const override {
return &mock_backoff_entry_;
}
- virtual BackoffEntry* GetBackoffEntry() OVERRIDE {
+ virtual BackoffEntry* GetBackoffEntry() override {
return &mock_backoff_entry_;
}
- virtual TimeTicks ImplGetTimeNow() const OVERRIDE {
+ virtual TimeTicks ImplGetTimeNow() const override {
return fake_now_;
}
@@ -414,14 +414,14 @@
DCHECK(server_);
}
- virtual void AdvanceTime(const TimeTicks& absolute_time) OVERRIDE {
+ virtual void AdvanceTime(const TimeTicks& absolute_time) override {
if (time_of_last_success_.is_null())
time_of_last_success_ = absolute_time;
throttler_entry_->SetFakeNow(absolute_time);
}
- virtual void PerformAction() OVERRIDE {
+ virtual void PerformAction() override {
TimeDelta effective_delay = time_between_requests_;
TimeDelta current_jitter = TimeDelta::FromMilliseconds(
request_jitter_.InMilliseconds() * base::RandDouble());
diff --git a/net/url_request/url_request_throttler_test_support.h b/net/url_request/url_request_throttler_test_support.h
index fc28068..60a63b2 100644
--- a/net/url_request/url_request_throttler_test_support.h
+++ b/net/url_request/url_request_throttler_test_support.h
@@ -19,7 +19,7 @@
virtual ~MockBackoffEntry();
// BackoffEntry overrides.
- virtual base::TimeTicks ImplGetTimeNow() const OVERRIDE;
+ virtual base::TimeTicks ImplGetTimeNow() const override;
void set_fake_now(const base::TimeTicks& now);
@@ -45,8 +45,8 @@
virtual ~MockURLRequestThrottlerHeaderAdapter();
// URLRequestThrottlerHeaderInterface overrides.
- virtual std::string GetNormalizedValue(const std::string& key) const OVERRIDE;
- virtual int GetResponseCode() const OVERRIDE;
+ virtual std::string GetNormalizedValue(const std::string& key) const override;
+ virtual int GetResponseCode() const override;
private:
std::string fake_retry_value_;
diff --git a/net/url_request/url_request_throttler_unittest.cc b/net/url_request/url_request_throttler_unittest.cc
index a3fb410..4188b77 100644
--- a/net/url_request/url_request_throttler_unittest.cc
+++ b/net/url_request/url_request_throttler_unittest.cc
@@ -63,11 +63,11 @@
backoff_policy_.num_errors_to_ignore = 0;
}
- virtual const BackoffEntry* GetBackoffEntry() const OVERRIDE {
+ virtual const BackoffEntry* GetBackoffEntry() const override {
return &mock_backoff_entry_;
}
- virtual BackoffEntry* GetBackoffEntry() OVERRIDE {
+ virtual BackoffEntry* GetBackoffEntry() override {
return &mock_backoff_entry_;
}
@@ -85,7 +85,7 @@
}
// Overridden for tests.
- virtual TimeTicks ImplGetTimeNow() const OVERRIDE { return fake_time_now_; }
+ virtual TimeTicks ImplGetTimeNow() const override { return fake_time_now_; }
void set_exponential_backoff_release_time(
const base::TimeTicks& release_time) {
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index dbf858d..0f64a7c 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -31,6 +31,8 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/capturing_net_log.h"
+#include "net/base/chunked_upload_data_stream.h"
+#include "net/base/elements_upload_data_stream.h"
#include "net/base/load_flags.h"
#include "net/base/load_timing_info.h"
#include "net/base/load_timing_info_test_util.h"
@@ -242,10 +244,10 @@
return it != haystack.end();
}
-UploadDataStream* CreateSimpleUploadData(const char* data) {
+scoped_ptr<UploadDataStream> CreateSimpleUploadData(const char* data) {
scoped_ptr<UploadElementReader> reader(
new UploadBytesElementReader(data, strlen(data)));
- return UploadDataStream::CreateWithReader(reader.Pass(), 0);
+ return ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0);
}
// Verify that the SSLInfo of a successful SSL connection has valid values.
@@ -367,24 +369,24 @@
// TestNetworkDelegate implementation.
virtual int OnBeforeURLRequest(URLRequest* request,
const CompletionCallback& callback,
- GURL* new_url) OVERRIDE;
+ GURL* new_url) override;
virtual int OnBeforeSendHeaders(URLRequest* request,
const CompletionCallback& callback,
- HttpRequestHeaders* headers) OVERRIDE;
+ HttpRequestHeaders* headers) override;
virtual int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
- GURL* allowed_unsafe_redirect_url) OVERRIDE;
+ GURL* allowed_unsafe_redirect_url) override;
virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
- AuthCredentials* credentials) OVERRIDE;
+ AuthCredentials* credentials) override;
// Resets the callbacks and |stage_blocked_for_callback_|.
void Reset();
@@ -1103,7 +1105,7 @@
RestartTestJob(URLRequest* request, NetworkDelegate* network_delegate)
: URLRequestTestJob(request, network_delegate, true) {}
protected:
- virtual void StartAsync() OVERRIDE {
+ virtual void StartAsync() override {
this->NotifyRestartRequired();
}
private:
@@ -1115,7 +1117,7 @@
explicit CancelTestJob(URLRequest* request, NetworkDelegate* network_delegate)
: URLRequestTestJob(request, network_delegate, true) {}
protected:
- virtual void StartAsync() OVERRIDE {
+ virtual void StartAsync() override {
request_->Cancel();
}
private:
@@ -1129,7 +1131,7 @@
: URLRequestTestJob(request, network_delegate, true) {
}
protected:
- virtual void StartAsync() OVERRIDE {
+ virtual void StartAsync() override {
request_->Cancel();
this->NotifyRestartRequired();
}
@@ -1160,7 +1162,7 @@
virtual URLRequestJob* MaybeIntercept(
URLRequest* request,
- NetworkDelegate* network_delegate) OVERRIDE {
+ NetworkDelegate* network_delegate) override {
if (restart_main_request_) {
restart_main_request_ = false;
did_restart_main_ = true;
@@ -1198,7 +1200,7 @@
virtual URLRequestJob* MaybeInterceptRedirect(
URLRequest* request,
NetworkDelegate* network_delegate,
- const GURL& location) OVERRIDE {
+ const GURL& location) override {
if (cancel_redirect_request_) {
cancel_redirect_request_ = false;
did_cancel_redirect_ = true;
@@ -1216,7 +1218,7 @@
}
virtual URLRequestJob* MaybeInterceptResponse(
- URLRequest* request, NetworkDelegate* network_delegate) OVERRIDE {
+ URLRequest* request, NetworkDelegate* network_delegate) override {
if (cancel_final_request_) {
cancel_final_request_ = false;
did_cancel_final_ = true;
@@ -2402,7 +2404,7 @@
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
- GURL* allowed_unsafe_redirect_url) OVERRIDE;
+ GURL* allowed_unsafe_redirect_url) override;
private:
std::string fixed_date_;
@@ -2556,7 +2558,7 @@
redirect_url, DEFAULT_PRIORITY, &d, NULL));
req->set_method(request_method);
if (include_data) {
- req->set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
+ req->set_upload(CreateSimpleUploadData(kData));
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kContentLength,
base::UintToString(arraysize(kData) - 1));
@@ -2602,7 +2604,7 @@
test_server_.GetURL("echo"), DEFAULT_PRIORITY, &d, NULL));
r->set_method(method.c_str());
- r->set_upload(make_scoped_ptr(CreateSimpleUploadData(uploadBytes)));
+ r->set_upload(CreateSimpleUploadData(uploadBytes));
r->Start();
EXPECT_TRUE(r->is_pending());
@@ -3015,7 +3017,7 @@
scoped_ptr<URLRequest> r(context.CreateRequest(
original_url, DEFAULT_PRIORITY, &d, NULL));
r->set_method("POST");
- r->set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
+ r->set_upload(CreateSimpleUploadData(kData));
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kContentLength,
base::UintToString(arraysize(kData) - 1));
@@ -3994,14 +3996,14 @@
// NetworkDelegate implementation.
virtual int OnBeforeURLRequest(URLRequest* request,
const CompletionCallback& callback,
- GURL* new_url) OVERRIDE {
+ GURL* new_url) override {
TestNetworkDelegate::OnBeforeURLRequest(request, callback, new_url);
return RunCallbackAsynchronously(request, callback);
}
virtual int OnBeforeSendHeaders(URLRequest* request,
const CompletionCallback& callback,
- HttpRequestHeaders* headers) OVERRIDE {
+ HttpRequestHeaders* headers) override {
TestNetworkDelegate::OnBeforeSendHeaders(request, callback, headers);
return RunCallbackAsynchronously(request, callback);
}
@@ -4011,7 +4013,7 @@
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
- GURL* allowed_unsafe_redirect_url) OVERRIDE {
+ GURL* allowed_unsafe_redirect_url) override {
TestNetworkDelegate::OnHeadersReceived(request,
callback,
original_response_headers,
@@ -4024,7 +4026,7 @@
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
- AuthCredentials* credentials) OVERRIDE {
+ AuthCredentials* credentials) override {
AsyncDelegateLogger::Run(
request,
LOAD_STATE_WAITING_FOR_DELEGATE,
@@ -4086,7 +4088,7 @@
// URLRequest::Delegate implementation:
void virtual OnReceivedRedirect(URLRequest* request,
const RedirectInfo& redirect_info,
- bool* defer_redirect) OVERRIDE {
+ bool* defer_redirect) override {
*defer_redirect = true;
AsyncDelegateLogger::Run(
request,
@@ -4098,7 +4100,7 @@
base::Unretained(this), request, redirect_info));
}
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE {
+ virtual void OnResponseStarted(URLRequest* request) override {
AsyncDelegateLogger::Run(
request,
LOAD_STATE_WAITING_FOR_DELEGATE,
@@ -4110,7 +4112,7 @@
}
virtual void OnReadCompleted(URLRequest* request,
- int bytes_read) OVERRIDE {
+ int bytes_read) override {
AsyncDelegateLogger::Run(
request,
LOAD_STATE_IDLE,
@@ -4578,7 +4580,7 @@
class RedirectWithAdditionalHeadersDelegate : public TestDelegate {
virtual void OnReceivedRedirect(URLRequest* request,
const RedirectInfo& redirect_info,
- bool* defer_redirect) OVERRIDE {
+ bool* defer_redirect) override {
TestDelegate::OnReceivedRedirect(request, redirect_info, defer_redirect);
request->SetExtraRequestHeaderByName(kExtraHeader, kExtraValue, false);
}
@@ -4615,7 +4617,7 @@
class RedirectWithHeaderRemovalDelegate : public TestDelegate {
virtual void OnReceivedRedirect(URLRequest* request,
const RedirectInfo& redirect_info,
- bool* defer_redirect) OVERRIDE {
+ bool* defer_redirect) override {
TestDelegate::OnReceivedRedirect(request, redirect_info, defer_redirect);
request->RemoveRequestHeaderByName(kExtraHeaderToRemove);
}
@@ -4828,8 +4830,8 @@
0,
kuint64max,
base::Time()));
- r->set_upload(make_scoped_ptr(
- new UploadDataStream(element_readers.Pass(), 0)));
+ r->set_upload(make_scoped_ptr<UploadDataStream>(
+ new ElementsUploadDataStream(element_readers.Pass(), 0)));
r->Start();
EXPECT_TRUE(r->is_pending());
@@ -4871,8 +4873,8 @@
0,
kuint64max,
base::Time()));
- r->set_upload(make_scoped_ptr(
- new UploadDataStream(element_readers.Pass(), 0)));
+ r->set_upload(make_scoped_ptr<UploadDataStream>(
+ new ElementsUploadDataStream(element_readers.Pass(), 0)));
r->Start();
EXPECT_TRUE(r->is_pending());
@@ -5949,7 +5951,7 @@
test_server_.GetURL("files/redirect-to-echoall"), DEFAULT_PRIORITY, &d,
NULL));
req->set_method("POST");
- req->set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
+ req->set_upload(CreateSimpleUploadData(kData));
// Set headers (some of which are specific to the POST).
HttpRequestHeaders headers;
@@ -6136,7 +6138,7 @@
scoped_ptr<URLRequest> req(default_context_.CreateRequest(
test_server_.GetURL("empty.html"), DEFAULT_PRIORITY, &d, NULL));
req->set_method("POST");
- req->set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
+ req->set_upload(CreateSimpleUploadData(kData));
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kContentLength,
base::UintToString(arraysize(kData) - 1));
@@ -6161,7 +6163,7 @@
scoped_ptr<URLRequest> req(default_context_.CreateRequest(
test_server_.GetURL("empty.html"), DEFAULT_PRIORITY, &d, NULL));
req->set_method("POST");
- req->set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
+ req->set_upload(CreateSimpleUploadData(kData));
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kContentLength,
base::UintToString(arraysize(kData) - 1));
@@ -6720,7 +6722,7 @@
test_server.host_port_pair().port())),
DEFAULT_PRIORITY, &d, NULL));
req->set_method("POST");
- req->set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
+ req->set_upload(CreateSimpleUploadData(kData));
req->Start();
base::RunLoop().Run();
@@ -6811,7 +6813,7 @@
}
virtual void OnCertificateRequested(
URLRequest* request,
- SSLCertRequestInfo* cert_request_info) OVERRIDE {
+ SSLCertRequestInfo* cert_request_info) override {
on_certificate_requested_count_++;
base::MessageLoop::current()->Quit();
}
@@ -6934,6 +6936,28 @@
}
}
+// AssertTwoDistinctSessionsInserted checks that |session_info|, which must be
+// the result of fetching "ssl-session-cache" from the test server, indicates
+// that exactly two different sessions were inserted, with no lookups etc.
+static void AssertTwoDistinctSessionsInserted(const string& session_info) {
+ std::vector<std::string> lines;
+ base::SplitString(session_info, '\n', &lines);
+ ASSERT_EQ(3u, lines.size()) << session_info;
+
+ std::string session_id;
+ for (size_t i = 0; i < 2; i++) {
+ std::vector<std::string> parts;
+ base::SplitString(lines[i], '\t', &parts);
+ ASSERT_EQ(2u, parts.size());
+ EXPECT_EQ("insert", parts[0]);
+ if (i == 0) {
+ session_id = parts[1];
+ } else {
+ EXPECT_NE(session_id, parts[1]);
+ }
+ }
+}
+
TEST_F(HTTPSRequestTest, SSLSessionCacheShardTest) {
// Test that sessions aren't resumed when the value of ssl_session_cache_shard
// differs.
@@ -6997,22 +7021,7 @@
// three lines.
EXPECT_EQ(1, d.response_started_count());
- std::vector<std::string> lines;
- base::SplitString(d.data_received(), '\n', &lines);
- ASSERT_EQ(3u, lines.size());
-
- std::string session_id;
- for (size_t i = 0; i < 2; i++) {
- std::vector<std::string> parts;
- base::SplitString(lines[i], '\t', &parts);
- ASSERT_EQ(2u, parts.size());
- EXPECT_EQ("insert", parts[0]);
- if (i == 0) {
- session_id = parts[1];
- } else {
- EXPECT_NE(session_id, parts[1]);
- }
- }
+ AssertTwoDistinctSessionsInserted(d.data_received());
}
}
@@ -7067,17 +7076,70 @@
#endif // OS_WIN
+class TestSSLConfigService : public SSLConfigService {
+ public:
+ TestSSLConfigService(bool ev_enabled,
+ bool online_rev_checking,
+ bool rev_checking_required_local_anchors)
+ : ev_enabled_(ev_enabled),
+ online_rev_checking_(online_rev_checking),
+ rev_checking_required_local_anchors_(
+ rev_checking_required_local_anchors),
+ fallback_min_version_(0) {}
+
+ void set_fallback_min_version(uint16 version) {
+ fallback_min_version_ = version;
+ }
+
+ // SSLConfigService:
+ virtual void GetSSLConfig(SSLConfig* config) override {
+ *config = SSLConfig();
+ config->rev_checking_enabled = online_rev_checking_;
+ config->verify_ev_cert = ev_enabled_;
+ config->rev_checking_required_local_anchors =
+ rev_checking_required_local_anchors_;
+ if (fallback_min_version_) {
+ config->version_fallback_min = fallback_min_version_;
+ }
+ }
+
+ protected:
+ virtual ~TestSSLConfigService() {}
+
+ private:
+ const bool ev_enabled_;
+ const bool online_rev_checking_;
+ const bool rev_checking_required_local_anchors_;
+ uint16 fallback_min_version_;
+};
+
+class FallbackTestURLRequestContext : public TestURLRequestContext {
+ public:
+ explicit FallbackTestURLRequestContext(bool delay_initialization)
+ : TestURLRequestContext(delay_initialization) {}
+
+ void set_fallback_min_version(uint16 version) {
+ TestSSLConfigService *ssl_config_service =
+ new TestSSLConfigService(true /* check for EV */,
+ false /* online revocation checking */,
+ false /* require rev. checking for local
+ anchors */);
+ ssl_config_service->set_fallback_min_version(version);
+ set_ssl_config_service(ssl_config_service);
+ }
+};
+
class HTTPSFallbackTest : public testing::Test {
public:
- HTTPSFallbackTest() : context_(true) {
- context_.Init();
- delegate_.set_allow_certificate_errors(true);
- }
+ HTTPSFallbackTest() : context_(true) {}
virtual ~HTTPSFallbackTest() {}
protected:
void DoFallbackTest(const SpawnedTestServer::SSLOptions& ssl_options) {
DCHECK(!request_);
+ context_.Init();
+ delegate_.set_allow_certificate_errors(true);
+
SpawnedTestServer test_server(
SpawnedTestServer::TYPE_HTTPS,
ssl_options,
@@ -7091,6 +7153,10 @@
base::RunLoop().Run();
}
+ void set_fallback_min_version(uint16 version) {
+ context_.set_fallback_min_version(version);
+ }
+
void ExpectConnection(int version) {
EXPECT_EQ(1, delegate_.response_started_count());
EXPECT_NE(0, delegate_.bytes_received());
@@ -7109,7 +7175,7 @@
private:
TestDelegate delegate_;
- TestURLRequestContext context_;
+ FallbackTestURLRequestContext context_;
scoped_ptr<URLRequest> request_;
};
@@ -7185,7 +7251,7 @@
ExpectFailure(ERR_CONNECTION_CLOSED);
}
-// Tests that the SSLv3 fallback triggers on alert.
+// Tests that the SSLv3 fallback doesn't happen by default.
TEST_F(HTTPSFallbackTest, SSLv3Fallback) {
SpawnedTestServer::SSLOptions ssl_options(
SpawnedTestServer::SSLOptions::CERT_OK);
@@ -7193,10 +7259,23 @@
SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL;
ASSERT_NO_FATAL_FAILURE(DoFallbackTest(ssl_options));
+ ExpectFailure(ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION);
+}
+
+// Tests that the SSLv3 fallback works when explicitly enabled.
+TEST_F(HTTPSFallbackTest, SSLv3FallbackEnabled) {
+ SpawnedTestServer::SSLOptions ssl_options(
+ SpawnedTestServer::SSLOptions::CERT_OK);
+ ssl_options.tls_intolerant =
+ SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL;
+ set_fallback_min_version(SSL_PROTOCOL_VERSION_SSL3);
+
+ ASSERT_NO_FATAL_FAILURE(DoFallbackTest(ssl_options));
ExpectConnection(SSL_CONNECTION_VERSION_SSL3);
}
-// Tests that the SSLv3 fallback triggers on closed connections.
+// Tests that the SSLv3 fallback triggers on closed connections when explicitly
+// enabled.
TEST_F(HTTPSFallbackTest, SSLv3FallbackClosed) {
SpawnedTestServer::SSLOptions ssl_options(
SpawnedTestServer::SSLOptions::CERT_OK);
@@ -7204,11 +7283,81 @@
SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL;
ssl_options.tls_intolerance_type =
SpawnedTestServer::SSLOptions::TLS_INTOLERANCE_CLOSE;
+ set_fallback_min_version(SSL_PROTOCOL_VERSION_SSL3);
ASSERT_NO_FATAL_FAILURE(DoFallbackTest(ssl_options));
ExpectConnection(SSL_CONNECTION_VERSION_SSL3);
}
+// Test that SSLv3 fallback probe connections don't cause sessions to be cached.
+TEST_F(HTTPSRequestTest, SSLv3FallbackNoCache) {
+ SpawnedTestServer::SSLOptions ssl_options(
+ SpawnedTestServer::SSLOptions::CERT_OK);
+ ssl_options.tls_intolerant =
+ SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL;
+ ssl_options.tls_intolerance_type =
+ SpawnedTestServer::SSLOptions::TLS_INTOLERANCE_CLOSE;
+ ssl_options.record_resume = true;
+
+ SpawnedTestServer test_server(
+ SpawnedTestServer::TYPE_HTTPS,
+ ssl_options,
+ base::FilePath(FILE_PATH_LITERAL("net/data/ssl")));
+ ASSERT_TRUE(test_server.Start());
+
+ SSLClientSocket::ClearSessionCache();
+
+ // Make a connection that does a probe fallback to SSLv3 but fails because
+ // SSLv3 fallback is disabled. We don't wish a session for this connection to
+ // be inserted locally.
+ {
+ TestDelegate delegate;
+ FallbackTestURLRequestContext context(true);
+
+ context.Init();
+ scoped_ptr<URLRequest> request(context.CreateRequest(
+ test_server.GetURL(std::string()), DEFAULT_PRIORITY, &delegate, NULL));
+ request->Start();
+
+ base::RunLoop().Run();
+
+ EXPECT_EQ(1, delegate.response_started_count());
+ EXPECT_FALSE(request->status().is_success());
+ EXPECT_EQ(URLRequestStatus::FAILED, request->status().status());
+ EXPECT_EQ(ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION,
+ request->status().error());
+ }
+
+ // Now allow SSLv3 connections and request the session cache log.
+ {
+ TestDelegate delegate;
+ FallbackTestURLRequestContext context(true);
+ context.set_fallback_min_version(SSL_PROTOCOL_VERSION_SSL3);
+
+ context.Init();
+ scoped_ptr<URLRequest> request(
+ context.CreateRequest(test_server.GetURL("ssl-session-cache"),
+ DEFAULT_PRIORITY,
+ &delegate,
+ NULL));
+ request->Start();
+
+ base::RunLoop().Run();
+
+ EXPECT_EQ(1, delegate.response_started_count());
+ EXPECT_NE(0, delegate.bytes_received());
+ EXPECT_EQ(SSL_CONNECTION_VERSION_SSL3, SSLConnectionStatusToVersion(
+ request->ssl_info().connection_status));
+ EXPECT_TRUE(request->ssl_info().connection_status &
+ SSL_CONNECTION_VERSION_FALLBACK);
+
+ std::vector<std::string> lines;
+ // If no sessions were cached then the server should have seen two sessions
+ // inserted with no lookups.
+ AssertTwoDistinctSessionsInserted(delegate.data_received());
+ }
+}
+
// This test is disabled on Android because the remote test server doesn't cause
// a TCP reset.
#if !defined(OS_ANDROID)
@@ -7301,53 +7450,10 @@
// insert xyz
EXPECT_EQ(1, d.response_started_count());
- std::vector<std::string> lines;
- base::SplitString(d.data_received(), '\n', &lines);
- ASSERT_EQ(3u, lines.size()) << d.data_received();
-
- std::string session_id;
- for (size_t i = 0; i < 2; i++) {
- std::vector<std::string> parts;
- base::SplitString(lines[i], '\t', &parts);
- ASSERT_EQ(2u, parts.size());
- EXPECT_EQ("insert", parts[0]);
- if (i == 0) {
- session_id = parts[1];
- } else {
- EXPECT_NE(session_id, parts[1]);
- }
- }
+ AssertTwoDistinctSessionsInserted(d.data_received());
}
}
-class TestSSLConfigService : public SSLConfigService {
- public:
- TestSSLConfigService(bool ev_enabled,
- bool online_rev_checking,
- bool rev_checking_required_local_anchors)
- : ev_enabled_(ev_enabled),
- online_rev_checking_(online_rev_checking),
- rev_checking_required_local_anchors_(
- rev_checking_required_local_anchors) {}
-
- // SSLConfigService:
- virtual void GetSSLConfig(SSLConfig* config) OVERRIDE {
- *config = SSLConfig();
- config->rev_checking_enabled = online_rev_checking_;
- config->verify_ev_cert = ev_enabled_;
- config->rev_checking_required_local_anchors =
- rev_checking_required_local_anchors_;
- }
-
- protected:
- virtual ~TestSSLConfigService() {}
-
- private:
- const bool ev_enabled_;
- const bool online_rev_checking_;
- const bool rev_checking_required_local_anchors_;
-};
-
// This the fingerprint of the "Testing CA" certificate used by the testserver.
// See net/data/ssl/certificates/ocsp-test-root.pem.
static const SHA1HashValue kOCSPTestCertFingerprint =
@@ -7377,7 +7483,7 @@
kOCSPTestCertPolicy)) {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
SetupContext(&context_);
context_.Init();
@@ -7558,7 +7664,7 @@
class HTTPSHardFailTest : public HTTPSOCSPTest {
protected:
- virtual void SetupContext(URLRequestContext* context) OVERRIDE {
+ virtual void SetupContext(URLRequestContext* context) override {
context->set_ssl_config_service(
new TestSSLConfigService(false /* check for EV */,
false /* online revocation checking */,
@@ -7596,7 +7702,7 @@
class HTTPSEVCRLSetTest : public HTTPSOCSPTest {
protected:
- virtual void SetupContext(URLRequestContext* context) OVERRIDE {
+ virtual void SetupContext(URLRequestContext* context) override {
context->set_ssl_config_service(
new TestSSLConfigService(true /* check for EV */,
false /* online revocation checking */,
@@ -7781,7 +7887,7 @@
class HTTPSCRLSetTest : public HTTPSOCSPTest {
protected:
- virtual void SetupContext(URLRequestContext* context) OVERRIDE {
+ virtual void SetupContext(URLRequestContext* context) override {
context->set_ssl_config_service(
new TestSSLConfigService(false /* check for EV */,
false /* online revocation checking */,
diff --git a/net/websockets/websocket_basic_handshake_stream.h b/net/websockets/websocket_basic_handshake_stream.h
index 51f0c4d..cc8f5bf 100644
--- a/net/websockets/websocket_basic_handshake_stream.h
+++ b/net/websockets/websocket_basic_handshake_stream.h
@@ -42,35 +42,35 @@
virtual int InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& net_log,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int SendRequest(const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
- const CompletionCallback& callback) OVERRIDE;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
virtual int ReadResponseBody(IOBuffer* buf,
int buf_len,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Close(bool not_reusable) OVERRIDE;
- virtual bool IsResponseBodyComplete() const OVERRIDE;
- virtual bool CanFindEndOfResponse() const OVERRIDE;
- virtual bool IsConnectionReused() const OVERRIDE;
- virtual void SetConnectionReused() OVERRIDE;
- virtual bool IsConnectionReusable() const OVERRIDE;
- virtual int64 GetTotalReceivedBytes() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void Close(bool not_reusable) override;
+ virtual bool IsResponseBodyComplete() const override;
+ virtual bool CanFindEndOfResponse() const override;
+ virtual bool IsConnectionReused() const override;
+ virtual void SetConnectionReused() override;
+ virtual bool IsConnectionReusable() const override;
+ virtual int64 GetTotalReceivedBytes() const override;
virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const
- OVERRIDE;
- virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
+ override;
+ virtual void GetSSLInfo(SSLInfo* ssl_info) override;
virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) OVERRIDE;
- virtual bool IsSpdyHttpStream() const OVERRIDE;
- virtual void Drain(HttpNetworkSession* session) OVERRIDE;
- virtual void SetPriority(RequestPriority priority) OVERRIDE;
+ SSLCertRequestInfo* cert_request_info) override;
+ virtual bool IsSpdyHttpStream() const override;
+ virtual void Drain(HttpNetworkSession* session) override;
+ virtual void SetPriority(RequestPriority priority) override;
// This is called from the top level once correct handshake response headers
// have been received. It creates an appropriate subclass of WebSocketStream
// depending on what extensions were negotiated. This object is unusable after
// Upgrade() has been called and should be disposed of as soon as possible.
- virtual scoped_ptr<WebSocketStream> Upgrade() OVERRIDE;
+ virtual scoped_ptr<WebSocketStream> Upgrade() override;
// Set the value used for the next Sec-WebSocket-Key header
// deterministically. The key is only used once, and then discarded.
diff --git a/net/websockets/websocket_basic_stream.cc b/net/websockets/websocket_basic_stream.cc
index af2444d..2890a9e 100644
--- a/net/websockets/websocket_basic_stream.cc
+++ b/net/websockets/websocket_basic_stream.cc
@@ -47,22 +47,22 @@
// masked bit of the frames on.
int CalculateSerializedSizeAndTurnOnMaskBit(
ScopedVector<WebSocketFrame>* frames) {
- const int kMaximumTotalSize = std::numeric_limits<int>::max();
+ const uint64 kMaximumTotalSize = std::numeric_limits<int>::max();
- int total_size = 0;
+ uint64 total_size = 0;
for (WebSocketFrameIterator it = frames->begin(); it != frames->end(); ++it) {
WebSocketFrame* frame = *it;
// Force the masked bit on.
frame->header.masked = true;
// We enforce flow control so the renderer should never be able to force us
// to cache anywhere near 2GB of frames.
- int frame_size = frame->header.payload_length +
- GetWebSocketFrameHeaderSize(frame->header);
- CHECK_GE(kMaximumTotalSize - total_size, frame_size)
+ uint64 frame_size = frame->header.payload_length +
+ GetWebSocketFrameHeaderSize(frame->header);
+ CHECK_LE(frame_size, kMaximumTotalSize - total_size)
<< "Aborting to prevent overflow";
total_size += frame_size;
}
- return total_size;
+ return static_cast<int>(total_size);
}
} // namespace
@@ -157,9 +157,9 @@
dest += result;
remaining_size -= result;
- const int frame_size = frame->header.payload_length;
+ CHECK_LE(frame->header.payload_length, static_cast<uint64>(remaining_size));
+ const int frame_size = static_cast<int>(frame->header.payload_length);
if (frame_size > 0) {
- CHECK_GE(remaining_size, frame_size);
const char* const frame_data = frame->data->data();
std::copy(frame_data, frame_data + frame_size, dest);
MaskWebSocketFramePayload(mask, 0, dest, frame_size);
diff --git a/net/websockets/websocket_basic_stream.h b/net/websockets/websocket_basic_stream.h
index ccfebd8..ed2f195 100644
--- a/net/websockets/websocket_basic_stream.h
+++ b/net/websockets/websocket_basic_stream.h
@@ -44,16 +44,16 @@
// WebSocketStream implementation.
virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
- virtual void Close() OVERRIDE;
+ virtual void Close() override;
- virtual std::string GetSubProtocol() const OVERRIDE;
+ virtual std::string GetSubProtocol() const override;
- virtual std::string GetExtensions() const OVERRIDE;
+ virtual std::string GetExtensions() const override;
////////////////////////////////////////////////////////////////////////////
// Methods for testing only.
diff --git a/net/websockets/websocket_basic_stream_test.cc b/net/websockets/websocket_basic_stream_test.cc
index c67583d..a658fcf 100644
--- a/net/websockets/websocket_basic_stream_test.cc
+++ b/net/websockets/websocket_basic_stream_test.cc
@@ -237,7 +237,7 @@
protected:
// All write tests use the same frame, so it is easiest to create it during
// test creation.
- virtual void SetUp() OVERRIDE { PrepareWriteFrame(); }
+ virtual void SetUp() override { PrepareWriteFrame(); }
// Creates a WebSocketFrame with a wire format matching kWriteFrame and adds
// it to |frames_|.
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index 8c264f1..9585dc2 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -85,9 +85,6 @@
return ((upper - kInvalidRanges) % 2) == 0;
}
-// This function avoids a bunch of boilerplate code.
-void AllowUnused(ChannelState ALLOW_UNUSED unused) {}
-
// Sets |name| to the name of the frame type for the given |opcode|. Note that
// for all of Text, Binary and Continuation opcode, this method returns
// "Data frame".
@@ -141,7 +138,7 @@
// The total size of the payload data in |frames_|. This will be used to
// measure the throughput of the link.
// TODO(ricea): Measure the throughput of the link.
- size_t total_bytes_;
+ uint64 total_bytes_;
};
void WebSocketChannel::SendBuffer::AddFrame(scoped_ptr<WebSocketFrame> frame) {
@@ -156,23 +153,23 @@
public:
explicit ConnectDelegate(WebSocketChannel* creator) : creator_(creator) {}
- virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) OVERRIDE {
+ virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) override {
creator_->OnConnectSuccess(stream.Pass());
// |this| may have been deleted.
}
- virtual void OnFailure(const std::string& message) OVERRIDE {
+ virtual void OnFailure(const std::string& message) override {
creator_->OnConnectFailure(message);
// |this| has been deleted.
}
virtual void OnStartOpeningHandshake(
- scoped_ptr<WebSocketHandshakeRequestInfo> request) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
creator_->OnStartOpeningHandshake(request.Pass());
}
virtual void OnFinishOpeningHandshake(
- scoped_ptr<WebSocketHandshakeResponseInfo> response) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
creator_->OnFinishOpeningHandshake(response.Pass());
}
@@ -180,7 +177,7 @@
scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks>
ssl_error_callbacks,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE {
+ bool fatal) override {
creator_->OnSSLCertificateError(
ssl_error_callbacks.Pass(), ssl_info, fatal);
}
@@ -240,7 +237,7 @@
// Do nothing if |sender| is already destructed.
if (sender) {
WebSocketChannel* channel = sender->owner_;
- AllowUnused(sender->SendImmediately(channel->event_interface_.get()));
+ sender->SendImmediately(channel->event_interface_.get());
}
}
@@ -269,8 +266,8 @@
bool final,
WebSocketFrameHeader::OpCode opcode,
const scoped_refptr<IOBuffer>& data,
- size_t offset,
- size_t size)
+ uint64 offset,
+ uint64 size)
: final_(final),
opcode_(opcode),
data_(data),
@@ -284,7 +281,7 @@
opcode_ = WebSocketFrameHeader::kOpCodeContinuation;
}
-void WebSocketChannel::PendingReceivedFrame::DidConsume(size_t bytes) {
+void WebSocketChannel::PendingReceivedFrame::DidConsume(uint64 bytes) {
DCHECK_LE(offset_, size_);
DCHECK_LE(bytes, size_ - offset_);
offset_ += bytes;
@@ -374,7 +371,7 @@
}
if (data.size() > base::checked_cast<size_t>(current_send_quota_)) {
// TODO(ricea): Kill renderer.
- AllowUnused(
+ ignore_result(
FailChannel("Send quota exceeded", kWebSocketErrorGoingAway, ""));
// |this| has been deleted.
return;
@@ -393,7 +390,7 @@
if (state == StreamingUtf8Validator::INVALID ||
(state == StreamingUtf8Validator::VALID_MIDPOINT && fin)) {
// TODO(ricea): Kill renderer.
- AllowUnused(
+ ignore_result(
FailChannel("Browser sent a text frame containing invalid UTF-8",
kWebSocketErrorGoingAway,
""));
@@ -410,7 +407,7 @@
// server is not saturated.
scoped_refptr<IOBuffer> buffer(new IOBuffer(data.size()));
std::copy(data.begin(), data.end(), buffer->data());
- AllowUnused(SendFrameFromIOBuffer(fin, op_code, buffer, data.size()));
+ ignore_result(SendFrameFromIOBuffer(fin, op_code, buffer, data.size()));
// |this| may have been deleted.
}
@@ -422,13 +419,13 @@
DCHECK_GE(quota, 0);
DCHECK_LE(quota, INT_MAX);
if (!pending_received_frames_.empty()) {
- DCHECK_EQ(0, current_receive_quota_);
+ DCHECK_EQ(0u, current_receive_quota_);
}
while (!pending_received_frames_.empty() && quota > 0) {
PendingReceivedFrame& front = pending_received_frames_.front();
- const size_t data_size = front.size() - front.offset();
- const size_t bytes_to_send =
- std::min(base::checked_cast<size_t>(quota), data_size);
+ const uint64 data_size = front.size() - front.offset();
+ const uint64 bytes_to_send =
+ std::min(base::checked_cast<uint64>(quota), data_size);
const bool final = front.final() && data_size == bytes_to_send;
const char* data =
front.data().get() ? front.data()->data() + front.offset() : NULL;
@@ -445,9 +442,7 @@
front.ResetOpcode();
return;
}
- const int64 signed_bytes_to_send = base::checked_cast<int64>(bytes_to_send);
- DCHECK_GE(quota, signed_bytes_to_send);
- quota -= signed_bytes_to_send;
+ quota -= bytes_to_send;
pending_received_frames_.pop();
}
@@ -456,9 +451,9 @@
const bool start_read =
current_receive_quota_ == 0 && quota > 0 &&
(state_ == CONNECTED || state_ == SEND_CLOSED || state_ == CLOSE_WAIT);
- current_receive_quota_ += base::checked_cast<int>(quota);
+ current_receive_quota_ += quota;
if (start_read)
- AllowUnused(ReadFrames());
+ ignore_result(ReadFrames());
// |this| may have been deleted.
}
@@ -475,7 +470,7 @@
// Abort the in-progress handshake and drop the connection immediately.
stream_request_.reset();
SetState(CLOSED);
- AllowUnused(DoDropChannel(false, kWebSocketErrorAbnormalClosure, ""));
+ DoDropChannel(false, kWebSocketErrorAbnormalClosure, "");
return;
}
if (state_ != CONNECTED) {
@@ -529,7 +524,7 @@
if (!socket_url.SchemeIsWSOrWSS()) {
// TODO(ricea): Kill the renderer (this error should have been caught by
// Javascript).
- AllowUnused(event_interface_->OnAddChannelResponse(true, "", ""));
+ ignore_result(event_interface_->OnAddChannelResponse(true, "", ""));
// |this| is deleted here.
return;
}
@@ -568,7 +563,7 @@
// |stream_request_| is not used once the connection has succeeded.
stream_request_.reset();
- AllowUnused(ReadFrames());
+ ignore_result(ReadFrames());
// |this| may have been deleted.
}
@@ -586,7 +581,7 @@
// |this| has been deleted.
return;
}
- AllowUnused(event_interface_->OnFailChannel(message_copy));
+ ignore_result(event_interface_->OnFailChannel(message_copy));
// |this| has been deleted.
}
@@ -594,7 +589,7 @@
scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks> ssl_error_callbacks,
const SSLInfo& ssl_info,
bool fatal) {
- AllowUnused(event_interface_->OnSSLCertificateError(
+ ignore_result(event_interface_->OnSSLCertificateError(
ssl_error_callbacks.Pass(), socket_url_, ssl_info, fatal));
}
@@ -793,7 +788,7 @@
const WebSocketFrameHeader::OpCode opcode,
bool final,
const scoped_refptr<IOBuffer>& data_buffer,
- size_t size) {
+ uint64 size) {
DCHECK_NE(RECV_CLOSED, state_)
<< "HandleFrame() does not support being called re-entrantly from within "
"SendClose()";
@@ -881,7 +876,7 @@
WebSocketFrameHeader::OpCode opcode,
bool final,
const scoped_refptr<IOBuffer>& data_buffer,
- size_t size) {
+ uint64 size) {
if (state_ != CONNECTED) {
DVLOG(3) << "Ignored data packet received in state " << state_;
return CHANNEL_ALIVE;
@@ -914,7 +909,7 @@
// This call is not redundant when size == 0 because it tells us what
// the current state is.
StreamingUtf8Validator::State state = incoming_utf8_validator_.AddBytes(
- size ? data_buffer->data() : NULL, size);
+ size ? data_buffer->data() : NULL, static_cast<size_t>(size));
if (state == StreamingUtf8Validator::INVALID ||
(state == StreamingUtf8Validator::VALID_MIDPOINT && final)) {
return FailChannel("Could not decode a text frame as UTF-8.",
@@ -928,8 +923,7 @@
return CHANNEL_ALIVE;
initial_frame_forwarded_ = !final;
- if (size > base::checked_cast<size_t>(current_receive_quota_) ||
- !pending_received_frames_.empty()) {
+ if (size > current_receive_quota_ || !pending_received_frames_.empty()) {
const bool no_quota = (current_receive_quota_ == 0);
DCHECK(no_quota || pending_received_frames_.empty());
DVLOG(3) << "Queueing frame to renderer due to quota. quota="
@@ -949,7 +943,6 @@
const char* const data_end = data_begin + size;
const std::vector<char> data(data_begin, data_end);
current_receive_quota_ -= size;
- DCHECK_GE(current_receive_quota_, 0);
// Sends the received frame to the renderer process.
return event_interface_->OnDataFrame(final, opcode_to_send, data);
@@ -959,7 +952,7 @@
bool fin,
WebSocketFrameHeader::OpCode op_code,
const scoped_refptr<IOBuffer>& buffer,
- size_t size) {
+ uint64 size) {
DCHECK(state_ == CONNECTED || state_ == RECV_CLOSED);
DCHECK(stream_);
@@ -1012,7 +1005,7 @@
DCHECK(state_ == CONNECTED || state_ == RECV_CLOSED);
DCHECK_LE(reason.size(), kMaximumCloseReasonLength);
scoped_refptr<IOBuffer> body;
- size_t size = 0;
+ uint64 size = 0;
if (code == kWebSocketErrorNoStatusReceived) {
// Special case: translate kWebSocketErrorNoStatusReceived into a Close
// frame with no payload.
@@ -1042,7 +1035,7 @@
}
bool WebSocketChannel::ParseClose(const scoped_refptr<IOBuffer>& buffer,
- size_t size,
+ uint64 size,
uint16* code,
std::string* reason,
std::string* message) {
@@ -1109,7 +1102,7 @@
void WebSocketChannel::CloseTimeout() {
stream_->Close();
SetState(CLOSED);
- AllowUnused(DoDropChannel(false, kWebSocketErrorAbnormalClosure, ""));
+ DoDropChannel(false, kWebSocketErrorAbnormalClosure, "");
// |this| has been deleted.
}
diff --git a/net/websockets/websocket_channel.h b/net/websockets/websocket_channel.h
index 6d5640e..a79ec4b 100644
--- a/net/websockets/websocket_channel.h
+++ b/net/websockets/websocket_channel.h
@@ -130,8 +130,8 @@
PendingReceivedFrame(bool final,
WebSocketFrameHeader::OpCode opcode,
const scoped_refptr<IOBuffer>& data,
- size_t offset,
- size_t size);
+ uint64 offset,
+ uint64 size);
~PendingReceivedFrame();
bool final() const { return final_; }
@@ -139,10 +139,10 @@
// ResetOpcode() to Continuation.
void ResetOpcode();
const scoped_refptr<IOBuffer>& data() const { return data_; }
- size_t offset() const { return offset_; }
- size_t size() const { return size_; }
+ uint64 offset() const { return offset_; }
+ uint64 size() const { return size_; }
// Increase |offset_| by |bytes|.
- void DidConsume(size_t bytes);
+ void DidConsume(uint64 bytes);
// This object needs to be copyable and assignable, since it will be placed
// in a std::queue. The compiler-generated copy constructor and assignment
@@ -154,9 +154,9 @@
scoped_refptr<IOBuffer> data_;
// Where to start reading from data_. Everything prior to offset_ has
// already been sent to the browser.
- size_t offset_;
+ uint64 offset_;
// The size of data_.
- size_t size_;
+ uint64 size_;
};
// Methods which return a value of type ChannelState may delete |this|. If the
@@ -259,7 +259,7 @@
const WebSocketFrameHeader::OpCode opcode,
bool final,
const scoped_refptr<IOBuffer>& data_buffer,
- size_t size) WARN_UNUSED_RESULT;
+ uint64 size) WARN_UNUSED_RESULT;
// Forward a received data frame to the renderer, if connected. If
// |expecting_continuation| is not equal to |expecting_to_read_continuation_|,
@@ -267,7 +267,7 @@
ChannelState HandleDataFrame(WebSocketFrameHeader::OpCode opcode,
bool final,
const scoped_refptr<IOBuffer>& data_buffer,
- size_t size) WARN_UNUSED_RESULT;
+ uint64 size) WARN_UNUSED_RESULT;
// Low-level method to send a single frame. Used for both data and control
// frames. Either sends the frame immediately or buffers it to be scheduled
@@ -277,7 +277,7 @@
ChannelState SendFrameFromIOBuffer(bool fin,
WebSocketFrameHeader::OpCode op_code,
const scoped_refptr<IOBuffer>& buffer,
- size_t size) WARN_UNUSED_RESULT;
+ uint64 size) WARN_UNUSED_RESULT;
// Performs the "Fail the WebSocket Connection" operation as defined in
// RFC6455. A NotifyFailure message is sent to the renderer with |message|.
@@ -306,7 +306,7 @@
// then false is returned and |message| is set to an appropriate console
// message.
bool ParseClose(const scoped_refptr<IOBuffer>& buffer,
- size_t size,
+ uint64 size,
uint16* code,
std::string* reason,
std::string* message);
@@ -368,7 +368,7 @@
int current_send_quota_;
// The remaining amount of quota that the renderer will allow us to send on
// this logical channel (quota units).
- int current_receive_quota_;
+ uint64 current_receive_quota_;
// Timer for the closing handshake.
base::OneShotTimer<WebSocketChannel> timer_;
diff --git a/net/websockets/websocket_channel_test.cc b/net/websockets/websocket_channel_test.cc
index 42c1ed6..6535741 100644
--- a/net/websockets/websocket_channel_test.cc
+++ b/net/websockets/websocket_channel_test.cc
@@ -163,12 +163,12 @@
// We can't use GMock with scoped_ptr.
ChannelState OnStartOpeningHandshake(
- scoped_ptr<WebSocketHandshakeRequestInfo>) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeRequestInfo>) override {
OnStartOpeningHandshakeCalled();
return CHANNEL_ALIVE;
}
ChannelState OnFinishOpeningHandshake(
- scoped_ptr<WebSocketHandshakeResponseInfo>) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeResponseInfo>) override {
OnFinishOpeningHandshakeCalled();
return CHANNEL_ALIVE;
}
@@ -176,7 +176,7 @@
scoped_ptr<SSLErrorCallbacks> ssl_error_callbacks,
const GURL& url,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE {
+ bool fatal) override {
OnSSLCertificateErrorCalled(
ssl_error_callbacks.get(), url, ssl_info, fatal);
return CHANNEL_ALIVE;
@@ -195,39 +195,39 @@
virtual ChannelState OnAddChannelResponse(
bool fail,
const std::string& selected_protocol,
- const std::string& extensions) OVERRIDE {
+ const std::string& extensions) override {
return fail ? CHANNEL_DELETED : CHANNEL_ALIVE;
}
virtual ChannelState OnDataFrame(bool fin,
WebSocketMessageType type,
- const std::vector<char>& data) OVERRIDE {
+ const std::vector<char>& data) override {
return CHANNEL_ALIVE;
}
- virtual ChannelState OnFlowControl(int64 quota) OVERRIDE {
+ virtual ChannelState OnFlowControl(int64 quota) override {
return CHANNEL_ALIVE;
}
- virtual ChannelState OnClosingHandshake() OVERRIDE { return CHANNEL_ALIVE; }
- virtual ChannelState OnFailChannel(const std::string& message) OVERRIDE {
+ virtual ChannelState OnClosingHandshake() override { return CHANNEL_ALIVE; }
+ virtual ChannelState OnFailChannel(const std::string& message) override {
return CHANNEL_DELETED;
}
virtual ChannelState OnDropChannel(bool was_clean,
uint16 code,
- const std::string& reason) OVERRIDE {
+ const std::string& reason) override {
return CHANNEL_DELETED;
}
virtual ChannelState OnStartOpeningHandshake(
- scoped_ptr<WebSocketHandshakeRequestInfo> request) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
return CHANNEL_ALIVE;
}
virtual ChannelState OnFinishOpeningHandshake(
- scoped_ptr<WebSocketHandshakeResponseInfo> response) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
return CHANNEL_ALIVE;
}
virtual ChannelState OnSSLCertificateError(
scoped_ptr<SSLErrorCallbacks> ssl_error_callbacks,
const GURL& url,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE {
+ bool fatal) override {
return CHANNEL_ALIVE;
}
};
@@ -246,22 +246,22 @@
: protocol_(protocol), extensions_(extensions) {}
virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual void Close() OVERRIDE {}
+ virtual void Close() override {}
// Returns the string passed to the constructor.
- virtual std::string GetSubProtocol() const OVERRIDE { return protocol_; }
+ virtual std::string GetSubProtocol() const override { return protocol_; }
// Returns the string passed to the constructor.
- virtual std::string GetExtensions() const OVERRIDE { return extensions_; }
+ virtual std::string GetExtensions() const override { return extensions_; }
private:
// The string to return from GetSubProtocol().
@@ -493,7 +493,7 @@
}
virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
CHECK(!read_frames_pending_);
if (index_ >= responses_.size())
return ERR_IO_PENDING;
@@ -550,7 +550,7 @@
class WriteableFakeWebSocketStream : public FakeWebSocketStream {
public:
virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return OK;
}
};
@@ -559,7 +559,7 @@
class UnWriteableFakeWebSocketStream : public FakeWebSocketStream {
public:
virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
return ERR_CONNECTION_RESET;
}
};
@@ -575,7 +575,7 @@
EchoeyFakeWebSocketStream() : read_frames_(NULL), done_(false) {}
virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
// Users of WebSocketStream will not expect the ReadFrames() callback to be
// called from within WriteFrames(), so post it to the message loop instead.
stored_frames_.insert(stored_frames_.end(), frames->begin(), frames->end());
@@ -585,7 +585,7 @@
}
virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
read_callback_ = callback;
read_frames_ = frames;
if (done_)
@@ -648,7 +648,7 @@
ResetOnWriteFakeWebSocketStream() : closed_(false), weak_ptr_factory_(this) {}
virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&ResetOnWriteFakeWebSocketStream::CallCallbackUnlessClosed,
@@ -665,12 +665,12 @@
}
virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
read_callback_ = callback;
return ERR_IO_PENDING;
}
- virtual void Close() OVERRIDE { closed_ = true; }
+ virtual void Close() override { closed_ = true; }
private:
void CallCallbackUnlessClosed(const CompletionCallback& callback, int value) {
@@ -736,8 +736,8 @@
class FakeSSLErrorCallbacks
: public WebSocketEventInterface::SSLErrorCallbacks {
public:
- virtual void CancelSSLRequest(int error, const SSLInfo* ssl_info) OVERRIDE {}
- virtual void ContinueSSLRequest() OVERRIDE {}
+ virtual void CancelSSLRequest(int error, const SSLInfo* ssl_info) override {}
+ virtual void ContinueSSLRequest() override {}
};
// Base class for all test fixtures.
@@ -850,7 +850,7 @@
EVENT_ON_SSL_CERTIFICATE_ERROR) {}
// Create a ChannelDeletingFakeWebSocketEventInterface. Defined out-of-line to
// avoid circular dependency.
- virtual scoped_ptr<WebSocketEventInterface> CreateEventInterface() OVERRIDE;
+ virtual scoped_ptr<WebSocketEventInterface> CreateEventInterface() override;
// Tests can set deleting_ to a bitmap of EventInterfaceCall members that they
// want to cause Channel deletion. The default is for all calls to cause
@@ -870,47 +870,47 @@
virtual ChannelState OnAddChannelResponse(
bool fail,
const std::string& selected_protocol,
- const std::string& extensions) OVERRIDE {
+ const std::string& extensions) override {
return fixture_->DeleteIfDeleting(EVENT_ON_ADD_CHANNEL_RESPONSE);
}
virtual ChannelState OnDataFrame(bool fin,
WebSocketMessageType type,
- const std::vector<char>& data) OVERRIDE {
+ const std::vector<char>& data) override {
return fixture_->DeleteIfDeleting(EVENT_ON_DATA_FRAME);
}
- virtual ChannelState OnFlowControl(int64 quota) OVERRIDE {
+ virtual ChannelState OnFlowControl(int64 quota) override {
return fixture_->DeleteIfDeleting(EVENT_ON_FLOW_CONTROL);
}
- virtual ChannelState OnClosingHandshake() OVERRIDE {
+ virtual ChannelState OnClosingHandshake() override {
return fixture_->DeleteIfDeleting(EVENT_ON_CLOSING_HANDSHAKE);
}
- virtual ChannelState OnFailChannel(const std::string& message) OVERRIDE {
+ virtual ChannelState OnFailChannel(const std::string& message) override {
return fixture_->DeleteIfDeleting(EVENT_ON_FAIL_CHANNEL);
}
virtual ChannelState OnDropChannel(bool was_clean,
uint16 code,
- const std::string& reason) OVERRIDE {
+ const std::string& reason) override {
return fixture_->DeleteIfDeleting(EVENT_ON_DROP_CHANNEL);
}
virtual ChannelState OnStartOpeningHandshake(
- scoped_ptr<WebSocketHandshakeRequestInfo> request) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
return fixture_->DeleteIfDeleting(EVENT_ON_START_OPENING_HANDSHAKE);
}
virtual ChannelState OnFinishOpeningHandshake(
- scoped_ptr<WebSocketHandshakeResponseInfo> response) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
return fixture_->DeleteIfDeleting(EVENT_ON_FINISH_OPENING_HANDSHAKE);
}
virtual ChannelState OnSSLCertificateError(
scoped_ptr<SSLErrorCallbacks> ssl_error_callbacks,
const GURL& url,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE {
+ bool fatal) override {
return fixture_->DeleteIfDeleting(EVENT_ON_SSL_CERTIFICATE_ERROR);
}
@@ -949,7 +949,7 @@
// object before calling CreateChannelAndConnect() or
// CreateChannelAndConnectSuccessfully(). This will only work once per test
// case, but once should be enough.
- virtual scoped_ptr<WebSocketEventInterface> CreateEventInterface() OVERRIDE {
+ virtual scoped_ptr<WebSocketEventInterface> CreateEventInterface() override {
return scoped_ptr<WebSocketEventInterface>(event_interface_.release());
}
@@ -963,7 +963,7 @@
WebSocketChannelStreamTest()
: mock_stream_(new StrictMock<MockWebSocketStream>) {}
- virtual void CreateChannelAndConnectSuccessfully() OVERRIDE {
+ virtual void CreateChannelAndConnectSuccessfully() override {
set_stream(mock_stream_.Pass());
WebSocketChannelTest::CreateChannelAndConnectSuccessfully();
}
@@ -3317,7 +3317,7 @@
protected:
WebSocketChannelStreamTimeoutTest() {}
- virtual void CreateChannelAndConnectSuccessfully() OVERRIDE {
+ virtual void CreateChannelAndConnectSuccessfully() override {
set_stream(mock_stream_.Pass());
CreateChannelAndConnect();
channel_->SendFlowControl(kPlentyOfQuota);
diff --git a/net/websockets/websocket_deflate_predictor_impl.h b/net/websockets/websocket_deflate_predictor_impl.h
index 88a919c..d6b52c4 100644
--- a/net/websockets/websocket_deflate_predictor_impl.h
+++ b/net/websockets/websocket_deflate_predictor_impl.h
@@ -21,9 +21,9 @@
virtual ~WebSocketDeflatePredictorImpl() {}
virtual Result Predict(const ScopedVector<WebSocketFrame>& frames,
- size_t frame_index) OVERRIDE;
- virtual void RecordInputDataFrame(const WebSocketFrame* frame) OVERRIDE;
- virtual void RecordWrittenDataFrame(const WebSocketFrame* frame) OVERRIDE;
+ size_t frame_index) override;
+ virtual void RecordInputDataFrame(const WebSocketFrame* frame) override;
+ virtual void RecordWrittenDataFrame(const WebSocketFrame* frame) override;
};
} // namespace net
diff --git a/net/websockets/websocket_deflate_stream.cc b/net/websockets/websocket_deflate_stream.cc
index f3d293a..6666bef 100644
--- a/net/websockets/websocket_deflate_stream.cc
+++ b/net/websockets/websocket_deflate_stream.cc
@@ -133,8 +133,9 @@
current_writing_opcode_ = WebSocketFrameHeader::kOpCodeContinuation;
} else {
if (frame->data.get() &&
- !deflater_.AddBytes(frame->data->data(),
- frame->header.payload_length)) {
+ !deflater_.AddBytes(
+ frame->data->data(),
+ static_cast<size_t>(frame->header.payload_length))) {
DVLOG(1) << "WebSocket protocol error. "
<< "deflater_.AddBytes() returns an error.";
return ERR_WS_PROTOCOL_ERROR;
@@ -312,8 +313,9 @@
} else {
DCHECK_EQ(reading_state_, READING_COMPRESSED_MESSAGE);
if (frame->data.get() &&
- !inflater_.AddBytes(frame->data->data(),
- frame->header.payload_length)) {
+ !inflater_.AddBytes(
+ frame->data->data(),
+ static_cast<size_t>(frame->header.payload_length))) {
DVLOG(1) << "WebSocket protocol error. "
<< "inflater_.AddBytes() returns an error.";
return ERR_WS_PROTOCOL_ERROR;
diff --git a/net/websockets/websocket_deflate_stream.h b/net/websockets/websocket_deflate_stream.h
index 39ac2df..8f939ec 100644
--- a/net/websockets/websocket_deflate_stream.h
+++ b/net/websockets/websocket_deflate_stream.h
@@ -47,12 +47,12 @@
// WebSocketStream functions.
virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) override;
virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual std::string GetSubProtocol() const OVERRIDE;
- virtual std::string GetExtensions() const OVERRIDE;
+ const CompletionCallback& callback) override;
+ virtual void Close() override;
+ virtual std::string GetSubProtocol() const override;
+ virtual std::string GetExtensions() const override;
private:
enum ReadingState {
diff --git a/net/websockets/websocket_deflate_stream_test.cc b/net/websockets/websocket_deflate_stream_test.cc
index 590f616..4f1c418 100644
--- a/net/websockets/websocket_deflate_stream_test.cc
+++ b/net/websockets/websocket_deflate_stream_test.cc
@@ -125,10 +125,10 @@
// WebSocketDeflatePredictor functions.
virtual Result Predict(const ScopedVector<WebSocketFrame>& frames,
- size_t frame_index) OVERRIDE {
+ size_t frame_index) override {
return result_;
}
- virtual void RecordInputDataFrame(const WebSocketFrame* frame) OVERRIDE {
+ virtual void RecordInputDataFrame(const WebSocketFrame* frame) override {
if (!WebSocketFrameHeader::IsKnownDataOpCode(frame->header.opcode)) {
ADD_FAILURE() << "Control frames should not be recorded.";
return;
@@ -147,7 +147,7 @@
}
frames_to_be_input_.pop_front();
}
- virtual void RecordWrittenDataFrame(const WebSocketFrame* frame) OVERRIDE {
+ virtual void RecordWrittenDataFrame(const WebSocketFrame* frame) override {
if (!WebSocketFrameHeader::IsKnownDataOpCode(frame->header.opcode)) {
ADD_FAILURE() << "Control frames should not be recorded.";
return;
diff --git a/net/websockets/websocket_frame_parser.cc b/net/websockets/websocket_frame_parser.cc
index 2e4c58f..d00a1d1 100644
--- a/net/websockets/websocket_frame_parser.cc
+++ b/net/websockets/websocket_frame_parser.cc
@@ -171,13 +171,11 @@
scoped_ptr<WebSocketFrameChunk> WebSocketFrameParser::DecodeFramePayload(
bool first_chunk) {
- const char* current = &buffer_.front() + current_read_pos_;
- const char* end = &buffer_.front() + buffer_.size();
- uint64 next_size = std::min<uint64>(
- end - current, current_frame_header_->payload_length - frame_offset_);
- // This check must pass because |payload_length| is already checked to be
+ // The cast here is safe because |payload_length| is already checked to be
// less than std::numeric_limits<int>::max() when the header is parsed.
- DCHECK_LE(next_size, static_cast<uint64>(kint32max));
+ int next_size = static_cast<int>(std::min(
+ static_cast<uint64>(buffer_.size() - current_read_pos_),
+ current_frame_header_->payload_length - frame_offset_));
scoped_ptr<WebSocketFrameChunk> frame_chunk(new WebSocketFrameChunk);
if (first_chunk) {
@@ -187,7 +185,7 @@
if (next_size) {
frame_chunk->data = new IOBufferWithSize(static_cast<int>(next_size));
char* io_data = frame_chunk->data->data();
- memcpy(io_data, current, next_size);
+ memcpy(io_data, &buffer_.front() + current_read_pos_, next_size);
if (current_frame_header_->masked) {
// The masking function is its own inverse, so we use the same function to
// unmask as to mask.
diff --git a/net/websockets/websocket_handshake_stream_create_helper.h b/net/websockets/websocket_handshake_stream_create_helper.h
index fd9ab74..aad2644 100644
--- a/net/websockets/websocket_handshake_stream_create_helper.h
+++ b/net/websockets/websocket_handshake_stream_create_helper.h
@@ -38,12 +38,12 @@
// Create a WebSocketBasicHandshakeStream.
virtual WebSocketHandshakeStreamBase* CreateBasicStream(
scoped_ptr<ClientSocketHandle> connection,
- bool using_proxy) OVERRIDE;
+ bool using_proxy) override;
// Unimplemented as of November 2013.
virtual WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<SpdySession>& session,
- bool use_relative_url) OVERRIDE;
+ bool use_relative_url) override;
// Call Upgrade() on the WebSocketHandshakeStream and return the result. This
// must only be called if the handshake succeeded.
diff --git a/net/websockets/websocket_handshake_stream_create_helper_test.cc b/net/websockets/websocket_handshake_stream_create_helper_test.cc
index 88b868f..a776acd 100644
--- a/net/websockets/websocket_handshake_stream_create_helper_test.cc
+++ b/net/websockets/websocket_handshake_stream_create_helper_test.cc
@@ -61,17 +61,17 @@
public:
virtual ~TestConnectDelegate() {}
- virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) OVERRIDE {}
- virtual void OnFailure(const std::string& failure_message) OVERRIDE {}
+ virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) override {}
+ virtual void OnFailure(const std::string& failure_message) override {}
virtual void OnStartOpeningHandshake(
- scoped_ptr<WebSocketHandshakeRequestInfo> request) OVERRIDE {}
+ scoped_ptr<WebSocketHandshakeRequestInfo> request) override {}
virtual void OnFinishOpeningHandshake(
- scoped_ptr<WebSocketHandshakeResponseInfo> response) OVERRIDE {}
+ scoped_ptr<WebSocketHandshakeResponseInfo> response) override {}
virtual void OnSSLCertificateError(
scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks>
ssl_error_callbacks,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE {}
+ bool fatal) override {}
};
class WebSocketHandshakeStreamCreateHelperTest : public ::testing::Test {
diff --git a/net/websockets/websocket_job.h b/net/websockets/websocket_job.h
index 2e90a24..924fdd0 100644
--- a/net/websockets/websocket_job.h
+++ b/net/websockets/websocket_job.h
@@ -50,37 +50,37 @@
static void EnsureInit();
State state() const { return state_; }
- virtual void Connect() OVERRIDE;
- virtual bool SendData(const char* data, int len) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void RestartWithAuth(const AuthCredentials& credentials) OVERRIDE;
- virtual void DetachDelegate() OVERRIDE;
+ virtual void Connect() override;
+ virtual bool SendData(const char* data, int len) override;
+ virtual void Close() override;
+ virtual void RestartWithAuth(const AuthCredentials& credentials) override;
+ virtual void DetachDelegate() override;
// SocketStream::Delegate methods.
virtual int OnStartOpenConnection(
- SocketStream* socket, const CompletionCallback& callback) OVERRIDE;
+ SocketStream* socket, const CompletionCallback& callback) override;
virtual void OnConnected(SocketStream* socket,
- int max_pending_send_allowed) OVERRIDE;
- virtual void OnSentData(SocketStream* socket, int amount_sent) OVERRIDE;
+ int max_pending_send_allowed) override;
+ virtual void OnSentData(SocketStream* socket, int amount_sent) override;
virtual void OnReceivedData(SocketStream* socket,
const char* data,
- int len) OVERRIDE;
- virtual void OnClose(SocketStream* socket) OVERRIDE;
+ int len) override;
+ virtual void OnClose(SocketStream* socket) override;
virtual void OnAuthRequired(
- SocketStream* socket, AuthChallengeInfo* auth_info) OVERRIDE;
+ SocketStream* socket, AuthChallengeInfo* auth_info) override;
virtual void OnSSLCertificateError(SocketStream* socket,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE;
- virtual void OnError(const SocketStream* socket, int error) OVERRIDE;
+ bool fatal) override;
+ virtual void OnError(const SocketStream* socket, int error) override;
// SpdyWebSocketStream::Delegate methods.
- virtual void OnCreatedSpdyStream(int status) OVERRIDE;
- virtual void OnSentSpdyHeaders() OVERRIDE;
+ virtual void OnCreatedSpdyStream(int status) override;
+ virtual void OnSentSpdyHeaders() override;
virtual void OnSpdyResponseHeadersUpdated(
- const SpdyHeaderBlock& response_headers) OVERRIDE;
- virtual void OnSentSpdyData(size_t bytes_sent) OVERRIDE;
- virtual void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) OVERRIDE;
- virtual void OnCloseSpdyStream() OVERRIDE;
+ const SpdyHeaderBlock& response_headers) override;
+ virtual void OnSentSpdyData(size_t bytes_sent) override;
+ virtual void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) override;
+ virtual void OnCloseSpdyStream() override;
private:
friend class WebSocketThrottle;
diff --git a/net/websockets/websocket_job_test.cc b/net/websockets/websocket_job_test.cc
index 59d529a..9cf3144 100644
--- a/net/websockets/websocket_job_test.cc
+++ b/net/websockets/websocket_job_test.cc
@@ -45,18 +45,18 @@
URLRequestContext* context, CookieStore* cookie_store)
: SocketStream(url, delegate, context, cookie_store) {}
- virtual void Connect() OVERRIDE {}
- virtual bool SendData(const char* data, int len) OVERRIDE {
+ virtual void Connect() override {}
+ virtual bool SendData(const char* data, int len) override {
sent_data_ += std::string(data, len);
return true;
}
- virtual void Close() OVERRIDE {}
+ virtual void Close() override {}
virtual void RestartWithAuth(
- const AuthCredentials& credentials) OVERRIDE {
+ const AuthCredentials& credentials) override {
}
- virtual void DetachDelegate() OVERRIDE {
+ virtual void DetachDelegate() override {
delegate_ = NULL;
}
@@ -98,40 +98,40 @@
virtual int OnStartOpenConnection(
SocketStream* socket,
- const CompletionCallback& callback) OVERRIDE {
+ const CompletionCallback& callback) override {
if (!on_start_open_connection_.is_null())
on_start_open_connection_.Run();
return OK;
}
virtual void OnConnected(SocketStream* socket,
- int max_pending_send_allowed) OVERRIDE {
+ int max_pending_send_allowed) override {
if (!on_connected_.is_null())
on_connected_.Run();
}
virtual void OnSentData(SocketStream* socket,
- int amount_sent) OVERRIDE {
+ int amount_sent) override {
amount_sent_ += amount_sent;
if (!on_sent_data_.is_null())
on_sent_data_.Run();
}
virtual void OnReceivedData(SocketStream* socket,
- const char* data, int len) OVERRIDE {
+ const char* data, int len) override {
received_data_ += std::string(data, len);
if (!on_received_data_.is_null())
on_received_data_.Run();
}
- virtual void OnClose(SocketStream* socket) OVERRIDE {
+ virtual void OnClose(SocketStream* socket) override {
if (!on_close_.is_null())
on_close_.Run();
}
virtual bool CanGetCookies(SocketStream* socket,
- const GURL& url) OVERRIDE {
+ const GURL& url) override {
return allow_all_cookies_;
}
virtual bool CanSetCookie(SocketStream* request,
const GURL& url,
const std::string& cookie_line,
- CookieOptions* options) OVERRIDE {
+ CookieOptions* options) override {
return allow_all_cookies_;
}
@@ -190,7 +190,7 @@
const GURL& url,
const std::string& cookie_line,
const CookieOptions& options,
- const SetCookiesCallback& callback) OVERRIDE {
+ const SetCookiesCallback& callback) override {
bool result = SetCookieWithOptions(url, cookie_line, options);
if (!callback.is_null())
callback.Run(result);
@@ -199,27 +199,27 @@
virtual void GetCookiesWithOptionsAsync(
const GURL& url,
const CookieOptions& options,
- const GetCookiesCallback& callback) OVERRIDE {
+ const GetCookiesCallback& callback) override {
if (!callback.is_null())
callback.Run(GetCookiesWithOptions(url, options));
}
virtual void GetAllCookiesForURLAsync(
const GURL& url,
- const GetCookieListCallback& callback) OVERRIDE {
+ const GetCookieListCallback& callback) override {
ADD_FAILURE();
}
virtual void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
- const base::Closure& callback) OVERRIDE {
+ const base::Closure& callback) override {
ADD_FAILURE();
}
virtual void DeleteAllCreatedBetweenAsync(
const base::Time& delete_begin,
const base::Time& delete_end,
- const DeleteCallback& callback) OVERRIDE {
+ const DeleteCallback& callback) override {
ADD_FAILURE();
}
@@ -227,15 +227,15 @@
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
- const DeleteCallback& callback) OVERRIDE {
+ const DeleteCallback& callback) override {
ADD_FAILURE();
}
- virtual void DeleteSessionCookiesAsync(const DeleteCallback&) OVERRIDE {
+ virtual void DeleteSessionCookiesAsync(const DeleteCallback&) override {
ADD_FAILURE();
}
- virtual CookieMonster* GetCookieMonster() OVERRIDE { return NULL; }
+ virtual CookieMonster* GetCookieMonster() override { return NULL; }
const std::vector<Entry>& entries() const { return entries_; }
@@ -248,7 +248,7 @@
class MockSSLConfigService : public SSLConfigService {
public:
- virtual void GetSSLConfig(SSLConfig* config) OVERRIDE {}
+ virtual void GetSSLConfig(SSLConfig* config) override {}
protected:
virtual ~MockSSLConfigService() {}
@@ -298,17 +298,17 @@
virtual int CreateTransaction(
RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) OVERRIDE {
+ scoped_ptr<HttpTransaction>* trans) override {
NOTREACHED();
return ERR_UNEXPECTED;
}
- virtual HttpCache* GetCache() OVERRIDE {
+ virtual HttpCache* GetCache() override {
NOTREACHED();
return NULL;
}
- virtual HttpNetworkSession* GetSession() OVERRIDE {
+ virtual HttpNetworkSession* GetSession() override {
return http_session_.get();
}
@@ -350,34 +350,34 @@
// OnStartOpenConnection() is not implemented by SocketStreamDispatcherHost
virtual void OnConnected(SocketStream* socket,
- int max_pending_send_allowed) OVERRIDE {
+ int max_pending_send_allowed) override {
DeleteJobMaybe();
}
- virtual void OnSentData(SocketStream* socket, int amount_sent) OVERRIDE {
+ virtual void OnSentData(SocketStream* socket, int amount_sent) override {
DeleteJobMaybe();
}
virtual void OnReceivedData(SocketStream* socket,
const char* data,
- int len) OVERRIDE {
+ int len) override {
DeleteJobMaybe();
}
- virtual void OnClose(SocketStream* socket) OVERRIDE { DeleteJobMaybe(); }
+ virtual void OnClose(SocketStream* socket) override { DeleteJobMaybe(); }
virtual void OnAuthRequired(SocketStream* socket,
- AuthChallengeInfo* auth_info) OVERRIDE {
+ AuthChallengeInfo* auth_info) override {
DeleteJobMaybe();
}
virtual void OnSSLCertificateError(SocketStream* socket,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE {
+ bool fatal) override {
DeleteJobMaybe();
}
- virtual void OnError(const SocketStream* socket, int error) OVERRIDE {
+ virtual void OnError(const SocketStream* socket, int error) override {
DeleteJobMaybe();
}
@@ -398,12 +398,12 @@
: spdy_util_(GetParam()),
enable_websocket_over_spdy_(false) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
stream_type_ = STREAM_INVALID;
cookie_store_ = new MockCookieStore;
context_.reset(new MockURLRequestContext(cookie_store_.get()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
cookie_store_ = NULL;
context_.reset();
websocket_ = NULL;
diff --git a/net/websockets/websocket_stream.cc b/net/websockets/websocket_stream.cc
index be2bc16..90cb7ca 100644
--- a/net/websockets/websocket_stream.cc
+++ b/net/websockets/websocket_stream.cc
@@ -56,7 +56,7 @@
// Implementation of URLRequest::Delegate methods.
virtual void OnReceivedRedirect(URLRequest* request,
const RedirectInfo& redirect_info,
- bool* defer_redirect) OVERRIDE {
+ bool* defer_redirect) override {
// HTTP status codes returned by HttpStreamParser are filtered by
// WebSocketBasicHandshakeStream, and only 101, 401 and 407 are permitted
// back up the stack to HttpNetworkTransaction. In particular, redirect
@@ -65,20 +65,20 @@
NOTREACHED();
}
- virtual void OnResponseStarted(URLRequest* request) OVERRIDE;
+ virtual void OnResponseStarted(URLRequest* request) override;
virtual void OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info) OVERRIDE;
+ AuthChallengeInfo* auth_info) override;
virtual void OnCertificateRequested(URLRequest* request,
SSLCertRequestInfo* cert_request_info)
- OVERRIDE;
+ override;
virtual void OnSSLCertificateError(URLRequest* request,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE;
+ bool fatal) override;
- virtual void OnReadCompleted(URLRequest* request, int bytes_read) OVERRIDE;
+ virtual void OnReadCompleted(URLRequest* request, int bytes_read) override;
private:
StreamRequestImpl* owner_;
@@ -206,7 +206,7 @@
explicit SSLErrorCallbacks(URLRequest* url_request)
: url_request_(url_request) {}
- virtual void CancelSSLRequest(int error, const SSLInfo* ssl_info) OVERRIDE {
+ virtual void CancelSSLRequest(int error, const SSLInfo* ssl_info) override {
if (ssl_info) {
url_request_->CancelWithSSLError(error, *ssl_info);
} else {
@@ -214,7 +214,7 @@
}
}
- virtual void ContinueSSLRequest() OVERRIDE {
+ virtual void ContinueSSLRequest() override {
url_request_->ContinueDespiteLastError();
}
diff --git a/net/websockets/websocket_stream_test.cc b/net/websockets/websocket_stream_test.cc
index c90777f..0b7ae4e 100644
--- a/net/websockets/websocket_stream_test.cc
+++ b/net/websockets/websocket_stream_test.cc
@@ -99,7 +99,7 @@
: WebSocketHandshakeStreamCreateHelper(connect_delegate,
requested_subprotocols) {}
- virtual void OnStreamCreated(WebSocketBasicHandshakeStream* stream) OVERRIDE {
+ virtual void OnStreamCreated(WebSocketBasicHandshakeStream* stream) override {
stream->SetWebSocketKeyForTesting("dGhlIHNhbXBsZSBub25jZQ==");
}
};
@@ -201,23 +201,23 @@
explicit TestConnectDelegate(WebSocketStreamCreateTest* owner)
: owner_(owner) {}
- virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) OVERRIDE {
+ virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) override {
stream.swap(owner_->stream_);
}
- virtual void OnFailure(const std::string& message) OVERRIDE {
+ virtual void OnFailure(const std::string& message) override {
owner_->has_failed_ = true;
owner_->failure_message_ = message;
}
virtual void OnStartOpeningHandshake(
- scoped_ptr<WebSocketHandshakeRequestInfo> request) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
// Can be called multiple times (in the case of HTTP auth). Last call
// wins.
owner_->request_info_ = request.Pass();
}
virtual void OnFinishOpeningHandshake(
- scoped_ptr<WebSocketHandshakeResponseInfo> response) OVERRIDE {
+ scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
if (owner_->response_info_)
ADD_FAILURE();
owner_->response_info_ = response.Pass();
@@ -226,7 +226,7 @@
scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks>
ssl_error_callbacks,
const SSLInfo& ssl_info,
- bool fatal) OVERRIDE {
+ bool fatal) override {
owner_->ssl_error_callbacks_ = ssl_error_callbacks.Pass();
owner_->ssl_info_ = ssl_info;
owner_->ssl_fatal_ = fatal;
@@ -408,7 +408,7 @@
};
class StreamCreation : public WebSocketStreamCreateTest {
- virtual void TestBody() OVERRIDE {}
+ virtual void TestBody() override {}
};
scoped_ptr<base::HistogramSamples> GetSamples(const std::string& name) {
diff --git a/net/websockets/websocket_throttle_test.cc b/net/websockets/websocket_throttle_test.cc
index 4d93001..a743e93 100644
--- a/net/websockets/websocket_throttle_test.cc
+++ b/net/websockets/websocket_throttle_test.cc
@@ -25,12 +25,12 @@
DummySocketStreamDelegate() {}
virtual ~DummySocketStreamDelegate() {}
virtual void OnConnected(
- SocketStream* socket, int max_pending_send_allowed) OVERRIDE {}
+ SocketStream* socket, int max_pending_send_allowed) override {}
virtual void OnSentData(SocketStream* socket,
- int amount_sent) OVERRIDE {}
+ int amount_sent) override {}
virtual void OnReceivedData(SocketStream* socket,
- const char* data, int len) OVERRIDE {}
- virtual void OnClose(SocketStream* socket) OVERRIDE {}
+ const char* data, int len) override {}
+ virtual void OnClose(SocketStream* socket) override {}
};
class WebSocketThrottleTestContext : public TestURLRequestContext {
diff --git a/skia/OWNERS b/skia/OWNERS
index 4f48079..d9d0a8b 100644
--- a/skia/OWNERS
+++ b/skia/OWNERS
@@ -17,5 +17,3 @@
thakis@chromium.org
tomhudson@google.com
vandebo@chromium.org
-
-
diff --git a/skia/ext/SkDiscardableMemory_chrome.h b/skia/ext/SkDiscardableMemory_chrome.h
index b251dc4..18088c5 100644
--- a/skia/ext/SkDiscardableMemory_chrome.h
+++ b/skia/ext/SkDiscardableMemory_chrome.h
@@ -16,9 +16,9 @@
virtual ~SkDiscardableMemoryChrome();
// SkDiscardableMemory:
- virtual bool lock() OVERRIDE;
- virtual void* data() OVERRIDE;
- virtual void unlock() OVERRIDE;
+ virtual bool lock() override;
+ virtual void* data() override;
+ virtual void unlock() override;
private:
friend class SkDiscardableMemory;
diff --git a/skia/ext/analysis_canvas.h b/skia/ext/analysis_canvas.h
index 8cbd4d1..d3d3b80 100644
--- a/skia/ext/analysis_canvas.h
+++ b/skia/ext/analysis_canvas.h
@@ -27,37 +27,37 @@
void SetForceNotTransparent(bool flag);
// SkDrawPictureCallback override.
- virtual bool abortDrawing() OVERRIDE;
+ virtual bool abortDrawing() override;
// SkCanvas overrides.
- virtual void clear(SkColor) OVERRIDE;
- virtual void drawPaint(const SkPaint& paint) OVERRIDE;
+ virtual void clear(SkColor) override;
+ virtual void drawPaint(const SkPaint& paint) override;
virtual void drawPoints(PointMode,
size_t count,
const SkPoint pts[],
- const SkPaint&) OVERRIDE;
- virtual void drawOval(const SkRect&, const SkPaint&) OVERRIDE;
- virtual void drawRect(const SkRect&, const SkPaint&) OVERRIDE;
- virtual void drawRRect(const SkRRect&, const SkPaint&) OVERRIDE;
- virtual void drawPath(const SkPath& path, const SkPaint&) OVERRIDE;
+ const SkPaint&) override;
+ virtual void drawOval(const SkRect&, const SkPaint&) override;
+ virtual void drawRect(const SkRect&, const SkPaint&) override;
+ virtual void drawRRect(const SkRRect&, const SkPaint&) override;
+ virtual void drawPath(const SkPath& path, const SkPaint&) override;
virtual void drawBitmap(const SkBitmap&,
SkScalar left,
SkScalar top,
- const SkPaint* paint = NULL) OVERRIDE;
+ const SkPaint* paint = NULL) override;
virtual void drawBitmapRectToRect(const SkBitmap&,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint,
- DrawBitmapRectFlags flags) OVERRIDE;
+ DrawBitmapRectFlags flags) override;
virtual void drawBitmapMatrix(const SkBitmap&,
const SkMatrix&,
- const SkPaint* paint = NULL) OVERRIDE;
+ const SkPaint* paint = NULL) override;
virtual void drawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center,
const SkRect& dst,
- const SkPaint* paint = NULL) OVERRIDE;
+ const SkPaint* paint = NULL) override;
virtual void drawSprite(const SkBitmap&, int left, int top,
- const SkPaint* paint = NULL) OVERRIDE;
+ const SkPaint* paint = NULL) override;
virtual void drawVertices(VertexMode,
int vertexCount,
const SkPoint vertices[],
@@ -66,53 +66,53 @@
SkXfermode*,
const uint16_t indices[],
int indexCount,
- const SkPaint&) OVERRIDE;
+ const SkPaint&) override;
protected:
- virtual void willSave() OVERRIDE;
+ virtual void willSave() override;
virtual SaveLayerStrategy willSaveLayer(const SkRect*,
const SkPaint*,
- SaveFlags) OVERRIDE;
- virtual void willRestore() OVERRIDE;
+ SaveFlags) override;
+ virtual void willRestore() override;
virtual void onClipRect(const SkRect& rect,
SkRegion::Op op,
- ClipEdgeStyle edge_style) OVERRIDE;
+ ClipEdgeStyle edge_style) override;
virtual void onClipRRect(const SkRRect& rrect,
SkRegion::Op op,
- ClipEdgeStyle edge_style) OVERRIDE;
+ ClipEdgeStyle edge_style) override;
virtual void onClipPath(const SkPath& path,
SkRegion::Op op,
- ClipEdgeStyle edge_style) OVERRIDE;
+ ClipEdgeStyle edge_style) override;
virtual void onClipRegion(const SkRegion& deviceRgn,
- SkRegion::Op op) OVERRIDE;
+ SkRegion::Op op) override;
virtual void onDrawText(const void* text,
size_t byteLength,
SkScalar x,
SkScalar y,
- const SkPaint&) OVERRIDE;
+ const SkPaint&) override;
virtual void onDrawPosText(const void* text,
size_t byteLength,
const SkPoint pos[],
- const SkPaint&) OVERRIDE;
+ const SkPaint&) override;
virtual void onDrawPosTextH(const void* text,
size_t byteLength,
const SkScalar xpos[],
SkScalar constY,
- const SkPaint&) OVERRIDE;
+ const SkPaint&) override;
virtual void onDrawTextOnPath(const void* text,
size_t byteLength,
const SkPath& path,
const SkMatrix* matrix,
- const SkPaint&) OVERRIDE;
+ const SkPaint&) override;
virtual void onDrawTextBlob(const SkTextBlob* blob,
SkScalar x,
SkScalar y,
- const SkPaint& paint) OVERRIDE;
+ const SkPaint& paint) override;
virtual void onDrawDRRect(const SkRRect& outer,
const SkRRect& inner,
- const SkPaint&) OVERRIDE;
+ const SkPaint&) override;
void OnComplexClip();
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc
index 593e238..f3f8cc5 100644
--- a/skia/ext/benchmarking_canvas.cc
+++ b/skia/ext/benchmarking_canvas.cc
@@ -40,56 +40,56 @@
}
// SkCanvas overrides.
- virtual void willSave() OVERRIDE {
+ virtual void willSave() override {
AutoStamper stamper(this);
SkProxyCanvas::willSave();
}
virtual SaveLayerStrategy willSaveLayer(const SkRect* bounds,
const SkPaint* paint,
- SaveFlags flags) OVERRIDE {
+ SaveFlags flags) override {
AutoStamper stamper(this);
return SkProxyCanvas::willSaveLayer(bounds, paint, flags);
}
- virtual void willRestore() OVERRIDE {
+ virtual void willRestore() override {
AutoStamper stamper(this);
SkProxyCanvas::willRestore();
}
- virtual void drawPaint(const SkPaint& paint) OVERRIDE {
+ virtual void drawPaint(const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::drawPaint(paint);
}
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
- const SkPaint& paint) OVERRIDE {
+ const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::drawPoints(mode, count, pts, paint);
}
- virtual void drawOval(const SkRect& rect, const SkPaint& paint) OVERRIDE {
+ virtual void drawOval(const SkRect& rect, const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::drawOval(rect, paint);
}
- virtual void drawRect(const SkRect& rect, const SkPaint& paint) OVERRIDE {
+ virtual void drawRect(const SkRect& rect, const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::drawRect(rect, paint);
}
- virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) OVERRIDE {
+ virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::drawRRect(rrect, paint);
}
- virtual void drawPath(const SkPath& path, const SkPaint& paint) OVERRIDE {
+ virtual void drawPath(const SkPath& path, const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::drawPath(path, paint);
}
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
- const SkPaint* paint = NULL) OVERRIDE {
+ const SkPaint* paint = NULL) override {
AutoStamper stamper(this);
SkProxyCanvas::drawBitmap(bitmap, left, top, paint);
}
@@ -97,19 +97,19 @@
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst,
const SkPaint* paint,
- DrawBitmapRectFlags flags) OVERRIDE {
+ DrawBitmapRectFlags flags) override {
AutoStamper stamper(this);
SkProxyCanvas::drawBitmapRectToRect(bitmap, src, dst, paint, flags);
}
virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m,
- const SkPaint* paint = NULL) OVERRIDE {
+ const SkPaint* paint = NULL) override {
AutoStamper stamper(this);
SkProxyCanvas::drawBitmapMatrix(bitmap, m, paint);
}
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
- const SkPaint* paint = NULL) OVERRIDE {
+ const SkPaint* paint = NULL) override {
AutoStamper stamper(this);
SkProxyCanvas::drawSprite(bitmap, left, top, paint);
}
@@ -118,71 +118,71 @@
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
- const SkPaint& paint) OVERRIDE {
+ const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::drawVertices(vmode, vertexCount, vertices, texs, colors,
xmode, indices, indexCount, paint);
}
- virtual void drawData(const void* data, size_t length) OVERRIDE {
+ virtual void drawData(const void* data, size_t length) override {
AutoStamper stamper(this);
SkProxyCanvas::drawData(data, length);
}
protected:
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x,
- SkScalar y, const SkPaint& paint) OVERRIDE {
+ SkScalar y, const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::onDrawText(text, byteLength, x, y, paint);
}
virtual void onDrawPosText(const void* text, size_t byteLength,
const SkPoint pos[],
- const SkPaint& paint) OVERRIDE {
+ const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::onDrawPosText(text, byteLength, pos, paint);
}
virtual void onDrawPosTextH(const void* text, size_t byteLength,
const SkScalar xpos[], SkScalar constY,
- const SkPaint& paint) OVERRIDE {
+ const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::onDrawPosTextH(text, byteLength, xpos, constY, paint);
}
virtual void onDrawTextOnPath(const void* text, size_t byteLength,
const SkPath& path, const SkMatrix* matrix,
- const SkPaint& paint) OVERRIDE {
+ const SkPaint& paint) override {
AutoStamper stamper(this);
SkProxyCanvas::onDrawTextOnPath(text, byteLength, path, matrix, paint);
}
virtual void onClipRect(const SkRect& rect, SkRegion::Op op,
- ClipEdgeStyle edge_style) OVERRIDE {
+ ClipEdgeStyle edge_style) override {
AutoStamper stamper(this);
SkProxyCanvas::onClipRect(rect, op, edge_style);
}
virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op,
- ClipEdgeStyle edge_style) OVERRIDE {
+ ClipEdgeStyle edge_style) override {
AutoStamper stamper(this);
SkProxyCanvas::onClipRRect(rrect, op, edge_style);
}
virtual void onClipPath(const SkPath& path, SkRegion::Op op,
- ClipEdgeStyle edge_style) OVERRIDE {
+ ClipEdgeStyle edge_style) override {
AutoStamper stamper(this);
SkProxyCanvas::onClipPath(path, op, edge_style);
}
virtual void onClipRegion(const SkRegion& region,
- SkRegion::Op op) OVERRIDE {
+ SkRegion::Op op) override {
AutoStamper stamper(this);
SkProxyCanvas::onClipRegion(region, op);
}
virtual void onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
- const SkPaint* paint) OVERRIDE {
+ const SkPaint* paint) override {
AutoStamper stamper(this);
SkProxyCanvas::onDrawPicture(picture, matrix, paint);
}
diff --git a/skia/ext/bitmap_platform_device_cairo.h b/skia/ext/bitmap_platform_device_cairo.h
index 6952e9a..2932111 100644
--- a/skia/ext/bitmap_platform_device_cairo.h
+++ b/skia/ext/bitmap_platform_device_cairo.h
@@ -85,16 +85,16 @@
// Overridden from SkBaseDevice:
virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region,
- const SkClipStack&) OVERRIDE;
+ const SkClipStack&) override;
// Overridden from PlatformDevice:
- virtual cairo_t* BeginPlatformPaint() OVERRIDE;
+ virtual cairo_t* BeginPlatformPaint() override;
virtual void DrawToNativeContext(PlatformSurface surface, int x, int y,
- const PlatformRect* src_rect) OVERRIDE;
+ const PlatformRect* src_rect) override;
protected:
virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info,
- Usage usage) OVERRIDE;
+ Usage usage) override;
private:
static BitmapPlatformDevice* Create(int width, int height, bool is_opaque,
diff --git a/skia/ext/bitmap_platform_device_mac.h b/skia/ext/bitmap_platform_device_mac.h
index 665356f..eb142e2 100644
--- a/skia/ext/bitmap_platform_device_mac.h
+++ b/skia/ext/bitmap_platform_device_mac.h
@@ -51,20 +51,20 @@
virtual ~BitmapPlatformDevice();
// PlatformDevice overrides
- virtual CGContextRef GetBitmapContext() OVERRIDE;
+ virtual CGContextRef GetBitmapContext() override;
virtual void DrawToNativeContext(CGContextRef context, int x, int y,
- const CGRect* src_rect) OVERRIDE;
+ const CGRect* src_rect) override;
// SkBaseDevice overrides
virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region,
- const SkClipStack&) OVERRIDE;
+ const SkClipStack&) override;
protected:
BitmapPlatformDevice(CGContextRef context,
const SkBitmap& bitmap);
virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info,
- Usage usage) OVERRIDE;
+ Usage usage) override;
private:
void ReleaseBitmapContext();
diff --git a/skia/ext/bitmap_platform_device_skia.h b/skia/ext/bitmap_platform_device_skia.h
index f1bb375..f670dea 100644
--- a/skia/ext/bitmap_platform_device_skia.h
+++ b/skia/ext/bitmap_platform_device_skia.h
@@ -42,13 +42,13 @@
explicit BitmapPlatformDevice(const SkBitmap& other);
virtual ~BitmapPlatformDevice();
- virtual PlatformSurface BeginPlatformPaint() OVERRIDE;
+ virtual PlatformSurface BeginPlatformPaint() override;
virtual void DrawToNativeContext(PlatformSurface surface, int x, int y,
- const PlatformRect* src_rect) OVERRIDE;
+ const PlatformRect* src_rect) override;
protected:
virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info,
- Usage usage) OVERRIDE;
+ Usage usage) override;
private:
DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice);
diff --git a/skia/ext/bitmap_platform_device_win.h b/skia/ext/bitmap_platform_device_win.h
index 78f801e..a8b7d83 100644
--- a/skia/ext/bitmap_platform_device_win.h
+++ b/skia/ext/bitmap_platform_device_win.h
@@ -51,25 +51,25 @@
// PlatformDevice overrides
// Retrieves the bitmap DC, which is the memory DC for our bitmap data. The
// bitmap DC is lazy created.
- virtual PlatformSurface BeginPlatformPaint() OVERRIDE;
- virtual void EndPlatformPaint() OVERRIDE;
+ virtual PlatformSurface BeginPlatformPaint() override;
+ virtual void EndPlatformPaint() override;
virtual void DrawToNativeContext(HDC dc, int x, int y,
- const RECT* src_rect) OVERRIDE;
+ const RECT* src_rect) override;
// Loads the given transform and clipping region into the HDC. This is
// overridden from SkBaseDevice.
virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region,
- const SkClipStack&) OVERRIDE;
+ const SkClipStack&) override;
protected:
// Flushes the Windows device context so that the pixel data can be accessed
// directly by Skia. Overridden from SkBaseDevice, this is called when Skia
// starts accessing pixel data.
- virtual const SkBitmap& onAccessBitmap() OVERRIDE;
+ virtual const SkBitmap& onAccessBitmap() override;
virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info,
- Usage usage) OVERRIDE;
+ Usage usage) override;
private:
// Private constructor.
diff --git a/skia/ext/event_tracer_impl.cc b/skia/ext/event_tracer_impl.cc
index 4974b00..f5e081d 100644
--- a/skia/ext/event_tracer_impl.cc
+++ b/skia/ext/event_tracer_impl.cc
@@ -9,9 +9,9 @@
namespace skia {
class SkChromiumEventTracer: public SkEventTracer {
- virtual const uint8_t* getCategoryGroupEnabled(const char* name) OVERRIDE;
+ virtual const uint8_t* getCategoryGroupEnabled(const char* name) override;
virtual const char* getCategoryGroupName(
- const uint8_t* categoryEnabledFlag) OVERRIDE;
+ const uint8_t* categoryEnabledFlag) override;
virtual SkEventTracer::Handle
addTraceEvent(char phase,
const uint8_t* categoryEnabledFlag,
@@ -21,11 +21,11 @@
const char** argNames,
const uint8_t* argTypes,
const uint64_t* argValues,
- uint8_t flags) OVERRIDE;
+ uint8_t flags) override;
virtual void
updateTraceEventDuration(const uint8_t* categoryEnabledFlag,
const char *name,
- SkEventTracer::Handle handle) OVERRIDE;
+ SkEventTracer::Handle handle) override;
};
const uint8_t*
diff --git a/skia/ext/image_operations_unittest.cc b/skia/ext/image_operations_unittest.cc
index 73429fc..6152731 100644
--- a/skia/ext/image_operations_unittest.cc
+++ b/skia/ext/image_operations_unittest.cc
@@ -535,7 +535,7 @@
// For each method, downscale by 16 in each dimension,
// and check each tested pixel against the expected average color.
- bool all_methods_ok ALLOW_UNUSED = true;
+ bool all_methods_ok = true;
for (size_t method_index = 0;
method_index < arraysize(tested_methods);
@@ -550,11 +550,11 @@
}
}
-#if DEBUG_BITMAP_GENERATION
if (!all_methods_ok) {
+#if DEBUG_BITMAP_GENERATION
SaveBitmapToPNG(src, "/tmp/ResizeShouldAverageColors_src.png");
- }
#endif // #if DEBUG_BITMAP_GENERATION
+ }
}
diff --git a/skia/ext/opacity_draw_filter.h b/skia/ext/opacity_draw_filter.h
index a2a686c..9789cc2 100644
--- a/skia/ext/opacity_draw_filter.h
+++ b/skia/ext/opacity_draw_filter.h
@@ -20,7 +20,7 @@
public:
OpacityDrawFilter(float opacity, bool disable_image_filtering);
virtual ~OpacityDrawFilter();
- virtual bool filter(SkPaint* paint, SkDrawFilter::Type type) OVERRIDE;
+ virtual bool filter(SkPaint* paint, SkDrawFilter::Type type) override;
private:
int alpha_;
diff --git a/skia/ext/pixel_ref_utils.cc b/skia/ext/pixel_ref_utils.cc
index 33ae11b..6eb7361 100644
--- a/skia/ext/pixel_ref_utils.cc
+++ b/skia/ext/pixel_ref_utils.cc
@@ -51,8 +51,8 @@
DiscardablePixelRefSet* pixel_ref_set)
: SkBitmapDevice(bm), pixel_ref_set_(pixel_ref_set) {}
- virtual void clear(SkColor color) SK_OVERRIDE {}
- virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) SK_OVERRIDE {
+ virtual void clear(SkColor color) override {}
+ virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) override {
SkBitmap bitmap;
if (GetBitmapFromPaint(paint, &bitmap)) {
SkRect clip_rect = SkRect::Make(draw.fRC->getBounds());
@@ -64,7 +64,7 @@
SkCanvas::PointMode mode,
size_t count,
const SkPoint points[],
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
SkBitmap bitmap;
if (!GetBitmapFromPaint(paint, &bitmap))
return;
@@ -89,7 +89,7 @@
}
virtual void drawRect(const SkDraw& draw,
const SkRect& rect,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
SkBitmap bitmap;
if (GetBitmapFromPaint(paint, &bitmap)) {
SkRect mapped_rect;
@@ -100,19 +100,19 @@
}
virtual void drawOval(const SkDraw& draw,
const SkRect& rect,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
GatherPixelRefDevice::drawRect(draw, rect, paint);
}
virtual void drawRRect(const SkDraw& draw,
const SkRRect& rect,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
GatherPixelRefDevice::drawRect(draw, rect.rect(), paint);
}
virtual void drawPath(const SkDraw& draw,
const SkPath& path,
const SkPaint& paint,
const SkMatrix* pre_path_matrix,
- bool path_is_mutable) SK_OVERRIDE {
+ bool path_is_mutable) override {
SkBitmap bitmap;
if (!GetBitmapFromPaint(paint, &bitmap))
return;
@@ -129,7 +129,7 @@
virtual void drawBitmap(const SkDraw& draw,
const SkBitmap& bitmap,
const SkMatrix& matrix,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
SkMatrix total_matrix;
total_matrix.setConcat(*draw.fMatrix, matrix);
@@ -147,7 +147,7 @@
const SkRect* src_or_null,
const SkRect& dst,
const SkPaint& paint,
- SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE {
+ SkCanvas::DrawBitmapRectFlags flags) override {
SkRect bitmap_rect = SkRect::MakeWH(bitmap.width(), bitmap.height());
SkMatrix matrix;
matrix.setRectToRect(bitmap_rect, dst, SkMatrix::kFill_ScaleToFit);
@@ -157,7 +157,7 @@
const SkBitmap& bitmap,
int x,
int y,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
// Sprites aren't affected by current matrix, so we can't reuse drawRect.
SkMatrix matrix;
matrix.setTranslate(x, y);
@@ -176,7 +176,7 @@
size_t len,
SkScalar x,
SkScalar y,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
SkBitmap bitmap;
if (!GetBitmapFromPaint(paint, &bitmap))
return;
@@ -224,7 +224,7 @@
const SkScalar pos[],
int scalars_per_pos,
const SkPoint& offset,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
SkBitmap bitmap;
if (!GetBitmapFromPaint(paint, &bitmap))
return;
@@ -268,7 +268,7 @@
size_t len,
const SkPath& path,
const SkMatrix* matrix,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
SkBitmap bitmap;
if (!GetBitmapFromPaint(paint, &bitmap))
return;
@@ -295,7 +295,7 @@
SkXfermode* xmode,
const uint16_t indices[],
int index_count,
- const SkPaint& paint) SK_OVERRIDE {
+ const SkPaint& paint) override {
GatherPixelRefDevice::drawPoints(
draw, SkCanvas::kPolygon_PointMode, vertex_count, verts, paint);
}
@@ -303,14 +303,14 @@
SkBaseDevice*,
int x,
int y,
- const SkPaint&) SK_OVERRIDE {}
+ const SkPaint&) override {}
protected:
virtual bool onReadPixels(const SkImageInfo& info,
void* pixels,
size_t rowBytes,
int x,
- int y) SK_OVERRIDE {
+ int y) override {
return false;
}
@@ -318,7 +318,7 @@
const void* pixels,
size_t rowBytes,
int x,
- int y) SK_OVERRIDE {
+ int y) override {
return false;
}
diff --git a/skia/ext/pixel_ref_utils_unittest.cc b/skia/ext/pixel_ref_utils_unittest.cc
index 92c62d7..aef5766 100644
--- a/skia/ext/pixel_ref_utils_unittest.cc
+++ b/skia/ext/pixel_ref_utils_unittest.cc
@@ -36,18 +36,18 @@
virtual SkShader::BitmapType asABitmap(SkBitmap* bitmap,
SkMatrix* matrix,
- TileMode xy[2]) const OVERRIDE {
+ TileMode xy[2]) const override {
if (bitmap)
*bitmap = bitmap_;
return SkShader::kDefault_BitmapType;
}
// not indended to return an actual context. Just need to supply this.
- virtual size_t contextSize() const OVERRIDE {
+ virtual size_t contextSize() const override {
return sizeof(SkShader::Context);
}
- virtual void flatten(SkWriteBuffer&) const OVERRIDE {}
+ virtual void flatten(SkWriteBuffer&) const override {}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(TestDiscardableShader);
diff --git a/skia/ext/vector_platform_device_emf_win.h b/skia/ext/vector_platform_device_emf_win.h
index b6d73da..f65390f 100644
--- a/skia/ext/vector_platform_device_emf_win.h
+++ b/skia/ext/vector_platform_device_emf_win.h
@@ -31,56 +31,56 @@
virtual ~VectorPlatformDeviceEmf();
// PlatformDevice methods
- virtual PlatformSurface BeginPlatformPaint() OVERRIDE;
+ virtual PlatformSurface BeginPlatformPaint() override;
virtual void DrawToNativeContext(HDC dc, int x, int y,
- const RECT* src_rect) OVERRIDE;
+ const RECT* src_rect) override;
// SkBaseDevice methods.
- virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) OVERRIDE;
+ virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) override;
virtual void drawPoints(const SkDraw& draw, SkCanvas::PointMode mode,
size_t count, const SkPoint[],
- const SkPaint& paint) OVERRIDE;
+ const SkPaint& paint) override;
virtual void drawRect(const SkDraw& draw, const SkRect& r,
- const SkPaint& paint) OVERRIDE;
+ const SkPaint& paint) override;
virtual void drawRRect(const SkDraw&, const SkRRect& rr,
- const SkPaint& paint) OVERRIDE;
+ const SkPaint& paint) override;
virtual void drawPath(const SkDraw& draw, const SkPath& path,
const SkPaint& paint,
const SkMatrix* prePathMatrix = NULL,
- bool pathIsMutable = false) OVERRIDE;
+ bool pathIsMutable = false) override;
virtual void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
const SkRect* src, const SkRect& dst,
const SkPaint& paint,
- SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE;
+ SkCanvas::DrawBitmapRectFlags flags) override;
virtual void drawBitmap(const SkDraw& draw, const SkBitmap& bitmap,
const SkMatrix& matrix,
- const SkPaint& paint) OVERRIDE;
+ const SkPaint& paint) override;
virtual void drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
- int x, int y, const SkPaint& paint) OVERRIDE;
+ int x, int y, const SkPaint& paint) override;
virtual void drawText(const SkDraw& draw, const void* text, size_t len,
- SkScalar x, SkScalar y, const SkPaint& paint) OVERRIDE;
+ SkScalar x, SkScalar y, const SkPaint& paint) override;
virtual void drawPosText(const SkDraw& draw, const void* text, size_t len,
const SkScalar pos[], int scalarsPerPos,
- const SkPoint& offset, const SkPaint& paint) OVERRIDE;
+ const SkPoint& offset, const SkPaint& paint) override;
virtual void drawTextOnPath(const SkDraw& draw, const void* text, size_t len,
const SkPath& path, const SkMatrix* matrix,
- const SkPaint& paint) OVERRIDE;
+ const SkPaint& paint) override;
virtual void drawVertices(const SkDraw& draw, SkCanvas::VertexMode,
int vertexCount,
const SkPoint verts[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
- const SkPaint& paint) OVERRIDE;
+ const SkPaint& paint) override;
virtual void drawDevice(const SkDraw& draw, SkBaseDevice*, int x, int y,
- const SkPaint&) OVERRIDE;
+ const SkPaint&) override;
virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region,
- const SkClipStack&) OVERRIDE;
+ const SkClipStack&) override;
void LoadClipRegion();
protected:
virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info,
- Usage usage) OVERRIDE;
+ Usage usage) override;
private:
// Applies the SkPaint's painting properties in the current GDI context, if
diff --git a/skia/ext/vector_platform_device_skia.h b/skia/ext/vector_platform_device_skia.h
index cf392c0..fc88904 100644
--- a/skia/ext/vector_platform_device_skia.h
+++ b/skia/ext/vector_platform_device_skia.h
@@ -26,26 +26,26 @@
virtual ~VectorPlatformDeviceSkia();
// PlatformDevice methods.
- virtual bool SupportsPlatformPaint() OVERRIDE;
+ virtual bool SupportsPlatformPaint() override;
- virtual PlatformSurface BeginPlatformPaint() OVERRIDE;
- virtual void EndPlatformPaint() OVERRIDE;
+ virtual PlatformSurface BeginPlatformPaint() override;
+ virtual void EndPlatformPaint() override;
#if defined(OS_WIN)
virtual void DrawToNativeContext(HDC dc,
int x,
int y,
- const RECT* src_rect) OVERRIDE;
+ const RECT* src_rect) override;
#elif defined(OS_MACOSX)
virtual void DrawToNativeContext(CGContext* context,
int x,
int y,
- const CGRect* src_rect) OVERRIDE;
- virtual CGContextRef GetBitmapContext() OVERRIDE;
+ const CGRect* src_rect) override;
+ virtual CGContextRef GetBitmapContext() override;
#elif defined(OS_POSIX)
virtual void DrawToNativeContext(PlatformSurface surface,
int x,
int y,
- const PlatformRect* src_rect) OVERRIDE;
+ const PlatformRect* src_rect) override;
#endif
private:
diff --git a/skia/skia_library.gypi b/skia/skia_library.gypi
index d178319..2df089e 100644
--- a/skia/skia_library.gypi
+++ b/skia/skia_library.gypi
@@ -21,7 +21,6 @@
'../third_party/skia/gyp/core.gypi',
'../third_party/skia/gyp/effects.gypi',
'../third_party/skia/gyp/pdf.gypi',
- '../third_party/skia/gyp/record.gypi',
'../third_party/skia/gyp/utils.gypi',
],
diff --git a/skia/skia_test_expectations.txt b/skia/skia_test_expectations.txt
index d0e0e57..4327f6e 100644
--- a/skia/skia_test_expectations.txt
+++ b/skia/skia_test_expectations.txt
@@ -48,7 +48,4 @@
#
# START OVERRIDES HERE
-# SkRecord records translates as setMatrix, requiring an update to test expectations.
-crbug.com/408985 inspector/layers/layer-canvas-log.html [ Failure Pass ]
-
# END OVERRIDES HERE (this line ensures that the file is newline-terminated)
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json
index d26b080..2595ad8 100644
--- a/testing/buildbot/chromium.chromiumos.json
+++ b/testing/buildbot/chromium.chromiumos.json
@@ -57,7 +57,10 @@
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
- "sandbox_linux_unittests",
+ {
+ "test": "sandbox_linux_unittests",
+ "args": ["--test-launcher-print-test-stdio=always"]
+ },
"ui_unittests",
"views_unittests",
"wm_unittests",
@@ -88,10 +91,6 @@
"chromevox_tests"
]
},
- "Linux ChromiumOS Tests (2)": {
- "gtest_tests": [
- ]
- },
"Linux ChromiumOS Ozone Tests (1)": {
"gtest_tests": [
"accessibility_unittests",
@@ -128,7 +127,10 @@
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
- "sandbox_linux_unittests",
+ {
+ "test": "sandbox_linux_unittests",
+ "args": ["--test-launcher-print-test-stdio=always"]
+ },
"sql_unittests",
"sync_unit_tests",
"ui_unittests",
@@ -174,7 +176,10 @@
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
- "sandbox_linux_unittests",
+ {
+ "test": "sandbox_linux_unittests",
+ "args": ["--test-launcher-print-test-stdio=always"]
+ },
"ui_unittests",
"views_unittests",
"wm_unittests",
@@ -209,7 +214,7 @@
"test": "browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
- "shards": 20
+ "shards": 10
}
},
"app_shell_browsertests",
@@ -231,13 +236,5 @@
}
}
]
- },
- "Linux ChromiumOS Tests (dbg)(2)": {
- "gtest_tests": [
- ]
- },
- "Linux ChromiumOS Tests (dbg)(3)": {
- "gtest_tests": [
- ]
}
}
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json
index b8cdd2f..d3bc9fb 100644
--- a/testing/buildbot/chromium.fyi.json
+++ b/testing/buildbot/chromium.fyi.json
@@ -283,6 +283,23 @@
"browser_tests"
]
},
+ "Linux ChromiumOS Athena Tests (1)": {
+ "gtest_tests": [
+ {
+ "test": "athena_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "browser_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 5
+ }
+ }
+ ]
+ },
"Site Isolation Linux": {
"gtest_tests": [
{ "test": "content_unittests", "args": ["--site-per-process"] },
@@ -294,5 +311,74 @@
{ "test": "content_unittests", "args": ["--site-per-process"] },
{ "test": "content_browsertests", "args": ["--site-per-process"] }
]
+ },
+ "Linux ChromeOS MSan Tests": {
+ "gtest_tests": [
+ "accessibility_unittests",
+ "app_list_unittests",
+ "app_shell_browsertests",
+ "aura_unittests",
+ "base_unittests",
+ "cacheinvalidation_unittests",
+ "cast_unittests",
+ "cc_unittests",
+ "chromedriver_unittests",
+ "components_unittests",
+ "content_browsertests",
+ "content_unittests",
+ "crypto_unittests",
+ "dbus_unittests",
+ "device_unittests",
+ "display_unittests",
+ "events_unittests",
+ "extensions_unittests",
+ "gcm_unit_tests",
+ "gfx_unittests",
+ "google_apis_unittests",
+ "gpu_unittests",
+ "interactive_ui_tests",
+ "ipc_mojo_unittests",
+ "ipc_tests",
+ "jingle_unittests",
+ "media_unittests",
+ "mojo_application_manager_unittests",
+ "mojo_apps_js_unittests",
+ "mojo_common_unittests",
+ "mojo_js_unittests",
+ "mojo_public_bindings_unittests",
+ "mojo_public_environment_unittests",
+ "mojo_public_system_unittests",
+ "mojo_public_utility_unittests",
+ "mojo_shell_tests",
+ "mojo_system_unittests",
+ "nacl_loader_unittests",
+ "net_unittests",
+ "ppapi_unittests",
+ "printing_unittests",
+ "remoting_unittests",
+ "sandbox_linux_unittests",
+ "sql_unittests",
+ "sync_unit_tests",
+ "ui_unittests",
+ "unit_tests",
+ "url_unittests",
+ "views_unittests",
+ "wm_unittests"
+ ]
+ },
+ "Linux ChromeOS MSan Browser (1)": {
+ "gtest_tests": [
+ {"test": "browser_tests", "shard_index": 0, "total_shards": 3}
+ ]
+ },
+ "Linux ChromeOS MSan Browser (2)": {
+ "gtest_tests": [
+ {"test": "browser_tests", "shard_index": 1, "total_shards": 3}
+ ]
+ },
+ "Linux ChromeOS MSan Browser (3)": {
+ "gtest_tests": [
+ {"test": "browser_tests", "shard_index": 2, "total_shards": 3}
+ ]
}
}
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json
index 5221109..9f814d3 100644
--- a/testing/buildbot/chromium.linux.json
+++ b/testing/buildbot/chromium.linux.json
@@ -199,10 +199,6 @@
"wm_unittests"
]
},
- "Linux Tests (dbg)(2)(32)": {
- "gtest_tests": [
- ]
- },
"Linux Tests (dbg)(1)": {
"gtest_tests": [
"accessibility_unittests",
@@ -283,7 +279,10 @@
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
- "sandbox_linux_unittests",
+ {
+ "test": "sandbox_linux_unittests",
+ "args": ["--test-launcher-print-test-stdio=always"]
+ },
"sql_unittests",
"ui_unittests",
{
@@ -304,10 +303,6 @@
"wm_unittests"
]
},
- "Linux Tests (dbg)(2)": {
- "gtest_tests": [
- ]
- },
"Linux Clang (dbg)": {
"gtest_tests": [
"accessibility_unittests",
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json
index e6fe443..ef5867d 100644
--- a/testing/buildbot/chromium.mac.json
+++ b/testing/buildbot/chromium.mac.json
@@ -87,10 +87,6 @@
"url_unittests"
]
},
- "Mac10.6 Tests (2)": {
- "gtest_tests": [
- ]
- },
"Mac10.7 Tests (1)": {
"gtest_tests": [
"accessibility_unittests",
@@ -105,7 +101,7 @@
"test": "browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
- "shards": 10
+ "shards": 5
}
},
"cacheinvalidation_unittests",
@@ -179,10 +175,6 @@
"url_unittests"
]
},
- "Mac10.7 Tests (2)": {
- "gtest_tests": [
- ]
- },
"Mac 10.6 Tests (dbg)(1)": {
"gtest_tests": [
"accessibility_unittests",
@@ -271,10 +263,6 @@
"url_unittests"
]
},
- "Mac 10.6 Tests (dbg)(2)": {
- "gtest_tests": [
- ]
- },
"Mac 10.7 Tests (dbg)(1)": {
"gtest_tests": [
"accessibility_unittests",
@@ -289,7 +277,7 @@
"test": "browser_tests",
"swarming": {
"can_use_on_swarming_builders": true,
- "shards": 20
+ "shards": 10
}
},
"cacheinvalidation_unittests",
@@ -363,9 +351,5 @@
},
"url_unittests"
]
- },
- "Mac 10.7 Tests (dbg)(2)": {
- "gtest_tests": [
- ]
}
}
diff --git a/testing/buildbot/chromium.memory.fyi.json b/testing/buildbot/chromium.memory.fyi.json
index 4daaf0e..c2e560e 100644
--- a/testing/buildbot/chromium.memory.fyi.json
+++ b/testing/buildbot/chromium.memory.fyi.json
@@ -10,9 +10,11 @@
"cast_unittests",
"cc_unittests",
"chromedriver_unittests",
+ "components_unittests",
"content_browsertests",
"content_unittests",
"crypto_unittests",
+ "dbus_unittests",
"device_unittests",
"display_unittests",
"events_unittests",
@@ -47,6 +49,7 @@
"ui_unittests",
"unit_tests",
"url_unittests",
+ "views_unittests",
"wm_unittests"
]
},
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json
index 3af9ba2..6ba4c8a 100644
--- a/testing/buildbot/chromium.memory.json
+++ b/testing/buildbot/chromium.memory.json
@@ -71,14 +71,6 @@
"url_unittests"
]
},
- "Linux ASan LSan Tests (2)": {
- "gtest_tests": [
- ]
- },
- "Linux ASan LSan Tests (3)": {
- "gtest_tests": [
- ]
- },
"Linux ASan Tests (sandboxed)": {
"gtest_tests": [
{
@@ -104,130 +96,212 @@
},
"Mac ASan Tests (1)": {
"gtest_tests": [
- "base_unittests",
+ {
+ "test": "base_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "browser_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 10
+ }
+ },
"cacheinvalidation_unittests",
"cc_unittests",
"chromedriver_unittests",
"components_unittests",
- "content_browsertests",
- "content_unittests",
+ {
+ "test": "content_browsertests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "content_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"crypto_unittests",
"gcm_unit_tests",
"gpu_unittests",
+ {
+ "test": "interactive_ui_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ipc_tests",
"jingle_unittests",
"media_unittests",
+ {
+ "test": "net_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
"sql_unittests",
- "url_unittests",
- {"test": "browser_tests", "shard_index": 0, "total_shards": 3}
- ]
- },
- "Mac ASan Tests (2)": {
- "gtest_tests": [
- "net_unittests",
"sync_unit_tests",
"ui_unittests",
- {"test": "browser_tests", "shard_index": 1, "total_shards": 3}
- ]
- },
- "Mac ASan Tests (3)": {
- "gtest_tests": [
- "interactive_ui_tests",
- {"test": "browser_tests", "shard_index": 2, "total_shards": 3}
+ "url_unittests"
]
},
"Mac ASan 64 Tests (1)": {
"gtest_tests": [
"base_unittests",
+ {
+ "test": "base_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "browser_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 20
+ }
+ },
"cacheinvalidation_unittests",
"cc_unittests",
"chromedriver_unittests",
"components_unittests",
- "content_browsertests",
- "content_unittests",
+ {
+ "test": "content_browsertests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 2
+ }
+ },
+ {
+ "test": "content_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"crypto_unittests",
"gcm_unit_tests",
"gpu_unittests",
+ {
+ "test": "interactive_ui_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 2
+ }
+ },
"ipc_tests",
"jingle_unittests",
"media_unittests",
+ {
+ "test": "net_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
"sql_unittests",
- "unit_tests",
- "url_unittests",
- {"test": "browser_tests", "shard_index": 0, "total_shards": 3}
- ]
- },
- "Mac ASan 64 Tests (2)": {
- "gtest_tests": [
- "net_unittests",
"sync_unit_tests",
"ui_unittests",
- {"test": "browser_tests", "shard_index": 1, "total_shards": 3}
- ]
- },
- "Mac ASan 64 Tests (3)": {
- "gtest_tests": [
- "interactive_ui_tests",
- {"test": "browser_tests", "shard_index": 2, "total_shards": 3}
+ {
+ "test": "unit_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ "url_unittests"
]
},
"Linux Chromium OS ASan LSan Tests (1)": {
"gtest_tests": [
- "ash_unittests",
+ "accessibility_unittests",
+ "app_list_unittests",
+ {
+ "test": "ash_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ "athena_unittests",
"aura_unittests",
- "base_unittests",
+ {
+ "test": "base_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "browser_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 10
+ }
+ },
"cacheinvalidation_unittests",
+ "cast_unittests",
"chromeos_unittests",
"compositor_unittests",
- "content_browsertests",
+ {
+ "test": "content_browsertests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "content_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ "components_unittests",
"crypto_unittests",
+ "device_unittests",
+ "display_unittests",
"events_unittests",
"gcm_unit_tests",
+ "gfx_unittests",
"gpu_unittests",
+ "google_apis_unittests",
+ {
+ "test": "interactive_ui_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 2
+ }
+ },
+ "ipc_tests",
"jingle_unittests",
"media_unittests",
+ "message_center_unittests",
+ "nacl_loader_unittests",
+ {
+ "test": "net_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
- "url_unittests",
- "views_unittests",
- {"test": "browser_tests", "shard_index": 0, "total_shards": 3}
- ]
- },
- "Linux Chromium OS ASan LSan Tests (2)": {
- "gtest_tests": [
- "interactive_ui_tests",
- "net_unittests",
- {"test": "browser_tests", "shard_index": 1, "total_shards": 3}
- ]
- },
- "Linux Chromium OS ASan LSan Tests (3)": {
- "gtest_tests": [
- "accessibility_unittests",
- "app_list_unittests",
- "athena_unittests",
- "cast_unittests",
- "components_unittests",
- "content_unittests",
- "device_unittests",
- "display_unittests",
- "gfx_unittests",
- "google_apis_unittests",
- "ipc_tests",
- "message_center_unittests",
- "nacl_loader_unittests",
"sandbox_linux_unittests",
"sql_unittests",
"sync_unit_tests",
+ {
+ "test": "unit_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ui_unittests",
- "unit_tests",
- {"test": "browser_tests", "shard_index": 2, "total_shards": 3}
+ "url_unittests",
+ "views_unittests"
]
}
}
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json
index 044cb1d..20fb969 100644
--- a/testing/buildbot/chromium.win.json
+++ b/testing/buildbot/chromium.win.json
@@ -93,14 +93,6 @@
"wm_unittests"
]
},
- "XP Tests (2)": {
- "gtest_tests": [
- ]
- },
- "XP Tests (3)": {
- "gtest_tests": [
- ]
- },
"Vista Tests (1)": {
"gtest_tests": [
"interactive_ui_tests",
@@ -268,14 +260,6 @@
"wm_unittests"
]
},
- "Win7 Tests (2)": {
- "gtest_tests": [
- ]
- },
- "Win7 Tests (3)": {
- "gtest_tests": [
- ]
- },
"Win 7 Tests x64 (1)": {
"gtest_tests": [
"accessibility_unittests",
@@ -369,14 +353,6 @@
"wm_unittests"
]
},
- "Win 7 Tests x64 (2)": {
- "gtest_tests": [
- ]
- },
- "Win 7 Tests x64 (3)": {
- "gtest_tests": [
- ]
- },
"Win7 Tests (dbg)(1)": {
"gtest_tests": [
"accessibility_unittests",
@@ -479,30 +455,6 @@
"wm_unittests"
]
},
- "Win7 Tests (dbg)(2)": {
- "gtest_tests": [
- ]
- },
- "Win7 Tests (dbg)(3)": {
- "gtest_tests": [
- ]
- },
- "Win7 Tests (dbg)(4)": {
- "gtest_tests": [
- ]
- },
- "Win7 Tests (dbg)(5)": {
- "gtest_tests": [
- ]
- },
- "Win7 Tests (dbg)(6)": {
- "gtest_tests": [
- ]
- },
- "Interactive Tests (dbg)": {
- "gtest_tests": [
- ]
- },
"Win8 Aura": {
"gtest_tests": [
"views_unittests",
diff --git a/testing/buildbot/chromium_trybot.json b/testing/buildbot/chromium_trybot.json
index 3078088..c11d231 100644
--- a/testing/buildbot/chromium_trybot.json
+++ b/testing/buildbot/chromium_trybot.json
@@ -7,7 +7,11 @@
"app_list_unittests",
{
"test": "ash_unittests",
- "chromium_configs": ["chromium_chromeos", "chromium_chromeos_clang"],
+ "chromium_configs": [
+ "chromium_chromeos",
+ "chromium_chromeos_clang",
+ "chromium_chromeos_ozone"
+ ],
"swarming": {
"can_use_on_swarming_builders": true
}
@@ -38,7 +42,11 @@
"chromedriver_unittests",
{
"test": "chromevox_tests",
- "chromium_configs": ["chromium_chromeos", "chromium_chromeos_clang"]
+ "chromium_configs": [
+ "chromium_chromeos",
+ "chromium_chromeos_clang",
+ "chromium_chromeos_ozone"
+ ]
},
{
"test": "chrome_elf_unittests",
@@ -200,12 +208,19 @@
{
"test": "chromeos_unittests",
"platforms": ["linux"],
- "chromium_configs": ["chromium_chromeos", "chromium_chromeos_clang"]
+ "chromium_configs": [
+ "chromium_chromeos",
+ "chromium_chromeos_clang",
+ "chromium_chromeos_ozone"
+ ]
},
{
"test": "athena_unittests",
"platforms": ["linux"],
- "chromium_configs": ["chromium_chromeos", "chromium_chromeos_clang"]
+ "chromium_configs": [
+ "chromium_chromeos_athena",
+ "chromium_chromeos_ozone"
+ ]
},
{
"test": "display_unittests",
diff --git a/testing/gtest.gyp b/testing/gtest.gyp
index 671a508..c4510f6 100644
--- a/testing/gtest.gyp
+++ b/testing/gtest.gyp
@@ -74,7 +74,7 @@
},
'mac_bundle_resources': [
'<(ios_unittest_info_plist_path)',
- '<(DEPTH)/testing/gtest_ios/Default-568h@2x.png',
+ '<(DEPTH)/testing/gtest_ios/Default.png',
],
'mac_bundle_resources!': [
'<(ios_unittest_info_plist_path)',
diff --git a/testing/gtest_ios/Default-568h@2x.png b/testing/gtest_ios/Default.png
similarity index 100%
rename from testing/gtest_ios/Default-568h@2x.png
rename to testing/gtest_ios/Default.png
Binary files differ
diff --git a/testing/gtest_ios/unittest-Info.plist b/testing/gtest_ios/unittest-Info.plist
index fc21034..cb03136 100644
--- a/testing/gtest_ios/unittest-Info.plist
+++ b/testing/gtest_ios/unittest-Info.plist
@@ -22,6 +22,82 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
+ <key>UILaunchImages</key>
+ <array>
+ <dict>
+ <key>UILaunchImageMinimumOSVersion</key>
+ <string>7.0</string>
+ <key>UILaunchImageName</key>
+ <string>Default</string>
+ <key>UILaunchImageOrientation</key>
+ <string>Portrait</string>
+ <key>UILaunchImageSize</key>
+ <string>{320, 480}</string>
+ </dict>
+ <dict>
+ <key>UILaunchImageMinimumOSVersion</key>
+ <string>7.0</string>
+ <key>UILaunchImageName</key>
+ <string>Default</string>
+ <key>UILaunchImageOrientation</key>
+ <string>Portrait</string>
+ <key>UILaunchImageSize</key>
+ <string>{320, 568}</string>
+ </dict>
+ <dict>
+ <key>UILaunchImageMinimumOSVersion</key>
+ <string>8.0</string>
+ <key>UILaunchImageName</key>
+ <string>Default</string>
+ <key>UILaunchImageOrientation</key>
+ <string>Portrait</string>
+ <key>UILaunchImageSize</key>
+ <string>{375, 667}</string>
+ </dict>
+ <dict>
+ <key>UILaunchImageMinimumOSVersion</key>
+ <string>8.0</string>
+ <key>UILaunchImageName</key>
+ <string>Default</string>
+ <key>UILaunchImageOrientation</key>
+ <string>Portrait</string>
+ <key>UILaunchImageSize</key>
+ <string>{414, 736}</string>
+ </dict>
+ <dict>
+ <key>UILaunchImageMinimumOSVersion</key>
+ <string>8.0</string>
+ <key>UILaunchImageName</key>
+ <string>Default</string>
+ <key>UILaunchImageOrientation</key>
+ <string>Landscape</string>
+ <key>UILaunchImageSize</key>
+ <string>{414, 736}</string>
+ </dict>
+ </array>
+ <key>UILaunchImages~ipad</key>
+ <array>
+ <dict>
+ <key>UILaunchImageMinimumOSVersion</key>
+ <string>7.0</string>
+ <key>UILaunchImageName</key>
+ <string>Default</string>
+ <key>UILaunchImageOrientation</key>
+ <string>Portrait</string>
+ <key>UILaunchImageSize</key>
+ <string>{768, 1024}</string>
+ </dict>
+ <dict>
+ <key>UILaunchImageMinimumOSVersion</key>
+ <string>7.0</string>
+ <key>UILaunchImageName</key>
+ <string>Default</string>
+ <key>UILaunchImageOrientation</key>
+ <string>Landscape</string>
+ <key>UILaunchImageSize</key>
+ <string>{768, 1024}</string>
+ </dict>
+ </array>
<key>UISupportedInterfaceOrientation</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
diff --git a/testing/scripts/checkdeps.py b/testing/scripts/checkdeps.py
new file mode 100755
index 0000000..83abfdf
--- /dev/null
+++ b/testing/scripts/checkdeps.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import argparse
+import contextlib
+import json
+import os
+import subprocess
+import sys
+import tempfile
+
+
+SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
+SRC_DIR = os.path.abspath(
+ os.path.join(SCRIPT_DIR, os.path.pardir, os.path.pardir))
+
+
+def run_command(argv):
+ print 'Running %r' % argv
+ rc = subprocess.call(argv)
+ print 'Command %r returned exit code %d' % (argv, rc)
+ return rc
+
+
+@contextlib.contextmanager
+def temporary_file():
+ fd, path = tempfile.mkstemp()
+ os.close(fd)
+ try:
+ yield path
+ finally:
+ os.remove(path)
+
+
+def mode_run(args):
+ with temporary_file() as tempfile_path:
+ rc = run_command([
+ os.path.join(SRC_DIR, 'buildtools', 'checkdeps', 'checkdeps.py'),
+ '--json', tempfile_path
+ ])
+
+ with open(tempfile_path) as f:
+ checkdeps_results = json.load(f)
+
+ result_set = set()
+ for result in checkdeps_results:
+ for violation in result['violations']:
+ result_set.add((result['dependee_path'], violation['include_path']))
+
+ with open(args.output, 'w') as f:
+ json.dump({
+ 'valid': True,
+ 'failures': ['%s: %s' % (r[0], r[1]) for r in result_set],
+ }, f)
+
+ return rc
+
+
+def main(argv):
+ parser = argparse.ArgumentParser()
+
+ subparsers = parser.add_subparsers()
+
+ run_parser = subparsers.add_parser('run')
+ run_parser.add_argument('--output', required=True)
+ run_parser.set_defaults(func=mode_run)
+
+ args = parser.parse_args(argv)
+ return args.func(args)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/testing/test_env.py b/testing/test_env.py
index 0729e17..0539309 100755
--- a/testing/test_env.py
+++ b/testing/test_env.py
@@ -38,20 +38,31 @@
return False
-def enable_sandbox_if_required(cmd, env, verbose=False):
- """Checks enables the sandbox if it is required, otherwise it disables it."""
+def get_sandbox_env(cmd, env, verbose=False):
+ """Checks enables the sandbox if it is required, otherwise it disables it.
+ Returns the environment flags to set."""
+ extra_env = {}
chrome_sandbox_path = env.get(CHROME_SANDBOX_ENV, CHROME_SANDBOX_PATH)
if should_enable_sandbox(cmd, chrome_sandbox_path):
if verbose:
print 'Enabling sandbox. Setting environment variable:'
print ' %s="%s"' % (CHROME_SANDBOX_ENV, chrome_sandbox_path)
- env[CHROME_SANDBOX_ENV] = chrome_sandbox_path
+ extra_env[CHROME_SANDBOX_ENV] = chrome_sandbox_path
else:
if verbose:
print 'Disabling sandbox. Setting environment variable:'
print ' CHROME_DEVEL_SANDBOX=""'
- env['CHROME_DEVEL_SANDBOX'] = ''
+ extra_env['CHROME_DEVEL_SANDBOX'] = ''
+
+ return extra_env
+
+
+def trim_cmd(cmd):
+ """Removes internal flags from cmd since they're just used to communicate from
+ the host machine to this script running on the swarm slaves."""
+ internal_flags = frozenset(['--asan=0', '--asan=1', '--lsan=0', '--lsan=1'])
+ return [i for i in cmd if i not in internal_flags]
def fix_python_path(cmd):
@@ -64,6 +75,63 @@
return out
+def get_asan_env(cmd, lsan):
+ """Returns the envirnoment flags needed for ASan and LSan."""
+
+ extra_env = {}
+
+ # Instruct GTK to use malloc while running ASan or LSan tests.
+ # TODO(earthdok): enabling G_SLICE gives these leaks, locally and on swarming
+ #0 0x62c01b in __interceptor_malloc (/tmp/run_tha_testXukBDT/out/Release/browser_tests+0x62c01b)
+ #1 0x7fb64ab64a38 in g_malloc /build/buildd/glib2.0-2.32.4/./glib/gmem.c:159
+ #extra_env['G_SLICE'] = 'always-malloc'
+
+ extra_env['NSS_DISABLE_ARENA_FREE_LIST'] = '1'
+ extra_env['NSS_DISABLE_UNLOAD'] = '1'
+
+ # TODO(glider): remove the symbolizer path once
+ # https://code.google.com/p/address-sanitizer/issues/detail?id=134 is fixed.
+ symbolizer_path = os.path.abspath(os.path.join(ROOT_DIR, 'third_party',
+ 'llvm-build', 'Release+Asserts', 'bin', 'llvm-symbolizer'))
+
+ asan_options = []
+ if lsan:
+ asan_options.append('detect_leaks=1')
+ if sys.platform == 'linux2':
+ # Use the debug version of libstdc++ under LSan. If we don't, there will
+ # be a lot of incomplete stack traces in the reports.
+ extra_env['LD_LIBRARY_PATH'] = '/usr/lib/x86_64-linux-gnu/debug:'
+
+ # LSan is not sandbox-compatible, so we can use online symbolization. In
+ # fact, it needs symbolization to be able to apply suppressions.
+ symbolization_options = ['symbolize=1',
+ 'external_symbolizer_path=%s' % symbolizer_path]
+
+ suppressions_file = os.path.join(ROOT_DIR, 'tools', 'lsan',
+ 'suppressions.txt')
+ lsan_options = ['suppressions=%s' % suppressions_file,
+ 'print_suppressions=1']
+ extra_env['LSAN_OPTIONS'] = ' '.join(lsan_options)
+ else:
+ # ASan uses a script for offline symbolization.
+ # Important note: when running ASan with leak detection enabled, we must use
+ # the LSan symbolization options above.
+ symbolization_options = ['symbolize=0']
+
+ asan_options.extend(symbolization_options)
+
+ extra_env['ASAN_OPTIONS'] = ' '.join(asan_options)
+
+ if sys.platform == 'darwin':
+ isolate_output_dir = os.path.abspath(os.path.dirname(cmd[0]))
+ # This is needed because the test binary has @executable_path embedded in it
+ # it that the OS tries to resolve to the cache directory and not the mapped
+ # directory.
+ extra_env['DYLD_LIBRARY_PATH'] = str(isolate_output_dir)
+
+ return extra_env
+
+
def run_executable(cmd, env):
"""Runs an executable with:
- environment variable CR_SOURCE_ROOT set to the root directory.
@@ -71,17 +139,48 @@
- environment variable CHROME_DEVEL_SANDBOX set if need
- Reuses sys.executable automatically.
"""
+ extra_env = {}
# Many tests assume a English interface...
- env['LANG'] = 'en_US.UTF-8'
+ extra_env['LANG'] = 'en_US.UTF-8'
# Used by base/base_paths_linux.cc as an override. Just make sure the default
# logic is used.
env.pop('CR_SOURCE_ROOT', None)
- enable_sandbox_if_required(cmd, env)
+ extra_env.update(get_sandbox_env(cmd, env))
+
+ # Copy logic from tools/build/scripts/slave/runtest.py.
+ asan = '--asan=1' in cmd
+ lsan = '--lsan=1' in cmd
+
+ if asan:
+ extra_env.update(get_asan_env(cmd, lsan))
+ if lsan:
+ cmd.append('--no-sandbox')
+
+ cmd = trim_cmd(cmd)
+
# Ensure paths are correctly separated on windows.
cmd[0] = cmd[0].replace('/', os.path.sep)
cmd = fix_python_path(cmd)
+
+ print('Additional test environment:\n%s\n'
+ 'Command: %s\n' % (
+ '\n'.join(' %s=%s' %
+ (k, v) for k, v in sorted(extra_env.iteritems())),
+ ' '.join(cmd)))
+ env.update(extra_env or {})
try:
- return subprocess.call(cmd, env=env)
+ # See above comment regarding offline symbolization.
+ if asan and not lsan:
+ # Need to pipe to the symbolizer script.
+ p1 = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
+ stderr=sys.stdout)
+ p2 = subprocess.Popen(["../tools/valgrind/asan/asan_symbolize.py"],
+ stdin=p1.stdout)
+ p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
+ p2.wait()
+ return p2.returncode
+ else:
+ return subprocess.call(cmd, env=env)
except OSError:
print >> sys.stderr, 'Failed to start %s' % cmd
raise
diff --git a/third_party/boringssl/boringssl.gypi b/third_party/boringssl/boringssl.gypi
index d14fee8..97faccd 100644
--- a/third_party/boringssl/boringssl.gypi
+++ b/third_party/boringssl/boringssl.gypi
@@ -132,8 +132,10 @@
'src/crypto/ecdsa/ecdsa_asn1.c',
'src/crypto/ecdsa/ecdsa_error.c',
'src/crypto/engine/engine.c',
+ 'src/crypto/engine/engine_error.c',
'src/crypto/err/err.c',
'src/crypto/err/err_impl.c',
+ 'src/crypto/evp/algorithm.c',
'src/crypto/evp/asn1.c',
'src/crypto/evp/digestsign.c',
'src/crypto/evp/evp.c',
diff --git a/third_party/freetype2/BUILD.gn b/third_party/freetype2/BUILD.gn
index 803917f..18ef5f5 100644
--- a/third_party/freetype2/BUILD.gn
+++ b/third_party/freetype2/BUILD.gn
@@ -26,6 +26,7 @@
"src/src/base/ftgxval.c",
"src/src/base/ftinit.c",
"src/src/base/ftlcdfil.c",
+ "src/src/base/ftmm.c",
"src/src/base/ftpfr.c",
"src/src/base/ftstroke.c",
"src/src/base/ftsynth.c",
@@ -58,7 +59,6 @@
"FT_CONFIG_CONFIG_H=<ftconfig.h>", # See comments in README.chromium.
"FT_CONFIG_MODULES_H=<ftmodule.h>", # See comments in README.chromium.
- "FT_CONFIG_OPTIONS_H=<ftoption.h>", # See comments in README.chromium.
]
configs -= [ "//build/config/compiler:chromium_code" ]
diff --git a/third_party/freetype2/README.chromium b/third_party/freetype2/README.chromium
index 95a2fa2..9442685 100644
--- a/third_party/freetype2/README.chromium
+++ b/third_party/freetype2/README.chromium
@@ -1,15 +1,27 @@
Name: freetype2
URL: git://git.sv.nongnu.org/freetype/freetype2.git
-Version: 2.3.11
+Version: 2.4.8-1ubuntu2.1
Security Critical: no
License: BSD
License File: NOT_SHIPPED
Description:
-This mirrors the version of Freetype2 that was distributed with Ubuntu Lucid
-(Version 2.3.11, git hash d699c2994ecc178c4ed05ac2086061b2034c2178, as seen
-in https://launchpad.net/ubuntu/lucid/+source/freetype ).
+This mirrors the version of Freetype2 that was distributed with Ubuntu Precise
+(Version 2.4.8, git hash 9d7f0957fbd10fdbabf9815e37857a910ad4f4ac, plus
+applicable debian/patches-freetype as seen in
+https://launchpad.net/ubuntu/lucid/+source/freetype ). On Ubuntu Precise
+this code should be the same as the result of
+
+apt-get source freetype && cd freetype-2.4.8/ && ./debian/rules patch
+
+The build files should approximate the output of
+
+make -Bn | rev | cut -d ' ' -f 1 | rev | grep "\.c$" | sort
+
+Currently the cache, validators, patent checker (no longer used), and bzip2
+are excluded.
+
We link this library into DumpRenderTree so that we can run the layout tests
on later versions of Ubuntu and still get the same font rendering so that
we don't have to support two sets of pixel test baselines.
diff --git a/third_party/freetype2/freetype2.gyp b/third_party/freetype2/freetype2.gyp
index 0a9a510..c2a279d 100644
--- a/third_party/freetype2/freetype2.gyp
+++ b/third_party/freetype2/freetype2.gyp
@@ -34,6 +34,7 @@
'<(ft2_dir)/src/base/ftgasp.c',
'<(ft2_dir)/src/base/ftgxval.c',
'<(ft2_dir)/src/base/ftlcdfil.c',
+ '<(ft2_dir)/src/base/ftmm.c',
'<(ft2_dir)/src/base/ftpfr.c',
'<(ft2_dir)/src/base/ftstroke.c',
'<(ft2_dir)/src/base/ftsynth.c',
@@ -68,7 +69,6 @@
'FT2_BUILD_LIBRARY',
'FT_CONFIG_CONFIG_H=<ftconfig.h>', # See comments in README.chromium.
'FT_CONFIG_MODULES_H=<ftmodule.h>', # See comments in README.chromium.
- 'FT_CONFIG_OPTIONS_H=<ftoption.h>', # See comments in README.chromium.
],
'include_dirs': [
'include',
diff --git a/third_party/freetype2/freetype2.patch b/third_party/freetype2/freetype2.patch
index 07e94a3..44bcc61 100644
--- a/third_party/freetype2/freetype2.patch
+++ b/third_party/freetype2/freetype2.patch
@@ -26,25 +26,3 @@
#endif
#endif /* !FT_EXPORT_DEF */
-diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
-index 759b3a3..f921a04 100644
---- a/include/freetype/config/ftoption.h
-+++ b/include/freetype/config/ftoption.h
-@@ -92,7 +92,7 @@ FT_BEGIN_HEADER
- /* This is done to allow FreeType clients to run unmodified, forcing */
- /* them to display normal gray-level anti-aliased glyphs. */
- /* */
--/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
- /*************************************************************************/
-@@ -495,7 +495,7 @@ FT_BEGIN_HEADER
- /* Do not #undef this macro here, since the build system might */
- /* define it for certain configurations only. */
- /* */
--/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
-+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
-
- /*************************************************************************/
diff --git a/third_party/freetype2/include/ftconfig.h b/third_party/freetype2/include/ftconfig.h
index 16f8854..f05e608 100644
--- a/third_party/freetype2/include/ftconfig.h
+++ b/third_party/freetype2/include/ftconfig.h
@@ -5,7 +5,7 @@
/* */
/* UNIX-specific configuration file (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */
+/* Copyright 1996-2004, 2006-2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -118,10 +118,6 @@
#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
- /* Preferred alignment of data */
-#define FT_ALIGNMENT 8
-
-
/* FT_UNUSED is a macro used to indicate that a given parameter is not */
/* used -- this is only used to get rid of unpleasant compiler warnings */
#ifndef FT_UNUSED
@@ -150,7 +146,12 @@
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
+ /* AvailabilityMacros.h is available since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
+#endif
#if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1
@@ -287,11 +288,42 @@
/* Provide assembler fragments for performance-critical functions. */
/* These must be defined `static __inline__' with GCC. */
+#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
+#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
+
+ /* documentation is in freetype.h */
+
+ static __inline FT_Int32
+ FT_MulFix_arm( FT_Int32 a,
+ FT_Int32 b )
+ {
+ register FT_Int32 t, t2;
+
+
+ __asm
+ {
+ smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
+ mov a, t, asr #31 /* a = (hi >> 31) */
+ add a, a, #0x8000 /* a += 0x8000 */
+ adds t2, t2, a /* t2 += a */
+ adc t, t, #0 /* t += carry */
+ mov a, t2, lsr #16 /* a = t2 >> 16 */
+ orr a, a, t, lsl #16 /* a |= t << 16 */
+ }
+ return a;
+ }
+
+#endif /* __CC_ARM || __ARMCC__ */
+
+
#ifdef __GNUC__
-#if defined( __arm__ ) && !defined( __thumb__ )
+#if defined( __arm__ ) && !defined( __thumb__ ) && \
+ !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
+ /* documentation is in freetype.h */
+
static __inline__ FT_Int32
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
@@ -312,11 +344,13 @@
return a;
}
-#endif /* __arm__ && !__thumb__ */
+#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
-#if defined( i386 )
+#if defined( __i386__ )
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
+ /* documentation is in freetype.h */
+
static __inline__ FT_Int32
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
@@ -334,9 +368,9 @@
"shrl $16, %%eax\n"
"shll $16, %%edx\n"
"addl %%edx, %%eax\n"
- : "=a"(result), "+d"(b)
- : "a"(a)
- : "%ecx" );
+ : "=a"(result), "=d"(b)
+ : "a"(a), "d"(b)
+ : "%ecx", "cc" );
return result;
}
@@ -344,6 +378,43 @@
#endif /* __GNUC__ */
+
+#ifdef _MSC_VER /* Visual C++ */
+
+#ifdef _M_IX86
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
+
+ /* documentation is in freetype.h */
+
+ static __inline FT_Int32
+ FT_MulFix_i386( FT_Int32 a,
+ FT_Int32 b )
+ {
+ register FT_Int32 result;
+
+ __asm
+ {
+ mov eax, a
+ mov edx, b
+ imul edx
+ mov ecx, edx
+ sar ecx, 31
+ add ecx, 8000h
+ add eax, ecx
+ adc edx, 0
+ shr eax, 16
+ shl edx, 16
+ add eax, edx
+ mov result, eax
+ }
+ return result;
+ }
+
+#endif /* _M_IX86 */
+
+#endif /* _MSC_VER */
+
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
diff --git a/third_party/freetype2/include/ftoption.h b/third_party/freetype2/include/ftoption.h
deleted file mode 100644
index 74f988d..0000000
--- a/third_party/freetype2/include/ftoption.h
+++ /dev/null
@@ -1,708 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftoption.h */
-/* */
-/* User-selectable configuration macros (specification only). */
-/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTOPTION_H__
-#define __FTOPTION_H__
-
-
-#include <ft2build.h>
-
-
-FT_BEGIN_HEADER
-
- /*************************************************************************/
- /* */
- /* USER-SELECTABLE CONFIGURATION MACROS */
- /* */
- /* This file contains the default configuration macro definitions for */
- /* a standard build of the FreeType library. There are three ways to */
- /* use this file to build project-specific versions of the library: */
- /* */
- /* - You can modify this file by hand, but this is not recommended in */
- /* cases where you would like to build several versions of the */
- /* library from a single source directory. */
- /* */
- /* - You can put a copy of this file in your build directory, more */
- /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
- /* is the name of a directory that is included _before_ the FreeType */
- /* include path during compilation. */
- /* */
- /* The default FreeType Makefiles and Jamfiles use the build */
- /* directory `builds/<system>' by default, but you can easily change */
- /* that for your own projects. */
- /* */
- /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
- /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
- /* locate this file during the build. For example, */
- /* */
- /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
- /* #include <freetype/config/ftheader.h> */
- /* */
- /* will use `$BUILD/myftoptions.h' instead of this file for macro */
- /* definitions. */
- /* */
- /* Note also that you can similarly pre-define the macro */
- /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
- /* that are statically linked to the library at compile time. By */
- /* default, this file is <freetype/config/ftmodule.h>. */
- /* */
- /* We highly recommend using the third method whenever possible. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Uncomment the line below if you want to activate sub-pixel rendering */
- /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
- /* */
- /* Note that this feature is covered by several Microsoft patents */
- /* and should not be activated in any default build of the library. */
- /* */
- /* This macro has no impact on the FreeType API, only on its */
- /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
- /* FT_Render_Glyph still generates a bitmap that is 3 times larger than */
- /* the original size; the difference will be that each triplet of */
- /* subpixels has R=G=B. */
- /* */
- /* This is done to allow FreeType clients to run unmodified, forcing */
- /* them to display normal gray-level anti-aliased glyphs. */
- /* */
-#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
- /*************************************************************************/
- /* */
- /* Many compilers provide a non-ANSI 64-bit data type that can be used */
- /* by FreeType to speed up some computations. However, this will create */
- /* some problems when compiling the library in strict ANSI mode. */
- /* */
- /* For this reason, the use of 64-bit integers is normally disabled when */
- /* the __STDC__ macro is defined. You can however disable this by */
- /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
- /* */
- /* For most compilers, this will only create compilation warnings when */
- /* building the library. */
- /* */
- /* ObNote: The compiler-specific 64-bit integers are detected in the */
- /* file `ftconfig.h' either statically or through the */
- /* `configure' script on supported platforms. */
- /* */
-#undef FT_CONFIG_OPTION_FORCE_INT64
-
-
- /*************************************************************************/
- /* */
- /* If this macro is defined, do not try to use an assembler version of */
- /* performance-critical functions (e.g. FT_MulFix). You should only do */
- /* that to verify that the assembler function works properly, or to */
- /* execute benchmark tests of the various implementations. */
-/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
-
-
- /*************************************************************************/
- /* */
- /* If this macro is defined, try to use an inlined assembler version of */
- /* the `FT_MulFix' function, which is a `hotspot' when loading and */
- /* hinting glyphs, and which should be executed as fast as possible. */
- /* */
- /* Note that if your compiler or CPU is not supported, this will default */
- /* to the standard and portable implementation found in `ftcalc.c'. */
- /* */
-#define FT_CONFIG_OPTION_INLINE_MULFIX
-
-
- /*************************************************************************/
- /* */
- /* LZW-compressed file support. */
- /* */
- /* FreeType now handles font files that have been compressed with the */
- /* `compress' program. This is mostly used to parse many of the PCF */
- /* files that come with various X11 distributions. The implementation */
- /* uses NetBSD's `zopen' to partially uncompress the file on the fly */
- /* (see src/lzw/ftgzip.c). */
- /* */
- /* Define this macro if you want to enable this `feature'. */
- /* */
-#define FT_CONFIG_OPTION_USE_LZW
-
-
- /*************************************************************************/
- /* */
- /* Gzip-compressed file support. */
- /* */
- /* FreeType now handles font files that have been compressed with the */
- /* `gzip' program. This is mostly used to parse many of the PCF files */
- /* that come with XFree86. The implementation uses `zlib' to */
- /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
- /* */
- /* Define this macro if you want to enable this `feature'. See also */
- /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
- /* */
-#define FT_CONFIG_OPTION_USE_ZLIB
-
-
- /*************************************************************************/
- /* */
- /* ZLib library selection */
- /* */
- /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
- /* It allows FreeType's `ftgzip' component to link to the system's */
- /* installation of the ZLib library. This is useful on systems like */
- /* Unix or VMS where it generally is already available. */
- /* */
- /* If you let it undefined, the component will use its own copy */
- /* of the zlib sources instead. These have been modified to be */
- /* included directly within the component and *not* export external */
- /* function names. This allows you to link any program with FreeType */
- /* _and_ ZLib without linking conflicts. */
- /* */
- /* Do not #undef this macro here since the build system might define */
- /* it for certain configurations only. */
- /* */
-/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
-
-
- /*************************************************************************/
- /* */
- /* DLL export compilation */
- /* */
- /* When compiling FreeType as a DLL, some systems/compilers need a */
- /* special keyword in front OR after the return type of function */
- /* declarations. */
- /* */
- /* Two macros are used within the FreeType source code to define */
- /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
- /* */
- /* FT_EXPORT( return_type ) */
- /* */
- /* is used in a function declaration, as in */
- /* */
- /* FT_EXPORT( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ); */
- /* */
- /* */
- /* FT_EXPORT_DEF( return_type ) */
- /* */
- /* is used in a function definition, as in */
- /* */
- /* FT_EXPORT_DEF( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ) */
- /* { */
- /* ... some code ... */
- /* return FT_Err_Ok; */
- /* } */
- /* */
- /* You can provide your own implementation of FT_EXPORT and */
- /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
- /* will be later automatically defined as `extern return_type' to */
- /* allow normal compilation. */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
-/* #define FT_EXPORT(x) extern x */
-/* #define FT_EXPORT_DEF(x) x */
-
-
- /*************************************************************************/
- /* */
- /* Glyph Postscript Names handling */
- /* */
- /* By default, FreeType 2 is compiled with the `psnames' module. This */
- /* module is in charge of converting a glyph name string into a */
- /* Unicode value, or return a Macintosh standard glyph name for the */
- /* use with the TrueType `post' table. */
- /* */
- /* Undefine this macro if you do not want `psnames' compiled in your */
- /* build of FreeType. This has the following effects: */
- /* */
- /* - The TrueType driver will provide its own set of glyph names, */
- /* if you build it to support postscript names in the TrueType */
- /* `post' table. */
- /* */
- /* - The Type 1 driver will not be able to synthesize a Unicode */
- /* charmap out of the glyphs found in the fonts. */
- /* */
- /* You would normally undefine this configuration macro when building */
- /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
- /* */
-#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
-
-
- /*************************************************************************/
- /* */
- /* Postscript Names to Unicode Values support */
- /* */
- /* By default, FreeType 2 is built with the `PSNames' module compiled */
- /* in. Among other things, the module is used to convert a glyph name */
- /* into a Unicode value. This is especially useful in order to */
- /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
- /* through a big table named the `Adobe Glyph List' (AGL). */
- /* */
- /* Undefine this macro if you do not want the Adobe Glyph List */
- /* compiled in your `PSNames' module. The Type 1 driver will not be */
- /* able to synthesize a Unicode charmap out of the glyphs found in the */
- /* fonts. */
- /* */
-#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
-
-
- /*************************************************************************/
- /* */
- /* Support for Mac fonts */
- /* */
- /* Define this macro if you want support for outline fonts in Mac */
- /* format (mac dfont, mac resource, macbinary containing a mac */
- /* resource) on non-Mac platforms. */
- /* */
- /* Note that the `FOND' resource isn't checked. */
- /* */
-#define FT_CONFIG_OPTION_MAC_FONTS
-
-
- /*************************************************************************/
- /* */
- /* Guessing methods to access embedded resource forks */
- /* */
- /* Enable extra Mac fonts support on non-Mac platforms (e.g. */
- /* GNU/Linux). */
- /* */
- /* Resource forks which include fonts data are stored sometimes in */
- /* locations which users or developers don't expected. In some cases, */
- /* resource forks start with some offset from the head of a file. In */
- /* other cases, the actual resource fork is stored in file different */
- /* from what the user specifies. If this option is activated, */
- /* FreeType tries to guess whether such offsets or different file */
- /* names must be used. */
- /* */
- /* Note that normal, direct access of resource forks is controlled via */
- /* the FT_CONFIG_OPTION_MAC_FONTS option. */
- /* */
-#ifdef FT_CONFIG_OPTION_MAC_FONTS
-#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
-#endif
-
-
- /*************************************************************************/
- /* */
- /* Allow the use of FT_Incremental_Interface to load typefaces that */
- /* contain no glyph data, but supply it via a callback function. */
- /* This allows FreeType to be used with the PostScript language, using */
- /* the GhostScript interpreter. */
- /* */
-/* #define FT_CONFIG_OPTION_INCREMENTAL */
-
-
- /*************************************************************************/
- /* */
- /* The size in bytes of the render pool used by the scan-line converter */
- /* to do all of its work. */
- /* */
- /* This must be greater than 4KByte if you use FreeType to rasterize */
- /* glyphs; otherwise, you may set it to zero to avoid unnecessary */
- /* allocation of the render pool. */
- /* */
-#define FT_RENDER_POOL_SIZE 16384L
-
-
- /*************************************************************************/
- /* */
- /* FT_MAX_MODULES */
- /* */
- /* The maximum number of modules that can be registered in a single */
- /* FreeType library object. 32 is the default. */
- /* */
-#define FT_MAX_MODULES 32
-
-
- /*************************************************************************/
- /* */
- /* Debug level */
- /* */
- /* FreeType can be compiled in debug or trace mode. In debug mode, */
- /* errors are reported through the `ftdebug' component. In trace */
- /* mode, additional messages are sent to the standard output during */
- /* execution. */
- /* */
- /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
- /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
- /* */
- /* Don't define any of these macros to compile in `release' mode! */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
-/* #define FT_DEBUG_LEVEL_ERROR */
-/* #define FT_DEBUG_LEVEL_TRACE */
-
-
- /*************************************************************************/
- /* */
- /* Memory Debugging */
- /* */
- /* FreeType now comes with an integrated memory debugger that is */
- /* capable of detecting simple errors like memory leaks or double */
- /* deletes. To compile it within your build of the library, you */
- /* should define FT_DEBUG_MEMORY here. */
- /* */
- /* Note that the memory debugger is only activated at runtime when */
- /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
- /* */
- /* Do not #undef this macro here since the build system might define */
- /* it for certain configurations only. */
- /* */
-/* #define FT_DEBUG_MEMORY */
-
-
- /*************************************************************************/
- /* */
- /* Module errors */
- /* */
- /* If this macro is set (which is _not_ the default), the higher byte */
- /* of an error code gives the module in which the error has occurred, */
- /* while the lower byte is the real error code. */
- /* */
- /* Setting this macro makes sense for debugging purposes only, since */
- /* it would break source compatibility of certain programs that use */
- /* FreeType 2. */
- /* */
- /* More details can be found in the files ftmoderr.h and fterrors.h. */
- /* */
-#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
-
-
- /*************************************************************************/
- /* */
- /* Position Independent Code */
- /* */
- /* If this macro is set (which is _not_ the default), FreeType2 will */
- /* avoid creating constants that require address fixups. Instead the */
- /* constants will be moved into a struct and additional intialization */
- /* code will be used. */
- /* */
- /* Setting this macro is needed for systems that prohibit address */
- /* fixups, such as BREW. */
- /* */
-/* #define FT_CONFIG_OPTION_PIC */
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
- /* embedded bitmaps in all formats using the SFNT module (namely */
- /* TrueType & OpenType). */
- /* */
-#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
- /* load and enumerate the glyph Postscript names in a TrueType or */
- /* OpenType file. */
- /* */
- /* Note that when you do not compile the `PSNames' module by undefining */
- /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
- /* contain additional code used to read the PS Names table from a font. */
- /* */
- /* (By default, the module uses `PSNames' to extract glyph names.) */
- /* */
-#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
- /* access the internal name table in a SFNT-based format like TrueType */
- /* or OpenType. The name table contains various strings used to */
- /* describe the font, like family name, copyright, version, etc. It */
- /* does not contain any glyph name though. */
- /* */
- /* Accessing SFNT names is done through the functions declared in */
- /* `freetype/ftsnames.h'. */
- /* */
-#define TT_CONFIG_OPTION_SFNT_NAMES
-
-
- /*************************************************************************/
- /* */
- /* TrueType CMap support */
- /* */
- /* Here you can fine-tune which TrueType CMap table format shall be */
- /* supported. */
-#define TT_CONFIG_CMAP_FORMAT_0
-#define TT_CONFIG_CMAP_FORMAT_2
-#define TT_CONFIG_CMAP_FORMAT_4
-#define TT_CONFIG_CMAP_FORMAT_6
-#define TT_CONFIG_CMAP_FORMAT_8
-#define TT_CONFIG_CMAP_FORMAT_10
-#define TT_CONFIG_CMAP_FORMAT_12
-#define TT_CONFIG_CMAP_FORMAT_13
-#define TT_CONFIG_CMAP_FORMAT_14
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
- /* a bytecode interpreter in the TrueType driver. Note that there are */
- /* important patent issues related to the use of the interpreter. */
- /* */
- /* By undefining this, you will only compile the code necessary to load */
- /* TrueType glyphs without hinting. */
- /* */
- /* Do not #undef this macro here, since the build system might */
- /* define it for certain configurations only. */
- /* */
-#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
-
- /*************************************************************************/
- /* */
- /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
- /* of the TrueType bytecode interpreter is used that doesn't implement */
- /* any of the patented opcodes and algorithms. Note that the */
- /* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */
- /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */
- /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
- /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
- /* */
- /* This macro is only useful for a small number of font files (mostly */
- /* for Asian scripts) that require bytecode interpretation to properly */
- /* load glyphs. For all other fonts, this produces unpleasant results, */
- /* thus the unpatented interpreter is never used to load glyphs from */
- /* TrueType fonts unless one of the following two options is used. */
- /* */
- /* - The unpatented interpreter is explicitly activated by the user */
- /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
- /* when opening the FT_Face. */
- /* */
- /* - FreeType detects that the FT_Face corresponds to one of the */
- /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
- /* contains a hard-coded list of font names and other matching */
- /* parameters (see function `tt_face_init' in file */
- /* `src/truetype/ttobjs.c'). */
- /* */
- /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
- /* */
- /* { */
- /* FT_Parameter parameter; */
- /* FT_Open_Args open_args; */
- /* */
- /* */
- /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
- /* */
- /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
- /* open_args.pathname = my_font_pathname; */
- /* open_args.num_params = 1; */
- /* open_args.params = ¶meter; */
- /* */
- /* error = FT_Open_Face( library, &open_args, index, &face ); */
- /* ... */
- /* } */
- /* */
-#define TT_CONFIG_OPTION_UNPATENTED_HINTING
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
- /* bytecode interpreter with a huge switch statement, rather than a call */
- /* table. This results in smaller and faster code for a number of */
- /* architectures. */
- /* */
- /* Note however that on some compiler/processor combinations, undefining */
- /* this macro will generate faster, though larger, code. */
- /* */
-#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
- /* TrueType glyph loader to use Apple's definition of how to handle */
- /* component offsets in composite glyphs. */
- /* */
- /* Apple and MS disagree on the default behavior of component offsets */
- /* in composites. Apple says that they should be scaled by the scaling */
- /* factors in the transformation matrix (roughly, it's more complex) */
- /* while MS says they should not. OpenType defines two bits in the */
- /* composite flags array which can be used to disambiguate, but old */
- /* fonts will not have them. */
- /* */
- /* http://partners.adobe.com/asn/developer/opentype/glyf.html */
- /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
- /* */
-#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
- /* support for Apple's distortable font technology (fvar, gvar, cvar, */
- /* and avar tables). This has many similarities to Type 1 Multiple */
- /* Masters support. */
- /* */
-#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_BDF if you want to include support for */
- /* an embedded `BDF ' table within SFNT-based bitmap formats. */
- /* */
-#define TT_CONFIG_OPTION_BDF
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
- /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
- /* required. */
- /* */
-#define T1_MAX_DICT_DEPTH 5
-
-
- /*************************************************************************/
- /* */
- /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
- /* calls during glyph loading. */
- /* */
-#define T1_MAX_SUBRS_CALLS 16
-
-
- /*************************************************************************/
- /* */
- /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
- /* minimum of 16 is required. */
- /* */
- /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
- /* */
-#define T1_MAX_CHARSTRINGS_OPERANDS 256
-
-
- /*************************************************************************/
- /* */
- /* Define this configuration macro if you want to prevent the */
- /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
- /* files into an existing face. Note that if set, the T1 driver will be */
- /* unable to produce kerning distances. */
- /* */
-#undef T1_CONFIG_OPTION_NO_AFM
-
-
- /*************************************************************************/
- /* */
- /* Define this configuration macro if you want to prevent the */
- /* compilation of the Multiple Masters font support in the Type 1 */
- /* driver. */
- /* */
-#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
- /* support. */
- /* */
-#define AF_CONFIG_OPTION_CJK
-
- /*************************************************************************/
- /* */
- /* Compile autofit module with Indic script support. */
- /* */
-#define AF_CONFIG_OPTION_INDIC
-
- /* */
-
-
- /*
- * Define this variable if you want to keep the layout of internal
- * structures that was used prior to FreeType 2.2. This also compiles in
- * a few obsolete functions to avoid linking problems on typical Unix
- * distributions.
- *
- * For embedded systems or building a new distribution from scratch, it
- * is recommended to disable the macro since it reduces the library's code
- * size and activates a few memory-saving optimizations as well.
- */
-#define FT_CONFIG_OPTION_OLD_INTERNALS
-
-
- /*
- * This macro is defined if either unpatented or native TrueType
- * hinting is requested by the definitions above.
- */
-#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-#define TT_USE_BYTECODE_INTERPRETER
-#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
-#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
-#define TT_USE_BYTECODE_INTERPRETER
-#endif
-
-FT_END_HEADER
-
-
-#endif /* __FTOPTION_H__ */
-
-
-/* END */
diff --git a/third_party/libevent/README.chromium b/third_party/libevent/README.chromium
index 7e5f8ba..be4fee3 100644
--- a/third_party/libevent/README.chromium
+++ b/third_party/libevent/README.chromium
@@ -18,3 +18,8 @@
5) Apply r87338.
6) The configs for android were copied from Linux's which were very close to
android one with the exception of HAVE_FD_MASK and HAVE_STRLCPY.
+7) Add files to support building with the PNaCl toolchain. Added
+ libevent_nacl_nonsfi.gyp for build rule. nacl_nonsfi/config.h and
+ nacl_nonsfi/event-config.h are derived from linux/ counterparts.
+ nacl_nonsfi/random.c is also added to provide the random() function,
+ which is missing in the newlib-based PNaCl toolchain.
diff --git a/third_party/libevent/event-config.h b/third_party/libevent/event-config.h
index d656999..2e564db 100644
--- a/third_party/libevent/event-config.h
+++ b/third_party/libevent/event-config.h
@@ -5,7 +5,9 @@
// This file is Chromium-specific, and brings in the appropriate
// event-config.h depending on your platform.
-#if defined(__APPLE__)
+#if defined(__native_client_nonsfi__)
+#include "nacl_nonsfi/event-config.h"
+#elif defined(__APPLE__)
#include "mac/event-config.h"
#elif defined(ANDROID)
#include "android/event-config.h"
diff --git a/third_party/libevent/libevent_nacl_nonsfi.gyp b/third_party/libevent/libevent_nacl_nonsfi.gyp
new file mode 100644
index 0000000..8638c96
--- /dev/null
+++ b/third_party/libevent/libevent_nacl_nonsfi.gyp
@@ -0,0 +1,51 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../build/common_untrusted.gypi',
+ ],
+ 'conditions': [
+ ['disable_nacl==0', {
+ 'targets': [
+ {
+ 'target_name': 'event_nacl_nonsfi',
+ 'type': 'none',
+ 'sources': [
+ 'buffer.c',
+ 'evbuffer.c',
+ 'event.c',
+ 'evutil.c',
+ 'log.c',
+ 'poll.c',
+ 'signal.c',
+ 'strlcpy.c',
+ 'nacl_nonsfi/config.h',
+ 'nacl_nonsfi/event-config.h',
+ 'nacl_nonsfi/random.c',
+ ],
+ 'defines': [
+ 'HAVE_CONFIG_H',
+ ],
+ 'variables': {
+ 'include_dirs': [
+ 'nacl_nonsfi',
+ '<(DEPTH)/native_client/src/public/linux_syscalls',
+ ],
+ 'nacl_untrusted_build': 1,
+ 'nlib_target': 'libevent_nacl_nonsfi.a',
+ 'build_glibc': 0,
+ 'build_newlib': 0,
+ 'build_irt': 0,
+ 'build_pnacl_newlib': 0,
+ 'build_nonsfi_helper': 1,
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/third_party/libevent/nacl_nonsfi/config.h b/third_party/libevent/nacl_nonsfi/config.h
new file mode 100644
index 0000000..60c9dfe
--- /dev/null
+++ b/third_party/libevent/nacl_nonsfi/config.h
@@ -0,0 +1,273 @@
+/* Copied from Linux version and changed the features according the PNaCl
+ * toolchain for the Non-SFI binary build, which is close to one under the
+ * linux/ directory. The built binary will be running under Linux directly,
+ * actually.
+ */
+
+/* Define if clock_gettime is available in libc */
+#define DNS_USE_CPU_CLOCK_FOR_ID 1
+
+/* Define is no secure id variant is available */
+/* #undef DNS_USE_GETTIMEOFDAY_FOR_ID */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define if /dev/poll is available */
+/* #undef HAVE_DEVPOLL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define if your system supports the epoll system calls */
+/* #undef HAVE_EPOLL */
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef HAVE_EPOLL_CTL */
+
+/* Define if your system supports event ports */
+/* #undef HAVE_EVENT_PORTS */
+
+/* Define to 1 if you have the `fcntl' function. */
+#define HAVE_FCNTL 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if the system has the type `fd_mask'. */
+#define HAVE_FD_MASK 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getegid' function. */
+#define HAVE_GETEGID 1
+
+/* Define to 1 if you have the `geteuid' function. */
+#define HAVE_GETEUID 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#define HAVE_INET_NTOP 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `issetugid' function. */
+/* #undef HAVE_ISSETUGID */
+
+/* Define to 1 if you have the `kqueue' function. */
+/* #undef HAVE_KQUEUE */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#define HAVE_LIBNSL 1
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+#define HAVE_LIBRESOLV 1
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#define HAVE_LIBRT 1
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+/* #undef HAVE_NETINET_IN6_H */
+
+/* Define to 1 if you have the `poll' function. */
+#define HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#define HAVE_POLL_H 1
+
+/* Define to 1 if you have the `port_create' function. */
+/* #undef HAVE_PORT_CREATE */
+
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef HAVE_PORT_H */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef HAVE_SELECT */
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+#define HAVE_SETFD 1
+
+/* Note: The PNaCl toolchain prodives linux ABI's sigaction, named
+ * linux_sigaction() in native_client/src/nonsfi/linux/linux_sys_private.c,
+ * but newlib ABI sigaction() is not provided.
+ */
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if you have the `signal' function. */
+/* #undef HAVE_SIGNAL */
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strsep' function. */
+#define HAVE_STRSEP 1
+
+/* Define to 1 if you have the `strtok_r' function. */
+#define HAVE_STRTOK_R 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define HAVE_STRTOLL 1
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define HAVE_STRUCT_IN6_ADDR 1
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#define HAVE_SYS_EPOLL_H 1
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+/* #undef HAVE_SYS_EVENT_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#define HAVE_SYS_QUEUE_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+#define HAVE_TAILQFOREACH 1
+
+/* Define if timeradd is defined in <sys/time.h> */
+/* #undef HAVE_TIMERADD */
+
+/* Define if timerclear is defined in <sys/time.h> */
+/* #undef HAVE_TIMERCLEAR */
+
+/* Define if timercmp is defined in <sys/time.h> */
+/* #undef HAVE_TIMERCMP */
+
+/* Define if timerisset is defined in <sys/time.h> */
+/* #undef HAVE_TIMERISSET */
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#define HAVE_UINT16_T 1
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#define HAVE_UINT32_T 1
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#define HAVE_UINT64_T 1
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#define HAVE_UINT8_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vasprintf' function. */
+/* #undef HAVE_VASPRINTF */
+
+/* Define if kqueue works correctly with pipes */
+/* #undef HAVE_WORKING_KQUEUE */
+
+/* Name of package */
+#define PACKAGE "libevent_nacl"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 8
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define VERSION "1.4.13-stable"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+/* #undef __func__ */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to unsigned int if you dont have it */
+/* #undef socklen_t */
diff --git a/third_party/libevent/nacl_nonsfi/event-config.h b/third_party/libevent/nacl_nonsfi/event-config.h
new file mode 100644
index 0000000..636ee80
--- /dev/null
+++ b/third_party/libevent/nacl_nonsfi/event-config.h
@@ -0,0 +1,280 @@
+/* Copied from Linux version and changed the features according the PNaCl
+ * toolchain for the Non-SFI binary build, which is close to one under the
+ * linux/ directory. The built binary will be running under Linux directly,
+ * actually.
+ */
+
+#ifndef _EVENT_CONFIG_H_
+#define _EVENT_CONFIG_H_
+
+/* Define if clock_gettime is available in libc */
+#define _EVENT_DNS_USE_CPU_CLOCK_FOR_ID 1
+
+/* Define is no secure id variant is available */
+/* #undef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define _EVENT_HAVE_CLOCK_GETTIME 1
+
+/* Define if /dev/poll is available */
+/* #undef _EVENT_HAVE_DEVPOLL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define _EVENT_HAVE_DLFCN_H 1
+
+/* Define if your system supports the epoll system calls */
+/* #undef _EVENT_HAVE_EPOLL */
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef _EVENT_HAVE_EPOLL_CTL */
+
+/* Define if your system supports event ports */
+/* #undef _EVENT_HAVE_EVENT_PORTS */
+
+/* Define to 1 if you have the `fcntl' function. */
+#define _EVENT_HAVE_FCNTL 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define _EVENT_HAVE_FCNTL_H 1
+
+/* Define to 1 if the system has the type `fd_mask'. */
+#define _EVENT_HAVE_FD_MASK 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define _EVENT_HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getegid' function. */
+#define _EVENT_HAVE_GETEGID 1
+
+/* Define to 1 if you have the `geteuid' function. */
+#define _EVENT_HAVE_GETEUID 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define _EVENT_HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define _EVENT_HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#define _EVENT_HAVE_INET_NTOP 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define _EVENT_HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `issetugid' function. */
+/* #undef _EVENT_HAVE_ISSETUGID */
+
+/* Define to 1 if you have the `kqueue' function. */
+/* #undef _EVENT_HAVE_KQUEUE */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#define _EVENT_HAVE_LIBNSL 1
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+#define _EVENT_HAVE_LIBRESOLV 1
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#define _EVENT_HAVE_LIBRT 1
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef _EVENT_HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define _EVENT_HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+/* #undef _EVENT_HAVE_NETINET_IN6_H */
+
+/* Define to 1 if you have the `poll' function. */
+#define _EVENT_HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#define _EVENT_HAVE_POLL_H 1
+
+/* Define to 1 if you have the `port_create' function. */
+/* #undef _EVENT_HAVE_PORT_CREATE */
+
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef _EVENT_HAVE_PORT_H */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef _EVENT_HAVE_SELECT */
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+#define _EVENT_HAVE_SETFD 1
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef _EVENT_HAVE_SIGACTION */
+
+/* Define to 1 if you have the `signal' function. */
+#define _EVENT_HAVE_SIGNAL 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define _EVENT_HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define _EVENT_HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define _EVENT_HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define _EVENT_HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define _EVENT_HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define _EVENT_HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef _EVENT_HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strsep' function. */
+#define _EVENT_HAVE_STRSEP 1
+
+/* Define to 1 if you have the `strtok_r' function. */
+#define _EVENT_HAVE_STRTOK_R 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define _EVENT_HAVE_STRTOLL 1
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define _EVENT_HAVE_STRUCT_IN6_ADDR 1
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+/* #undef _EVENT_HAVE_SYS_EPOLL_H */
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+/* #undef _EVENT_HAVE_SYS_EVENT_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef _EVENT_HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define _EVENT_HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#define _EVENT_HAVE_SYS_QUEUE_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define _EVENT_HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define _EVENT_HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define _EVENT_HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define _EVENT_HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define _EVENT_HAVE_SYS_TYPES_H 1
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+#define _EVENT_HAVE_TAILQFOREACH 1
+
+/* Define if timeradd is defined in <sys/time.h> */
+/* #undef _EVENT_HAVE_TIMERADD */
+
+/* Define if timerclear is defined in <sys/time.h> */
+/* #undef _EVENT_HAVE_TIMERCLEAR */
+
+/* Define if timercmp is defined in <sys/time.h> */
+/* #undef _EVENT_HAVE_TIMERCMP */
+
+/* Define if timerisset is defined in <sys/time.h> */
+/* #undef _EVENT_HAVE_TIMERISSET */
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#define _EVENT_HAVE_UINT16_T 1
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#define _EVENT_HAVE_UINT32_T 1
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#define _EVENT_HAVE_UINT64_T 1
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#define _EVENT_HAVE_UINT8_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define _EVENT_HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vasprintf' function. */
+#define _EVENT_HAVE_VASPRINTF 1
+
+/* Define if kqueue works correctly with pipes */
+/* #undef _EVENT_HAVE_WORKING_KQUEUE */
+
+/* Name of package */
+#define _EVENT_PACKAGE "libevent_nacl"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define _EVENT_PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define _EVENT_PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define _EVENT_PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define _EVENT_PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define _EVENT_PACKAGE_VERSION ""
+
+/* The size of `int', as computed by sizeof. */
+#define _EVENT_SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define _EVENT_SIZEOF_LONG 8
+
+/* The size of `long long', as computed by sizeof. */
+#define _EVENT_SIZEOF_LONG_LONG 8
+
+/* The size of `short', as computed by sizeof. */
+#define _EVENT_SIZEOF_SHORT 2
+
+/* Define to 1 if you have the ANSI C header files. */
+#define _EVENT_STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define _EVENT_TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define _EVENT_VERSION "1.4.13-stable"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+/* #undef _EVENT___func__ */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef _EVENT_const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef _EVENT___cplusplus
+/* #undef _EVENT_inline */
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef _EVENT_pid_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef _EVENT_size_t */
+
+/* Define to unsigned int if you dont have it */
+/* #undef _EVENT_socklen_t */
+
+/* Work around for __native_client_nonsfi__ build. random() is not provided
+ * by the newlib-based PNaCl toolchain, so here we declare it. Please see also
+ * nacl_nonsfi/random.c for more details.
+ */
+long int random();
+
+#endif
diff --git a/third_party/libevent/nacl_nonsfi/random.c b/third_party/libevent/nacl_nonsfi/random.c
new file mode 100644
index 0000000..3577dd5
--- /dev/null
+++ b/third_party/libevent/nacl_nonsfi/random.c
@@ -0,0 +1,13 @@
+/* Copyright 2014 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <stdlib.h>
+
+/* The newlib-based PNaCl toolchain does not provide random(). So, here we
+ * define it. It just redirects to the rand(), which is provided by the
+ * toolchain. */
+long int random() {
+ return rand();
+}
diff --git a/tools/android/checkstyle/checkstyle.py b/tools/android/checkstyle/checkstyle.py
index 25f202f..6b54c77 100644
--- a/tools/android/checkstyle/checkstyle.py
+++ b/tools/android/checkstyle/checkstyle.py
@@ -6,13 +6,14 @@
import os
import subprocess
+import xml.dom.minidom
CHROMIUM_SRC = os.path.normpath(
os.path.join(os.path.dirname(__file__),
os.pardir, os.pardir, os.pardir))
CHECKSTYLE_ROOT = os.path.join(CHROMIUM_SRC, 'third_party', 'checkstyle',
- 'checkstyle-5.7-all.jar')
+ 'checkstyle-5.8-all.jar')
def RunCheckstyle(input_api, output_api, style_file):
@@ -34,11 +35,9 @@
check = subprocess.Popen(['java', '-cp',
CHECKSTYLE_ROOT,
'com.puppycrawl.tools.checkstyle.Main', '-c',
- style_file] + java_files,
+ style_file, '-f', 'xml'] + java_files,
stdout=subprocess.PIPE, env=checkstyle_env)
stdout, _ = check.communicate()
- if check.returncode == 0:
- return []
except OSError as e:
import errno
if e.errno == errno.ENOENT:
@@ -46,24 +45,32 @@
'build/install-build-deps-android.sh')
return [output_api.PresubmitPromptWarning(install_error)]
- # Remove non-error values from stdout
- errors = stdout.splitlines()
-
- if errors and errors[0] == 'Starting audit...':
- del errors[0]
- if errors and errors[-1] == 'Audit done.':
- del errors[-1]
-
- # Filter out warnings
- errors = [x for x in errors if 'warning: ' not in x]
- if not errors:
- return []
+ result_errors = []
+ result_warnings = []
local_path = input_api.PresubmitLocalPath()
- output = []
- for error in errors:
- # Change the full file path to relative path in the output lines
- full_path, end = error.split(':', 1)
- rel_path = os.path.relpath(full_path, local_path)
- output.append(' %s:%s' % (rel_path, end))
- return [output_api.PresubmitPromptWarning('\n'.join(output))]
+ root = xml.dom.minidom.parseString(stdout)
+ for fileElement in root.getElementsByTagName('file'):
+ fileName = fileElement.attributes['name'].value
+ fileName = os.path.relpath(fileName, local_path)
+ errors = fileElement.getElementsByTagName('error')
+ for error in errors:
+ line = error.attributes['line'].value
+ column = ''
+ if error.hasAttribute('column'):
+ column = '%s:' % (error.attributes['column'].value)
+ message = error.attributes['message'].value
+ result = ' %s:%s:%s %s' % (fileName, line, column, message)
+
+ severity = error.attributes['severity'].value
+ if severity == 'error':
+ result_errors.append(result)
+ elif severity == 'warning':
+ result_warnings.append(result)
+
+ result = []
+ if result_warnings:
+ result.append(output_api.PresubmitPromptWarning('\n'.join(result_warnings)))
+ if result_errors:
+ result.append(output_api.PresubmitError('\n'.join(result_errors)))
+ return result
diff --git a/tools/android/checkstyle/chromium-style-5.0.xml b/tools/android/checkstyle/chromium-style-5.0.xml
index bc40f87..7f6b7ee 100644
--- a/tools/android/checkstyle/chromium-style-5.0.xml
+++ b/tools/android/checkstyle/chromium-style-5.0.xml
@@ -12,25 +12,27 @@
<property name="severity" value="error"/>
</module>
<module name="IllegalCatch">
- <property name="severity" value="warning"/>
+ <property name="severity" value="info"/>
</module>
<module name="RedundantImport">
<message key="import.redundant" value="Redundant import: {0}. Use :JavaImportOrganize (ECLIM) or Ctrl+Shift+O (Eclipse) to sort imports"/>
- <property name="severity" value="error"/>
+ <!-- This check is set to a warning because JNI generator sometimes requires to leave an unused import -->
+ <property name="severity" value="warning"/>
</module>
<module name="UnusedImports">
- <property name="severity" value="error"/>
- <property name="processJavadoc" value="true"/>
<message key="import.unused" value="Unused import: {0}. Use :JavaImportOrganize (ECLIM) or Ctrl+Shift+O (Eclipse) to sort imports"/>
+ <!-- This check is set to a warning because JNI generator sometimes requires to leave an unused import -->
+ <property name="severity" value="warning"/>
+ <property name="processJavadoc" value="true"/>
</module>
<module name="JavadocType">
- <property name="severity" value="error"/>
+ <property name="severity" value="warning"/>
<property name="tokens" value="INTERFACE_DEF, CLASS_DEF"/>
<property name="scope" value="public"/>
<message key="javadoc.missing" value="Public classes and interfaces require JavaDoc comments."/>
</module>
<module name="JavadocMethod">
- <property name="severity" value="warning"/>
+ <property name="severity" value="info"/>
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
@@ -99,7 +101,7 @@
<property name="severity" value="error"/>
</module>
<module name="NeedBraces">
- <property name="severity" value="warning"/>
+ <property name="severity" value="info"/>
<property name="tokens" value="LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
</module>
<module name="EmptyBlock">
@@ -140,11 +142,14 @@
<property name="severity" value="error"/>
</module>
<module name="NoFinalizer">
- <property name="severity" value="warning"/>
+ <property name="severity" value="info"/>
</module>
<module name="ParenPad">
<property name="severity" value="error"/>
</module>
+ <module name="MethodParamPad">
+ <property name="severity" value="error"/>
+ </module>
<module name="ImportOrder">
<property name="severity" value="error"/>
<message key="import.ordering" value="Wrong order for {0} import. Use :JavaImportOrganize (ECLIM) or Ctrl+Shift+O (Eclipse) to sort imports"/>
@@ -155,7 +160,7 @@
</module>
<!-- TODO(aurimas): make indentation an error once https://github.com/checkstyle/checkstyle/issues/255 is fixed. -->
<module name="Indentation">
- <property name="severity" value="warning"/>
+ <property name="severity" value="info"/>
<property name="basicOffset" value="4"/>
<property name="throwsIndent" value="8"/>
</module>
@@ -164,14 +169,6 @@
<property name="severity" value="error"/>
</module>
<module name="RegexpSingleline">
- <property name="format" value="((//.*)|(\*.*))FIXME"/>
- <property name="message" value="TODO is preferred to FIXME. e.g. "TODO(johndoe):"/>
- </module>
- <module name="RegexpSingleline">
- <property name="format" value="((//.*)|(\*.*))(?<!TODO\(.{0,100})(TODO[^(])|(TODO\([^)]*$)"/>
- <property name="message" value="All TODOs should be named. e.g. "TODO(johndoe):"/>
- </module>
- <module name="RegexpSingleline">
<property name="severity" value="error"/>
<property name="format" value="[ \t]+$"/>
<property name="message" value="Trailing whitespace"/>
diff --git a/tools/android/forwarder2/forwarder.gyp b/tools/android/forwarder2/forwarder.gyp
index fbf5eba..c427366 100644
--- a/tools/android/forwarder2/forwarder.gyp
+++ b/tools/android/forwarder2/forwarder.gyp
@@ -25,6 +25,7 @@
'toolsets': ['target'],
'dependencies': [
'../../../base/base.gyp:base',
+ '../../../build/android/pylib/device/commands/commands.gyp:chromium_commands',
'../common/common.gyp:android_tools_common',
],
'include_dirs': [
diff --git a/tools/android/memconsumer/java/src/org/chromium/memconsumer/MemConsumer.java b/tools/android/memconsumer/java/src/org/chromium/memconsumer/MemConsumer.java
index 17566f8..23ad2b8 100644
--- a/tools/android/memconsumer/java/src/org/chromium/memconsumer/MemConsumer.java
+++ b/tools/android/memconsumer/java/src/org/chromium/memconsumer/MemConsumer.java
@@ -58,7 +58,7 @@
EditText editText = (EditText) child;
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
- public boolean onEditorAction (TextView v, int actionId, KeyEvent event) {
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (v.getText().length() > 0) {
updateMemoryConsumption(Integer.parseInt(v.getText().toString()));
}
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
index 8658b04..59cd417 100644
--- a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
+++ b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
@@ -861,6 +861,10 @@
}
void HandleTranslationUnit(ASTContext& context) override {
+ // Don't run the plugin if the compilation unit is already invalid.
+ if (diagnostic_.hasErrorOccurred())
+ return;
+
CollectVisitor visitor;
visitor.TraverseDecl(context.getTranslationUnitDecl());
diff --git a/tools/clang/blink_gc_plugin/tests/crash_on_invalid.cpp b/tools/clang/blink_gc_plugin/tests/crash_on_invalid.cpp
new file mode 100644
index 0000000..6370812
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/tests/crash_on_invalid.cpp
@@ -0,0 +1,7 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "crash_on_invalid.h"
+
+// Nothing to define.
diff --git a/tools/clang/blink_gc_plugin/tests/crash_on_invalid.h b/tools/clang/blink_gc_plugin/tests/crash_on_invalid.h
new file mode 100644
index 0000000..a77d097
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/tests/crash_on_invalid.h
@@ -0,0 +1,26 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Regression test for http://crbug.com/421958
+
+#ifndef CRASH_ON_INVALID_H_
+#define CRASH_ON_INVALID_H_
+
+namespace blink {
+
+class Visitor;
+class GamepadCommon {};
+class ScriptWrappable {};
+
+class Gamepad final : public GarbageCollectedFinalized<Gamepad>,
+ public GamepadCommon,
+ public ScriptWrappable {
+public:
+ virtual const WrapperTypeInfo *wrapperTypeInfo() const {}
+ void trace(Visitor *);
+};
+
+}
+
+#endif
diff --git a/tools/clang/blink_gc_plugin/tests/crash_on_invalid.txt b/tools/clang/blink_gc_plugin/tests/crash_on_invalid.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/tests/crash_on_invalid.txt
@@ -0,0 +1 @@
+
diff --git a/tools/valgrind/drmemory/suppressions_full.txt b/tools/valgrind/drmemory/suppressions_full.txt
index c3c7f8e..544e5a6 100644
--- a/tools/valgrind/drmemory/suppressions_full.txt
+++ b/tools/valgrind/drmemory/suppressions_full.txt
@@ -1769,19 +1769,6 @@
*!content::BrowserPluginTest_ResizeFlowControl_Test::TestBody
UNINITIALIZED READ
-name=bug_374105a
-...
-gpu.dll!gpu::gles2::ShaderTranslatorCache::GetTranslator
-gpu.dll!gpu::gles2::GLES2DecoderImpl::InitializeShaderTranslator
-gpu.dll!gpu::gles2::GLES2DecoderImpl::Initialize
-
-UNINITIALIZED READ
-name=bug_374105b
-...
-gpu.dll!gpu::gles2::ShaderTranslator::GetStringForOptionsThatWouldAffectCompilation
-*!gpu::gles2::ShaderTranslatorTest_OptionsString_Test::TestBody
-
-UNINITIALIZED READ
name=bug_374410
*!ui::NativeThemeWin::PaintScrollbarTrack
*!ui::NativeThemeWin::PaintDirect
diff --git a/tools/valgrind/gtest_exclude/ash_unittests.gtest-memcheck.txt b/tools/valgrind/gtest_exclude/ash_unittests.gtest-memcheck.txt
index c981fbb..636878e 100644
--- a/tools/valgrind/gtest_exclude/ash_unittests.gtest-memcheck.txt
+++ b/tools/valgrind/gtest_exclude/ash_unittests.gtest-memcheck.txt
@@ -4,3 +4,6 @@
AutoclickTest.SynthesizedMouseMovesIgnored
# http://crbug.com/383384
SystemGestureEventFilterTest.TwoFingerDragDelayed
+# http://crbug.com/421888
+SystemTrayTest.*TouchFeedback*
+TrayDetailsViewTest.*TouchFeedback*
diff --git a/tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt b/tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt
index c9a1bd5..7dd32b9 100644
--- a/tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt
+++ b/tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt
@@ -1,3 +1,7 @@
+# crbug.com/395172
+WebRtcBrowserTest.CanForwardRemoteStream
+WebRtcBrowserTest.CanForwardRemoteStream720p
+
# crbug.com/399289
WebRtcBrowserTest.NoCrashWhenConnectChromiumSinkToRemoteTrack
diff --git a/tools/valgrind/gtest_exclude/content_unittests.gtest.txt b/tools/valgrind/gtest_exclude/content_unittests.gtest.txt
index 0431d8c..54bc307 100644
--- a/tools/valgrind/gtest_exclude/content_unittests.gtest.txt
+++ b/tools/valgrind/gtest_exclude/content_unittests.gtest.txt
@@ -1,6 +1,3 @@
-# Flaky, see http://crbug.com/227278
-WebContentsVideoCaptureDeviceTest.WebContentsDestroyed
-
# False positive, according to crbug.com/386080
WebLayerImplFixedBoundsTest.CompareToWebLayerImplComplex
WebLayerImplFixedBoundsTest.CompareToWebLayerImplSimple
diff --git a/tools/valgrind/gtest_exclude/content_unittests.gtest_mac.txt b/tools/valgrind/gtest_exclude/content_unittests.gtest_mac.txt
index e82512b..6d4dce0 100644
--- a/tools/valgrind/gtest_exclude/content_unittests.gtest_mac.txt
+++ b/tools/valgrind/gtest_exclude/content_unittests.gtest_mac.txt
@@ -14,15 +14,18 @@
BlobURLRequestJobTest.*
# Fail, see http://crbug.com/159234
-WebContentsVideoCaptureDeviceTest.GoesThroughAllTheMotions
WebContentsVideoCaptureDeviceTest.BadFramesGoodFrames
+WebContentsVideoCaptureDeviceTest.DeviceRestart
+WebContentsVideoCaptureDeviceTest.GoesThroughAllTheMotions
# Hang at arbitrary point, can't tell where exactly, see http://crbug.com/163314
RenderWidgetHostViewMacTest.*
-WebContentsVideoCaptureDeviceTest.*
RenderViewHostTest.*
DeviceMotionEventPumpTest.*
+# Flaky, see http://crbug.com/227278
+WebContentsVideoCaptureDeviceTest.WebContentsDestroyed
+
# Speculative disable of hanging tests. http://crbug.com/241919
VideoCaptureControllerTest.*
VideoCaptureHostTest.*
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index fad0fa3..b68e69e 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -2746,18 +2746,6 @@
fun:_ZN3WTFL18callFunctionObjectEPv
}
{
- bug_365259
- Memcheck:Leak
- fun:malloc
- fun:_ZN3WTF10fastMallocEm
- fun:_ZN3WTF10RefCountedIN7blink20IDBDatabaseCallbacksEEnwEm
- fun:_ZN5blink20IDBDatabaseCallbacks6createEv
- fun:_ZN5blink10IDBFactory12openInternalEPNS_16ExecutionContextERKN3WTF6StringElRNS_14ExceptionStateE
- fun:_ZN5blink10IDBFactory4openEPNS_16ExecutionContextERKN3WTF6StringERNS_14ExceptionStateE
- fun:_ZN5blink20IDBFactoryV8InternalL10openMethodERKN2v820FunctionCallbackInfoINS1_5ValueEEE
- fun:_ZN5blink20IDBFactoryV8InternalL18openMethodCallbackERKN2v820FunctionCallbackInfoINS1_5ValueEEE
-}
-{
bug_367809_a
Memcheck:Leak
fun:_Znw*
@@ -3455,7 +3443,7 @@
bug_417526
Memcheck:Leak
fun:_Znw*
- fun:_ZN4base19SequencedWorkerPoolC1EmRKSs
+ ...
fun:_ZN16sync_file_system13drive_backend14SyncEngineTest5SetUpEv
}
{
@@ -3469,3 +3457,14 @@
fun:_ZN5blink13InlineFlowBox5paintERNS_9PaintInfoERKNS_11LayoutPointENS_10LayoutUnitES6_
fun:_ZN5blink13RootInlineBox5paintERNS_9PaintInfoERKNS_11LayoutPointENS_10LayoutUnitES6_
}
+{
+ bug_422485
+ Memcheck:Overlap
+ fun:memcpy@@GLIBC_2.14
+ fun:_ZNK8SkBitmap12copyPixelsToEPvmmb
+ fun:_ZN5blink19ImageFrameGenerator14decodeAndScaleERK11SkImageInfomPvm
+ fun:_ZN5blink22DecodingImageGenerator11onGetPixelsERK11SkImageInfoPvmPjPi
+ fun:_ZN16SkImageGenerator9getPixelsERK11SkImageInfoPvmPjPi
+ ...
+ fun:_ZNK6SkDraw10drawBitmapERK8SkBitmapRK8SkMatrixRK7SkPaint
+}
diff --git a/ui/accessibility/ax_enums.idl b/ui/accessibility/ax_enums.idl
index 94efe78..6557702 100644
--- a/ui/accessibility/ax_enums.idl
+++ b/ui/accessibility/ax_enums.idl
@@ -80,6 +80,8 @@
combo_box,
complementary,
content_info,
+ date,
+ date_time,
definition,
description_list_detail,
description_list,
@@ -129,6 +131,8 @@
menu_bar,
menu_button,
menu_item,
+ menu_item_check_box,
+ menu_item_radio,
menu_list_option,
menu_list_popup,
menu,
@@ -171,6 +175,7 @@
table,
text_area,
text_field,
+ time,
timer,
title_bar,
toggle_button,
diff --git a/ui/accessibility/ax_serializable_tree.cc b/ui/accessibility/ax_serializable_tree.cc
index 4e4da83..3198b61 100644
--- a/ui/accessibility/ax_serializable_tree.cc
+++ b/ui/accessibility/ax_serializable_tree.cc
@@ -20,44 +20,44 @@
virtual ~AXTreeSourceAdapter() {}
// AXTreeSource implementation.
- virtual AXNode* GetRoot() const OVERRIDE {
+ virtual AXNode* GetRoot() const override {
return tree_->GetRoot();
}
- virtual AXNode* GetFromId(int32 id) const OVERRIDE {
+ virtual AXNode* GetFromId(int32 id) const override {
return tree_->GetFromId(id);
}
- virtual int32 GetId(const AXNode* node) const OVERRIDE {
+ virtual int32 GetId(const AXNode* node) const override {
return node->id();
}
virtual void GetChildren(
const AXNode* node,
- std::vector<const AXNode*>* out_children) const OVERRIDE {
+ std::vector<const AXNode*>* out_children) const override {
for (int i = 0; i < node->child_count(); ++i)
out_children->push_back(node->ChildAtIndex(i));
}
- virtual AXNode* GetParent(const AXNode* node) const OVERRIDE {
+ virtual AXNode* GetParent(const AXNode* node) const override {
return node->parent();
}
- virtual bool IsValid(const AXNode* node) const OVERRIDE {
+ virtual bool IsValid(const AXNode* node) const override {
return node != NULL;
}
virtual bool IsEqual(const AXNode* node1,
- const AXNode* node2) const OVERRIDE {
+ const AXNode* node2) const override {
return node1 == node2;
}
- virtual const AXNode* GetNull() const OVERRIDE {
+ virtual const AXNode* GetNull() const override {
return NULL;
}
virtual void SerializeNode(
- const AXNode* node, AXNodeData* out_data) const OVERRIDE {
+ const AXNode* node, AXNodeData* out_data) const override {
*out_data = node->data();
}
diff --git a/ui/accessibility/ax_tree_unittest.cc b/ui/accessibility/ax_tree_unittest.cc
index 05369de..3edd308 100644
--- a/ui/accessibility/ax_tree_unittest.cc
+++ b/ui/accessibility/ax_tree_unittest.cc
@@ -16,27 +16,27 @@
class FakeAXTreeDelegate : public AXTreeDelegate {
public:
- virtual void OnNodeWillBeDeleted(AXNode* node) OVERRIDE {
+ virtual void OnNodeWillBeDeleted(AXNode* node) override {
deleted_ids_.push_back(node->id());
}
- virtual void OnNodeCreated(AXNode* node) OVERRIDE {
+ virtual void OnNodeCreated(AXNode* node) override {
created_ids_.push_back(node->id());
}
- virtual void OnNodeChanged(AXNode* node) OVERRIDE {
+ virtual void OnNodeChanged(AXNode* node) override {
changed_ids_.push_back(node->id());
}
- virtual void OnNodeCreationFinished(AXNode* node) OVERRIDE {
+ virtual void OnNodeCreationFinished(AXNode* node) override {
creation_finished_ids_.push_back(node->id());
}
- virtual void OnNodeChangeFinished(AXNode* node) OVERRIDE {
+ virtual void OnNodeChangeFinished(AXNode* node) override {
change_finished_ids_.push_back(node->id());
}
- virtual void OnRootChanged(AXNode* new_root) OVERRIDE {
+ virtual void OnRootChanged(AXNode* new_root) override {
new_root_ids_.push_back(new_root->id());
}
diff --git a/ui/accessibility/platform/ax_platform_node_base.h b/ui/accessibility/platform/ax_platform_node_base.h
index 306f5ab..437b158 100644
--- a/ui/accessibility/platform/ax_platform_node_base.h
+++ b/ui/accessibility/platform/ax_platform_node_base.h
@@ -26,8 +26,8 @@
gfx::NativeViewAccessible ChildAtIndex(int index);
// AXPlatformNode
- virtual void Destroy() OVERRIDE;
- virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
+ virtual void Destroy() override;
+ virtual gfx::NativeViewAccessible GetNativeViewAccessible() override;
protected:
AXPlatformNodeBase();
diff --git a/ui/accessibility/platform/ax_platform_node_mac.h b/ui/accessibility/platform/ax_platform_node_mac.h
index 4303de3..2f15120 100644
--- a/ui/accessibility/platform/ax_platform_node_mac.h
+++ b/ui/accessibility/platform/ax_platform_node_mac.h
@@ -18,8 +18,8 @@
AXPlatformNodeMac();
// AXPlatformNode.
- virtual void Destroy() OVERRIDE;
- virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
+ virtual void Destroy() override;
+ virtual gfx::NativeViewAccessible GetNativeViewAccessible() override;
private:
virtual ~AXPlatformNodeMac();
diff --git a/ui/accessibility/platform/ax_platform_node_mac.mm b/ui/accessibility/platform/ax_platform_node_mac.mm
index 8f0708d..7431c6b 100644
--- a/ui/accessibility/platform/ax_platform_node_mac.mm
+++ b/ui/accessibility/platform/ax_platform_node_mac.mm
@@ -83,6 +83,8 @@
{ui::AX_ROLE_MENU_BAR, NSAccessibilityMenuBarRole},
{ui::AX_ROLE_MENU_BUTTON, NSAccessibilityButtonRole},
{ui::AX_ROLE_MENU_ITEM, NSAccessibilityMenuItemRole},
+ {ui::AX_ROLE_MENU_ITEM_CHECK_BOX, NSAccessibilityMenuItemRole},
+ {ui::AX_ROLE_MENU_ITEM_RADIO, NSAccessibilityMenuItemRole},
{ui::AX_ROLE_MENU_LIST_OPTION, NSAccessibilityMenuItemRole},
{ui::AX_ROLE_MENU_LIST_POPUP, NSAccessibilityUnknownRole},
{ui::AX_ROLE_NAVIGATION, NSAccessibilityGroupRole},
diff --git a/ui/android/java/src/org/chromium/ui/interpolators/BakedBezierInterpolator.java b/ui/android/java/src/org/chromium/ui/interpolators/BakedBezierInterpolator.java
index f95d855..bffcb48 100644
--- a/ui/android/java/src/org/chromium/ui/interpolators/BakedBezierInterpolator.java
+++ b/ui/android/java/src/org/chromium/ui/interpolators/BakedBezierInterpolator.java
@@ -150,7 +150,7 @@
}
int position = Math.min(
- (int)(input * (mValues.length - 1)),
+ (int) (input * (mValues.length - 1)),
mValues.length - 2);
float quantized = position * mStepSize;
diff --git a/ui/android/java/src/org/chromium/ui/picker/InputDialogContainer.java b/ui/android/java/src/org/chromium/ui/picker/InputDialogContainer.java
index 797e03b..c59f465 100644
--- a/ui/android/java/src/org/chromium/ui/picker/InputDialogContainer.java
+++ b/ui/android/java/src/org/chromium/ui/picker/InputDialogContainer.java
@@ -249,7 +249,7 @@
mDialog.setButton(DialogInterface.BUTTON_POSITIVE,
mContext.getText(R.string.date_picker_dialog_set),
- (DialogInterface.OnClickListener)mDialog);
+ (DialogInterface.OnClickListener) mDialog);
mDialog.setButton(DialogInterface.BUTTON_NEGATIVE,
mContext.getText(android.R.string.cancel),
diff --git a/ui/app_list/BUILD.gn b/ui/app_list/BUILD.gn
index aefca57..a5055e0 100644
--- a/ui/app_list/BUILD.gn
+++ b/ui/app_list/BUILD.gn
@@ -34,6 +34,8 @@
"search_box_model.cc",
"search_box_model.h",
"search_box_model_observer.h",
+ "search_controller.cc",
+ "search_controller.h",
"search_provider.cc",
"search_provider.h",
"search_result.cc",
diff --git a/ui/app_list/app_list.gyp b/ui/app_list/app_list.gyp
index 3f10aec..919a3f8 100644
--- a/ui/app_list/app_list.gyp
+++ b/ui/app_list/app_list.gyp
@@ -82,6 +82,8 @@
'search_box_model.cc',
'search_box_model.h',
'search_box_model_observer.h',
+ 'search_controller.cc',
+ 'search_controller.h',
'search_provider.cc',
'search_provider.h',
'search_result.cc',
diff --git a/ui/app_list/app_list_folder_item.cc b/ui/app_list/app_list_folder_item.cc
index 99d9c19..3c5634d 100644
--- a/ui/app_list/app_list_folder_item.cc
+++ b/ui/app_list/app_list_folder_item.cc
@@ -47,7 +47,7 @@
}
// gfx::CanvasImageSource overrides:
- virtual void Draw(gfx::Canvas* canvas) OVERRIDE {
+ virtual void Draw(gfx::Canvas* canvas) override {
// Draw folder circle.
gfx::Point center = gfx::Point(size().width() / 2 , size().height() / 2);
SkPaint paint;
diff --git a/ui/app_list/app_list_folder_item.h b/ui/app_list/app_list_folder_item.h
index 2f054cc..bfcb86e 100644
--- a/ui/app_list/app_list_folder_item.h
+++ b/ui/app_list/app_list_folder_item.h
@@ -59,13 +59,13 @@
FolderType folder_type() const { return folder_type_; }
// AppListItem
- virtual void Activate(int event_flags) OVERRIDE;
- virtual const char* GetItemType() const OVERRIDE;
- virtual ui::MenuModel* GetContextMenuModel() OVERRIDE;
- virtual AppListItem* FindChildItem(const std::string& id) OVERRIDE;
- virtual size_t ChildItemCount() const OVERRIDE;
- virtual void OnExtensionPreferenceChanged() OVERRIDE;
- virtual bool CompareForTest(const AppListItem* other) const OVERRIDE;
+ virtual void Activate(int event_flags) override;
+ virtual const char* GetItemType() const override;
+ virtual ui::MenuModel* GetContextMenuModel() override;
+ virtual AppListItem* FindChildItem(const std::string& id) override;
+ virtual size_t ChildItemCount() const override;
+ virtual void OnExtensionPreferenceChanged() override;
+ virtual bool CompareForTest(const AppListItem* other) const override;
// Calculates the top item icons' bounds inside |folder_icon_bounds|.
// Returns the bounds of top item icons in sequence of top left, top right,
@@ -77,15 +77,15 @@
private:
// AppListItemObserver
- virtual void ItemIconChanged() OVERRIDE;
+ virtual void ItemIconChanged() override;
// AppListItemListObserver
- virtual void OnListItemAdded(size_t index, AppListItem* item) OVERRIDE;
+ virtual void OnListItemAdded(size_t index, AppListItem* item) override;
virtual void OnListItemRemoved(size_t index,
- AppListItem* item) OVERRIDE;;
+ AppListItem* item) override;;
virtual void OnListItemMoved(size_t from_index,
size_t to_index,
- AppListItem* item) OVERRIDE;
+ AppListItem* item) override;
void UpdateTopItems();
diff --git a/ui/app_list/app_list_item_list_unittest.cc b/ui/app_list/app_list_item_list_unittest.cc
index de18b6a..9b68ea4 100644
--- a/ui/app_list/app_list_item_list_unittest.cc
+++ b/ui/app_list/app_list_item_list_unittest.cc
@@ -23,17 +23,17 @@
}
// AppListItemListObserver overriden:
- virtual void OnListItemAdded(size_t index, AppListItem* item) OVERRIDE {
+ virtual void OnListItemAdded(size_t index, AppListItem* item) override {
++items_added_;
}
- virtual void OnListItemRemoved(size_t index, AppListItem* item) OVERRIDE {
+ virtual void OnListItemRemoved(size_t index, AppListItem* item) override {
++items_removed_;
}
virtual void OnListItemMoved(size_t from_index,
size_t to_index,
- AppListItem* item) OVERRIDE {
+ AppListItem* item) override {
++items_moved_;
}
@@ -67,11 +67,11 @@
virtual ~AppListItemListTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
item_list_.AddObserver(&observer_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
item_list_.RemoveObserver(&observer_);
}
diff --git a/ui/app_list/app_list_menu.h b/ui/app_list/app_list_menu.h
index 6520e1d..738ab1e 100644
--- a/ui/app_list/app_list_menu.h
+++ b/ui/app_list/app_list_menu.h
@@ -32,12 +32,12 @@
private:
void InitMenu();
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdChecked(int command_id) const override;
+ virtual bool IsCommandIdEnabled(int command_id) const override;
virtual bool GetAcceleratorForCommandId(
int command_id,
- ui::Accelerator* accelerator) OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+ ui::Accelerator* accelerator) override;
+ virtual void ExecuteCommand(int command_id, int event_flags) override;
ui::SimpleMenuModel menu_model_;
AppListViewDelegate* delegate_;
diff --git a/ui/app_list/app_list_model.h b/ui/app_list/app_list_model.h
index 07ab33c..81c9854 100644
--- a/ui/app_list/app_list_model.h
+++ b/ui/app_list/app_list_model.h
@@ -135,7 +135,7 @@
// AppListItemListObserver
virtual void OnListItemMoved(size_t from_index,
size_t to_index,
- AppListItem* item) OVERRIDE;
+ AppListItem* item) override;
// Returns an existing folder matching |folder_id| or creates a new folder.
AppListFolderItem* FindOrCreateFolderItem(const std::string& folder_id);
diff --git a/ui/app_list/app_list_model_unittest.cc b/ui/app_list/app_list_model_unittest.cc
index 05dbfbb..91d744e 100644
--- a/ui/app_list/app_list_model_unittest.cc
+++ b/ui/app_list/app_list_model_unittest.cc
@@ -33,19 +33,19 @@
}
// AppListModelObserver
- virtual void OnAppListModelStatusChanged() OVERRIDE {
+ virtual void OnAppListModelStatusChanged() override {
++status_changed_count_;
}
- virtual void OnAppListItemAdded(AppListItem* item) OVERRIDE {
+ virtual void OnAppListItemAdded(AppListItem* item) override {
items_added_++;
}
- virtual void OnAppListItemWillBeDeleted(AppListItem* item) OVERRIDE {
+ virtual void OnAppListItemWillBeDeleted(AppListItem* item) override {
items_removed_++;
}
- virtual void OnAppListItemUpdated(AppListItem* item) OVERRIDE {
+ virtual void OnAppListItemUpdated(AppListItem* item) override {
items_updated_++;
}
@@ -78,10 +78,10 @@
virtual ~AppListModelTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
model_.AddObserver(&observer_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
model_.RemoveObserver(&observer_);
}
@@ -237,10 +237,10 @@
virtual ~AppListModelFolderTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AppListModelTest::SetUp();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
AppListModelTest::TearDown();
}
diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm
index b831f9a..c55576a 100644
--- a/ui/app_list/cocoa/app_list_view_controller.mm
+++ b/ui/app_list/cocoa/app_list_view_controller.mm
@@ -87,8 +87,8 @@
private:
// Overridden from app_list::AppListViewDelegateObserver:
- virtual void OnProfilesChanged() OVERRIDE;
- virtual void OnShutdown() OVERRIDE;
+ virtual void OnProfilesChanged() override;
+ virtual void OnShutdown() override;
AppListViewController* parent_; // Weak. Owns us.
diff --git a/ui/app_list/cocoa/app_list_view_controller_unittest.mm b/ui/app_list/cocoa/app_list_view_controller_unittest.mm
index 47d99b5..3b28651 100644
--- a/ui/app_list/cocoa/app_list_view_controller_unittest.mm
+++ b/ui/app_list/cocoa/app_list_view_controller_unittest.mm
@@ -17,7 +17,7 @@
public:
AppListViewControllerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
app_list_view_controller_.reset([[AppListViewController alloc] init]);
delegate_.reset(new AppListTestViewDelegate);
[app_list_view_controller_ setDelegate:delegate_.get()];
@@ -25,7 +25,7 @@
[[test_window() contentView] addSubview:[app_list_view_controller_ view]];
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
[app_list_view_controller_ setDelegate:NULL];
app_list_view_controller_.reset();
AppsGridControllerTestHelper::TearDown();
diff --git a/ui/app_list/cocoa/app_list_window_controller_unittest.mm b/ui/app_list/cocoa/app_list_window_controller_unittest.mm
index 692f23c..03b74b4 100644
--- a/ui/app_list/cocoa/app_list_window_controller_unittest.mm
+++ b/ui/app_list/cocoa/app_list_window_controller_unittest.mm
@@ -19,7 +19,7 @@
AppListWindowControllerTest();
protected:
- virtual void TearDown() OVERRIDE;
+ virtual void TearDown() override;
base::scoped_nsobject<AppListWindowController> controller_;
diff --git a/ui/app_list/cocoa/apps_grid_controller.mm b/ui/app_list/cocoa/apps_grid_controller.mm
index f2df08d..e9cec7a 100644
--- a/ui/app_list/cocoa/apps_grid_controller.mm
+++ b/ui/app_list/cocoa/apps_grid_controller.mm
@@ -98,20 +98,20 @@
private:
// Overridden from AppListItemListObserver:
- virtual void OnListItemAdded(size_t index, AppListItem* item) OVERRIDE {
+ virtual void OnListItemAdded(size_t index, AppListItem* item) override {
[parent_ listItemAdded:index
item:item];
}
- virtual void OnListItemRemoved(size_t index, AppListItem* item) OVERRIDE {
+ virtual void OnListItemRemoved(size_t index, AppListItem* item) override {
[parent_ listItemRemoved:index];
}
virtual void OnListItemMoved(size_t from_index,
size_t to_index,
- AppListItem* item) OVERRIDE {
+ AppListItem* item) override {
[parent_ listItemMovedFromIndex:from_index
toModelIndex:to_index];
}
- virtual void OnAppListItemHighlight(size_t index, bool highlight) OVERRIDE {
+ virtual void OnAppListItemHighlight(size_t index, bool highlight) override {
// NSCollectionView (or -[AppsGridController scrollToPage]) ensures only one
// item is highlighted, so clearing a highlight isn't necessary.
if (!highlight)
diff --git a/ui/app_list/cocoa/apps_grid_controller_unittest.mm b/ui/app_list/cocoa/apps_grid_controller_unittest.mm
index 756bb3f..2723143 100644
--- a/ui/app_list/cocoa/apps_grid_controller_unittest.mm
+++ b/ui/app_list/cocoa/apps_grid_controller_unittest.mm
@@ -96,7 +96,7 @@
return [attributes objectForKey:NSForegroundColorAttributeName];
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
owned_apps_grid_controller_.reset([[AppsGridController alloc] init]);
owned_delegate_.reset(new AppListTestViewDelegate);
[owned_apps_grid_controller_ setDelegate:owned_delegate_.get()];
@@ -108,7 +108,7 @@
[apps_grid_controller_ collectionViewAtPageIndex:0]];
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
[owned_apps_grid_controller_ setDelegate:NULL];
owned_apps_grid_controller_.reset();
AppsGridControllerTestHelper::TearDown();
@@ -145,7 +145,7 @@
menu_ready_ = ready;
}
- virtual ui::MenuModel* GetContextMenuModel() OVERRIDE {
+ virtual ui::MenuModel* GetContextMenuModel() override {
if (!menu_ready_)
return NULL;
diff --git a/ui/app_list/cocoa/apps_grid_view_item.mm b/ui/app_list/cocoa/apps_grid_view_item.mm
index fc37ff3..d78e08e 100644
--- a/ui/app_list/cocoa/apps_grid_view_item.mm
+++ b/ui/app_list/cocoa/apps_grid_view_item.mm
@@ -69,10 +69,10 @@
AppListItem* model() { return model_; }
NSMenu* GetContextMenu();
- virtual void ItemIconChanged() OVERRIDE;
- virtual void ItemNameChanged() OVERRIDE;
- virtual void ItemIsInstallingChanged() OVERRIDE;
- virtual void ItemPercentDownloadedChanged() OVERRIDE;
+ virtual void ItemIconChanged() override;
+ virtual void ItemNameChanged() override;
+ virtual void ItemIsInstallingChanged() override;
+ virtual void ItemPercentDownloadedChanged() override;
private:
AppsGridViewItem* parent_; // Weak. Owns us.
diff --git a/ui/app_list/cocoa/apps_search_box_controller.mm b/ui/app_list/cocoa/apps_search_box_controller.mm
index 0e5ba2f..81d7c44 100644
--- a/ui/app_list/cocoa/apps_search_box_controller.mm
+++ b/ui/app_list/cocoa/apps_search_box_controller.mm
@@ -52,11 +52,11 @@
void SetSearchText(const base::string16& text);
- virtual void IconChanged() OVERRIDE;
- virtual void SpeechRecognitionButtonPropChanged() OVERRIDE;
- virtual void HintTextChanged() OVERRIDE;
- virtual void SelectionModelChanged() OVERRIDE;
- virtual void TextChanged() OVERRIDE;
+ virtual void IconChanged() override;
+ virtual void SpeechRecognitionButtonPropChanged() override;
+ virtual void HintTextChanged() override;
+ virtual void SelectionModelChanged() override;
+ virtual void TextChanged() override;
private:
SearchBoxModel* GetModel();
diff --git a/ui/app_list/cocoa/apps_search_box_controller_unittest.mm b/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
index 60182f9..285bbdb 100644
--- a/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
+++ b/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
@@ -88,7 +88,7 @@
Init();
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
apps_search_box_controller_.reset(
[[AppsSearchBoxController alloc] initWithFrame:
NSMakeRect(0, 0, 400, 100)]);
@@ -99,7 +99,7 @@
[[test_window() contentView] addSubview:[apps_search_box_controller_ view]];
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
[apps_search_box_controller_ setDelegate:nil];
ui::CocoaTest::TearDown();
}
diff --git a/ui/app_list/cocoa/apps_search_results_controller.mm b/ui/app_list/cocoa/apps_search_results_controller.mm
index 4ef6167..95f293f 100644
--- a/ui/app_list/cocoa/apps_search_results_controller.mm
+++ b/ui/app_list/cocoa/apps_search_results_controller.mm
@@ -402,15 +402,6 @@
[self delegate]);
}
-- (BOOL)canDraw {
- // AppKit doesn't call -[NSView canDrawConcurrently] which would have told it
- // that this is unsafe. Returning true from canDraw only if there is a message
- // loop ensures that no drawing occurs on a background thread. Without this,
- // ImageSkia can assert when trying to get bitmaps. http://crbug.com/417148.
- // This means unit tests will always return 'NO', but that's OK.
- return !!base::MessageLoop::current() && [super canDraw];
-}
-
- (void)mouseDown:(NSEvent*)theEvent {
[[self controller] mouseDown:theEvent];
[super mouseDown:theEvent];
diff --git a/ui/app_list/cocoa/apps_search_results_controller_unittest.mm b/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
index b6f2f95..bc6d4fc 100644
--- a/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
+++ b/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
@@ -74,7 +74,7 @@
menu_ready_ = ready;
}
- virtual ui::MenuModel* GetContextMenuModel() OVERRIDE {
+ virtual ui::MenuModel* GetContextMenuModel() override {
if (!menu_ready_)
return NULL;
@@ -123,8 +123,8 @@
void ExpectConsistent();
// ui::CocoaTest overrides:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
protected:
base::scoped_nsobject<TestAppsSearchResultsDelegate> delegate_;
diff --git a/ui/app_list/cocoa/apps_search_results_model_bridge.h b/ui/app_list/cocoa/apps_search_results_model_bridge.h
index 8939d26..70e66b7 100644
--- a/ui/app_list/cocoa/apps_search_results_model_bridge.h
+++ b/ui/app_list/cocoa/apps_search_results_model_bridge.h
@@ -34,10 +34,10 @@
void ReloadDataForItems(size_t start, size_t count) const;
// Overridden from ui::ListModelObserver:
- virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE;
- virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE;
- virtual void ListItemMoved(size_t index, size_t target_index) OVERRIDE;
- virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE;
+ virtual void ListItemsAdded(size_t start, size_t count) override;
+ virtual void ListItemsRemoved(size_t start, size_t count) override;
+ virtual void ListItemMoved(size_t index, size_t target_index) override;
+ virtual void ListItemsChanged(size_t start, size_t count) override;
AppsSearchResultsController* parent_; // Weak. Owns us.
ScopedVector<ItemObserver> item_observers_;
diff --git a/ui/app_list/cocoa/apps_search_results_model_bridge.mm b/ui/app_list/cocoa/apps_search_results_model_bridge.mm
index 69a3205..26e8091 100644
--- a/ui/app_list/cocoa/apps_search_results_model_bridge.mm
+++ b/ui/app_list/cocoa/apps_search_results_model_bridge.mm
@@ -43,14 +43,14 @@
}
// SearchResultObserver overrides:
- virtual void OnIconChanged() OVERRIDE {
+ virtual void OnIconChanged() override {
bridge_->ReloadDataForItems(row_in_view_, 1);
}
- virtual void OnActionsChanged() OVERRIDE {}
- virtual void OnIsInstallingChanged() OVERRIDE {}
- virtual void OnPercentDownloadedChanged() OVERRIDE {}
- virtual void OnItemInstalled() OVERRIDE {}
- virtual void OnItemUninstalled() OVERRIDE;
+ virtual void OnActionsChanged() override {}
+ virtual void OnIsInstallingChanged() override {}
+ virtual void OnPercentDownloadedChanged() override {}
+ virtual void OnItemInstalled() override {}
+ virtual void OnItemUninstalled() override;
private:
AppsSearchResultsModelBridge* bridge_; // Weak. Owns us.
diff --git a/ui/app_list/demo/app_list_demo_views.cc b/ui/app_list/demo/app_list_demo_views.cc
index 58e939a..b87885a 100644
--- a/ui/app_list/demo/app_list_demo_views.cc
+++ b/ui/app_list/demo/app_list_demo_views.cc
@@ -39,9 +39,9 @@
app_list::AppListView* InitView(gfx::NativeWindow window_context);
// Overridden from AppListViewDelegate:
- virtual void Dismiss() OVERRIDE;
- virtual void ViewClosing() OVERRIDE;
- virtual views::View* CreateStartPageWebView(const gfx::Size& size) OVERRIDE;
+ virtual void Dismiss() override;
+ virtual void ViewClosing() override;
+ virtual views::View* CreateStartPageWebView(const gfx::Size& size) override;
private:
app_list::AppListView* view_; // Weak. Owns this.
diff --git a/ui/app_list/pagination_model.h b/ui/app_list/pagination_model.h
index af30230..1447559 100644
--- a/ui/app_list/pagination_model.h
+++ b/ui/app_list/pagination_model.h
@@ -122,8 +122,8 @@
void ResetTransitionAnimation();
// gfx::AnimationDelegate overrides:
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
+ virtual void AnimationEnded(const gfx::Animation* animation) override;
int total_pages_;
int selected_page_;
diff --git a/ui/app_list/pagination_model_unittest.cc b/ui/app_list/pagination_model_unittest.cc
index 391ed87..ad437cf 100644
--- a/ui/app_list/pagination_model_unittest.cc
+++ b/ui/app_list/pagination_model_unittest.cc
@@ -61,9 +61,9 @@
}
// PaginationModelObserver overrides:
- virtual void TotalPagesChanged() OVERRIDE {}
+ virtual void TotalPagesChanged() override {}
virtual void SelectedPageChanged(int old_selected,
- int new_selected) OVERRIDE {
+ int new_selected) override {
AppendSelectedPage(new_selected);
++selection_count_;
if (expected_page_selection_ &&
@@ -72,10 +72,10 @@
}
}
- virtual void TransitionStarted() OVERRIDE {
+ virtual void TransitionStarted() override {
}
- virtual void TransitionChanged() OVERRIDE {
+ virtual void TransitionChanged() override {
if (transition_page_ == -1 ||
model_->transition().target_page == transition_page_) {
if (model_->transition().progress == 0)
@@ -117,13 +117,13 @@
virtual ~PaginationModelTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
pagination_.SetTotalPages(5);
pagination_.SetTransitionDurations(1, 1);
observer_.set_model(&pagination_);
pagination_.AddObserver(&observer_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
pagination_.RemoveObserver(&observer_);
observer_.set_model(NULL);
}
diff --git a/ui/app_list/search_controller.cc b/ui/app_list/search_controller.cc
new file mode 100644
index 0000000..3a4a52f
--- /dev/null
+++ b/ui/app_list/search_controller.cc
@@ -0,0 +1,114 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/search_controller.h"
+
+#include <algorithm>
+#include <vector>
+
+#include "base/bind.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/metrics/user_metrics.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
+#include "ui/app_list/search/history.h"
+#include "ui/app_list/search_box_model.h"
+#include "ui/app_list/search_provider.h"
+#include "ui/app_list/search_result.h"
+
+namespace {
+
+// Maximum time (in milliseconds) to wait to the search providers to finish.
+const int kStopTimeMS = 1500;
+}
+
+namespace app_list {
+
+SearchController::SearchController(SearchBoxModel* search_box,
+ AppListModel::SearchResults* results,
+ History* history)
+ : search_box_(search_box),
+ dispatching_query_(false),
+ mixer_(new Mixer(results)),
+ history_(history) {
+ mixer_->Init();
+}
+
+SearchController::~SearchController() {
+}
+
+void SearchController::Start() {
+ Stop();
+
+ base::string16 query;
+ base::TrimWhitespace(search_box_->text(), base::TRIM_ALL, &query);
+
+ dispatching_query_ = true;
+ for (Providers::iterator it = providers_.begin();
+ it != providers_.end();
+ ++it) {
+ (*it)->Start(query);
+ }
+ dispatching_query_ = false;
+
+ OnResultsChanged();
+
+ stop_timer_.Start(FROM_HERE,
+ base::TimeDelta::FromMilliseconds(kStopTimeMS),
+ base::Bind(&SearchController::Stop,
+ base::Unretained(this)));
+}
+
+void SearchController::Stop() {
+ stop_timer_.Stop();
+
+ for (Providers::iterator it = providers_.begin();
+ it != providers_.end();
+ ++it) {
+ (*it)->Stop();
+ }
+}
+
+void SearchController::OpenResult(SearchResult* result, int event_flags) {
+ // Count AppList.Search here because it is composed of search + action.
+ base::RecordAction(base::UserMetricsAction("AppList_Search"));
+
+ result->Open(event_flags);
+
+ if (history_ && history_->IsReady()) {
+ history_->AddLaunchEvent(base::UTF16ToUTF8(search_box_->text()),
+ result->id());
+ }
+}
+
+void SearchController::InvokeResultAction(SearchResult* result,
+ int action_index,
+ int event_flags) {
+ // TODO(xiyuan): Hook up with user learning.
+ result->InvokeAction(action_index, event_flags);
+}
+
+void SearchController::AddProvider(Mixer::GroupId group,
+ scoped_ptr<SearchProvider> provider) {
+ provider->set_result_changed_callback(base::Bind(
+ &SearchController::OnResultsChanged,
+ base::Unretained(this)));
+ mixer_->AddProviderToGroup(group, provider.get());
+ providers_.push_back(provider.release()); // Takes ownership.
+}
+
+void SearchController::OnResultsChanged() {
+ if (dispatching_query_)
+ return;
+
+ KnownResults known_results;
+ if (history_ && history_->IsReady()) {
+ history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text()))
+ ->swap(known_results);
+ }
+
+ mixer_->MixAndPublish(known_results);
+}
+
+} // namespace app_list
diff --git a/ui/app_list/search_controller.h b/ui/app_list/search_controller.h
new file mode 100644
index 0000000..18c67ef
--- /dev/null
+++ b/ui/app_list/search_controller.h
@@ -0,0 +1,66 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_SEARCH_CONTROLLER_H_
+#define UI_APP_LIST_SEARCH_CONTROLLER_H_
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "base/timer/timer.h"
+#include "ui/app_list/app_list_export.h"
+#include "ui/app_list/app_list_model.h"
+#include "ui/app_list/search/mixer.h"
+#include "ui/app_list/speech_ui_model_observer.h"
+
+namespace app_list {
+
+class History;
+class SearchBoxModel;
+class SearchProvider;
+class SearchResult;
+
+// Controller that collects query from given SearchBoxModel, dispatches it
+// to all search providers, then invokes the mixer to mix and to publish the
+// results to the given SearchResults UI model.
+class APP_LIST_EXPORT SearchController {
+ public:
+ SearchController(SearchBoxModel* search_box,
+ AppListModel::SearchResults* results,
+ History* history);
+ virtual ~SearchController();
+
+ void Start();
+ void Stop();
+
+ void OpenResult(SearchResult* result, int event_flags);
+ void InvokeResultAction(SearchResult* result,
+ int action_index,
+ int event_flags);
+
+ // Takes ownership of |provider| and associates it with given mixer group.
+ void AddProvider(Mixer::GroupId group,
+ scoped_ptr<SearchProvider> provider);
+
+ private:
+ typedef ScopedVector<SearchProvider> Providers;
+
+ // Invoked when the search results are changed.
+ void OnResultsChanged();
+
+ SearchBoxModel* search_box_;
+
+ bool dispatching_query_;
+ Providers providers_;
+ scoped_ptr<Mixer> mixer_;
+ History* history_; // KeyedService, not owned.
+
+ base::OneShotTimer<SearchController> stop_timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(SearchController);
+};
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_SEARCH_CONTROLLER_H_
diff --git a/ui/app_list/test/app_list_test_model.h b/ui/app_list/test/app_list_test_model.h
index 89e407b..d2a1845 100644
--- a/ui/app_list/test/app_list_test_model.h
+++ b/ui/app_list/test/app_list_test_model.h
@@ -22,8 +22,8 @@
public:
AppListTestItem(const std::string& id, AppListTestModel* model);
virtual ~AppListTestItem();
- virtual void Activate(int event_flags) OVERRIDE;
- virtual const char* GetItemType() const OVERRIDE;
+ virtual void Activate(int event_flags) override;
+ virtual const char* GetItemType() const override;
void SetPosition(const syncer::StringOrdinal& new_position);
diff --git a/ui/app_list/test/app_list_test_view_delegate.h b/ui/app_list/test/app_list_test_view_delegate.h
index dac12b7..2e307a6 100644
--- a/ui/app_list/test/app_list_test_view_delegate.h
+++ b/ui/app_list/test/app_list_test_view_delegate.h
@@ -48,43 +48,43 @@
int GetToggleSpeechRecognitionCountAndReset();
// AppListViewDelegate overrides:
- virtual bool ForceNativeDesktop() const OVERRIDE;
- virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE;
- virtual AppListModel* GetModel() OVERRIDE;
- virtual SpeechUIModel* GetSpeechUI() OVERRIDE;
+ virtual bool ForceNativeDesktop() const override;
+ virtual void SetProfileByPath(const base::FilePath& profile_path) override;
+ virtual AppListModel* GetModel() override;
+ virtual SpeechUIModel* GetSpeechUI() override;
virtual void GetShortcutPathForApp(
const std::string& app_id,
- const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE;
- virtual void StartSearch() OVERRIDE {}
- virtual void StopSearch() OVERRIDE {}
+ const base::Callback<void(const base::FilePath&)>& callback) override;
+ virtual void StartSearch() override {}
+ virtual void StopSearch() override {}
virtual void OpenSearchResult(SearchResult* result,
bool auto_launch,
- int event_flags) OVERRIDE;
+ int event_flags) override;
virtual void InvokeSearchResultAction(SearchResult* result,
int action_index,
- int event_flags) OVERRIDE {}
- virtual base::TimeDelta GetAutoLaunchTimeout() OVERRIDE;
- virtual void AutoLaunchCanceled() OVERRIDE;
- virtual void ViewInitialized() OVERRIDE {}
- virtual void Dismiss() OVERRIDE;
- virtual void ViewClosing() OVERRIDE {}
- virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
- virtual void OpenSettings() OVERRIDE {}
- virtual void OpenHelp() OVERRIDE {}
- virtual void OpenFeedback() OVERRIDE {}
- virtual void ToggleSpeechRecognition() OVERRIDE;
+ int event_flags) override {}
+ virtual base::TimeDelta GetAutoLaunchTimeout() override;
+ virtual void AutoLaunchCanceled() override;
+ virtual void ViewInitialized() override {}
+ virtual void Dismiss() override;
+ virtual void ViewClosing() override {}
+ virtual gfx::ImageSkia GetWindowIcon() override;
+ virtual void OpenSettings() override {}
+ virtual void OpenHelp() override {}
+ virtual void OpenFeedback() override {}
+ virtual void ToggleSpeechRecognition() override;
virtual void ShowForProfileByPath(
- const base::FilePath& profile_path) OVERRIDE {}
+ const base::FilePath& profile_path) override {}
#if defined(TOOLKIT_VIEWS)
- virtual views::View* CreateStartPageWebView(const gfx::Size& size) OVERRIDE;
+ virtual views::View* CreateStartPageWebView(const gfx::Size& size) override;
virtual std::vector<views::View*> CreateCustomPageWebViews(
- const gfx::Size& size) OVERRIDE;
+ const gfx::Size& size) override;
#endif
- virtual bool IsSpeechRecognitionEnabled() OVERRIDE;
- virtual const Users& GetUsers() const OVERRIDE;
- virtual bool ShouldCenterWindow() const OVERRIDE;
- virtual void AddObserver(AppListViewDelegateObserver* observer) OVERRIDE;
- virtual void RemoveObserver(AppListViewDelegateObserver* observer) OVERRIDE;
+ virtual bool IsSpeechRecognitionEnabled() override;
+ virtual const Users& GetUsers() const override;
+ virtual bool ShouldCenterWindow() const override;
+ virtual void AddObserver(AppListViewDelegateObserver* observer) override;
+ virtual void RemoveObserver(AppListViewDelegateObserver* observer) override;
// Do a bulk replacement of the items in the model.
void ReplaceTestModel(int item_count);
diff --git a/ui/app_list/test/run_all_unittests.cc b/ui/app_list/test/run_all_unittests.cc
index fa3c94b..19f0a0c 100644
--- a/ui/app_list/test/run_all_unittests.cc
+++ b/ui/app_list/test/run_all_unittests.cc
@@ -23,7 +23,7 @@
AppListTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
protected:
- virtual void Initialize() OVERRIDE {
+ virtual void Initialize() override {
#if !defined(OS_MACOSX)
gfx::GLSurface::InitializeOneOffForTests();
#endif
@@ -35,7 +35,7 @@
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
}
- virtual void Shutdown() OVERRIDE {
+ virtual void Shutdown() override {
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
diff --git a/ui/app_list/views/app_list_background.h b/ui/app_list/views/app_list_background.h
index 900e698..c3159a0 100644
--- a/ui/app_list/views/app_list_background.h
+++ b/ui/app_list/views/app_list_background.h
@@ -26,7 +26,7 @@
private:
// views::Background overrides:
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE;
+ virtual void Paint(gfx::Canvas* canvas, views::View* view) const override;
const int corner_radius_;
const AppListMainView* main_view_; // Owned by views hierarchy.
diff --git a/ui/app_list/views/app_list_folder_view.h b/ui/app_list/views/app_list_folder_view.h
index 2692578..58a25fb 100644
--- a/ui/app_list/views/app_list_folder_view.h
+++ b/ui/app_list/views/app_list_folder_view.h
@@ -58,15 +58,15 @@
void CloseFolderPage();
// views::View
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
// AppListModelObserver
- virtual void OnAppListItemWillBeDeleted(AppListItem* item) OVERRIDE;
+ virtual void OnAppListItemWillBeDeleted(AppListItem* item) override;
// ui::ImplicitAnimationObserver
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ virtual void OnImplicitAnimationsCompleted() override;
AppsGridView* items_grid_view() { return items_grid_view_; }
@@ -81,29 +81,29 @@
const gfx::Point& drag_point_in_root_grid);
// Overridden from views::View:
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
// Overridden from FolderHeaderViewDelegate:
virtual void NavigateBack(AppListFolderItem* item,
- const ui::Event& event_flags) OVERRIDE;
- virtual void GiveBackFocusToSearchBox() OVERRIDE;
+ const ui::Event& event_flags) override;
+ virtual void GiveBackFocusToSearchBox() override;
virtual void SetItemName(AppListFolderItem* item,
- const std::string& name) OVERRIDE;
+ const std::string& name) override;
// Overridden from AppsGridViewFolderDelegate:
- virtual void UpdateFolderViewBackground(bool show_bubble) OVERRIDE;
+ virtual void UpdateFolderViewBackground(bool show_bubble) override;
virtual void ReparentItem(AppListItemView* original_drag_view,
const gfx::Point& drag_point_in_folder_grid)
- OVERRIDE;
+ override;
virtual void DispatchDragEventForReparent(
AppsGridView::Pointer pointer,
- const gfx::Point& drag_point_in_folder_grid) OVERRIDE;
+ const gfx::Point& drag_point_in_folder_grid) override;
virtual void DispatchEndDragEventForReparent(
bool events_forwarded_to_drag_drop_host,
- bool cancel_drag) OVERRIDE;
- virtual bool IsPointOutsideOfFolderBoundary(const gfx::Point& point) OVERRIDE;
- virtual bool IsOEMFolder() const OVERRIDE;
- virtual void SetRootLevelDragViewVisible(bool visible) OVERRIDE;
+ bool cancel_drag) override;
+ virtual bool IsPointOutsideOfFolderBoundary(const gfx::Point& point) override;
+ virtual bool IsOEMFolder() const override;
+ virtual void SetRootLevelDragViewVisible(bool visible) override;
AppsContainerView* container_view_; // Not owned.
AppListMainView* app_list_main_view_; // Not Owned.
diff --git a/ui/app_list/views/app_list_item_view.h b/ui/app_list/views/app_list_item_view.h
index 8c7945b..8328969 100644
--- a/ui/app_list/views/app_list_item_view.h
+++ b/ui/app_list/views/app_list_item_view.h
@@ -107,36 +107,36 @@
void SetTitleSubpixelAA();
// views::View overrides:
- virtual const char* GetClassName() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void SchedulePaintInRect(const gfx::Rect& r) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual const char* GetClassName() const override;
+ virtual void Layout() override;
+ virtual void SchedulePaintInRect(const gfx::Rect& r) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// views::ContextMenuController overrides:
virtual void ShowContextMenuForView(views::View* source,
const gfx::Point& point,
- ui::MenuSourceType source_type) OVERRIDE;
+ ui::MenuSourceType source_type) override;
// views::CustomButton overrides:
- virtual void StateChanged() OVERRIDE;
- virtual bool ShouldEnterPushedState(const ui::Event& event) OVERRIDE;
+ virtual void StateChanged() override;
+ virtual bool ShouldEnterPushedState(const ui::Event& event) override;
// views::View overrides:
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
// ui::EventHandler overrides:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// AppListItemObserver overrides:
- virtual void ItemIconChanged() OVERRIDE;
- virtual void ItemNameChanged() OVERRIDE;
- virtual void ItemIsInstallingChanged() OVERRIDE;
- virtual void ItemPercentDownloadedChanged() OVERRIDE;
- virtual void ItemBeingDestroyed() OVERRIDE;
+ virtual void ItemIconChanged() override;
+ virtual void ItemNameChanged() override;
+ virtual void ItemIsInstallingChanged() override;
+ virtual void ItemPercentDownloadedChanged() override;
+ virtual void ItemBeingDestroyed() override;
const bool is_folder_;
const bool is_in_folder_;
diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc
index 4404d35..b7e08b1 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -57,7 +57,7 @@
private:
// Overridden from views::View:
- virtual void ChildVisibilityChanged(views::View* child) OVERRIDE {
+ virtual void ChildVisibilityChanged(views::View* child) override {
DCHECK_EQ(search_box_, child);
host_->NotifySearchBoxVisibilityChanged();
}
@@ -92,7 +92,7 @@
private:
// AppListItemObserver overrides:
- virtual void ItemIconChanged() OVERRIDE {
+ virtual void ItemIconChanged() override {
owner_->OnItemIconLoaded(this);
// Note that IconLoader is released here.
}
diff --git a/ui/app_list/views/app_list_main_view.h b/ui/app_list/views/app_list_main_view.h
index b45559d..2abe961 100644
--- a/ui/app_list/views/app_list_main_view.h
+++ b/ui/app_list/views/app_list_main_view.h
@@ -97,18 +97,18 @@
void OnItemIconLoaded(IconLoader* loader);
// Overridden from AppsGridViewDelegate:
- virtual void ActivateApp(AppListItem* item, int event_flags) OVERRIDE;
+ virtual void ActivateApp(AppListItem* item, int event_flags) override;
virtual void GetShortcutPathForApp(
const std::string& app_id,
- const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE;
- virtual void CancelDragInActiveFolder() OVERRIDE;
+ const base::Callback<void(const base::FilePath&)>& callback) override;
+ virtual void CancelDragInActiveFolder() override;
// Overridden from SearchBoxViewDelegate:
- virtual void QueryChanged(SearchBoxView* sender) OVERRIDE;
+ virtual void QueryChanged(SearchBoxView* sender) override;
// Overridden from SearchResultListViewDelegate:
- virtual void OnResultInstalled(SearchResult* result) OVERRIDE;
- virtual void OnResultUninstalled(SearchResult* result) OVERRIDE;
+ virtual void OnResultInstalled(SearchResult* result) override;
+ virtual void OnResultUninstalled(SearchResult* result) override;
AppListViewDelegate* delegate_; // Owned by parent view (AppListView).
AppListModel* model_; // Unowned; ownership is handled by |delegate_|.
diff --git a/ui/app_list/views/app_list_main_view_unittest.cc b/ui/app_list/views/app_list_main_view_unittest.cc
index f92e041..08cd351 100644
--- a/ui/app_list/views/app_list_main_view_unittest.cc
+++ b/ui/app_list/views/app_list_main_view_unittest.cc
@@ -69,7 +69,7 @@
virtual ~AppListMainViewTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
views::ViewsTestBase::SetUp();
delegate_.reset(new AppListTestViewDelegate);
@@ -89,7 +89,7 @@
widget_->SetContentsView(main_view_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
widget_->Close();
views::ViewsTestBase::TearDown();
delegate_.reset();
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index 2a01e82..c6b8896 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -90,7 +90,7 @@
virtual ~AppListOverlayBackground() {};
// Overridden from views::Background:
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE {
+ virtual void Paint(gfx::Canvas* canvas, views::View* view) const override {
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setColor(SK_ColorWHITE);
@@ -128,7 +128,7 @@
private:
// Overridden from ui::ImplicitAnimationObserver:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE {
+ virtual void OnImplicitAnimationsCompleted() override {
if (target_) {
target_->SetVisible(false);
target_ = NULL;
diff --git a/ui/app_list/views/app_list_view.h b/ui/app_list/views/app_list_view.h
index 0ee715a..c9cd5cf 100644
--- a/ui/app_list/views/app_list_view.h
+++ b/ui/app_list/views/app_list_view.h
@@ -90,17 +90,17 @@
bool ShouldCenterWindow() const;
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
virtual void Paint(gfx::Canvas* canvas,
- const views::CullSet& cull_set) OVERRIDE;
- virtual void OnThemeChanged() OVERRIDE;
+ const views::CullSet& cull_set) override;
+ virtual void OnThemeChanged() override;
// WidgetDelegate overrides:
- virtual bool ShouldHandleSystemCommands() const OVERRIDE;
+ virtual bool ShouldHandleSystemCommands() const override;
// Overridden from AppListViewDelegateObserver:
- virtual void OnProfilesChanged() OVERRIDE;
- virtual void OnShutdown() OVERRIDE;
+ virtual void OnProfilesChanged() override;
+ virtual void OnShutdown() override;
void Prerender();
@@ -133,29 +133,29 @@
// Overridden from views::BubbleDelegateView:
virtual void OnBeforeBubbleWidgetInit(
views::Widget::InitParams* params,
- views::Widget* widget) const OVERRIDE;
+ views::Widget* widget) const override;
// Overridden from views::WidgetDelegateView:
- virtual views::View* GetInitiallyFocusedView() OVERRIDE;
- virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
- virtual bool WidgetHasHitTestMask() const OVERRIDE;
- virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE;
+ virtual views::View* GetInitiallyFocusedView() override;
+ virtual gfx::ImageSkia GetWindowIcon() override;
+ virtual bool WidgetHasHitTestMask() const override;
+ virtual void GetWidgetHitTestMask(gfx::Path* mask) const override;
// Overridden from views::View:
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
+ virtual void Layout() override;
+ virtual void SchedulePaintInRect(const gfx::Rect& rect) override;
// Overridden from views::WidgetObserver:
- virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
+ virtual void OnWidgetDestroying(views::Widget* widget) override;
virtual void OnWidgetVisibilityChanged(
- views::Widget* widget, bool visible) OVERRIDE;
+ views::Widget* widget, bool visible) override;
virtual void OnWidgetActivationChanged(
- views::Widget* widget, bool active) OVERRIDE;
+ views::Widget* widget, bool active) override;
// Overridden from SpeechUIModelObserver:
virtual void OnSpeechRecognitionStateChanged(
- SpeechRecognitionState new_state) OVERRIDE;
+ SpeechRecognitionState new_state) override;
AppListViewDelegate* delegate_; // Weak. Owned by AppListService.
diff --git a/ui/app_list/views/app_list_view_unittest.cc b/ui/app_list/views/app_list_view_unittest.cc
index 29428ea..2ee50d4 100644
--- a/ui/app_list/views/app_list_view_unittest.cc
+++ b/ui/app_list/views/app_list_view_unittest.cc
@@ -144,12 +144,12 @@
UnitTestViewDelegate(AppListViewTestContext* parent) : parent_(parent) {}
// Overridden from app_list::AppListViewDelegate:
- virtual bool ShouldCenterWindow() const OVERRIDE {
+ virtual bool ShouldCenterWindow() const override {
return app_list::switches::IsCenteredAppListEnabled();
}
// Overridden from app_list::test::AppListTestViewDelegate:
- virtual void ViewClosing() OVERRIDE { parent_->NativeWidgetClosing(); }
+ virtual void ViewClosing() override { parent_->NativeWidgetClosing(); }
private:
AppListViewTestContext* parent_;
@@ -563,7 +563,7 @@
virtual ~AppListViewTestAura() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
views::ViewsTestBase::SetUp();
// On Ash (only) the app list is placed into an aura::Window "container",
@@ -578,7 +578,7 @@
test_context_.reset(new AppListViewTestContext(GetParam(), container));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
test_context_.reset();
views::ViewsTestBase::TearDown();
}
@@ -597,13 +597,13 @@
virtual ~AppListViewTestDesktop() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
set_views_delegate(new AppListViewTestViewsDelegate(this));
views::ViewsTestBase::SetUp();
test_context_.reset(new AppListViewTestContext(GetParam(), NULL));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
test_context_.reset();
views::ViewsTestBase::TearDown();
}
@@ -620,7 +620,7 @@
// Overridden from views::ViewsDelegate:
virtual void OnBeforeWidgetInit(
views::Widget::InitParams* params,
- views::internal::NativeWidgetDelegate* delegate) OVERRIDE;
+ views::internal::NativeWidgetDelegate* delegate) override;
private:
AppListViewTestDesktop* parent_;
diff --git a/ui/app_list/views/apps_container_view.h b/ui/app_list/views/apps_container_view.h
index 3278385..895d2e4 100644
--- a/ui/app_list/views/apps_container_view.h
+++ b/ui/app_list/views/apps_container_view.h
@@ -58,12 +58,12 @@
bool IsInFolderView() const;
// views::View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
// TopIconAnimationObserver overrides:
- virtual void OnTopIconAnimationsComplete() OVERRIDE;
+ virtual void OnTopIconAnimationsComplete() override;
AppsGridView* apps_grid_view() { return apps_grid_view_; }
FolderBackgroundView* folder_background_view() {
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 53b365d..1c24bf5 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -137,7 +137,7 @@
virtual ~RowMoveAnimationDelegate() {}
// gfx::AnimationDelegate overrides:
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE {
+ virtual void AnimationProgressed(const gfx::Animation* animation) override {
view_->layer()->SetOpacity(animation->GetCurrentValue());
view_->layer()->ScheduleDraw();
@@ -148,11 +148,11 @@
layer_->ScheduleDraw();
}
}
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE {
+ virtual void AnimationEnded(const gfx::Animation* animation) override {
view_->layer()->SetOpacity(1.0f);
view_->SchedulePaint();
}
- virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE {
+ virtual void AnimationCanceled(const gfx::Animation* animation) override {
view_->layer()->SetOpacity(1.0f);
view_->SchedulePaint();
}
@@ -181,7 +181,7 @@
}
// gfx::AnimationDelegate overrides:
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE {
+ virtual void AnimationProgressed(const gfx::Animation* animation) override {
view_->layer()->SetOpacity(1 - animation->GetCurrentValue());
view_->layer()->ScheduleDraw();
}
@@ -199,10 +199,10 @@
public:
ItemMoveAnimationDelegate(views::View* view) : view_(view) {}
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE {
+ virtual void AnimationEnded(const gfx::Animation* animation) override {
view_->SchedulePaint();
}
- virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE {
+ virtual void AnimationCanceled(const gfx::Animation* animation) override {
view_->SchedulePaint();
}
@@ -301,14 +301,14 @@
private:
// Overridden from ui::DragSourceWin.
- virtual void OnDragSourceCancel() OVERRIDE {
+ virtual void OnDragSourceCancel() override {
canceled_ = true;
}
- virtual void OnDragSourceDrop() OVERRIDE {
+ virtual void OnDragSourceDrop() override {
}
- virtual void OnDragSourceMove() OVERRIDE {
+ virtual void OnDragSourceMove() override {
grid_view_->UpdateDrag(AppsGridView::MOUSE, GetCursorInGridViewCoords());
}
diff --git a/ui/app_list/views/apps_grid_view.h b/ui/app_list/views/apps_grid_view.h
index 08a11f6..3a395cb 100644
--- a/ui/app_list/views/apps_grid_view.h
+++ b/ui/app_list/views/apps_grid_view.h
@@ -127,22 +127,22 @@
PaginationModel* pagination_model() { return &pagination_model_; }
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnKeyReleased(const ui::KeyEvent& event) override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
virtual bool GetDropFormats(
int* formats,
- std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE;
- virtual bool CanDrop(const OSExchangeData& data) OVERRIDE;
- virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE;
+ std::set<OSExchangeData::CustomFormat>* custom_formats) override;
+ virtual bool CanDrop(const OSExchangeData& data) override;
+ virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
// Overridden from ui::EventHandler:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
// Stops the timer that triggers a page flip during a drag.
void StopPageFlipTimer();
@@ -369,27 +369,27 @@
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// Overridden from AppListItemListObserver:
- virtual void OnListItemAdded(size_t index, AppListItem* item) OVERRIDE;
- virtual void OnListItemRemoved(size_t index, AppListItem* item) OVERRIDE;
+ virtual void OnListItemAdded(size_t index, AppListItem* item) override;
+ virtual void OnListItemRemoved(size_t index, AppListItem* item) override;
virtual void OnListItemMoved(size_t from_index,
size_t to_index,
- AppListItem* item) OVERRIDE;
- virtual void OnAppListItemHighlight(size_t index, bool highlight) OVERRIDE;
+ AppListItem* item) override;
+ virtual void OnAppListItemHighlight(size_t index, bool highlight) override;
// Overridden from PaginationModelObserver:
- virtual void TotalPagesChanged() OVERRIDE;
- virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE;
- virtual void TransitionStarted() OVERRIDE;
- virtual void TransitionChanged() OVERRIDE;
+ virtual void TotalPagesChanged() override;
+ virtual void SelectedPageChanged(int old_selected, int new_selected) override;
+ virtual void TransitionStarted() override;
+ virtual void TransitionChanged() override;
// Overridden from AppListModelObserver:
- virtual void OnAppListModelStatusChanged() OVERRIDE;
+ virtual void OnAppListModelStatusChanged() override;
// ui::ImplicitAnimationObserver overrides:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ virtual void OnImplicitAnimationsCompleted() override;
// Hide a given view temporarily without losing (mouse) events and / or
// changing the size of it. If |immediate| is set the change will be
diff --git a/ui/app_list/views/apps_grid_view_unittest.cc b/ui/app_list/views/apps_grid_view_unittest.cc
index b9cc401..492b233 100644
--- a/ui/app_list/views/apps_grid_view_unittest.cc
+++ b/ui/app_list/views/apps_grid_view_unittest.cc
@@ -63,10 +63,10 @@
private:
// PaginationModelObserver overrides:
- virtual void TotalPagesChanged() OVERRIDE {
+ virtual void TotalPagesChanged() override {
}
virtual void SelectedPageChanged(int old_selected,
- int new_selected) OVERRIDE {
+ int new_selected) override {
if (!selected_pages_.empty())
selected_pages_ += ',';
selected_pages_ += base::IntToString(new_selected);
@@ -74,9 +74,9 @@
if (wait_)
ui_loop_->Quit();
}
- virtual void TransitionStarted() OVERRIDE {
+ virtual void TransitionStarted() override {
}
- virtual void TransitionChanged() OVERRIDE {
+ virtual void TransitionChanged() override {
}
base::MessageLoopForUI* ui_loop_;
@@ -95,7 +95,7 @@
virtual ~AppsGridViewTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
views::ViewsTestBase::SetUp();
model_.reset(new AppListTestModel);
model_->SetFoldersEnabled(true);
@@ -108,7 +108,7 @@
test_api_.reset(new AppsGridViewTestApi(apps_grid_view_.get()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
apps_grid_view_.reset(); // Release apps grid view before models.
views::ViewsTestBase::TearDown();
}
@@ -189,30 +189,30 @@
virtual ~TestAppsGridViewFolderDelegate() {}
// Overridden from AppsGridViewFolderDelegate:
- virtual void UpdateFolderViewBackground(bool show_bubble) OVERRIDE {
+ virtual void UpdateFolderViewBackground(bool show_bubble) override {
show_bubble_ = show_bubble;
}
virtual void ReparentItem(AppListItemView* original_drag_view,
const gfx::Point& drag_point_in_folder_grid)
- OVERRIDE {}
+ override {}
virtual void DispatchDragEventForReparent(
AppsGridView::Pointer pointer,
- const gfx::Point& drag_point_in_folder_grid) OVERRIDE {}
+ const gfx::Point& drag_point_in_folder_grid) override {}
virtual void DispatchEndDragEventForReparent(
bool events_forwarded_to_drag_drop_host,
- bool cancel_drag) OVERRIDE {}
+ bool cancel_drag) override {}
virtual bool IsPointOutsideOfFolderBoundary(const gfx::Point& point)
- OVERRIDE {
+ override {
return false;
}
- virtual bool IsOEMFolder() const OVERRIDE { return false; }
+ virtual bool IsOEMFolder() const override { return false; }
- virtual void SetRootLevelDragViewVisible(bool visible) OVERRIDE {}
+ virtual void SetRootLevelDragViewVisible(bool visible) override {}
bool show_bubble() { return show_bubble_; }
diff --git a/ui/app_list/views/cached_label.h b/ui/app_list/views/cached_label.h
index 8b4360a..3120446 100644
--- a/ui/app_list/views/cached_label.h
+++ b/ui/app_list/views/cached_label.h
@@ -28,11 +28,11 @@
#if defined(OS_WIN)
// Overridden from views::View:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
#endif
// Overridden from ui::LayerDelegate:
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
private:
bool needs_repaint_;
diff --git a/ui/app_list/views/contents_switcher_view.h b/ui/app_list/views/contents_switcher_view.h
index 9c8f67c..c6f2bdf 100644
--- a/ui/app_list/views/contents_switcher_view.h
+++ b/ui/app_list/views/contents_switcher_view.h
@@ -34,13 +34,13 @@
private:
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// Overridden from PaginationModelObserver:
- virtual void TotalPagesChanged() OVERRIDE;
- virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE;
- virtual void TransitionStarted() OVERRIDE;
- virtual void TransitionChanged() OVERRIDE;
+ virtual void TotalPagesChanged() override;
+ virtual void SelectedPageChanged(int old_selected, int new_selected) override;
+ virtual void TransitionStarted() override;
+ virtual void TransitionChanged() override;
ContentsView* contents_view_; // Owned by views hierarchy.
diff --git a/ui/app_list/views/contents_view.h b/ui/app_list/views/contents_view.h
index 092f08d..9546a0e 100644
--- a/ui/app_list/views/contents_view.h
+++ b/ui/app_list/views/contents_view.h
@@ -102,15 +102,15 @@
void AddBlankPageForTesting();
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
// Overridden from PaginationModelObserver:
- virtual void TotalPagesChanged() OVERRIDE;
- virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE;
- virtual void TransitionStarted() OVERRIDE;
- virtual void TransitionChanged() OVERRIDE;
+ virtual void TotalPagesChanged() override;
+ virtual void SelectedPageChanged(int old_selected, int new_selected) override;
+ virtual void TransitionStarted() override;
+ virtual void TransitionChanged() override;
// Returns the pagination model for the ContentsView.
const PaginationModel& pagination_model() { return pagination_model_; }
diff --git a/ui/app_list/views/folder_background_view.h b/ui/app_list/views/folder_background_view.h
index af4e8cf..dd6c9dd 100644
--- a/ui/app_list/views/folder_background_view.h
+++ b/ui/app_list/views/folder_background_view.h
@@ -38,10 +38,10 @@
private:
// views::View overrides:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// ui::ImplicitAnimationObserver overrides:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ virtual void OnImplicitAnimationsCompleted() override;
AppListFolderView* folder_view_;
ShowState show_state_;
diff --git a/ui/app_list/views/folder_header_view.h b/ui/app_list/views/folder_header_view.h
index c01b72d..3d1e7b6 100644
--- a/ui/app_list/views/folder_header_view.h
+++ b/ui/app_list/views/folder_header_view.h
@@ -41,7 +41,7 @@
void OnFolderItemRemoved();
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
private:
class FolderNameView;
@@ -61,20 +61,20 @@
bool IsFolderNameEnabledForTest() const;
// views::View overrides:
- virtual void Layout() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void Layout() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// views::TextfieldController overrides:
virtual void ContentsChanged(views::Textfield* sender,
- const base::string16& new_contents) OVERRIDE;
+ const base::string16& new_contents) override;
// views::ButtonListener overrides:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// AppListItemObserver overrides:
- virtual void ItemNameChanged() OVERRIDE;
+ virtual void ItemNameChanged() override;
AppListFolderItem* folder_item_; // Not owned.
diff --git a/ui/app_list/views/folder_header_view_unittest.cc b/ui/app_list/views/folder_header_view_unittest.cc
index 34f1984..6408adb 100644
--- a/ui/app_list/views/folder_header_view_unittest.cc
+++ b/ui/app_list/views/folder_header_view_unittest.cc
@@ -32,12 +32,12 @@
// FolderHeaderViewDelegate
virtual void NavigateBack(AppListFolderItem* item,
- const ui::Event& event_flags) OVERRIDE {}
+ const ui::Event& event_flags) override {}
- virtual void GiveBackFocusToSearchBox() OVERRIDE {}
+ virtual void GiveBackFocusToSearchBox() override {}
virtual void SetItemName(AppListFolderItem* item,
- const std::string& name) OVERRIDE {
+ const std::string& name) override {
folder_name_ = name;
}
@@ -57,7 +57,7 @@
virtual ~FolderHeaderViewTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
views::ViewsTestBase::SetUp();
model_.reset(new AppListTestModel);
model_->SetFoldersEnabled(true);
@@ -66,7 +66,7 @@
folder_header_view_.reset(new FolderHeaderView(delegate_.get()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
folder_header_view_.reset(); // Release apps grid view before models.
delegate_.reset();
views::ViewsTestBase::TearDown();
diff --git a/ui/app_list/views/page_switcher.cc b/ui/app_list/views/page_switcher.cc
index 84077f9..4ab6d6c 100644
--- a/ui/app_list/views/page_switcher.cc
+++ b/ui/app_list/views/page_switcher.cc
@@ -49,11 +49,11 @@
void set_button_width(int button_width) { button_width_ = button_width; }
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(button_width_, kButtonHeight);
}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
if (state() == STATE_HOVERED)
PaintButton(canvas, kPagerHoverColor);
else
diff --git a/ui/app_list/views/page_switcher.h b/ui/app_list/views/page_switcher.h
index a1ca14a..88807db 100644
--- a/ui/app_list/views/page_switcher.h
+++ b/ui/app_list/views/page_switcher.h
@@ -34,21 +34,21 @@
void UpdateUIForDragPoint(const gfx::Point& point);
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
private:
void CalculateButtonWidthAndSpacing(int contents_width);
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// Overridden from PaginationModelObserver:
- virtual void TotalPagesChanged() OVERRIDE;
- virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE;
- virtual void TransitionStarted() OVERRIDE;
- virtual void TransitionChanged() OVERRIDE;
+ virtual void TotalPagesChanged() override;
+ virtual void SelectedPageChanged(int old_selected, int new_selected) override;
+ virtual void TransitionStarted() override;
+ virtual void TransitionChanged() override;
PaginationModel* model_; // Owned by AppsGridView.
views::View* buttons_; // Owned by views hierarchy.
diff --git a/ui/app_list/views/progress_bar_view.h b/ui/app_list/views/progress_bar_view.h
index 0e61820..4aaaa63 100644
--- a/ui/app_list/views/progress_bar_view.h
+++ b/ui/app_list/views/progress_bar_view.h
@@ -22,8 +22,8 @@
virtual ~ProgressBarView();
// views::View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
scoped_ptr<views::Painter> background_painter_;
diff --git a/ui/app_list/views/pulsing_block_view.h b/ui/app_list/views/pulsing_block_view.h
index 22bbec2..f517bc0 100644
--- a/ui/app_list/views/pulsing_block_view.h
+++ b/ui/app_list/views/pulsing_block_view.h
@@ -28,7 +28,7 @@
void OnStartDelayTimer();
// views::View overrides:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
base::OneShotTimer<PulsingBlockView> start_delay_timer_;
diff --git a/ui/app_list/views/search_box_view.cc b/ui/app_list/views/search_box_view.cc
index 43cb313..6af224c 100644
--- a/ui/app_list/views/search_box_view.cc
+++ b/ui/app_list/views/search_box_view.cc
@@ -52,7 +52,7 @@
private:
// views::Background overrides:
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE {
+ virtual void Paint(gfx::Canvas* canvas, views::View* view) const override {
gfx::Rect bounds = view->GetContentsBounds();
SkPaint paint;
diff --git a/ui/app_list/views/search_box_view.h b/ui/app_list/views/search_box_view.h
index a2e3c8a..ef05438 100644
--- a/ui/app_list/views/search_box_view.h
+++ b/ui/app_list/views/search_box_view.h
@@ -55,8 +55,8 @@
}
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
private:
// Updates model text and selection model with current Textfield info.
@@ -67,28 +67,28 @@
// Overridden from views::TextfieldController:
virtual void ContentsChanged(views::Textfield* sender,
- const base::string16& new_contents) OVERRIDE;
+ const base::string16& new_contents) override;
virtual bool HandleKeyEvent(views::Textfield* sender,
- const ui::KeyEvent& key_event) OVERRIDE;
+ const ui::KeyEvent& key_event) override;
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// Overridden from views::MenuButtonListener:
virtual void OnMenuButtonClicked(View* source,
- const gfx::Point& point) OVERRIDE;
+ const gfx::Point& point) override;
// Overridden from SearchBoxModelObserver:
- virtual void IconChanged() OVERRIDE;
- virtual void SpeechRecognitionButtonPropChanged() OVERRIDE;
- virtual void HintTextChanged() OVERRIDE;
- virtual void SelectionModelChanged() OVERRIDE;
- virtual void TextChanged() OVERRIDE;
+ virtual void IconChanged() override;
+ virtual void SpeechRecognitionButtonPropChanged() override;
+ virtual void HintTextChanged() override;
+ virtual void SelectionModelChanged() override;
+ virtual void TextChanged() override;
// Overridden from SpeechUIModelObserver:
virtual void OnSpeechRecognitionStateChanged(
- SpeechRecognitionState new_state) OVERRIDE;
+ SpeechRecognitionState new_state) override;
SearchBoxViewDelegate* delegate_; // Not owned.
AppListViewDelegate* view_delegate_; // Not owned.
diff --git a/ui/app_list/views/search_box_view_unittest.cc b/ui/app_list/views/search_box_view_unittest.cc
index cc7354e..a1643a0 100644
--- a/ui/app_list/views/search_box_view_unittest.cc
+++ b/ui/app_list/views/search_box_view_unittest.cc
@@ -29,7 +29,7 @@
private:
// Overridden from views::View:
- virtual bool OnKeyPressed(const ui::KeyEvent& key_event) OVERRIDE {
+ virtual bool OnKeyPressed(const ui::KeyEvent& key_event) override {
if (!::isalnum(static_cast<int>(key_event.key_code()))) {
++count_;
return true;
@@ -48,7 +48,7 @@
virtual ~SearchBoxViewTest() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
views::test::WidgetTest::SetUp();
widget_ = CreateTopLevelPlatformWidget();
view_ = new SearchBoxView(this, &view_delegate_);
@@ -58,7 +58,7 @@
view_->set_contents_view(counter_view_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
widget_->CloseNow();
views::test::WidgetTest::TearDown();
}
@@ -107,7 +107,7 @@
private:
// Overridden from SearchBoxViewDelegate:
- virtual void QueryChanged(SearchBoxView* sender) OVERRIDE {
+ virtual void QueryChanged(SearchBoxView* sender) override {
++query_changed_count_;
last_query_ = sender->search_box()->text();
}
diff --git a/ui/app_list/views/search_result_actions_view.h b/ui/app_list/views/search_result_actions_view.h
index 7e5fa75..bb11a8b 100644
--- a/ui/app_list/views/search_result_actions_view.h
+++ b/ui/app_list/views/search_result_actions_view.h
@@ -34,11 +34,11 @@
void CreateBlueButton(const SearchResult::Action& action);
// views::View overrides:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// views::ButtonListener overrides:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
SearchResultActionsViewDelegate* delegate_; // Not owned.
int selected_action_;
diff --git a/ui/app_list/views/search_result_list_view.h b/ui/app_list/views/search_result_list_view.h
index e46bc23..40e9414 100644
--- a/ui/app_list/views/search_result_list_view.h
+++ b/ui/app_list/views/search_result_list_view.h
@@ -54,8 +54,8 @@
void OnSearchResultUninstalled(SearchResultView* view);
// Overridden from views::View:
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual gfx::Size GetPreferredSize() const override;
private:
friend class test::SearchResultListViewTest;
@@ -78,20 +78,20 @@
void ForceAutoLaunchForTest();
// Overridden from views::View:
- virtual void Layout() OVERRIDE;
- virtual int GetHeightForWidth(int w) const OVERRIDE;
+ virtual void Layout() override;
+ virtual int GetHeightForWidth(int w) const override;
virtual void VisibilityChanged(
- views::View* starting_from, bool is_visible) OVERRIDE;
+ views::View* starting_from, bool is_visible) override;
// Overridden from gfx::AnimationDelegate:
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationEnded(const gfx::Animation* animation) override;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
// Overridden from ui::ListModelObserver:
- virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE;
- virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE;
- virtual void ListItemMoved(size_t index, size_t target_index) OVERRIDE;
- virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE;
+ virtual void ListItemsAdded(size_t start, size_t count) override;
+ virtual void ListItemsRemoved(size_t start, size_t count) override;
+ virtual void ListItemMoved(size_t index, size_t target_index) override;
+ virtual void ListItemsChanged(size_t start, size_t count) override;
SearchResultListViewDelegate* delegate_; // Not owned.
AppListViewDelegate* view_delegate_; // Not owned.
diff --git a/ui/app_list/views/search_result_list_view_unittest.cc b/ui/app_list/views/search_result_list_view_unittest.cc
index e48a760..a42ba68 100644
--- a/ui/app_list/views/search_result_list_view_unittest.cc
+++ b/ui/app_list/views/search_result_list_view_unittest.cc
@@ -29,7 +29,7 @@
virtual ~SearchResultListViewTest() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
views::ViewsTestBase::SetUp();
view_.reset(new SearchResultListView(this, &view_delegate_));
view_->SetResults(view_delegate_.GetModel()->results());
@@ -111,8 +111,8 @@
}
private:
- virtual void OnResultInstalled(SearchResult* result) OVERRIDE {}
- virtual void OnResultUninstalled(SearchResult* result) OVERRIDE {}
+ virtual void OnResultInstalled(SearchResult* result) override {}
+ virtual void OnResultUninstalled(SearchResult* result) override {}
AppListTestViewDelegate view_delegate_;
scoped_ptr<SearchResultListView> view_;
diff --git a/ui/app_list/views/search_result_view.h b/ui/app_list/views/search_result_view.h
index c05e6bd..ae744f2 100644
--- a/ui/app_list/views/search_result_view.h
+++ b/ui/app_list/views/search_result_view.h
@@ -66,33 +66,33 @@
void UpdateDetailsText();
// views::View overrides:
- virtual const char* GetClassName() const OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual const char* GetClassName() const override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual void ChildPreferredSizeChanged(views::View* child) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// views::ButtonListener overrides:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// views::ContextMenuController overrides:
virtual void ShowContextMenuForView(views::View* source,
const gfx::Point& point,
- ui::MenuSourceType source_type) OVERRIDE;
+ ui::MenuSourceType source_type) override;
// SearchResultObserver overrides:
- virtual void OnIconChanged() OVERRIDE;
- virtual void OnActionsChanged() OVERRIDE;
- virtual void OnIsInstallingChanged() OVERRIDE;
- virtual void OnPercentDownloadedChanged() OVERRIDE;
- virtual void OnItemInstalled() OVERRIDE;
- virtual void OnItemUninstalled() OVERRIDE;
+ virtual void OnIconChanged() override;
+ virtual void OnActionsChanged() override;
+ virtual void OnIsInstallingChanged() override;
+ virtual void OnPercentDownloadedChanged() override;
+ virtual void OnItemInstalled() override;
+ virtual void OnItemUninstalled() override;
// SearchResultActionsViewDelegate overrides:
virtual void OnSearchResultActionActivated(size_t index,
- int event_flags) OVERRIDE;
+ int event_flags) override;
SearchResult* result_; // Owned by AppListModel::SearchResults.
diff --git a/ui/app_list/views/speech_view.cc b/ui/app_list/views/speech_view.cc
index 7fb213f..82e5f3c 100644
--- a/ui/app_list/views/speech_view.cc
+++ b/ui/app_list/views/speech_view.cc
@@ -53,7 +53,7 @@
private:
// Overridden from views::View:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
DISALLOW_COPY_AND_ASSIGN(SoundLevelIndicator);
};
@@ -79,7 +79,7 @@
private:
// views::MaskedTargeterDelegate:
- virtual bool GetHitTestMask(gfx::Path* mask) const OVERRIDE;
+ virtual bool GetHitTestMask(gfx::Path* mask) const override;
DISALLOW_COPY_AND_ASSIGN(MicButton);
};
diff --git a/ui/app_list/views/speech_view.h b/ui/app_list/views/speech_view.h
index 53a2f7b..d0d9cf6 100644
--- a/ui/app_list/views/speech_view.h
+++ b/ui/app_list/views/speech_view.h
@@ -34,8 +34,8 @@
void Reset();
// Overridden from views::View:
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
views::ImageButton* mic_button() { return mic_button_; }
@@ -44,14 +44,14 @@
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// Overridden from SpeechUIModelObserver:
- virtual void OnSpeechSoundLevelChanged(uint8 level) OVERRIDE;
+ virtual void OnSpeechSoundLevelChanged(uint8 level) override;
virtual void OnSpeechResult(const base::string16& result,
- bool is_final) OVERRIDE;
+ bool is_final) override;
virtual void OnSpeechRecognitionStateChanged(
- SpeechRecognitionState new_state) OVERRIDE;
+ SpeechRecognitionState new_state) override;
AppListViewDelegate* delegate_;
diff --git a/ui/app_list/views/speech_view_unittest.cc b/ui/app_list/views/speech_view_unittest.cc
index 1c49faa..ad49f0d 100644
--- a/ui/app_list/views/speech_view_unittest.cc
+++ b/ui/app_list/views/speech_view_unittest.cc
@@ -18,7 +18,7 @@
virtual ~SpeechViewTest() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
views::test::WidgetTest::SetUp();
widget_ = CreateTopLevelPlatformWidget();
widget_->SetBounds(gfx::Rect(0, 0, 300, 200));
@@ -27,7 +27,7 @@
view_->SetBoundsRect(widget_->GetContentsView()->GetLocalBounds());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
widget_->CloseNow();
views::test::WidgetTest::TearDown();
}
diff --git a/ui/app_list/views/start_page_view.cc b/ui/app_list/views/start_page_view.cc
index 23d2f64..580c986 100644
--- a/ui/app_list/views/start_page_view.cc
+++ b/ui/app_list/views/start_page_view.cc
@@ -53,7 +53,7 @@
virtual ~DummySearchBoxView() {}
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
gfx::Size size(SearchBoxView::GetPreferredSize());
size.set_width(kDummySearchBoxWidth);
return size;
diff --git a/ui/app_list/views/start_page_view.h b/ui/app_list/views/start_page_view.h
index 857c65a..2949ec5 100644
--- a/ui/app_list/views/start_page_view.h
+++ b/ui/app_list/views/start_page_view.h
@@ -41,8 +41,8 @@
SearchBoxView* dummy_search_box_view() { return search_box_view_; }
// Overridden from views::View:
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual void Layout() override;
private:
enum ShowState {
@@ -64,13 +64,13 @@
void ScheduleUpdate();
// Overridden from SearchBoxViewDelegate:
- virtual void QueryChanged(SearchBoxView* sender) OVERRIDE;
+ virtual void QueryChanged(SearchBoxView* sender) override;
// Overridden from ui::ListModelObserver:
- virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE;
- virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE;
- virtual void ListItemMoved(size_t index, size_t target_index) OVERRIDE;
- virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE;
+ virtual void ListItemsAdded(size_t start, size_t count) override;
+ virtual void ListItemsRemoved(size_t start, size_t count) override;
+ virtual void ListItemMoved(size_t index, size_t target_index) override;
+ virtual void ListItemsChanged(size_t start, size_t count) override;
// The parent view of ContentsView which is the parent of this view.
AppListMainView* app_list_main_view_;
diff --git a/ui/app_list/views/tile_item_view.h b/ui/app_list/views/tile_item_view.h
index baf61aa..816adfd 100644
--- a/ui/app_list/views/tile_item_view.h
+++ b/ui/app_list/views/tile_item_view.h
@@ -31,15 +31,15 @@
private:
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// Overridden from SearchResultObserver:
- virtual void OnIconChanged() OVERRIDE;
- virtual void OnResultDestroying() OVERRIDE;
+ virtual void OnIconChanged() override;
+ virtual void OnResultDestroying() override;
// Owned by the model provided by the AppListViewDelegate.
SearchResult* item_;
diff --git a/ui/app_list/views/top_icon_animation_view.h b/ui/app_list/views/top_icon_animation_view.h
index 4dc2aa5..a3c1286 100644
--- a/ui/app_list/views/top_icon_animation_view.h
+++ b/ui/app_list/views/top_icon_animation_view.h
@@ -54,12 +54,12 @@
private:
// views::View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
// ui::ImplicitAnimationObserver overrides:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
- virtual bool RequiresNotificationWhenAnimatorDestroyed() const OVERRIDE;
+ virtual void OnImplicitAnimationsCompleted() override;
+ virtual bool RequiresNotificationWhenAnimatorDestroyed() const override;
gfx::Size icon_size_;
views::ImageView* icon_; // Owned by views hierarchy.
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn
index 4f9a4a8..8b22fbb 100644
--- a/ui/aura/BUILD.gn
+++ b/ui/aura/BUILD.gn
@@ -142,8 +142,6 @@
}
}
-if (false) {
-
source_set("test_support") {
testonly = true
sources = [
@@ -305,5 +303,3 @@
]
}
}
-
-} # if (false)
diff --git a/ui/aura/bench/bench_main.cc b/ui/aura/bench/bench_main.cc
index 447b303..4704f7b 100644
--- a/ui/aura/bench/bench_main.cc
+++ b/ui/aura/bench/bench_main.cc
@@ -60,19 +60,19 @@
virtual ~ColoredLayer() {}
// Overridden from LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override {
if (draw_) {
canvas->DrawColor(color_);
}
}
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
+ const gfx::Rect& damage_rect_in_dip) override {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {
}
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
+ virtual base::Closure PrepareForLayerBoundsChange() override {
return base::Closure();
}
@@ -97,12 +97,12 @@
max_frames_(max_frames) {
}
- virtual void OnCompositingDidCommit(ui::Compositor* compositor) OVERRIDE {}
+ virtual void OnCompositingDidCommit(ui::Compositor* compositor) override {}
virtual void OnCompositingStarted(Compositor* compositor,
- base::TimeTicks start_time) OVERRIDE {}
+ base::TimeTicks start_time) override {}
- virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE {
+ virtual void OnCompositingEnded(Compositor* compositor) override {
if (start_time_.is_null()) {
start_time_ = TimeTicks::Now();
} else {
@@ -121,10 +121,10 @@
}
}
- virtual void OnCompositingAborted(Compositor* compositor) OVERRIDE {}
+ virtual void OnCompositingAborted(Compositor* compositor) override {}
virtual void OnCompositingLockStateChanged(
- Compositor* compositor) OVERRIDE {}
+ Compositor* compositor) override {}
virtual void Draw() {}
@@ -157,7 +157,7 @@
int max_frames)
: BenchCompositorObserver(max_frames),
parent_(parent),
- webgl_(ui::LAYER_TEXTURED),
+ webgl_(ui::LAYER_SOLID_COLOR),
compositor_(compositor),
fbo_(0),
do_draw_(true) {
@@ -223,13 +223,13 @@
}
virtual ~WebGLBench() {
- webgl_.SetShowPaintedContent();
+ webgl_.SetShowSolidColorContent();
gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL();
gl->DeleteFramebuffers(1, &fbo_);
compositor_->RemoveObserver(this);
}
- virtual void Draw() OVERRIDE {
+ virtual void Draw() override {
if (do_draw_) {
gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL();
gl->ClearColor((frames() % kFrames)*1.0/kFrames, 1.f, 0.f, 1.f);
@@ -273,7 +273,7 @@
compositor_->RemoveObserver(this);
}
- virtual void Draw() OVERRIDE {
+ virtual void Draw() override {
layer_->set_color(
SkColorSetARGBInline(255*(frames() % kFrames)/kFrames, 255, 0, 255));
layer_->SchedulePaint(gfx::Rect(layer_->bounds().size()));
diff --git a/ui/aura/client/default_capture_client.h b/ui/aura/client/default_capture_client.h
index cae13b7..41194af 100644
--- a/ui/aura/client/default_capture_client.h
+++ b/ui/aura/client/default_capture_client.h
@@ -20,10 +20,10 @@
private:
// Overridden from client::CaptureClient:
- virtual void SetCapture(Window* window) OVERRIDE;
- virtual void ReleaseCapture(Window* window) OVERRIDE;
- virtual Window* GetCaptureWindow() OVERRIDE;
- virtual Window* GetGlobalCaptureWindow() OVERRIDE;
+ virtual void SetCapture(Window* window) override;
+ virtual void ReleaseCapture(Window* window) override;
+ virtual Window* GetCaptureWindow() override;
+ virtual Window* GetGlobalCaptureWindow() override;
Window* root_window_;
Window* capture_window_;
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index f531cd3..ec5ea52 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -39,38 +39,38 @@
explicit DemoWindowDelegate(SkColor color) : color_(color) {}
// Overridden from WindowDelegate:
- virtual gfx::Size GetMinimumSize() const OVERRIDE {
+ virtual gfx::Size GetMinimumSize() const override {
return gfx::Size();
}
- virtual gfx::Size GetMaximumSize() const OVERRIDE {
+ virtual gfx::Size GetMaximumSize() const override {
return gfx::Size();
}
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {}
- virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+ const gfx::Rect& new_bounds) override {}
+ virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override {
return gfx::kNullCursor;
}
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
+ virtual int GetNonClientComponent(const gfx::Point& point) const override {
return HTCAPTION;
}
virtual bool ShouldDescendIntoChildForEventHandling(
aura::Window* child,
- const gfx::Point& location) OVERRIDE {
+ const gfx::Point& location) override {
return true;
}
- virtual bool CanFocus() OVERRIDE { return true; }
- virtual void OnCaptureLost() OVERRIDE {}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual bool CanFocus() override { return true; }
+ virtual void OnCaptureLost() override {}
+ virtual void OnPaint(gfx::Canvas* canvas) override {
canvas->DrawColor(color_, SkXfermode::kSrc_Mode);
}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {}
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {}
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {}
- virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {}
- virtual bool HasHitTestMask() const OVERRIDE { return false; }
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {}
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
+ virtual void OnWindowDestroying(aura::Window* window) override {}
+ virtual void OnWindowDestroyed(aura::Window* window) override {}
+ virtual void OnWindowTargetVisibilityChanged(bool visible) override {}
+ virtual bool HasHitTestMask() const override { return false; }
+ virtual void GetHitTestMask(gfx::Path* mask) const override {}
private:
SkColor color_;
@@ -91,7 +91,7 @@
// Overridden from aura::client::WindowTreeClient:
virtual aura::Window* GetDefaultParent(aura::Window* context,
aura::Window* window,
- const gfx::Rect& bounds) OVERRIDE {
+ const gfx::Rect& bounds) override {
if (!capture_client_) {
capture_client_.reset(
new aura::client::DefaultCaptureClient(window_->GetRootWindow()));
diff --git a/ui/aura/env.h b/ui/aura/env.h
index e857da6..480c6cb 100644
--- a/ui/aura/env.h
+++ b/ui/aura/env.h
@@ -87,10 +87,10 @@
void NotifyHostActivated(WindowTreeHost* host);
// Overridden from ui::EventTarget:
- virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
- virtual ui::EventTarget* GetParentTarget() OVERRIDE;
- virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE;
- virtual ui::EventTargeter* GetEventTargeter() OVERRIDE;
+ virtual bool CanAcceptEvent(const ui::Event& event) override;
+ virtual ui::EventTarget* GetParentTarget() override;
+ virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override;
+ virtual ui::EventTargeter* GetEventTargeter() override;
ObserverList<EnvObserver> observers_;
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
index 7e0faa5..f1b51d8 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -196,7 +196,7 @@
run_loop_->Run();
}
- virtual void OnGestureEvent(ui::GestureEvent* gesture) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* gesture) override {
events_.push_back(gesture->type());
bounding_box_ = gesture->details().bounding_box();
flags_ = gesture->flags();
@@ -346,7 +346,7 @@
}
}
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
+ virtual void OnTouchEvent(ui::TouchEvent* event) override {
if (queue_events_) {
queue_.push(new ui::TouchEvent(*event, window_, window_));
event->StopPropagation();
@@ -409,7 +409,7 @@
bool mouse_release() const { return mouse_release_; }
bool double_click() const { return double_click_; }
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
switch (event->type()) {
case ui::ET_MOUSE_PRESSED:
double_click_ = event->flags() & ui::EF_IS_DOUBLE_CLICK;
@@ -498,8 +498,8 @@
int time_step,
int num_steps,
GestureEventConsumeDelegate* delegate) {
- int x = x_start;
- int y = y_start;
+ float x = x_start;
+ float y = y_start;
for (int i = 0; i < num_steps; i++) {
x += dx;
@@ -538,7 +538,7 @@
virtual ~TestEventHandler() {}
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
+ virtual void OnTouchEvent(ui::TouchEvent* event) override {
switch (event->type()) {
case ui::ET_TOUCH_RELEASED:
touch_released_count_++;
@@ -592,7 +592,7 @@
private:
// ui::EventHandler:
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
+ virtual void OnTouchEvent(ui::TouchEvent* event) override {
TestEventHandler::OnTouchEvent(event);
if (event->type() == ui::ET_TOUCH_CANCELLED) {
Window* target = static_cast<Window*>(event->target());
@@ -633,10 +633,10 @@
public:
GestureRecognizerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AuraTestBase::SetUp();
ui::GestureConfiguration::set_show_press_delay_in_ms(2);
- ui::GestureConfiguration::set_long_press_time_in_seconds(0.003);
+ ui::GestureConfiguration::set_long_press_time_in_ms(3);
}
DISALLOW_COPY_AND_ASSIGN(GestureRecognizerTest);
@@ -939,7 +939,7 @@
// that distance to be consumed by the slop, so we set the slop radius to
// sqrt(5 * 5 + 5 * 5).
ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(
- sqrt(static_cast<double>(5 * 5 + 5 * 5)));
+ sqrt(5.f * 5 + 5 * 5));
scoped_ptr<GestureEventConsumeDelegate> delegate(
new GestureEventConsumeDelegate());
TimedEvents tes;
@@ -1010,7 +1010,7 @@
// distance to be consumed by the slop, so we set the slop radius to
// sqrt(5 * 5 + 5 * 5).
ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(
- sqrt(static_cast<double>(5 * 5 + 5 * 5)));
+ sqrt(5.f * 5 + 5 * 5));
scoped_ptr<GestureEventConsumeDelegate> delegate(
new GestureEventConsumeDelegate());
@@ -1080,7 +1080,7 @@
// Check that the bounding box during a scroll event is correct.
TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) {
TimedEvents tes;
- for (int radius = 1; radius <= 10; ++radius) {
+ for (float radius = 1; radius <= 10; ++radius) {
ui::GestureConfiguration::set_default_radius(radius);
scoped_ptr<GestureEventConsumeDelegate> delegate(
new GestureEventConsumeDelegate());
@@ -1091,44 +1091,44 @@
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- const int kPositionX = 101;
- const int kPositionY = 201;
+ const float kPositionX = 101;
+ const float kPositionY = 201;
delegate->Reset();
ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
- gfx::Point(kPositionX, kPositionY),
+ gfx::PointF(kPositionX, kPositionY),
kTouchId,
tes.Now());
DispatchEventUsingWindowDispatcher(&press);
- EXPECT_EQ(gfx::Rect(kPositionX - radius,
- kPositionY - radius,
- radius * 2,
- radius * 2).ToString(),
- delegate->bounding_box().ToString());
+ EXPECT_EQ(gfx::RectF(kPositionX - radius,
+ kPositionY - radius,
+ radius * 2,
+ radius * 2),
+ delegate->bounding_box());
const int kScrollAmount = 50;
tes.SendScrollEvents(event_processor(), kPositionX, kPositionY,
- 1, 1, kTouchId, 1, kScrollAmount, delegate.get());
+ 1, 1, kTouchId, 1, kScrollAmount, delegate.get());
EXPECT_EQ(gfx::Point(1, 1).ToString(),
delegate->scroll_begin_position().ToString());
- EXPECT_EQ(gfx::Rect(kPositionX + kScrollAmount - radius,
- kPositionY + kScrollAmount - radius,
- radius * 2,
- radius * 2).ToString(),
- delegate->bounding_box().ToString());
+ EXPECT_EQ(gfx::RectF(kPositionX + kScrollAmount - radius,
+ kPositionY + kScrollAmount - radius,
+ radius * 2,
+ radius * 2),
+ delegate->bounding_box());
// Release the touch. This should end the scroll.
delegate->Reset();
ui::TouchEvent release(ui::ET_TOUCH_RELEASED,
- gfx::Point(kPositionX + kScrollAmount,
- kPositionY + kScrollAmount),
+ gfx::PointF(kPositionX + kScrollAmount,
+ kPositionY + kScrollAmount),
kTouchId, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
DispatchEventUsingWindowDispatcher(&release);
- EXPECT_EQ(gfx::Rect(kPositionX + kScrollAmount - radius,
- kPositionY + kScrollAmount - radius,
- radius * 2,
- radius * 2).ToString(),
- delegate->bounding_box().ToString());
+ EXPECT_EQ(gfx::RectF(kPositionX + kScrollAmount - radius,
+ kPositionY + kScrollAmount - radius,
+ radius * 2,
+ radius * 2),
+ delegate->bounding_box());
}
ui::GestureConfiguration::set_default_radius(0);
}
@@ -1366,8 +1366,7 @@
// Check that appropriate touch events generate long tap events
TEST_F(GestureRecognizerTest, GestureEventLongTap) {
- ui::GestureConfiguration::set_max_touch_down_duration_in_seconds_for_click(
- 0.0025);
+ ui::GestureConfiguration::set_max_touch_down_duration_for_click_in_ms(3);
scoped_ptr<GestureEventConsumeDelegate> delegate(
new GestureEventConsumeDelegate());
const int kWindowWidth = 123;
@@ -1574,7 +1573,7 @@
// distance to be consumed by the slop, so we set the slop radius to
// sqrt(5 * 5 + 5 * 5).
ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(
- sqrt(static_cast<double>(5 * 5 + 5 * 5)));
+ sqrt(5.f * 5 + 5 * 5));
// First, tap. Then, do a scroll using the same touch-id.
scoped_ptr<GestureEventConsumeDelegate> delegate(
@@ -1831,9 +1830,13 @@
// should generate both SCROLL_BEGIN and PINCH_BEGIN gestures.
queued_delegate->Reset();
delegate->Reset();
- int x_move = ui::GestureConfiguration::max_touch_move_in_pixels_for_click();
ui::TouchEvent move(
- ui::ET_TOUCH_MOVED, gfx::Point(203 + x_move, 303), kTouchId2, tes.Now());
+ ui::ET_TOUCH_MOVED,
+ gfx::PointF(
+ 203 + ui::GestureConfiguration::max_touch_move_in_pixels_for_click(),
+ 303),
+ kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
@@ -2979,7 +2982,7 @@
void set_consume_touch_move(bool consume) { consume_touch_move_ = consume; }
private:
- virtual void OnTouchEvent(ui::TouchEvent* touch) OVERRIDE {
+ virtual void OnTouchEvent(ui::TouchEvent* touch) override {
if (consume_touch_move_ && touch->type() == ui::ET_TOUCH_MOVED)
touch->SetHandled();
else
@@ -4105,7 +4108,7 @@
void set_window(aura::Window** window) { window_ = window; }
- virtual void OnGestureEvent(ui::GestureEvent* gesture) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* gesture) override {
GestureEventConsumeDelegate::OnGestureEvent(gesture);
if (gesture->type() != ui::ET_GESTURE_LONG_PRESS)
return;
diff --git a/ui/aura/input_state_lookup_win.h b/ui/aura/input_state_lookup_win.h
index 4178841..94e4ee6 100644
--- a/ui/aura/input_state_lookup_win.h
+++ b/ui/aura/input_state_lookup_win.h
@@ -18,7 +18,7 @@
virtual ~InputStateLookupWin();
// InputStateLookup overrides:
- virtual bool IsMouseButtonDown() const OVERRIDE;
+ virtual bool IsMouseButtonDown() const override;
private:
DISALLOW_COPY_AND_ASSIGN(InputStateLookupWin);
diff --git a/ui/aura/remote_window_tree_host_win.h b/ui/aura/remote_window_tree_host_win.h
index 9a726d1..d1454d2 100644
--- a/ui/aura/remote_window_tree_host_win.h
+++ b/ui/aura/remote_window_tree_host_win.h
@@ -116,28 +116,28 @@
void OnImeInputSourceChanged(uint16 language_id, bool is_ime);
// WindowTreeHost overrides:
- virtual ui::EventSource* GetEventSource() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual gfx::Rect GetBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
- virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE;
- virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE;
- virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE;
+ virtual ui::EventSource* GetEventSource() override;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual gfx::Rect GetBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Point GetLocationOnNativeScreen() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void PostNativeEvent(const base::NativeEvent& native_event) override;
+ virtual void SetCursorNative(gfx::NativeCursor cursor) override;
+ virtual void MoveCursorToNative(const gfx::Point& location) override;
+ virtual void OnCursorVisibilityChangedNative(bool show) override;
// ui::EventSource:
- virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
+ virtual ui::EventProcessor* GetEventProcessor() override;
// ui::internal::RemoteInputMethodDelegateWin overrides:
- virtual void CancelComposition() OVERRIDE;
+ virtual void CancelComposition() override;
virtual void OnTextInputClientUpdated(
const std::vector<int32>& input_scopes,
- const std::vector<gfx::Rect>& composition_character_bounds) OVERRIDE;
+ const std::vector<gfx::Rect>& composition_character_bounds) override;
// Helper function to dispatch a keyboard message to the desired target.
// The default target is the WindowEventDispatcher. For nested message loop
diff --git a/ui/aura/scoped_window_targeter.h b/ui/aura/scoped_window_targeter.h
index f8546c5..14c3e89 100644
--- a/ui/aura/scoped_window_targeter.h
+++ b/ui/aura/scoped_window_targeter.h
@@ -33,7 +33,7 @@
private:
// WindowObserver:
- virtual void OnWindowDestroyed(Window* window) OVERRIDE;
+ virtual void OnWindowDestroyed(Window* window) override;
Window* window_;
scoped_ptr<ui::EventTargeter> old_targeter_;
diff --git a/ui/aura/test/aura_test_base.cc b/ui/aura/test/aura_test_base.cc
index 039661d..a6271cc 100644
--- a/ui/aura/test/aura_test_base.cc
+++ b/ui/aura/test/aura_test_base.cc
@@ -37,21 +37,20 @@
// Changing the parameters for gesture recognition shouldn't cause
// tests to fail, so we use a separate set of parameters for unit
// testing.
- ui::GestureConfiguration::set_long_press_time_in_seconds(1.0);
- ui::GestureConfiguration::set_semi_long_press_time_in_seconds(0.4);
+ ui::GestureConfiguration::set_long_press_time_in_ms(1000);
+ ui::GestureConfiguration::set_semi_long_press_time_in_ms(400);
ui::GestureConfiguration::set_show_press_delay_in_ms(5);
ui::GestureConfiguration::set_max_distance_for_two_finger_tap_in_pixels(300);
- ui::GestureConfiguration::set_max_seconds_between_double_click(0.7);
+ ui::GestureConfiguration::set_max_time_between_double_click_in_ms(700);
ui::GestureConfiguration::
set_max_separation_for_gesture_touches_in_pixels(150);
- ui::GestureConfiguration::
- set_max_touch_down_duration_in_seconds_for_click(0.8);
+ ui::GestureConfiguration::set_max_touch_down_duration_for_click_in_ms(800);
ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(5);
ui::GestureConfiguration::set_max_distance_between_taps_for_double_tap(20);
ui::GestureConfiguration::set_min_distance_for_pinch_scroll_in_pixels(20);
ui::GestureConfiguration::set_min_pinch_update_distance_in_pixels(5);
ui::GestureConfiguration::set_default_radius(0);
- ui::GestureConfiguration::set_fling_velocity_cap(15000.0f);
+ ui::GestureConfiguration::set_fling_velocity_cap(15000);
ui::GestureConfiguration::set_min_swipe_speed(10);
// The ContextFactory must exist before any Compositors are created.
diff --git a/ui/aura/test/aura_test_base.h b/ui/aura/test/aura_test_base.h
index b9f6e7f..4717243 100644
--- a/ui/aura/test/aura_test_base.h
+++ b/ui/aura/test/aura_test_base.h
@@ -24,8 +24,8 @@
virtual ~AuraTestBase();
// testing::Test:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
// Creates a normal window parented to |parent|.
aura::Window* CreateNormalWindow(int id, Window* parent,
diff --git a/ui/aura/test/event_generator_delegate_aura.cc b/ui/aura/test/event_generator_delegate_aura.cc
index a4041a3..576cc8e 100644
--- a/ui/aura/test/event_generator_delegate_aura.cc
+++ b/ui/aura/test/event_generator_delegate_aura.cc
@@ -22,17 +22,17 @@
// EventGeneratorDelegate:
virtual void SetContext(ui::test::EventGenerator* owner,
gfx::NativeWindow root_window,
- gfx::NativeWindow window) OVERRIDE {
+ gfx::NativeWindow window) override {
root_window_ = root_window;
}
// EventGeneratorDelegateAura:
- virtual WindowTreeHost* GetHostAt(const gfx::Point& point) const OVERRIDE {
+ virtual WindowTreeHost* GetHostAt(const gfx::Point& point) const override {
return root_window_->GetHost();
}
virtual client::ScreenPositionClient* GetScreenPositionClient(
- const aura::Window* window) const OVERRIDE {
+ const aura::Window* window) const override {
return NULL;
}
diff --git a/ui/aura/test/event_generator_delegate_aura.h b/ui/aura/test/event_generator_delegate_aura.h
index 5d37538..b43bf68 100644
--- a/ui/aura/test/event_generator_delegate_aura.h
+++ b/ui/aura/test/event_generator_delegate_aura.h
@@ -35,17 +35,17 @@
const aura::Window* window) const = 0;
// Overridden from ui::test::EventGeneratorDelegate:
- virtual ui::EventTarget* GetTargetAt(const gfx::Point& location) OVERRIDE;
- virtual ui::EventSource* GetEventSource(ui::EventTarget* target) OVERRIDE;
+ virtual ui::EventTarget* GetTargetAt(const gfx::Point& location) override;
+ virtual ui::EventSource* GetEventSource(ui::EventTarget* target) override;
virtual gfx::Point CenterOfTarget(
- const ui::EventTarget* target) const OVERRIDE;
- virtual gfx::Point CenterOfWindow(gfx::NativeWindow window) const OVERRIDE;
+ const ui::EventTarget* target) const override;
+ virtual gfx::Point CenterOfWindow(gfx::NativeWindow window) const override;
virtual void ConvertPointFromTarget(const ui::EventTarget* target,
- gfx::Point* point) const OVERRIDE;
+ gfx::Point* point) const override;
virtual void ConvertPointToTarget(const ui::EventTarget* target,
- gfx::Point* point) const OVERRIDE;
+ gfx::Point* point) const override;
virtual void ConvertPointFromHost(const ui::EventTarget* hosted_target,
- gfx::Point* point) const OVERRIDE;
+ gfx::Point* point) const override;
private:
DISALLOW_COPY_AND_ASSIGN(EventGeneratorDelegateAura);
diff --git a/ui/aura/test/test_cursor_client.h b/ui/aura/test/test_cursor_client.h
index 1372c33..c3f845e 100644
--- a/ui/aura/test/test_cursor_client.h
+++ b/ui/aura/test/test_cursor_client.h
@@ -32,26 +32,26 @@
}
// Overridden from aura::client::CursorClient:
- virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
- virtual gfx::NativeCursor GetCursor() const OVERRIDE;
- virtual void ShowCursor() OVERRIDE;
- virtual void HideCursor() OVERRIDE;
- virtual void SetCursorSet(ui::CursorSetType cursor_set) OVERRIDE;
- virtual ui::CursorSetType GetCursorSet() const OVERRIDE;
- virtual bool IsCursorVisible() const OVERRIDE;
- virtual void EnableMouseEvents() OVERRIDE;
- virtual void DisableMouseEvents() OVERRIDE;
- virtual bool IsMouseEventsEnabled() const OVERRIDE;
- virtual void SetDisplay(const gfx::Display& display) OVERRIDE;
- virtual void LockCursor() OVERRIDE;
- virtual void UnlockCursor() OVERRIDE;
- virtual bool IsCursorLocked() const OVERRIDE;
+ virtual void SetCursor(gfx::NativeCursor cursor) override;
+ virtual gfx::NativeCursor GetCursor() const override;
+ virtual void ShowCursor() override;
+ virtual void HideCursor() override;
+ virtual void SetCursorSet(ui::CursorSetType cursor_set) override;
+ virtual ui::CursorSetType GetCursorSet() const override;
+ virtual bool IsCursorVisible() const override;
+ virtual void EnableMouseEvents() override;
+ virtual void DisableMouseEvents() override;
+ virtual bool IsMouseEventsEnabled() const override;
+ virtual void SetDisplay(const gfx::Display& display) override;
+ virtual void LockCursor() override;
+ virtual void UnlockCursor() override;
+ virtual bool IsCursorLocked() const override;
virtual void AddObserver(
- aura::client::CursorClientObserver* observer) OVERRIDE;
+ aura::client::CursorClientObserver* observer) override;
virtual void RemoveObserver(
- aura::client::CursorClientObserver* observer) OVERRIDE;
+ aura::client::CursorClientObserver* observer) override;
virtual bool ShouldHideCursorOnKeyEvent(
- const ui::KeyEvent& event) const OVERRIDE;
+ const ui::KeyEvent& event) const override;
private:
bool visible_;
diff --git a/ui/aura/test/test_focus_client.h b/ui/aura/test/test_focus_client.h
index 06ae3c8..5f9f718 100644
--- a/ui/aura/test/test_focus_client.h
+++ b/ui/aura/test/test_focus_client.h
@@ -22,14 +22,14 @@
private:
// Overridden from client::FocusClient:
- virtual void AddObserver(client::FocusChangeObserver* observer) OVERRIDE;
- virtual void RemoveObserver(client::FocusChangeObserver* observer) OVERRIDE;
- virtual void FocusWindow(Window* window) OVERRIDE;
- virtual void ResetFocusWithinActiveWindow(Window* window) OVERRIDE;
- virtual Window* GetFocusedWindow() OVERRIDE;
+ virtual void AddObserver(client::FocusChangeObserver* observer) override;
+ virtual void RemoveObserver(client::FocusChangeObserver* observer) override;
+ virtual void FocusWindow(Window* window) override;
+ virtual void ResetFocusWithinActiveWindow(Window* window) override;
+ virtual Window* GetFocusedWindow() override;
// Overridden from WindowObserver:
- virtual void OnWindowDestroying(Window* window) OVERRIDE;
+ virtual void OnWindowDestroying(Window* window) override;
Window* focused_window_;
ScopedObserver<Window, WindowObserver> observer_manager_;
diff --git a/ui/aura/test/test_screen.h b/ui/aura/test/test_screen.h
index 7310008..7b1f98b 100644
--- a/ui/aura/test/test_screen.h
+++ b/ui/aura/test/test_screen.h
@@ -45,26 +45,26 @@
// WindowObserver overrides:
virtual void OnWindowBoundsChanged(Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnWindowDestroying(Window* window) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual void OnWindowDestroying(Window* window) override;
// gfx::Screen overrides:
- virtual bool IsDIPEnabled() OVERRIDE;
- virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
- virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE;
+ virtual bool IsDIPEnabled() override;
+ virtual gfx::Point GetCursorScreenPoint() override;
+ virtual gfx::NativeWindow GetWindowUnderCursor() override;
virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
- OVERRIDE;
- virtual int GetNumDisplays() const OVERRIDE;
- virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE;
+ override;
+ virtual int GetNumDisplays() const override;
+ virtual std::vector<gfx::Display> GetAllDisplays() const override;
virtual gfx::Display GetDisplayNearestWindow(
- gfx::NativeView view) const OVERRIDE;
+ gfx::NativeView view) const override;
virtual gfx::Display GetDisplayNearestPoint(
- const gfx::Point& point) const OVERRIDE;
+ const gfx::Point& point) const override;
virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const OVERRIDE;
- virtual gfx::Display GetPrimaryDisplay() const OVERRIDE;
- virtual void AddObserver(gfx::DisplayObserver* observer) OVERRIDE;
- virtual void RemoveObserver(gfx::DisplayObserver* observer) OVERRIDE;
+ const gfx::Rect& match_rect) const override;
+ virtual gfx::Display GetPrimaryDisplay() const override;
+ virtual void AddObserver(gfx::DisplayObserver* observer) override;
+ virtual void RemoveObserver(gfx::DisplayObserver* observer) override;
private:
explicit TestScreen(const gfx::Rect& screen_bounds);
diff --git a/ui/aura/test/test_window_delegate.h b/ui/aura/test/test_window_delegate.h
index 6f36e44..1cb142a 100644
--- a/ui/aura/test/test_window_delegate.h
+++ b/ui/aura/test/test_window_delegate.h
@@ -42,24 +42,24 @@
void set_can_focus(bool can_focus) { can_focus_ = can_focus; }
// Overridden from WindowDelegate:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override;
+ virtual int GetNonClientComponent(const gfx::Point& point) const override;
virtual bool ShouldDescendIntoChildForEventHandling(
Window* child,
- const gfx::Point& location) OVERRIDE;
- virtual bool CanFocus() OVERRIDE;
- virtual void OnCaptureLost() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
- virtual void OnWindowDestroying(Window* window) OVERRIDE;
- virtual void OnWindowDestroyed(Window* window) OVERRIDE;
- virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE;
- virtual bool HasHitTestMask() const OVERRIDE;
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE;
+ const gfx::Point& location) override;
+ virtual bool CanFocus() override;
+ virtual void OnCaptureLost() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
+ virtual void OnWindowDestroying(Window* window) override;
+ virtual void OnWindowDestroyed(Window* window) override;
+ virtual void OnWindowTargetVisibilityChanged(bool visible) override;
+ virtual bool HasHitTestMask() const override;
+ virtual void GetHitTestMask(gfx::Path* mask) const override;
private:
int window_component_;
@@ -81,9 +81,9 @@
ui::KeyboardCode last_key_code() const { return last_key_code_; }
// Overridden from TestWindowDelegate:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnWindowDestroyed(Window* window) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnWindowDestroyed(Window* window) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
SkColor color_;
@@ -98,8 +98,8 @@
explicit MaskedWindowDelegate(const gfx::Rect mask_rect);
// Overridden from TestWindowDelegate:
- virtual bool HasHitTestMask() const OVERRIDE;
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE;
+ virtual bool HasHitTestMask() const override;
+ virtual void GetHitTestMask(gfx::Path* mask) const override;
private:
gfx::Rect mask_rect_;
@@ -113,9 +113,9 @@
EventCountDelegate();
// Overridden from TestWindowDelegate:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Returns the counts of mouse motion events in the
// form of "<enter> <move> <leave>".
diff --git a/ui/aura/test/test_window_tree_client.h b/ui/aura/test/test_window_tree_client.h
index 7b3c5ee..8856a9f 100644
--- a/ui/aura/test/test_window_tree_client.h
+++ b/ui/aura/test/test_window_tree_client.h
@@ -21,7 +21,7 @@
// Overridden from client::WindowTreeClient:
virtual Window* GetDefaultParent(Window* context,
Window* window,
- const gfx::Rect& bounds) OVERRIDE;
+ const gfx::Rect& bounds) override;
private:
Window* root_window_;
diff --git a/ui/aura/test/ui_controls_factory_aurax11.cc b/ui/aura/test/ui_controls_factory_aurax11.cc
index 59db324..8f6b278 100644
--- a/ui/aura/test/ui_controls_factory_aurax11.cc
+++ b/ui/aura/test/ui_controls_factory_aurax11.cc
@@ -55,7 +55,7 @@
bool control,
bool shift,
bool alt,
- bool command) OVERRIDE {
+ bool command) override {
return SendKeyPressNotifyWhenDone(
window, key, control, shift, alt, command, base::Closure());
}
@@ -66,7 +66,7 @@
bool shift,
bool alt,
bool command,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
XEvent xevent = {0};
xevent.xkey.type = KeyPress;
if (control)
@@ -98,13 +98,13 @@
return true;
}
- virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE {
+ virtual bool SendMouseMove(long screen_x, long screen_y) override {
return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure());
}
virtual bool SendMouseMoveNotifyWhenDone(
long screen_x,
long screen_y,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
gfx::Point root_location(screen_x, screen_y);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(host_->window());
@@ -134,13 +134,13 @@
RunClosureAfterAllPendingUIEvents(closure);
return true;
}
- virtual bool SendMouseEvents(MouseButton type, int state) OVERRIDE {
+ virtual bool SendMouseEvents(MouseButton type, int state) override {
return SendMouseEventsNotifyWhenDone(type, state, base::Closure());
}
virtual bool SendMouseEventsNotifyWhenDone(
MouseButton type,
int state,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
XEvent xevent = {0};
XButtonEvent* xbutton = &xevent.xbutton;
gfx::Point mouse_loc = aura::Env::GetInstance()->last_mouse_location();
@@ -181,11 +181,11 @@
RunClosureAfterAllPendingUIEvents(closure);
return true;
}
- virtual bool SendMouseClick(MouseButton type) OVERRIDE {
+ virtual bool SendMouseClick(MouseButton type) override {
return SendMouseEvents(type, UP | DOWN);
}
virtual void RunClosureAfterAllPendingUIEvents(
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
if (closure.is_null())
return;
static XEvent* marker_event = NULL;
diff --git a/ui/aura/test/ui_controls_factory_ozone.cc b/ui/aura/test/ui_controls_factory_ozone.cc
index 4c5330c..5bd96bb 100644
--- a/ui/aura/test/ui_controls_factory_ozone.cc
+++ b/ui/aura/test/ui_controls_factory_ozone.cc
@@ -24,7 +24,7 @@
bool control,
bool shift,
bool alt,
- bool command) OVERRIDE {
+ bool command) override {
return SendKeyPressNotifyWhenDone(
window, key, control, shift, alt, command, base::Closure());
}
@@ -35,7 +35,7 @@
bool shift,
bool alt,
bool command,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
int flags = button_down_mask_;
if (control) {
@@ -85,13 +85,13 @@
return true;
}
- virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE {
+ virtual bool SendMouseMove(long screen_x, long screen_y) override {
return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure());
}
virtual bool SendMouseMoveNotifyWhenDone(
long screen_x,
long screen_y,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
gfx::Point root_location(screen_x, screen_y);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(host_->window());
@@ -112,13 +112,13 @@
return true;
}
virtual bool SendMouseEvents(ui_controls::MouseButton type,
- int state) OVERRIDE {
+ int state) override {
return SendMouseEventsNotifyWhenDone(type, state, base::Closure());
}
virtual bool SendMouseEventsNotifyWhenDone(
ui_controls::MouseButton type,
int state,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
gfx::Point loc = aura::Env::GetInstance()->last_mouse_location();
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(host_->window());
@@ -155,11 +155,11 @@
RunClosureAfterAllPendingUIEvents(closure);
return true;
}
- virtual bool SendMouseClick(ui_controls::MouseButton type) OVERRIDE {
+ virtual bool SendMouseClick(ui_controls::MouseButton type) override {
return SendMouseEvents(type, ui_controls::UP | ui_controls::DOWN);
}
virtual void RunClosureAfterAllPendingUIEvents(
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
if (!closure.is_null())
base::MessageLoop::current()->PostTask(FROM_HERE, closure);
}
diff --git a/ui/aura/window.h b/ui/aura/window.h
index dd08697..1a2721a 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -312,7 +312,7 @@
typedef void (*PropertyDeallocator)(int64 value);
// Overridden from ui::LayerDelegate:
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
#if !defined(NDEBUG)
// These methods are useful when debugging.
@@ -455,18 +455,18 @@
void OnWindowBoundsChanged(const gfx::Rect& old_bounds);
// Overridden from ui::LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override;
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE;
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE;
+ const gfx::Rect& damage_rect_in_dip) override;
+ virtual base::Closure PrepareForLayerBoundsChange() override;
// Overridden from ui::EventTarget:
- virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
- virtual EventTarget* GetParentTarget() OVERRIDE;
- virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE;
- virtual ui::EventTargeter* GetEventTargeter() OVERRIDE;
+ virtual bool CanAcceptEvent(const ui::Event& event) override;
+ virtual EventTarget* GetParentTarget() override;
+ virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override;
+ virtual ui::EventTargeter* GetEventTargeter() override;
virtual void ConvertEventToTarget(ui::EventTarget* target,
- ui::LocatedEvent* event) OVERRIDE;
+ ui::LocatedEvent* event) override;
// Updates the layer name based on the window's name and id.
void UpdateLayerName();
diff --git a/ui/aura/window_event_dispatcher.h b/ui/aura/window_event_dispatcher.h
index 1620af3..a93c5d8 100644
--- a/ui/aura/window_event_dispatcher.h
+++ b/ui/aura/window_event_dispatcher.h
@@ -168,44 +168,44 @@
Window* GetGestureTarget(ui::GestureEvent* event);
// Overridden from aura::client::CaptureDelegate:
- virtual void UpdateCapture(Window* old_capture, Window* new_capture) OVERRIDE;
- virtual void OnOtherRootGotCapture() OVERRIDE;
- virtual void SetNativeCapture() OVERRIDE;
- virtual void ReleaseNativeCapture() OVERRIDE;
+ virtual void UpdateCapture(Window* old_capture, Window* new_capture) override;
+ virtual void OnOtherRootGotCapture() override;
+ virtual void SetNativeCapture() override;
+ virtual void ReleaseNativeCapture() override;
// Overridden from ui::EventProcessor:
- virtual ui::EventTarget* GetRootTarget() OVERRIDE;
- virtual void OnEventProcessingStarted(ui::Event* event) OVERRIDE;
+ virtual ui::EventTarget* GetRootTarget() override;
+ virtual void OnEventProcessingStarted(ui::Event* event) override;
// Overridden from ui::EventDispatcherDelegate.
- virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE;
+ virtual bool CanDispatchToTarget(ui::EventTarget* target) override;
virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target,
- ui::Event* event) OVERRIDE;
+ ui::Event* event) override;
virtual ui::EventDispatchDetails PostDispatchEvent(
- ui::EventTarget* target, const ui::Event& event) OVERRIDE;
+ ui::EventTarget* target, const ui::Event& event) override;
// Overridden from ui::GestureEventHelper.
- virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE;
- virtual void DispatchGestureEvent(ui::GestureEvent* event) OVERRIDE;
- virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE;
+ virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) override;
+ virtual void DispatchGestureEvent(ui::GestureEvent* event) override;
+ virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) override;
// Overridden from WindowObserver:
- virtual void OnWindowDestroying(Window* window) OVERRIDE;
- virtual void OnWindowDestroyed(Window* window) OVERRIDE;
- virtual void OnWindowAddedToRootWindow(Window* window) OVERRIDE;
+ virtual void OnWindowDestroying(Window* window) override;
+ virtual void OnWindowDestroyed(Window* window) override;
+ virtual void OnWindowAddedToRootWindow(Window* window) override;
virtual void OnWindowRemovingFromRootWindow(Window* window,
- Window* new_root) OVERRIDE;
+ Window* new_root) override;
virtual void OnWindowVisibilityChanging(Window* window,
- bool visible) OVERRIDE;
- virtual void OnWindowVisibilityChanged(Window* window, bool visible) OVERRIDE;
+ bool visible) override;
+ virtual void OnWindowVisibilityChanged(Window* window, bool visible) override;
virtual void OnWindowBoundsChanged(Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnWindowTransforming(Window* window) OVERRIDE;
- virtual void OnWindowTransformed(Window* window) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual void OnWindowTransforming(Window* window) override;
+ virtual void OnWindowTransformed(Window* window) override;
// Overridden from EnvObserver:
- virtual void OnWindowInitialized(Window* window) OVERRIDE;
+ virtual void OnWindowInitialized(Window* window) override;
// We hold and aggregate mouse drags and touch moves as a way of throttling
// resizes when HoldMouseMoves() is called. The following methods are used to
diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc
index 94c9aba..4ef4cae 100644
--- a/ui/aura/window_event_dispatcher_unittest.cc
+++ b/ui/aura/window_event_dispatcher_unittest.cc
@@ -53,13 +53,13 @@
gfx::Point mouse_event_location() const { return mouse_event_location_; }
int mouse_event_flags() const { return mouse_event_flags_; }
- virtual int GetNonClientComponent(const gfx::Point& location) const OVERRIDE {
+ virtual int GetNonClientComponent(const gfx::Point& location) const override {
NonClientDelegate* self = const_cast<NonClientDelegate*>(this);
self->non_client_count_++;
self->non_client_location_ = location;
return HTTOPLEFT;
}
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
mouse_event_count_++;
mouse_event_location_ = event->location();
mouse_event_flags_ = event->flags();
@@ -83,7 +83,7 @@
virtual ~ConsumeKeyHandler() {}
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE {
+ virtual void OnKeyEvent(ui::KeyEvent* event) override {
ui::test::TestEventHandler::OnKeyEvent(event);
event->StopPropagation();
}
@@ -268,13 +268,13 @@
private:
// Overridden from client::EventClient:
virtual bool CanProcessEventsWithinSubtree(
- const Window* window) const OVERRIDE {
+ const Window* window) const override {
return lock_ ?
window->Contains(GetLockWindow()) || GetLockWindow()->Contains(window) :
true;
}
- virtual ui::EventTarget* GetToplevelEventTarget() OVERRIDE {
+ virtual ui::EventTarget* GetToplevelEventTarget() override {
return NULL;
}
@@ -486,7 +486,7 @@
}
// ui::EventHandler overrides:
- virtual void OnEvent(ui::Event* event) OVERRIDE {
+ virtual void OnEvent(ui::Event* event) override {
ui::EventHandler::OnEvent(event);
events_.push_back(event->type());
if (wait_until_event_ == event->type() && run_loop_) {
@@ -495,16 +495,16 @@
}
}
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
mouse_locations_.push_back(event->location());
mouse_event_flags_.push_back(event->flags());
}
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
+ virtual void OnTouchEvent(ui::TouchEvent* event) override {
touch_locations_.push_back(event->location());
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
gesture_locations_.push_back(event->location());
}
@@ -838,7 +838,7 @@
private:
// ui::test::TestEventHandler:
- virtual void OnGestureEvent(ui::GestureEvent* gesture) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* gesture) override {
if (!holding_moves_ && gesture->type() == ui::ET_GESTURE_SCROLL_UPDATE) {
holding_moves_ = true;
dispatcher_->HoldPointerMoves();
@@ -1141,12 +1141,12 @@
private:
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE {
+ virtual void OnKeyEvent(ui::KeyEvent* event) override {
if (delete_during_pre_handle_)
delete event->target();
}
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
if (delete_during_pre_handle_)
delete event->target();
}
@@ -1173,13 +1173,13 @@
private:
// Overridden from WindowDelegate:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE {
+ virtual void OnKeyEvent(ui::KeyEvent* event) override {
if (delete_during_handle_)
delete window_;
got_event_ = true;
}
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
if (delete_during_handle_)
delete window_;
got_event_ = true;
@@ -1242,7 +1242,7 @@
virtual ~DetachesParentOnTapDelegate() {}
private:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
event->SetHandled();
return;
@@ -1287,7 +1287,7 @@
int gesture_end_count() const { return gesture_end_count_; }
private:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
switch (event->type()) {
case ui::ET_GESTURE_TAP_DOWN:
event->SetHandled();
@@ -1373,7 +1373,7 @@
virtual ~RepostGestureEventRecorder() {}
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
+ virtual void OnTouchEvent(ui::TouchEvent* event) override {
if (reposted_ && event->type() == ui::ET_TOUCH_PRESSED) {
done_cleanup_ = true;
Reset();
@@ -1381,7 +1381,7 @@
EventFilterRecorder::OnTouchEvent(event);
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
EXPECT_EQ(done_cleanup_ ? repost_target_ : repost_source_, event->target());
if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
if (!reposted_) {
@@ -1399,7 +1399,7 @@
// Ignore mouse events as they don't fire at all times. This causes
// the GestureRepostEventOrder test to fail randomly.
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {}
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {}
private:
aura::Window* repost_source_;
@@ -1481,7 +1481,7 @@
private:
// Overridden from ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
EventFilterRecorder::OnMouseEvent(event);
if (window_to_delete_) {
delete window_to_delete_;
@@ -1547,7 +1547,7 @@
}
// WindowObserver:
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {
+ virtual void OnWindowDestroying(aura::Window* window) override {
*got_destroying_ = true;
*has_valid_root_ = (window->GetRootWindow() != NULL);
}
@@ -1592,7 +1592,7 @@
int mouse_event_count() const { return mouse_event_count_; }
// TestWindowDelegate:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
if ((event->flags() & ui::EF_SHIFT_DOWN) != 0 &&
mouse_event_count_++ == 0) {
ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED,
@@ -1653,13 +1653,13 @@
bool got_destroy() const { return got_destroy_; }
// TestWindowDelegate:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
if ((event->flags() & ui::EF_SHIFT_DOWN) != 0) {
got_mouse_event_ = true;
delete host_;
}
}
- virtual void OnWindowDestroyed(Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(Window* window) override {
got_destroy_ = true;
}
@@ -1824,11 +1824,11 @@
capture_window_.reset();
}
- virtual void OnCaptureLost() OVERRIDE {
+ virtual void OnCaptureLost() override {
capture_window_.reset();
}
- virtual void OnWindowDestroyed(Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(Window* window) override {
TestWindowDelegate::OnWindowDestroyed(window);
capture_window_.reset();
}
@@ -1865,7 +1865,7 @@
virtual ~ExitMessageLoopOnMousePress() {}
protected:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
ui::test::TestEventHandler::OnMouseEvent(event);
if (event->type() == ui::ET_MOUSE_PRESSED)
base::MessageLoopForUI::current()->Quit();
@@ -1915,13 +1915,13 @@
}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
WindowEventDispatcherTest::SetUp();
window_.reset(CreateNormalWindow(1, root_window(), NULL));
window_->AddPreTargetHandler(&handler_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
window_.reset();
WindowEventDispatcherTest::TearDown();
}
@@ -1956,7 +1956,7 @@
virtual ~WindowEventDispatcherTestInHighDPI() {}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
WindowEventDispatcherTest::SetUp();
test_screen()->SetDeviceScaleFactor(2.f);
}
@@ -2034,7 +2034,7 @@
SelfDestructDelegate() {}
virtual ~SelfDestructDelegate() {}
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
window_.reset();
}
@@ -2087,11 +2087,11 @@
private:
// client::FocusClient:
- virtual void AddObserver(client::FocusChangeObserver* observer) OVERRIDE {}
- virtual void RemoveObserver(client::FocusChangeObserver* observer) OVERRIDE {}
- virtual void FocusWindow(Window* window) OVERRIDE {}
- virtual void ResetFocusWithinActiveWindow(Window* window) OVERRIDE {}
- virtual Window* GetFocusedWindow() OVERRIDE { return focused_; }
+ virtual void AddObserver(client::FocusChangeObserver* observer) override {}
+ virtual void RemoveObserver(client::FocusChangeObserver* observer) override {}
+ virtual void FocusWindow(Window* window) override {}
+ virtual void ResetFocusWithinActiveWindow(Window* window) override {}
+ virtual Window* GetFocusedWindow() override { return focused_; }
Window* focused_;
@@ -2126,7 +2126,7 @@
bool dispatched() const { return dispatched_; }
private:
// ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* mouse) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* mouse) override {
if (mouse->type() == ui::ET_MOUSE_MOVED) {
ui::MouseEvent move(ui::ET_MOUSE_MOVED, target_->bounds().CenterPoint(),
target_->bounds().CenterPoint(), ui::EF_NONE, ui::EF_NONE);
@@ -2156,7 +2156,7 @@
private:
// ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* mouse) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* mouse) override {
if (mouse->type() == ui::ET_MOUSE_MOVED) {
root_window_to_move_to_->AddChild(window_to_move_);
}
@@ -2222,7 +2222,7 @@
private:
// InputStateLookup:
- virtual bool IsMouseButtonDown() const OVERRIDE { return true; }
+ virtual bool IsMouseButtonDown() const override { return true; }
DISALLOW_COPY_AND_ASSIGN(AlwaysMouseDownInputStateLookup);
};
@@ -2319,7 +2319,7 @@
window_ = window;
}
private:
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
+ virtual void OnTouchEvent(ui::TouchEvent* event) override {
// Convert touch event back to root window coordinates.
event->ConvertLocationToTarget(window_, window_->GetRootWindow());
dispatcher_->ProcessedTouchEvent(event, window_, ui::ER_UNHANDLED);
diff --git a/ui/aura/window_targeter.cc b/ui/aura/window_targeter.cc
index d5c9393..afe079d 100644
--- a/ui/aura/window_targeter.cc
+++ b/ui/aura/window_targeter.cc
@@ -49,8 +49,9 @@
located_event->UpdateForRootTransform(
new_root->GetHost()->GetRootTransform());
}
- ui::EventDispatchDetails details ALLOW_UNUSED =
- new_root->GetHost()->event_processor()->OnEventFromSource(event);
+ ignore_result(
+ new_root->GetHost()->event_processor()->OnEventFromSource(event));
+
target = NULL;
}
return target;
diff --git a/ui/aura/window_targeter.h b/ui/aura/window_targeter.h
index e64ef75..5054c57 100644
--- a/ui/aura/window_targeter.h
+++ b/ui/aura/window_targeter.h
@@ -20,16 +20,16 @@
protected:
// ui::EventTargeter:
virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root,
- ui::Event* event) OVERRIDE;
+ ui::Event* event) override;
virtual ui::EventTarget* FindTargetForLocatedEvent(
ui::EventTarget* root,
- ui::LocatedEvent* event) OVERRIDE;
+ ui::LocatedEvent* event) override;
virtual bool SubtreeCanAcceptEvent(
ui::EventTarget* target,
- const ui::LocatedEvent& event) const OVERRIDE;
+ const ui::LocatedEvent& event) const override;
virtual bool EventLocationInsideBounds(
ui::EventTarget* target,
- const ui::LocatedEvent& event) const OVERRIDE;
+ const ui::LocatedEvent& event) const override;
private:
Window* FindTargetForKeyEvent(Window* root_window,
diff --git a/ui/aura/window_targeter_unittest.cc b/ui/aura/window_targeter_unittest.cc
index 86bd8d8..847f567 100644
--- a/ui/aura/window_targeter_unittest.cc
+++ b/ui/aura/window_targeter_unittest.cc
@@ -23,7 +23,7 @@
// ui::EventTargeter:
virtual ui::EventTarget* FindTargetForLocatedEvent(
ui::EventTarget* root,
- ui::LocatedEvent* event) OVERRIDE {
+ ui::LocatedEvent* event) override {
return window_;
}
diff --git a/ui/aura/window_tracker.h b/ui/aura/window_tracker.h
index 6d4545c..3a9650e 100644
--- a/ui/aura/window_tracker.h
+++ b/ui/aura/window_tracker.h
@@ -37,7 +37,7 @@
bool Contains(Window* window);
// WindowObserver overrides:
- virtual void OnWindowDestroying(Window* window) OVERRIDE;
+ virtual void OnWindowDestroying(Window* window) override;
private:
Windows windows_;
diff --git a/ui/aura/window_tree_host_mac.h b/ui/aura/window_tree_host_mac.h
index 8fbf4ec..da502b5 100644
--- a/ui/aura/window_tree_host_mac.h
+++ b/ui/aura/window_tree_host_mac.h
@@ -30,25 +30,25 @@
private:
// WindowTreeHost Overrides.
- virtual ui::EventSource* GetEventSource() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual void ToggleFullScreen() OVERRIDE;
- virtual gfx::Rect GetBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual void SetInsets(const gfx::Insets& insets) OVERRIDE;
- virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual bool ConfineCursorToRootWindow() OVERRIDE;
- virtual void UnConfineCursor() OVERRIDE;
- virtual void SetCursorNative(gfx::NativeCursor cursor_type) OVERRIDE;
- virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE;
- virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE;
- virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE;
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
+ virtual ui::EventSource* GetEventSource() override;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual void ToggleFullScreen() override;
+ virtual gfx::Rect GetBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Insets GetInsets() const override;
+ virtual void SetInsets(const gfx::Insets& insets) override;
+ virtual gfx::Point GetLocationOnNativeScreen() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual bool ConfineCursorToRootWindow() override;
+ virtual void UnConfineCursor() override;
+ virtual void SetCursorNative(gfx::NativeCursor cursor_type) override;
+ virtual void MoveCursorToNative(const gfx::Point& location) override;
+ virtual void OnCursorVisibilityChangedNative(bool show) override;
+ virtual void PostNativeEvent(const base::NativeEvent& event) override;
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
private:
base::scoped_nsobject<NSWindow> window_;
diff --git a/ui/aura/window_tree_host_ozone.h b/ui/aura/window_tree_host_ozone.h
index 88736f3..f0e8c98 100644
--- a/ui/aura/window_tree_host_ozone.h
+++ b/ui/aura/window_tree_host_ozone.h
@@ -26,34 +26,34 @@
private:
// ui::PlatformWindowDelegate:
- virtual void OnBoundsChanged(const gfx::Rect&) OVERRIDE;
- virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE;
- virtual void DispatchEvent(ui::Event* event) OVERRIDE;
- virtual void OnCloseRequest() OVERRIDE;
- virtual void OnClosed() OVERRIDE;
- virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) OVERRIDE;
- virtual void OnLostCapture() OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect&) override;
+ virtual void OnDamageRect(const gfx::Rect& damaged_region) override;
+ virtual void DispatchEvent(ui::Event* event) override;
+ virtual void OnCloseRequest() override;
+ virtual void OnClosed() override;
+ virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) override;
+ virtual void OnLostCapture() override;
virtual void OnAcceleratedWidgetAvailable(
- gfx::AcceleratedWidget widget) OVERRIDE;
- virtual void OnActivationChanged(bool active) OVERRIDE;
+ gfx::AcceleratedWidget widget) override;
+ virtual void OnActivationChanged(bool active) override;
// WindowTreeHost:
- virtual ui::EventSource* GetEventSource() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual gfx::Rect GetBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE;
- virtual void SetCursorNative(gfx::NativeCursor cursor_type) OVERRIDE;
- virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE;
- virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE;
+ virtual ui::EventSource* GetEventSource() override;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual gfx::Rect GetBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Point GetLocationOnNativeScreen() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void PostNativeEvent(const base::NativeEvent& event) override;
+ virtual void SetCursorNative(gfx::NativeCursor cursor_type) override;
+ virtual void MoveCursorToNative(const gfx::Point& location) override;
+ virtual void OnCursorVisibilityChangedNative(bool show) override;
// ui::EventSource overrides.
- virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
+ virtual ui::EventProcessor* GetEventProcessor() override;
// Platform-specific part of this WindowTreeHost.
scoped_ptr<ui::PlatformWindow> platform_window_;
diff --git a/ui/aura/window_tree_host_win.h b/ui/aura/window_tree_host_win.h
index f2c5e85..bfbdc07 100644
--- a/ui/aura/window_tree_host_win.h
+++ b/ui/aura/window_tree_host_win.h
@@ -24,38 +24,38 @@
virtual ~WindowTreeHostWin();
// WindowTreeHost:
- virtual ui::EventSource* GetEventSource() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual gfx::Rect GetBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE;
- virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE;
- virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE;
- virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
+ virtual ui::EventSource* GetEventSource() override;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual gfx::Rect GetBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Point GetLocationOnNativeScreen() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void SetCursorNative(gfx::NativeCursor cursor) override;
+ virtual void MoveCursorToNative(const gfx::Point& location) override;
+ virtual void OnCursorVisibilityChangedNative(bool show) override;
+ virtual void PostNativeEvent(const base::NativeEvent& native_event) override;
// ui::EventSource:
- virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
+ virtual ui::EventProcessor* GetEventProcessor() override;
protected:
gfx::AcceleratedWidget hwnd() const { return widget_; }
private:
// ui::PlatformWindowDelegate:
- virtual void OnBoundsChanged(const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE;
- virtual void DispatchEvent(ui::Event* event) OVERRIDE;
- virtual void OnCloseRequest() OVERRIDE;
- virtual void OnClosed() OVERRIDE;
- virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) OVERRIDE;
- virtual void OnLostCapture() OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& new_bounds) override;
+ virtual void OnDamageRect(const gfx::Rect& damaged_region) override;
+ virtual void DispatchEvent(ui::Event* event) override;
+ virtual void OnCloseRequest() override;
+ virtual void OnClosed() override;
+ virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) override;
+ virtual void OnLostCapture() override;
virtual void OnAcceleratedWidgetAvailable(
- gfx::AcceleratedWidget widget) OVERRIDE;
- virtual void OnActivationChanged(bool active) OVERRIDE;
+ gfx::AcceleratedWidget widget) override;
+ virtual void OnActivationChanged(bool active) override;
bool has_capture_;
gfx::Rect bounds_;
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index 35ebb1e..06c3a3f 100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -202,7 +202,7 @@
private:
// ui::PlatformEventObserver:
- virtual void WillProcessEvent(const ui::PlatformEvent& event) OVERRIDE {
+ virtual void WillProcessEvent(const ui::PlatformEvent& event) override {
#if defined(USE_XI2_MT)
if (event->type == GenericEvent &&
(event->xgeneric.evtype == XI_TouchBegin ||
@@ -216,7 +216,7 @@
#endif // defined(USE_XI2_MT)
}
- virtual void DidProcessEvent(const ui::PlatformEvent& event) OVERRIDE {}
+ virtual void DidProcessEvent(const ui::PlatformEvent& event) override {}
// The difference in screen's native resolution pixels between
// the border of the touchscreen and the border of the screen,
diff --git a/ui/aura/window_tree_host_x11.h b/ui/aura/window_tree_host_x11.h
index c5a0351..1c05bf0 100644
--- a/ui/aura/window_tree_host_x11.h
+++ b/ui/aura/window_tree_host_x11.h
@@ -38,26 +38,26 @@
virtual ~WindowTreeHostX11();
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
// WindowTreeHost:
- virtual ui::EventSource* GetEventSource() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual gfx::Rect GetBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE;
- virtual void SetCursorNative(gfx::NativeCursor cursor_type) OVERRIDE;
- virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE;
- virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE;
+ virtual ui::EventSource* GetEventSource() override;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual gfx::Rect GetBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Point GetLocationOnNativeScreen() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void PostNativeEvent(const base::NativeEvent& event) override;
+ virtual void SetCursorNative(gfx::NativeCursor cursor_type) override;
+ virtual void MoveCursorToNative(const gfx::Point& location) override;
+ virtual void OnCursorVisibilityChangedNative(bool show) override;
// ui::EventSource overrides.
- virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
+ virtual ui::EventProcessor* GetEventProcessor() override;
protected:
// Called when X Configure Notify event is recevied.
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index bdc0c7e..937212e 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -55,7 +55,7 @@
WindowTest() : max_separation_(0) {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AuraTestBase::SetUp();
// TODO: there needs to be an easier way to do this.
max_separation_ = ui::GestureConfiguration::
@@ -64,14 +64,14 @@
set_max_separation_for_gesture_touches_in_pixels(0);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
AuraTestBase::TearDown();
ui::GestureConfiguration::
set_max_separation_for_gesture_touches_in_pixels(max_separation_);
}
private:
- int max_separation_;
+ float max_separation_;
DISALLOW_COPY_AND_ASSIGN(WindowTest);
};
@@ -94,13 +94,13 @@
bool in_destroying() const { return in_destroying_; }
- virtual void OnWindowDestroying(Window* window) OVERRIDE {
+ virtual void OnWindowDestroying(Window* window) override {
EXPECT_FALSE(in_destroying_);
in_destroying_ = true;
destroying_count_++;
}
- virtual void OnWindowDestroyed(Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(Window* window) override {
EXPECT_TRUE(in_destroying_);
in_destroying_ = false;
destroyed_count_++;
@@ -123,7 +123,7 @@
: parent_delegate_(parent_delegate) {
}
- virtual void OnWindowDestroying(Window* window) OVERRIDE {
+ virtual void OnWindowDestroying(Window* window) override {
EXPECT_TRUE(parent_delegate_->in_destroying());
DestroyTrackingDelegateImpl::OnWindowDestroying(window);
}
@@ -143,7 +143,7 @@
void set_window(Window* window) { window_ = window; }
- virtual void OnWindowDestroyed(Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(Window* window) override {
EXPECT_FALSE(window_->parent());
}
@@ -175,18 +175,18 @@
int touch_event_count() const { return touch_event_count_; }
int gesture_event_count() const { return gesture_event_count_; }
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED)
capture_changed_event_count_++;
mouse_event_count_++;
}
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
+ virtual void OnTouchEvent(ui::TouchEvent* event) override {
touch_event_count_++;
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
gesture_event_count_++;
}
- virtual void OnCaptureLost() OVERRIDE {
+ virtual void OnCaptureLost() override {
capture_lost_count_++;
}
@@ -205,7 +205,7 @@
public:
GestureTrackPositionDelegate() {}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
position_ = event->location();
event->StopPropagation();
}
@@ -228,7 +228,7 @@
virtual bool ShouldDescendIntoChildForEventHandling(
Window* child,
- const gfx::Point& location) OVERRIDE {
+ const gfx::Point& location) override {
return false;
}
@@ -245,7 +245,7 @@
virtual ~DestroyWindowDelegate() {}
// Overridden from WindowDelegate.
- virtual void OnWindowDestroyed(Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(Window* window) override {
delete this;
}
@@ -576,7 +576,7 @@
public:
AddedToRootWindowObserver() : called_(false) {}
- virtual void OnWindowAddedToRootWindow(Window* window) OVERRIDE {
+ virtual void OnWindowAddedToRootWindow(Window* window) override {
called_ = true;
}
@@ -1087,7 +1087,7 @@
public:
MouseEnterExitWindowDelegate() : entered_(false), exited_(false) {}
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
switch (event->type()) {
case ui::ET_MOUSE_ENTERED:
EXPECT_TRUE(event->flags() & ui::EF_IS_SYNTHESIZED);
@@ -1372,7 +1372,7 @@
hidden_ = 0;
}
- virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {
+ virtual void OnWindowTargetVisibilityChanged(bool visible) override {
if (visible)
shown_++;
else
@@ -1721,16 +1721,16 @@
}
private:
- virtual void OnWindowAdded(Window* new_window) OVERRIDE {
+ virtual void OnWindowAdded(Window* new_window) override {
added_count_++;
}
- virtual void OnWillRemoveWindow(Window* window) OVERRIDE {
+ virtual void OnWillRemoveWindow(Window* window) override {
removed_count_++;
}
virtual void OnWindowVisibilityChanged(Window* window,
- bool visible) OVERRIDE {
+ bool visible) override {
if (!visibility_info_) {
visibility_info_.reset(new VisibilityInfo);
visibility_info_->changed_count = 0;
@@ -1740,20 +1740,20 @@
visibility_info_->changed_count++;
}
- virtual void OnWindowDestroyed(Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(Window* window) override {
EXPECT_FALSE(window->parent());
destroyed_count_++;
}
virtual void OnWindowPropertyChanged(Window* window,
const void* key,
- intptr_t old) OVERRIDE {
+ intptr_t old) override {
property_key_ = key;
old_property_value_ = old;
}
virtual void OnAncestorWindowTransformed(Window* source,
- Window* window) OVERRIDE {
+ Window* window) override {
transform_notifications_.push_back(
std::make_pair(source->id(), window->id()));
}
@@ -2043,7 +2043,7 @@
// Overridden from client::VisibilityClient:
virtual void UpdateLayerVisibility(aura::Window* window,
- bool visible) OVERRIDE {
+ bool visible) override {
if (!ignore_visibility_changes_)
window->layer()->SetVisible(visible);
}
@@ -2179,11 +2179,11 @@
}
// Overridden from WindowObserver:
- virtual void OnWindowAddedToRootWindow(Window* window) OVERRIDE {
+ virtual void OnWindowAddedToRootWindow(Window* window) override {
++added_count_;
}
virtual void OnWindowRemovingFromRootWindow(Window* window,
- Window* new_root) OVERRIDE {
+ Window* new_root) override {
++removed_count_;
}
@@ -2265,7 +2265,7 @@
virtual void OnWindowBoundsChanged(Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
root_set_ = window->GetRootWindow() != NULL;
}
@@ -2344,7 +2344,7 @@
owned_window_.reset(window);
}
- virtual void OnWindowDestroyed(Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(Window* window) override {
owned_window_.reset(NULL);
}
@@ -2390,7 +2390,7 @@
// Window
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
bounds_changed_ = true;
}
@@ -2498,11 +2498,11 @@
}
// WindowObserver overrides:
- virtual void OnWindowAddedToRootWindow(Window* window) OVERRIDE {
+ virtual void OnWindowAddedToRootWindow(Window* window) override {
added_count_++;
}
virtual void OnWindowRemovingFromRootWindow(Window* window,
- Window* new_root) OVERRIDE {
+ Window* new_root) override {
removed_count_++;
}
@@ -2564,11 +2564,11 @@
private:
// Overridden from WindowObserver:
virtual void OnWindowHierarchyChanging(
- const HierarchyChangeParams& params) OVERRIDE {
+ const HierarchyChangeParams& params) override {
params_.push_back(params);
}
virtual void OnWindowHierarchyChanged(
- const HierarchyChangeParams& params) OVERRIDE {
+ const HierarchyChangeParams& params) override {
params_.push_back(params);
}
@@ -2949,7 +2949,7 @@
int paint_count() const { return paint_count_; }
// TestWindowDelegate::
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
paint_count_++;
canvas->GetClipBounds(&most_recent_paint_clip_bounds_);
const SkMatrix& matrix = canvas->sk_canvas()->getTotalMatrix();
@@ -3425,17 +3425,17 @@
private:
// ui::LayerAnimationObserver:
virtual void OnLayerAnimationEnded(
- ui::LayerAnimationSequence* sequence) OVERRIDE {
+ ui::LayerAnimationSequence* sequence) override {
animation_completed_ = true;
}
virtual void OnLayerAnimationAborted(
- ui::LayerAnimationSequence* sequence) OVERRIDE {
+ ui::LayerAnimationSequence* sequence) override {
animation_aborted_ = true;
}
virtual void OnLayerAnimationScheduled(
- ui::LayerAnimationSequence* sequence) OVERRIDE {
+ ui::LayerAnimationSequence* sequence) override {
}
bool animation_completed_;
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index d32a9ec..3a3cd76 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -892,10 +892,10 @@
"x/selection_requestor_unittest.cc",
]
deps += [
+ "//chromeos",
"//ui/aura:test_support",
"//ui/events:gesture_detection",
"//ui/chromeos:ui_chromeos",
- #'../../chromeos/chromeos.gyp:chromeos', TODO(GYP)
]
}
}
diff --git a/ui/base/accelerators/accelerator_manager_unittest.cc b/ui/base/accelerators/accelerator_manager_unittest.cc
index b8672ec..979ff4a 100644
--- a/ui/base/accelerators/accelerator_manager_unittest.cc
+++ b/ui/base/accelerators/accelerator_manager_unittest.cc
@@ -28,8 +28,8 @@
}
// Overridden from AcceleratorTarget:
- virtual bool AcceleratorPressed(const Accelerator& accelerator) OVERRIDE;
- virtual bool CanHandleAccelerators() const OVERRIDE;
+ virtual bool AcceleratorPressed(const Accelerator& accelerator) override;
+ virtual bool CanHandleAccelerators() const override;
private:
int accelerator_pressed_count_;
diff --git a/ui/base/accelerators/platform_accelerator_cocoa.h b/ui/base/accelerators/platform_accelerator_cocoa.h
index 3f72cac..f14bc4d 100644
--- a/ui/base/accelerators/platform_accelerator_cocoa.h
+++ b/ui/base/accelerators/platform_accelerator_cocoa.h
@@ -20,8 +20,8 @@
virtual ~PlatformAcceleratorCocoa();
// PlatformAccelerator:
- virtual scoped_ptr<PlatformAccelerator> CreateCopy() const OVERRIDE;
- virtual bool Equals(const PlatformAccelerator& rhs) const OVERRIDE;
+ virtual scoped_ptr<PlatformAccelerator> CreateCopy() const override;
+ virtual bool Equals(const PlatformAccelerator& rhs) const override;
// The keyEquivalent of the NSMenuItem associated with the accelerator.
NSString* characters() const { return characters_.get(); }
diff --git a/ui/base/clipboard/clipboard_aurax11.cc b/ui/base/clipboard/clipboard_aurax11.cc
index e40af36..82542e0 100644
--- a/ui/base/clipboard/clipboard_aurax11.cc
+++ b/ui/base/clipboard/clipboard_aurax11.cc
@@ -77,8 +77,8 @@
virtual ~SelectionChangeObserver();
// ui::PlatformEventObserver:
- virtual void WillProcessEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual void DidProcessEvent(const ui::PlatformEvent& event) OVERRIDE {}
+ virtual void WillProcessEvent(const ui::PlatformEvent& event) override;
+ virtual void DidProcessEvent(const ui::PlatformEvent& event) override {}
int event_base_;
Atom clipboard_atom_;
@@ -290,8 +290,8 @@
private:
// PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override;
// Our X11 state.
Display* x_display_;
diff --git a/ui/base/clipboard/custom_data_helper.cc b/ui/base/clipboard/custom_data_helper.cc
index a6ac8d2..323a92e 100644
--- a/ui/base/clipboard/custom_data_helper.cc
+++ b/ui/base/clipboard/custom_data_helper.cc
@@ -43,16 +43,16 @@
SkippablePickle pickle(data, data_length);
PickleIterator iter(pickle);
- uint64 size = 0;
- if (!pickle.ReadUInt64(&iter, &size))
+ size_t size = 0;
+ if (!pickle.ReadSizeT(&iter, &size))
return;
// Keep track of the original elements in the types vector. On failure, we
// truncate the vector to the original size since we want to ignore corrupt
// custom data pickles.
- uint64 original_size = types->size();
+ size_t original_size = types->size();
- for (uint64 i = 0; i < size; ++i) {
+ for (size_t i = 0; i < size; ++i) {
types->push_back(base::string16());
if (!pickle.ReadString16(&iter, &types->back()) ||
!pickle.SkipString16(&iter)) {
@@ -69,11 +69,11 @@
SkippablePickle pickle(data, data_length);
PickleIterator iter(pickle);
- uint64 size = 0;
- if (!pickle.ReadUInt64(&iter, &size))
+ size_t size = 0;
+ if (!pickle.ReadSizeT(&iter, &size))
return;
- for (uint64 i = 0; i < size; ++i) {
+ for (size_t i = 0; i < size; ++i) {
base::string16 deserialized_type;
if (!pickle.ReadString16(&iter, &deserialized_type))
return;
@@ -92,11 +92,11 @@
Pickle pickle(reinterpret_cast<const char*>(data), data_length);
PickleIterator iter(pickle);
- uint64 size = 0;
- if (!pickle.ReadUInt64(&iter, &size))
+ size_t size = 0;
+ if (!pickle.ReadSizeT(&iter, &size))
return;
- for (uint64 i = 0; i < size; ++i) {
+ for (size_t i = 0; i < size; ++i) {
base::string16 type;
if (!pickle.ReadString16(&iter, &type)) {
// Data is corrupt, return an empty map.
@@ -116,7 +116,7 @@
void WriteCustomDataToPickle(
const std::map<base::string16, base::string16>& data,
Pickle* pickle) {
- pickle->WriteUInt64(data.size());
+ pickle->WriteSizeT(data.size());
for (std::map<base::string16, base::string16>::const_iterator it =
data.begin();
it != data.end();
diff --git a/ui/base/clipboard/custom_data_helper_unittest.cc b/ui/base/clipboard/custom_data_helper_unittest.cc
index bc79d90..a765852 100644
--- a/ui/base/clipboard/custom_data_helper_unittest.cc
+++ b/ui/base/clipboard/custom_data_helper_unittest.cc
@@ -120,7 +120,7 @@
expected.push_back(ASCIIToUTF16("f"));
Pickle malformed;
- malformed.WriteUInt64(1000);
+ malformed.WriteSizeT(1000);
malformed.WriteString16(ASCIIToUTF16("hello"));
malformed.WriteString16(ASCIIToUTF16("world"));
std::vector<base::string16> actual(expected);
@@ -128,7 +128,7 @@
EXPECT_EQ(expected, actual);
Pickle malformed2;
- malformed2.WriteUInt64(1);
+ malformed2.WriteSizeT(1);
malformed2.WriteString16(ASCIIToUTF16("hello"));
std::vector<base::string16> actual2(expected);
ReadCustomDataTypes(malformed2.data(), malformed2.size(), &actual2);
@@ -140,7 +140,7 @@
std::map<base::string16, base::string16> result_map;
Pickle malformed;
- malformed.WriteUInt64(1000);
+ malformed.WriteSizeT(1000);
malformed.WriteString16(ASCIIToUTF16("hello"));
malformed.WriteString16(ASCIIToUTF16("world"));
@@ -153,7 +153,7 @@
EXPECT_EQ(0u, result_map.size());
Pickle malformed2;
- malformed2.WriteUInt64(1);
+ malformed2.WriteSizeT(1);
malformed2.WriteString16(ASCIIToUTF16("hello"));
ReadCustomDataForType(malformed2.data(),
diff --git a/ui/base/cocoa/controls/blue_label_button_unittest.mm b/ui/base/cocoa/controls/blue_label_button_unittest.mm
index 1e2a8f8..2166d30 100644
--- a/ui/base/cocoa/controls/blue_label_button_unittest.mm
+++ b/ui/base/cocoa/controls/blue_label_button_unittest.mm
@@ -16,7 +16,7 @@
BlueLabelButtonTest() {}
// ui::CocoaTest override:
- virtual void SetUp() OVERRIDE;
+ virtual void SetUp() override;
protected:
base::scoped_nsobject<BlueLabelButton> blue_label_button_;
diff --git a/ui/base/cocoa/controls/hover_image_menu_button_unittest.mm b/ui/base/cocoa/controls/hover_image_menu_button_unittest.mm
index ad5b2da..ffe46be 100644
--- a/ui/base/cocoa/controls/hover_image_menu_button_unittest.mm
+++ b/ui/base/cocoa/controls/hover_image_menu_button_unittest.mm
@@ -20,7 +20,7 @@
HoverImageMenuButtonTest() {}
// CocoaTest override:
- virtual void SetUp() OVERRIDE;
+ virtual void SetUp() override;
protected:
base::scoped_nsobject<HoverImageMenuButton> menu_button_;
diff --git a/ui/base/cocoa/fullscreen_window_manager.mm b/ui/base/cocoa/fullscreen_window_manager.mm
index 8482168..15a5948 100644
--- a/ui/base/cocoa/fullscreen_window_manager.mm
+++ b/ui/base/cocoa/fullscreen_window_manager.mm
@@ -85,15 +85,18 @@
}
- (void)update {
+ // From OS X 10.10, NSApplicationDidChangeScreenParametersNotification is sent
+ // when displaying a fullscreen window, which should normally only be sent if
+ // the monitor resolution has changed or new display is detected.
if (![[NSScreen screens] containsObject:desiredScreen_])
desiredScreen_.reset([[window_ screen] retain]);
base::mac::FullScreenMode newMode;
if (!fullscreenActive_)
newMode = base::mac::kFullScreenModeNormal;
- else if (desiredScreen_ == GetMenuBarScreen())
+ else if ([desiredScreen_ isEqual:GetMenuBarScreen()])
newMode = base::mac::kFullScreenModeHideAll;
- else if (desiredScreen_ == GetDockScreen())
+ else if ([desiredScreen_ isEqual:GetDockScreen()])
newMode = base::mac::kFullScreenModeHideDock;
else
newMode = base::mac::kFullScreenModeNormal;
diff --git a/ui/base/cocoa/menu_controller_unittest.mm b/ui/base/cocoa/menu_controller_unittest.mm
index 56e610e..161bf28 100644
--- a/ui/base/cocoa/menu_controller_unittest.mm
+++ b/ui/base/cocoa/menu_controller_unittest.mm
@@ -39,21 +39,21 @@
did_close_(false) {
}
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE {
+ virtual bool IsCommandIdChecked(int command_id) const override {
return false;
}
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE {
+ virtual bool IsCommandIdEnabled(int command_id) const override {
++enable_count_;
return true;
}
virtual bool GetAcceleratorForCommandId(
int command_id,
- Accelerator* accelerator) OVERRIDE { return false; }
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE {
+ Accelerator* accelerator) override { return false; }
+ virtual void ExecuteCommand(int command_id, int event_flags) override {
++execute_count_;
}
- virtual void MenuWillShow(SimpleMenuModel* /*source*/) OVERRIDE {
+ virtual void MenuWillShow(SimpleMenuModel* /*source*/) override {
EXPECT_FALSE(did_show_);
EXPECT_FALSE(did_close_);
did_show_ = true;
@@ -66,7 +66,7 @@
inModes:modes];
}
- virtual void MenuClosed(SimpleMenuModel* /*source*/) OVERRIDE {
+ virtual void MenuClosed(SimpleMenuModel* /*source*/) override {
EXPECT_TRUE(did_show_);
EXPECT_FALSE(did_close_);
did_close_ = true;
@@ -86,15 +86,15 @@
class DynamicDelegate : public Delegate {
public:
DynamicDelegate() {}
- virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE {
+ virtual bool IsItemForCommandIdDynamic(int command_id) const override {
return true;
}
- virtual base::string16 GetLabelForCommandId(int command_id) const OVERRIDE {
+ virtual base::string16 GetLabelForCommandId(int command_id) const override {
return label_;
}
virtual bool GetIconForCommandId(
int command_id,
- gfx::Image* icon) const OVERRIDE {
+ gfx::Image* icon) const override {
if (icon_.IsEmpty()) {
return false;
} else {
@@ -121,7 +121,7 @@
index_(index) {
}
virtual ~FontListMenuModel() {}
- virtual const gfx::FontList* GetLabelFontListAt(int index) const OVERRIDE {
+ virtual const gfx::FontList* GetLabelFontListAt(int index) const override {
return (index == index_) ? font_list_ : NULL;
}
diff --git a/ui/base/cocoa/remote_layer_api.mm b/ui/base/cocoa/remote_layer_api.mm
index 0fb1fdf..839daa1 100644
--- a/ui/base/cocoa/remote_layer_api.mm
+++ b/ui/base/cocoa/remote_layer_api.mm
@@ -5,6 +5,7 @@
#include "ui/base/cocoa/remote_layer_api.h"
#include "base/command_line.h"
+#include "base/mac/mac_util.h"
#include "ui/base/ui_base_switches.h"
#include <objc/runtime.h>
@@ -12,10 +13,14 @@
namespace ui {
bool RemoteLayerAPISupported() {
- bool enabled_at_command_line =
+ // This API only works on Mac OS 10.9 and later.
+ if (!base::mac::IsOSMavericksOrLater())
+ return false;
+
+ bool disabled_at_command_line =
CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableRemoteCoreAnimation);
- if (!enabled_at_command_line)
+ switches::kDisableRemoteCoreAnimation);
+ if (disabled_at_command_line)
return false;
// Verify the GPU process interfaces are present.
diff --git a/ui/base/cursor/cursor_loader_ozone.h b/ui/base/cursor/cursor_loader_ozone.h
index 402cdc2..7aef431 100644
--- a/ui/base/cursor/cursor_loader_ozone.h
+++ b/ui/base/cursor/cursor_loader_ozone.h
@@ -20,13 +20,13 @@
// CursorLoader overrides:
virtual void LoadImageCursor(int id,
int resource_id,
- const gfx::Point& hot) OVERRIDE;
+ const gfx::Point& hot) override;
virtual void LoadAnimatedCursor(int id,
int resource_id,
const gfx::Point& hot,
- int frame_delay_ms) OVERRIDE;
- virtual void UnloadAll() OVERRIDE;
- virtual void SetPlatformCursor(gfx::NativeCursor* cursor) OVERRIDE;
+ int frame_delay_ms) override;
+ virtual void UnloadAll() override;
+ virtual void SetPlatformCursor(gfx::NativeCursor* cursor) override;
private:
// Pointers are owned by ResourceBundle and must not be freed here.
diff --git a/ui/base/cursor/cursor_loader_win.h b/ui/base/cursor/cursor_loader_win.h
index adcc0ae..c886af0 100644
--- a/ui/base/cursor/cursor_loader_win.h
+++ b/ui/base/cursor/cursor_loader_win.h
@@ -18,13 +18,13 @@
// Overridden from CursorLoader:
virtual void LoadImageCursor(int id,
int resource_id,
- const gfx::Point& hot) OVERRIDE;
+ const gfx::Point& hot) override;
virtual void LoadAnimatedCursor(int id,
int resource_id,
const gfx::Point& hot,
- int frame_delay_ms) OVERRIDE;
- virtual void UnloadAll() OVERRIDE;
- virtual void SetPlatformCursor(gfx::NativeCursor* cursor) OVERRIDE;
+ int frame_delay_ms) override;
+ virtual void UnloadAll() override;
+ virtual void SetPlatformCursor(gfx::NativeCursor* cursor) override;
// Used to pass the cursor resource module name to the cursor loader. This is
// typically used to load non system cursors.
diff --git a/ui/base/cursor/cursor_loader_x11.h b/ui/base/cursor/cursor_loader_x11.h
index 331529b..2667221 100644
--- a/ui/base/cursor/cursor_loader_x11.h
+++ b/ui/base/cursor/cursor_loader_x11.h
@@ -25,13 +25,13 @@
// Overridden from CursorLoader:
virtual void LoadImageCursor(int id,
int resource_id,
- const gfx::Point& hot) OVERRIDE;
+ const gfx::Point& hot) override;
virtual void LoadAnimatedCursor(int id,
int resource_id,
const gfx::Point& hot,
- int frame_delay_ms) OVERRIDE;
- virtual void UnloadAll() OVERRIDE;
- virtual void SetPlatformCursor(gfx::NativeCursor* cursor) OVERRIDE;
+ int frame_delay_ms) override;
+ virtual void UnloadAll() override;
+ virtual void SetPlatformCursor(gfx::NativeCursor* cursor) override;
const XcursorImage* GetXcursorImageForTest(int id);
diff --git a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h
index dc51602..037fd08 100644
--- a/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h
+++ b/ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h
@@ -60,15 +60,15 @@
PlatformCursor platform_cursor);
// CursorFactoryOzone:
- virtual PlatformCursor GetDefaultCursor(int type) OVERRIDE;
+ virtual PlatformCursor GetDefaultCursor(int type) override;
virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap,
- const gfx::Point& hotspot) OVERRIDE;
+ const gfx::Point& hotspot) override;
virtual PlatformCursor CreateAnimatedCursor(
const std::vector<SkBitmap>& bitmaps,
const gfx::Point& hotspot,
- int frame_delay_ms) OVERRIDE;
- virtual void RefImageCursor(PlatformCursor cursor) OVERRIDE;
- virtual void UnrefImageCursor(PlatformCursor cursor) OVERRIDE;
+ int frame_delay_ms) override;
+ virtual void RefImageCursor(PlatformCursor cursor) override;
+ virtual void UnrefImageCursor(PlatformCursor cursor) override;
private:
// Get cached BitmapCursorOzone for a default cursor.
diff --git a/ui/base/default_theme_provider.h b/ui/base/default_theme_provider.h
index 8bf2a01..0fe64d1 100644
--- a/ui/base/default_theme_provider.h
+++ b/ui/base/default_theme_provider.h
@@ -24,22 +24,22 @@
virtual ~DefaultThemeProvider();
// Overridden from ui::ThemeProvider:
- virtual bool UsingSystemTheme() const OVERRIDE;
- virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE;
- virtual SkColor GetColor(int id) const OVERRIDE;
- virtual int GetDisplayProperty(int id) const OVERRIDE;
- virtual bool ShouldUseNativeFrame() const OVERRIDE;
- virtual bool HasCustomImage(int id) const OVERRIDE;
+ virtual bool UsingSystemTheme() const override;
+ virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const override;
+ virtual SkColor GetColor(int id) const override;
+ virtual int GetDisplayProperty(int id) const override;
+ virtual bool ShouldUseNativeFrame() const override;
+ virtual bool HasCustomImage(int id) const override;
virtual base::RefCountedMemory* GetRawData(
int id,
- ui::ScaleFactor scale_factor) const OVERRIDE;
+ ui::ScaleFactor scale_factor) const override;
#if defined(OS_MACOSX)
- virtual NSImage* GetNSImageNamed(int id) const OVERRIDE;
- virtual NSColor* GetNSImageColorNamed(int id) const OVERRIDE;
- virtual NSColor* GetNSColor(int id) const OVERRIDE;
- virtual NSColor* GetNSColorTint(int id) const OVERRIDE;
- virtual NSGradient* GetNSGradient(int id) const OVERRIDE;
+ virtual NSImage* GetNSImageNamed(int id) const override;
+ virtual NSColor* GetNSImageColorNamed(int id) const override;
+ virtual NSColor* GetNSColor(int id) const override;
+ virtual NSColor* GetNSColorTint(int id) const override;
+ virtual NSGradient* GetNSGradient(int id) const override;
#endif
private:
diff --git a/ui/base/dragdrop/drag_utils.cc b/ui/base/dragdrop/drag_utils.cc
index 53f3e99..363dad4 100644
--- a/ui/base/dragdrop/drag_utils.cc
+++ b/ui/base/dragdrop/drag_utils.cc
@@ -40,7 +40,7 @@
}
// Overridden from gfx::CanvasImageSource.
- virtual void Draw(gfx::Canvas* canvas) OVERRIDE {
+ virtual void Draw(gfx::Canvas* canvas) override {
if (!icon_.isNull()) {
// Paint the icon.
canvas->DrawImageInt(icon_, (size().width() - icon_.width()) / 2, 0);
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.h b/ui/base/dragdrop/os_exchange_data_provider_aura.h
index e54a2fd..88218a2 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aura.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_aura.h
@@ -26,38 +26,38 @@
virtual ~OSExchangeDataProviderAura();
// Overridden from OSExchangeData::Provider:
- virtual Provider* Clone() const OVERRIDE;
- virtual void MarkOriginatedFromRenderer() OVERRIDE;
- virtual bool DidOriginateFromRenderer() const OVERRIDE;
- virtual void SetString(const base::string16& data) OVERRIDE;
- virtual void SetURL(const GURL& url, const base::string16& title) OVERRIDE;
- virtual void SetFilename(const base::FilePath& path) OVERRIDE;
- virtual void SetFilenames(const std::vector<FileInfo>& filenames) OVERRIDE;
+ virtual Provider* Clone() const override;
+ virtual void MarkOriginatedFromRenderer() override;
+ virtual bool DidOriginateFromRenderer() const override;
+ virtual void SetString(const base::string16& data) override;
+ virtual void SetURL(const GURL& url, const base::string16& title) override;
+ virtual void SetFilename(const base::FilePath& path) override;
+ virtual void SetFilenames(const std::vector<FileInfo>& filenames) override;
virtual void SetPickledData(const OSExchangeData::CustomFormat& format,
- const Pickle& data) OVERRIDE;
- virtual bool GetString(base::string16* data) const OVERRIDE;
+ const Pickle& data) override;
+ virtual bool GetString(base::string16* data) const override;
virtual bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy,
GURL* url,
- base::string16* title) const OVERRIDE;
- virtual bool GetFilename(base::FilePath* path) const OVERRIDE;
- virtual bool GetFilenames(std::vector<FileInfo>* filenames) const OVERRIDE;
+ base::string16* title) const override;
+ virtual bool GetFilename(base::FilePath* path) const override;
+ virtual bool GetFilenames(std::vector<FileInfo>* filenames) const override;
virtual bool GetPickledData(const OSExchangeData::CustomFormat& format,
- Pickle* data) const OVERRIDE;
- virtual bool HasString() const OVERRIDE;
+ Pickle* data) const override;
+ virtual bool HasString() const override;
virtual bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const
- OVERRIDE;
- virtual bool HasFile() const OVERRIDE;
+ override;
+ virtual bool HasFile() const override;
virtual bool HasCustomFormat(const OSExchangeData::CustomFormat& format) const
- OVERRIDE;
+ override;
virtual void SetHtml(const base::string16& html,
- const GURL& base_url) OVERRIDE;
- virtual bool GetHtml(base::string16* html, GURL* base_url) const OVERRIDE;
- virtual bool HasHtml() const OVERRIDE;
+ const GURL& base_url) override;
+ virtual bool GetHtml(base::string16* html, GURL* base_url) const override;
+ virtual bool HasHtml() const override;
virtual void SetDragImage(const gfx::ImageSkia& image,
- const gfx::Vector2d& cursor_offset) OVERRIDE;
- virtual const gfx::ImageSkia& GetDragImage() const OVERRIDE;
- virtual const gfx::Vector2d& GetDragImageOffset() const OVERRIDE;
+ const gfx::Vector2d& cursor_offset) override;
+ virtual const gfx::ImageSkia& GetDragImage() const override;
+ virtual const gfx::Vector2d& GetDragImageOffset() const override;
private:
typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData;
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.h b/ui/base/dragdrop/os_exchange_data_provider_aurax11.h
index 702cc7e..9664b02 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.h
@@ -61,45 +61,45 @@
}
// Overridden from OSExchangeData::Provider:
- virtual Provider* Clone() const OVERRIDE;
- virtual void MarkOriginatedFromRenderer() OVERRIDE;
- virtual bool DidOriginateFromRenderer() const OVERRIDE;
- virtual void SetString(const base::string16& data) OVERRIDE;
- virtual void SetURL(const GURL& url, const base::string16& title) OVERRIDE;
- virtual void SetFilename(const base::FilePath& path) OVERRIDE;
- virtual void SetFilenames(const std::vector<FileInfo>& filenames) OVERRIDE;
+ virtual Provider* Clone() const override;
+ virtual void MarkOriginatedFromRenderer() override;
+ virtual bool DidOriginateFromRenderer() const override;
+ virtual void SetString(const base::string16& data) override;
+ virtual void SetURL(const GURL& url, const base::string16& title) override;
+ virtual void SetFilename(const base::FilePath& path) override;
+ virtual void SetFilenames(const std::vector<FileInfo>& filenames) override;
virtual void SetPickledData(const OSExchangeData::CustomFormat& format,
- const Pickle& pickle) OVERRIDE;
- virtual bool GetString(base::string16* data) const OVERRIDE;
+ const Pickle& pickle) override;
+ virtual bool GetString(base::string16* data) const override;
virtual bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy,
GURL* url,
- base::string16* title) const OVERRIDE;
- virtual bool GetFilename(base::FilePath* path) const OVERRIDE;
- virtual bool GetFilenames(std::vector<FileInfo>* filenames) const OVERRIDE;
+ base::string16* title) const override;
+ virtual bool GetFilename(base::FilePath* path) const override;
+ virtual bool GetFilenames(std::vector<FileInfo>* filenames) const override;
virtual bool GetPickledData(const OSExchangeData::CustomFormat& format,
- Pickle* pickle) const OVERRIDE;
- virtual bool HasString() const OVERRIDE;
+ Pickle* pickle) const override;
+ virtual bool HasString() const override;
virtual bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const
- OVERRIDE;
- virtual bool HasFile() const OVERRIDE;
+ override;
+ virtual bool HasFile() const override;
virtual bool HasCustomFormat(const OSExchangeData::CustomFormat& format) const
- OVERRIDE;
+ override;
virtual void SetFileContents(const base::FilePath& filename,
- const std::string& file_contents) OVERRIDE;
+ const std::string& file_contents) override;
virtual void SetHtml(const base::string16& html,
- const GURL& base_url) OVERRIDE;
- virtual bool GetHtml(base::string16* html, GURL* base_url) const OVERRIDE;
- virtual bool HasHtml() const OVERRIDE;
+ const GURL& base_url) override;
+ virtual bool GetHtml(base::string16* html, GURL* base_url) const override;
+ virtual bool HasHtml() const override;
virtual void SetDragImage(const gfx::ImageSkia& image,
- const gfx::Vector2d& cursor_offset) OVERRIDE;
- virtual const gfx::ImageSkia& GetDragImage() const OVERRIDE;
- virtual const gfx::Vector2d& GetDragImageOffset() const OVERRIDE;
+ const gfx::Vector2d& cursor_offset) override;
+ virtual const gfx::ImageSkia& GetDragImage() const override;
+ virtual const gfx::Vector2d& GetDragImageOffset() const override;
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override;
private:
friend class OSExchangeDataProviderAuraX11Test;
diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.h b/ui/base/dragdrop/os_exchange_data_provider_mac.h
index 1e46e2e..911973e 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_mac.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_mac.h
@@ -21,29 +21,29 @@
virtual ~OSExchangeDataProviderMac();
// Overridden from OSExchangeData::Provider:
- virtual Provider* Clone() const OVERRIDE;
- virtual void MarkOriginatedFromRenderer() OVERRIDE;
- virtual bool DidOriginateFromRenderer() const OVERRIDE;
- virtual void SetString(const base::string16& data) OVERRIDE;
- virtual void SetURL(const GURL& url, const base::string16& title) OVERRIDE;
- virtual void SetFilename(const base::FilePath& path) OVERRIDE;
- virtual void SetFilenames(const std::vector<FileInfo>& filenames) OVERRIDE;
+ virtual Provider* Clone() const override;
+ virtual void MarkOriginatedFromRenderer() override;
+ virtual bool DidOriginateFromRenderer() const override;
+ virtual void SetString(const base::string16& data) override;
+ virtual void SetURL(const GURL& url, const base::string16& title) override;
+ virtual void SetFilename(const base::FilePath& path) override;
+ virtual void SetFilenames(const std::vector<FileInfo>& filenames) override;
virtual void SetPickledData(const OSExchangeData::CustomFormat& format,
- const Pickle& data) OVERRIDE;
- virtual bool GetString(base::string16* data) const OVERRIDE;
+ const Pickle& data) override;
+ virtual bool GetString(base::string16* data) const override;
virtual bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy,
GURL* url,
- base::string16* title) const OVERRIDE;
- virtual bool GetFilename(base::FilePath* path) const OVERRIDE;
- virtual bool GetFilenames(std::vector<FileInfo>* filenames) const OVERRIDE;
+ base::string16* title) const override;
+ virtual bool GetFilename(base::FilePath* path) const override;
+ virtual bool GetFilenames(std::vector<FileInfo>* filenames) const override;
virtual bool GetPickledData(const OSExchangeData::CustomFormat& format,
- Pickle* data) const OVERRIDE;
- virtual bool HasString() const OVERRIDE;
+ Pickle* data) const override;
+ virtual bool HasString() const override;
virtual bool HasURL(
- OSExchangeData::FilenameToURLPolicy policy) const OVERRIDE;
- virtual bool HasFile() const OVERRIDE;
+ OSExchangeData::FilenameToURLPolicy policy) const override;
+ virtual bool HasFile() const override;
virtual bool HasCustomFormat(
- const OSExchangeData::CustomFormat& format) const OVERRIDE;
+ const OSExchangeData::CustomFormat& format) const override;
private:
base::scoped_nsobject<NSPasteboard> pasteboard_;
diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.cc b/ui/base/dragdrop/os_exchange_data_provider_win.cc
index 669d850..d283394 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_win.cc
+++ b/ui/base/dragdrop/os_exchange_data_provider_win.cc
@@ -63,7 +63,7 @@
// some sort of sequential data (why not just use an array?). See comments
// throughout.
//
-class FormatEtcEnumerator FINAL : public IEnumFORMATETC {
+class FormatEtcEnumerator final : public IEnumFORMATETC {
public:
FormatEtcEnumerator(DataObjectImpl::StoredData::const_iterator begin,
DataObjectImpl::StoredData::const_iterator end);
diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.h b/ui/base/dragdrop/os_exchange_data_provider_win.h
index a89deb2..8587bd1 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_win.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_win.h
@@ -182,9 +182,9 @@
virtual void SetDownloadFileInfo(
const OSExchangeData::DownloadFileInfo& download_info);
virtual void SetDragImage(const gfx::ImageSkia& image,
- const gfx::Vector2d& cursor_offset) OVERRIDE;
- virtual const gfx::ImageSkia& GetDragImage() const OVERRIDE;
- virtual const gfx::Vector2d& GetDragImageOffset() const OVERRIDE;
+ const gfx::Vector2d& cursor_offset) override;
+ virtual const gfx::ImageSkia& GetDragImage() const override;
+ virtual const gfx::Vector2d& GetDragImageOffset() const override;
private:
scoped_refptr<DataObjectImpl> data_;
diff --git a/ui/base/ime/chromeos/ime_bridge.cc b/ui/base/ime/chromeos/ime_bridge.cc
index 49d0f73..98f997e 100644
--- a/ui/base/ime/chromeos/ime_bridge.cc
+++ b/ui/base/ime/chromeos/ime_bridge.cc
@@ -27,46 +27,46 @@
// IMEBridge override.
virtual IMEInputContextHandlerInterface*
- GetInputContextHandler() const OVERRIDE {
+ GetInputContextHandler() const override {
return input_context_handler_;
}
// IMEBridge override.
virtual void SetInputContextHandler(
- IMEInputContextHandlerInterface* handler) OVERRIDE {
+ IMEInputContextHandlerInterface* handler) override {
input_context_handler_ = handler;
}
// IMEBridge override.
virtual void SetCurrentEngineHandler(
- IMEEngineHandlerInterface* handler) OVERRIDE {
+ IMEEngineHandlerInterface* handler) override {
engine_handler_ = handler;
}
// IMEBridge override.
- virtual IMEEngineHandlerInterface* GetCurrentEngineHandler() const OVERRIDE {
+ virtual IMEEngineHandlerInterface* GetCurrentEngineHandler() const override {
return engine_handler_;
}
// IMEBridge override.
virtual IMECandidateWindowHandlerInterface* GetCandidateWindowHandler() const
- OVERRIDE {
+ override {
return candidate_window_handler_;
}
// IMEBridge override.
virtual void SetCandidateWindowHandler(
- IMECandidateWindowHandlerInterface* handler) OVERRIDE {
+ IMECandidateWindowHandlerInterface* handler) override {
candidate_window_handler_ = handler;
}
// IMEBridge override.
- virtual void SetCurrentTextInputType(ui::TextInputType input_type) OVERRIDE {
+ virtual void SetCurrentTextInputType(ui::TextInputType input_type) override {
current_text_input_ = input_type;
}
// IMEBridge override.
- virtual ui::TextInputType GetCurrentTextInputType() const OVERRIDE {
+ virtual ui::TextInputType GetCurrentTextInputType() const override {
return current_text_input_;
}
diff --git a/ui/base/ime/chromeos/mock_ime_candidate_window_handler.h b/ui/base/ime/chromeos/mock_ime_candidate_window_handler.h
index a7705e3..9bac92c 100644
--- a/ui/base/ime/chromeos/mock_ime_candidate_window_handler.h
+++ b/ui/base/ime/chromeos/mock_ime_candidate_window_handler.h
@@ -30,11 +30,11 @@
// IMECandidateWindowHandlerInterface override.
virtual void UpdateLookupTable(
const ui::CandidateWindow& candidate_window,
- bool visible) OVERRIDE;
+ bool visible) override;
virtual void UpdatePreeditText(
- const base::string16& text, uint32 cursor_pos, bool visible) OVERRIDE;
+ const base::string16& text, uint32 cursor_pos, bool visible) override;
virtual void SetCursorBounds(const gfx::Rect& cursor_bounds,
- const gfx::Rect& composition_head) OVERRIDE;
+ const gfx::Rect& composition_head) override;
int set_cursor_bounds_call_count() const {
return set_cursor_bounds_call_count_;
diff --git a/ui/base/ime/chromeos/mock_ime_engine_handler.h b/ui/base/ime/chromeos/mock_ime_engine_handler.h
index 112c0dd..798cde6 100644
--- a/ui/base/ime/chromeos/mock_ime_engine_handler.h
+++ b/ui/base/ime/chromeos/mock_ime_engine_handler.h
@@ -16,17 +16,17 @@
MockIMEEngineHandler();
virtual ~MockIMEEngineHandler();
- virtual void FocusIn(const InputContext& input_context) OVERRIDE;
- virtual void FocusOut() OVERRIDE;
- virtual void Enable(const std::string& component_id) OVERRIDE;
- virtual void Disable() OVERRIDE;
- virtual void PropertyActivate(const std::string& property_name) OVERRIDE;
- virtual void Reset() OVERRIDE;
+ virtual void FocusIn(const InputContext& input_context) override;
+ virtual void FocusOut() override;
+ virtual void Enable(const std::string& component_id) override;
+ virtual void Disable() override;
+ virtual void PropertyActivate(const std::string& property_name) override;
+ virtual void Reset() override;
virtual void ProcessKeyEvent(const ui::KeyEvent& key_event,
- const KeyEventDoneCallback& callback) OVERRIDE;
- virtual void CandidateClicked(uint32 index) OVERRIDE;
+ const KeyEventDoneCallback& callback) override;
+ virtual void CandidateClicked(uint32 index) override;
virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos,
- uint32 anchor_pos) OVERRIDE;
+ uint32 anchor_pos) override;
int focus_in_call_count() const { return focus_in_call_count_; }
int focus_out_call_count() const { return focus_out_call_count_; }
diff --git a/ui/base/ime/chromeos/mock_ime_input_context_handler.h b/ui/base/ime/chromeos/mock_ime_input_context_handler.h
index 71fe395..8e18dec 100644
--- a/ui/base/ime/chromeos/mock_ime_input_context_handler.h
+++ b/ui/base/ime/chromeos/mock_ime_input_context_handler.h
@@ -28,11 +28,11 @@
MockIMEInputContextHandler();
virtual ~MockIMEInputContextHandler();
- virtual void CommitText(const std::string& text) OVERRIDE;
+ virtual void CommitText(const std::string& text) override;
virtual void UpdateCompositionText(const CompositionText& text,
uint32 cursor_pos,
- bool visible) OVERRIDE;
- virtual void DeleteSurroundingText(int32 offset, uint32 length) OVERRIDE;
+ bool visible) override;
+ virtual void DeleteSurroundingText(int32 offset, uint32 length) override;
int commit_text_call_count() const { return commit_text_call_count_; }
diff --git a/ui/base/ime/dummy_input_method.h b/ui/base/ime/dummy_input_method.h
index 39b0419..a0037f5 100644
--- a/ui/base/ime/dummy_input_method.h
+++ b/ui/base/ime/dummy_input_method.h
@@ -18,30 +18,30 @@
// InputMethod overrides:
virtual void SetDelegate(
- internal::InputMethodDelegate* delegate) OVERRIDE;
- virtual void Init(bool focused) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ internal::InputMethodDelegate* delegate) override;
+ virtual void Init(bool focused) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(
- const base::NativeEvent& event, NativeEventResult* result) OVERRIDE;
- virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE;
- virtual void DetachTextInputClient(TextInputClient* client) OVERRIDE;
- virtual TextInputClient* GetTextInputClient() const OVERRIDE;
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE;
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual TextInputType GetTextInputType() const OVERRIDE;
- virtual TextInputMode GetTextInputMode() const OVERRIDE;
- virtual bool CanComposeInline() const OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
- virtual void ShowImeIfNeeded() OVERRIDE;
+ const base::NativeEvent& event, NativeEventResult* result) override;
+ virtual void SetFocusedTextInputClient(TextInputClient* client) override;
+ virtual void DetachTextInputClient(TextInputClient* client) override;
+ virtual TextInputClient* GetTextInputClient() const override;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override;
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override;
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override;
+ virtual void CancelComposition(const TextInputClient* client) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual TextInputType GetTextInputType() const override;
+ virtual TextInputMode GetTextInputMode() const override;
+ virtual bool CanComposeInline() const override;
+ virtual bool IsCandidatePopupOpen() const override;
+ virtual void ShowImeIfNeeded() override;
- virtual void AddObserver(InputMethodObserver* observer) OVERRIDE;
- virtual void RemoveObserver(InputMethodObserver* observer) OVERRIDE;
+ virtual void AddObserver(InputMethodObserver* observer) override;
+ virtual void RemoveObserver(InputMethodObserver* observer) override;
private:
DISALLOW_COPY_AND_ASSIGN(DummyInputMethod);
diff --git a/ui/base/ime/dummy_input_method_delegate.h b/ui/base/ime/dummy_input_method_delegate.h
index ce64216..5055500 100644
--- a/ui/base/ime/dummy_input_method_delegate.h
+++ b/ui/base/ime/dummy_input_method_delegate.h
@@ -18,7 +18,7 @@
virtual ~DummyInputMethodDelegate();
// Overridden from InputMethodDelegate:
- virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& key_event) OVERRIDE;
+ virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& key_event) override;
private:
DISALLOW_COPY_AND_ASSIGN(DummyInputMethodDelegate);
diff --git a/ui/base/ime/dummy_text_input_client.h b/ui/base/ime/dummy_text_input_client.h
index be2295c..92705cb 100644
--- a/ui/base/ime/dummy_text_input_client.h
+++ b/ui/base/ime/dummy_text_input_client.h
@@ -17,36 +17,36 @@
virtual ~DummyTextInputClient();
// Overriden from TextInputClient.
- virtual void SetCompositionText(const CompositionText& composition) OVERRIDE;
- virtual void ConfirmCompositionText() OVERRIDE;
- virtual void ClearCompositionText() OVERRIDE;
- virtual void InsertText(const base::string16& text) OVERRIDE;
- virtual void InsertChar(base::char16 ch, int flags) OVERRIDE;
- virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE;
- virtual TextInputType GetTextInputType() const OVERRIDE;
- virtual TextInputMode GetTextInputMode() const OVERRIDE;
- virtual bool CanComposeInline() const OVERRIDE;
- virtual gfx::Rect GetCaretBounds() const OVERRIDE;
+ virtual void SetCompositionText(const CompositionText& composition) override;
+ virtual void ConfirmCompositionText() override;
+ virtual void ClearCompositionText() override;
+ virtual void InsertText(const base::string16& text) override;
+ virtual void InsertChar(base::char16 ch, int flags) override;
+ virtual gfx::NativeWindow GetAttachedWindow() const override;
+ virtual TextInputType GetTextInputType() const override;
+ virtual TextInputMode GetTextInputMode() const override;
+ virtual bool CanComposeInline() const override;
+ virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,
- gfx::Rect* rect) const OVERRIDE;
- virtual bool HasCompositionText() const OVERRIDE;
- virtual bool GetTextRange(gfx::Range* range) const OVERRIDE;
- virtual bool GetCompositionTextRange(gfx::Range* range) const OVERRIDE;
- virtual bool GetSelectionRange(gfx::Range* range) const OVERRIDE;
- virtual bool SetSelectionRange(const gfx::Range& range) OVERRIDE;
- virtual bool DeleteRange(const gfx::Range& range) OVERRIDE;
+ gfx::Rect* rect) const override;
+ virtual bool HasCompositionText() const override;
+ virtual bool GetTextRange(gfx::Range* range) const override;
+ virtual bool GetCompositionTextRange(gfx::Range* range) const override;
+ virtual bool GetSelectionRange(gfx::Range* range) const override;
+ virtual bool SetSelectionRange(const gfx::Range& range) override;
+ virtual bool DeleteRange(const gfx::Range& range) override;
virtual bool GetTextFromRange(const gfx::Range& range,
- base::string16* text) const OVERRIDE;
- virtual void OnInputMethodChanged() OVERRIDE;
+ base::string16* text) const override;
+ virtual void OnInputMethodChanged() override;
virtual bool ChangeTextDirectionAndLayoutAlignment(
- base::i18n::TextDirection direction) OVERRIDE;
- virtual void ExtendSelectionAndDelete(size_t before, size_t after) OVERRIDE;
- virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE;
- virtual void OnCandidateWindowShown() OVERRIDE;
- virtual void OnCandidateWindowUpdated() OVERRIDE;
- virtual void OnCandidateWindowHidden() OVERRIDE;
- virtual bool IsEditingCommandEnabled(int command_id) OVERRIDE;
- virtual void ExecuteEditingCommand(int command_id) OVERRIDE;
+ base::i18n::TextDirection direction) override;
+ virtual void ExtendSelectionAndDelete(size_t before, size_t after) override;
+ virtual void EnsureCaretInRect(const gfx::Rect& rect) override;
+ virtual void OnCandidateWindowShown() override;
+ virtual void OnCandidateWindowUpdated() override;
+ virtual void OnCandidateWindowHidden() override;
+ virtual bool IsEditingCommandEnabled(int command_id) override;
+ virtual void ExecuteEditingCommand(int command_id) override;
TextInputType text_input_type_;
diff --git a/ui/base/ime/input_method_auralinux.h b/ui/base/ime/input_method_auralinux.h
index 245055e..505abbd 100644
--- a/ui/base/ime/input_method_auralinux.h
+++ b/ui/base/ime/input_method_auralinux.h
@@ -22,29 +22,29 @@
virtual ~InputMethodAuraLinux();
// Overriden from InputMethod.
- virtual void Init(bool focused) OVERRIDE;
+ virtual void Init(bool focused) override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE;
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
+ NativeEventResult* result) override;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override;
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override;
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override;
+ virtual void CancelComposition(const TextInputClient* client) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual bool IsCandidatePopupOpen() const override;
// Overriden from ui::LinuxInputMethodContextDelegate
- virtual void OnCommit(const base::string16& text) OVERRIDE;
+ virtual void OnCommit(const base::string16& text) override;
virtual void OnPreeditChanged(const CompositionText& composition_text)
- OVERRIDE;
- virtual void OnPreeditEnd() OVERRIDE;
- virtual void OnPreeditStart() OVERRIDE;
+ override;
+ virtual void OnPreeditEnd() override;
+ virtual void OnPreeditStart() override;
protected:
// Overridden from InputMethodBase.
virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
- TextInputClient* focused) OVERRIDE;
+ TextInputClient* focused) override;
private:
// Allows to fire a VKEY_PROCESSKEY key event.
diff --git a/ui/base/ime/input_method_base.h b/ui/base/ime/input_method_base.h
index ce38015..76260e6 100644
--- a/ui/base/ime/input_method_base.h
+++ b/ui/base/ime/input_method_base.h
@@ -32,28 +32,28 @@
virtual ~InputMethodBase();
// Overriden from InputMethod.
- virtual void SetDelegate(internal::InputMethodDelegate* delegate) OVERRIDE;
- virtual void Init(bool focused) OVERRIDE;
+ virtual void SetDelegate(internal::InputMethodDelegate* delegate) override;
+ virtual void Init(bool focused) override;
// If a derived class overrides OnFocus()/OnBlur(), it should call parent's
// implementation first, to make sure |system_toplevel_window_focused_| flag
// can be updated correctly.
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE;
- virtual void DetachTextInputClient(TextInputClient* client) OVERRIDE;
- virtual TextInputClient* GetTextInputClient() const OVERRIDE;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual void SetFocusedTextInputClient(TextInputClient* client) override;
+ virtual void DetachTextInputClient(TextInputClient* client) override;
+ virtual TextInputClient* GetTextInputClient() const override;
// If a derived class overrides this method, it should call parent's
// implementation.
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE;
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override;
- virtual TextInputType GetTextInputType() const OVERRIDE;
- virtual TextInputMode GetTextInputMode() const OVERRIDE;
- virtual bool CanComposeInline() const OVERRIDE;
- virtual void ShowImeIfNeeded() OVERRIDE;
+ virtual TextInputType GetTextInputType() const override;
+ virtual TextInputMode GetTextInputMode() const override;
+ virtual bool CanComposeInline() const override;
+ virtual void ShowImeIfNeeded() override;
- virtual void AddObserver(InputMethodObserver* observer) OVERRIDE;
- virtual void RemoveObserver(InputMethodObserver* observer) OVERRIDE;
+ virtual void AddObserver(InputMethodObserver* observer) override;
+ virtual void RemoveObserver(InputMethodObserver* observer) override;
protected:
virtual void OnWillChangeFocusedClient(TextInputClient* focused_before,
diff --git a/ui/base/ime/input_method_base_unittest.cc b/ui/base/ime/input_method_base_unittest.cc
index 830bba0..797d88e 100644
--- a/ui/base/ime/input_method_base_unittest.cc
+++ b/ui/base/ime/input_method_base_unittest.cc
@@ -154,35 +154,35 @@
// Overriden from InputMethod.
virtual bool OnUntranslatedIMEMessage(
const base::NativeEvent& event,
- InputMethod::NativeEventResult* result) OVERRIDE {
+ InputMethod::NativeEventResult* result) override {
return false;
}
- virtual bool DispatchKeyEvent(const ui::KeyEvent&) OVERRIDE {
+ virtual bool DispatchKeyEvent(const ui::KeyEvent&) override {
return false;
}
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override {
}
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE {
+ virtual void CancelComposition(const TextInputClient* client) override {
}
- virtual void OnInputLocaleChanged() OVERRIDE {
+ virtual void OnInputLocaleChanged() override {
}
- virtual std::string GetInputLocale() OVERRIDE{
+ virtual std::string GetInputLocale() override{
return "";
}
- virtual bool IsActive() OVERRIDE {
+ virtual bool IsActive() override {
return false;
}
- virtual bool IsCandidatePopupOpen() const OVERRIDE {
+ virtual bool IsCandidatePopupOpen() const override {
return false;
}
// Overriden from InputMethodBase.
virtual void OnWillChangeFocusedClient(TextInputClient* focused_before,
- TextInputClient* focused) OVERRIDE {
+ TextInputClient* focused) override {
verifier_->OnWillChangeFocusedClient(focused_before, focused);
}
virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
- TextInputClient* focused) OVERRIDE {
+ TextInputClient* focused) override {
verifier_->OnDidChangeFocusedClient(focused_before, focused);
}
@@ -202,20 +202,20 @@
}
private:
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override {
}
- virtual void OnFocus() OVERRIDE {
+ virtual void OnFocus() override {
}
- virtual void OnBlur() OVERRIDE {
+ virtual void OnBlur() override {
}
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override {
}
- virtual void OnTextInputStateChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnTextInputStateChanged(const TextInputClient* client) override {
verifier_->OnTextInputStateChanged(client);
}
- virtual void OnShowImeIfNeeded() OVERRIDE {
+ virtual void OnShowImeIfNeeded() override {
}
- virtual void OnInputMethodDestroyed(const InputMethod* client) OVERRIDE {
+ virtual void OnInputMethodDestroyed(const InputMethod* client) override {
}
ClientChangeVerifier* verifier_;
@@ -230,13 +230,13 @@
virtual ~MockTextInputClient() {
}
- virtual void OnCandidateWindowShown() OVERRIDE {
+ virtual void OnCandidateWindowShown() override {
++shown_event_count_;
}
- virtual void OnCandidateWindowUpdated() OVERRIDE {
+ virtual void OnCandidateWindowUpdated() override {
++updated_event_count_;
}
- virtual void OnCandidateWindowHidden() OVERRIDE {
+ virtual void OnCandidateWindowHidden() override {
++hidden_event_count_;
}
diff --git a/ui/base/ime/input_method_chromeos.cc b/ui/base/ime/input_method_chromeos.cc
index b3df071..6930968 100644
--- a/ui/base/ime/input_method_chromeos.cc
+++ b/ui/base/ime/input_method_chromeos.cc
@@ -617,6 +617,9 @@
else if (underline_attributes[i].type ==
chromeos::CompositionText::COMPOSITION_TEXT_UNDERLINE_ERROR)
underline.color = SK_ColorRED;
+ else if (underline_attributes[i].type ==
+ chromeos::CompositionText::COMPOSITION_TEXT_UNDERLINE_NONE)
+ underline.color = SK_ColorTRANSPARENT;
out_composition->underlines.push_back(underline);
}
}
diff --git a/ui/base/ime/input_method_chromeos.h b/ui/base/ime/input_method_chromeos.h
index 98b42ae..a09cd3d 100644
--- a/ui/base/ime/input_method_chromeos.h
+++ b/ui/base/ime/input_method_chromeos.h
@@ -28,18 +28,18 @@
virtual ~InputMethodChromeOS();
// Overridden from InputMethod:
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE;
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
+ NativeEventResult* result) override;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override;
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override;
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override;
+ virtual void CancelComposition(const TextInputClient* client) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual bool IsCandidatePopupOpen() const override;
protected:
// Converts |text| into CompositionText.
@@ -59,9 +59,9 @@
// Overridden from InputMethodBase:
virtual void OnWillChangeFocusedClient(TextInputClient* focused_before,
- TextInputClient* focused) OVERRIDE;
+ TextInputClient* focused) override;
virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
- TextInputClient* focused) OVERRIDE;
+ TextInputClient* focused) override;
// Asks the client to confirm current composition text.
void ConfirmCompositionText();
@@ -100,11 +100,11 @@
bool ExecuteCharacterComposer(const ui::KeyEvent& event);
// chromeos::IMEInputContextHandlerInterface overrides:
- virtual void CommitText(const std::string& text) OVERRIDE;
+ virtual void CommitText(const std::string& text) override;
virtual void UpdateCompositionText(const chromeos::CompositionText& text,
uint32 cursor_pos,
- bool visible) OVERRIDE;
- virtual void DeleteSurroundingText(int32 offset, uint32 length) OVERRIDE;
+ bool visible) override;
+ virtual void DeleteSurroundingText(int32 offset, uint32 length) override;
// Hides the composition text.
void HidePreeditText();
diff --git a/ui/base/ime/input_method_chromeos_unittest.cc b/ui/base/ime/input_method_chromeos_unittest.cc
index 1db29e9..5071872 100644
--- a/ui/base/ime/input_method_chromeos_unittest.cc
+++ b/ui/base/ime/input_method_chromeos_unittest.cc
@@ -80,7 +80,7 @@
// Overridden from InputMethodChromeOS:
virtual void ProcessKeyEventPostIME(const ui::KeyEvent& key_event,
- bool handled) OVERRIDE {
+ bool handled) override {
process_key_event_post_ime_args_.event = &key_event;
process_key_event_post_ime_args_.handled = handled;
++process_key_event_post_ime_call_count_;
@@ -210,7 +210,7 @@
virtual ~InputMethodChromeOSTest() {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
chromeos::IMEBridge::Initialize();
mock_ime_engine_handler_.reset(
@@ -230,7 +230,7 @@
ime_->SetFocusedTextInputClient(this);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (ime_.get()) {
if (switches::IsTextInputFocusManagerEnabled())
TextInputFocusManager::GetInstance()->BlurTextInputClient(this);
@@ -246,89 +246,89 @@
}
// Overridden from ui::internal::InputMethodDelegate:
- virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) OVERRIDE {
+ virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override {
dispatched_key_event_ = event;
return false;
}
// Overridden from ui::TextInputClient:
virtual void SetCompositionText(
- const CompositionText& composition) OVERRIDE {
+ const CompositionText& composition) override {
composition_text_ = composition;
}
- virtual void ConfirmCompositionText() OVERRIDE {
+ virtual void ConfirmCompositionText() override {
confirmed_text_ = composition_text_;
composition_text_.Clear();
}
- virtual void ClearCompositionText() OVERRIDE {
+ virtual void ClearCompositionText() override {
composition_text_.Clear();
}
- virtual void InsertText(const base::string16& text) OVERRIDE {
+ virtual void InsertText(const base::string16& text) override {
inserted_text_ = text;
}
- virtual void InsertChar(base::char16 ch, int flags) OVERRIDE {
+ virtual void InsertChar(base::char16 ch, int flags) override {
inserted_char_ = ch;
inserted_char_flags_ = flags;
}
- virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE {
+ virtual gfx::NativeWindow GetAttachedWindow() const override {
return static_cast<gfx::NativeWindow>(NULL);
}
- virtual TextInputType GetTextInputType() const OVERRIDE {
+ virtual TextInputType GetTextInputType() const override {
return input_type_;
}
- virtual TextInputMode GetTextInputMode() const OVERRIDE {
+ virtual TextInputMode GetTextInputMode() const override {
return input_mode_;
}
- virtual bool CanComposeInline() const OVERRIDE {
+ virtual bool CanComposeInline() const override {
return can_compose_inline_;
}
- virtual gfx::Rect GetCaretBounds() const OVERRIDE {
+ virtual gfx::Rect GetCaretBounds() const override {
return caret_bounds_;
}
virtual bool GetCompositionCharacterBounds(uint32 index,
- gfx::Rect* rect) const OVERRIDE {
+ gfx::Rect* rect) const override {
return false;
}
- virtual bool HasCompositionText() const OVERRIDE {
+ virtual bool HasCompositionText() const override {
CompositionText empty;
return composition_text_ != empty;
}
- virtual bool GetTextRange(gfx::Range* range) const OVERRIDE {
+ virtual bool GetTextRange(gfx::Range* range) const override {
*range = text_range_;
return true;
}
- virtual bool GetCompositionTextRange(gfx::Range* range) const OVERRIDE {
+ virtual bool GetCompositionTextRange(gfx::Range* range) const override {
return false;
}
- virtual bool GetSelectionRange(gfx::Range* range) const OVERRIDE {
+ virtual bool GetSelectionRange(gfx::Range* range) const override {
*range = selection_range_;
return true;
}
- virtual bool SetSelectionRange(const gfx::Range& range) OVERRIDE {
+ virtual bool SetSelectionRange(const gfx::Range& range) override {
return false;
}
- virtual bool DeleteRange(const gfx::Range& range) OVERRIDE { return false; }
+ virtual bool DeleteRange(const gfx::Range& range) override { return false; }
virtual bool GetTextFromRange(const gfx::Range& range,
- base::string16* text) const OVERRIDE {
+ base::string16* text) const override {
*text = surrounding_text_.substr(range.GetMin(), range.length());
return true;
}
- virtual void OnInputMethodChanged() OVERRIDE {
+ virtual void OnInputMethodChanged() override {
++on_input_method_changed_call_count_;
}
virtual bool ChangeTextDirectionAndLayoutAlignment(
- base::i18n::TextDirection direction) OVERRIDE { return false; }
+ base::i18n::TextDirection direction) override { return false; }
virtual void ExtendSelectionAndDelete(size_t before,
- size_t after) OVERRIDE {}
- virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE {}
- virtual void OnCandidateWindowShown() OVERRIDE {}
- virtual void OnCandidateWindowUpdated() OVERRIDE {}
- virtual void OnCandidateWindowHidden() OVERRIDE {}
- virtual bool IsEditingCommandEnabled(int command_id) OVERRIDE {
+ size_t after) override {}
+ virtual void EnsureCaretInRect(const gfx::Rect& rect) override {}
+ virtual void OnCandidateWindowShown() override {}
+ virtual void OnCandidateWindowUpdated() override {}
+ virtual void OnCandidateWindowHidden() override {}
+ virtual bool IsEditingCommandEnabled(int command_id) override {
return false;
}
- virtual void ExecuteEditingCommand(int command_id) OVERRIDE {}
+ virtual void ExecuteEditingCommand(int command_id) override {}
bool HasNativeEvent() const {
return dispatched_key_event_.HasNativeEvent();
@@ -945,7 +945,7 @@
InputMethodChromeOSKeyEventTest() {}
virtual ~InputMethodChromeOSKeyEventTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
InputMethodChromeOSTest::SetUp();
ime_->Init(true);
}
diff --git a/ui/base/ime/input_method_mac.h b/ui/base/ime/input_method_mac.h
index 08f6080..95d3cee 100644
--- a/ui/base/ime/input_method_mac.h
+++ b/ui/base/ime/input_method_mac.h
@@ -20,14 +20,14 @@
// Overriden from InputMethod.
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
+ NativeEventResult* result) override;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override;
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override;
+ virtual void CancelComposition(const TextInputClient* client) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual bool IsCandidatePopupOpen() const override;
private:
DISALLOW_COPY_AND_ASSIGN(InputMethodMac);
diff --git a/ui/base/ime/input_method_minimal.h b/ui/base/ime/input_method_minimal.h
index 84fd066..14700f5 100644
--- a/ui/base/ime/input_method_minimal.h
+++ b/ui/base/ime/input_method_minimal.h
@@ -18,14 +18,14 @@
// Overriden from InputMethod.
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
+ NativeEventResult* result) override;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override;
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override;
+ virtual void CancelComposition(const TextInputClient* client) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual bool IsCandidatePopupOpen() const override;
private:
DISALLOW_COPY_AND_ASSIGN(InputMethodMinimal);
diff --git a/ui/base/ime/input_method_win.h b/ui/base/ime/input_method_win.h
index b02d670..b6d5320 100644
--- a/ui/base/ime/input_method_win.h
+++ b/ui/base/ime/input_method_win.h
@@ -23,28 +23,28 @@
HWND toplevel_window_handle);
// Overridden from InputMethod:
- virtual void Init(bool focused) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual void Init(bool focused) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE;
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
+ NativeEventResult* result) override;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override;
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override;
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override;
+ virtual void CancelComposition(const TextInputClient* client) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual bool IsCandidatePopupOpen() const override;
protected:
// Overridden from InputMethodBase:
// If a derived class overrides this method, it should call parent's
// implementation.
virtual void OnWillChangeFocusedClient(TextInputClient* focused_before,
- TextInputClient* focused) OVERRIDE;
+ TextInputClient* focused) override;
virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
- TextInputClient* focused) OVERRIDE;
+ TextInputClient* focused) override;
private:
// For both WM_CHAR and WM_SYSCHAR
diff --git a/ui/base/ime/linux/fake_input_method_context.h b/ui/base/ime/linux/fake_input_method_context.h
index 67210c1..d13d2b9 100644
--- a/ui/base/ime/linux/fake_input_method_context.h
+++ b/ui/base/ime/linux/fake_input_method_context.h
@@ -15,11 +15,11 @@
FakeInputMethodContext();
// Overriden from ui::LinuxInputMethodContext
- virtual bool DispatchKeyEvent(const ui::KeyEvent& key_event) OVERRIDE;
- virtual void Reset() OVERRIDE;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& key_event) override;
+ virtual void Reset() override;
virtual void OnTextInputTypeChanged(ui::TextInputType text_input_type)
- OVERRIDE;
- virtual void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) OVERRIDE;
+ override;
+ virtual void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override;
private:
DISALLOW_COPY_AND_ASSIGN(FakeInputMethodContext);
diff --git a/ui/base/ime/linux/fake_input_method_context_factory.h b/ui/base/ime/linux/fake_input_method_context_factory.h
index b2f6b43..d6101fa 100644
--- a/ui/base/ime/linux/fake_input_method_context_factory.h
+++ b/ui/base/ime/linux/fake_input_method_context_factory.h
@@ -17,7 +17,7 @@
// Overriden from ui::LinuxInputMethodContextFactory
virtual scoped_ptr<LinuxInputMethodContext> CreateInputMethodContext(
- LinuxInputMethodContextDelegate* delegate) const OVERRIDE;
+ LinuxInputMethodContextDelegate* delegate) const override;
private:
DISALLOW_COPY_AND_ASSIGN(FakeInputMethodContextFactory);
diff --git a/ui/base/ime/mock_input_method.h b/ui/base/ime/mock_input_method.h
index 7716065..e61c6fb 100644
--- a/ui/base/ime/mock_input_method.h
+++ b/ui/base/ime/mock_input_method.h
@@ -29,29 +29,29 @@
virtual ~MockInputMethod();
// Overriden from InputMethod.
- virtual void SetDelegate(internal::InputMethodDelegate* delegate) OVERRIDE;
- virtual void Init(bool focused) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual void SetDelegate(internal::InputMethodDelegate* delegate) override;
+ virtual void Init(bool focused) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE;
- virtual void DetachTextInputClient(TextInputClient* client) OVERRIDE;
- virtual TextInputClient* GetTextInputClient() const OVERRIDE;
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE;
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual TextInputType GetTextInputType() const OVERRIDE;
- virtual TextInputMode GetTextInputMode() const OVERRIDE;
- virtual bool CanComposeInline() const OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
- virtual void ShowImeIfNeeded() OVERRIDE;
- virtual void AddObserver(InputMethodObserver* observer) OVERRIDE;
- virtual void RemoveObserver(InputMethodObserver* observer) OVERRIDE;
+ NativeEventResult* result) override;
+ virtual void SetFocusedTextInputClient(TextInputClient* client) override;
+ virtual void DetachTextInputClient(TextInputClient* client) override;
+ virtual TextInputClient* GetTextInputClient() const override;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override;
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override;
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override;
+ virtual void CancelComposition(const TextInputClient* client) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual TextInputType GetTextInputType() const override;
+ virtual TextInputMode GetTextInputMode() const override;
+ virtual bool CanComposeInline() const override;
+ virtual bool IsCandidatePopupOpen() const override;
+ virtual void ShowImeIfNeeded() override;
+ virtual void AddObserver(InputMethodObserver* observer) override;
+ virtual void RemoveObserver(InputMethodObserver* observer) override;
private:
TextInputClient* text_input_client_;
diff --git a/ui/base/ime/remote_input_method_win.cc b/ui/base/ime/remote_input_method_win.cc
index 9fad0ad..0b75c07 100644
--- a/ui/base/ime/remote_input_method_win.cc
+++ b/ui/base/ime/remote_input_method_win.cc
@@ -4,6 +4,7 @@
#include "ui/base/ime/remote_input_method_win.h"
+#include "base/command_line.h"
#include "base/observer_list.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/metro.h"
@@ -14,6 +15,7 @@
#include "ui/base/ime/remote_input_method_delegate_win.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/base/ime/win/tsf_input_scope.h"
+#include "ui/base/ui_base_switches.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/gfx/rect.h"
@@ -128,25 +130,25 @@
private:
// Overridden from InputMethod:
- virtual void SetDelegate(internal::InputMethodDelegate* delegate) OVERRIDE {
+ virtual void SetDelegate(internal::InputMethodDelegate* delegate) override {
delegate_ = delegate;
}
- virtual void Init(bool focused) OVERRIDE {
+ virtual void Init(bool focused) override {
}
- virtual void OnFocus() OVERRIDE {
+ virtual void OnFocus() override {
}
- virtual void OnBlur() OVERRIDE {
+ virtual void OnBlur() override {
}
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE {
+ NativeEventResult* result) override {
return false;
}
- virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE {
+ virtual void SetFocusedTextInputClient(TextInputClient* client) override {
std::vector<int32> prev_input_scopes;
std::swap(input_scopes_, prev_input_scopes);
std::vector<gfx::Rect> prev_bounds;
@@ -172,17 +174,17 @@
composition_character_bounds_);
}
- virtual void DetachTextInputClient(TextInputClient* client) OVERRIDE {
+ virtual void DetachTextInputClient(TextInputClient* client) override {
if (text_input_client_ != client)
return;
SetFocusedTextInputClient(NULL);
}
- virtual TextInputClient* GetTextInputClient() const OVERRIDE {
+ virtual TextInputClient* GetTextInputClient() const override {
return text_input_client_;
}
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE {
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override {
if (event.HasNativeEvent()) {
const base::NativeEvent& native_key_event = event.native_event();
if (native_key_event.message != WM_CHAR)
@@ -207,7 +209,7 @@
return delegate_->DispatchKeyEventPostIME(event);
}
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override {
if (!text_input_client_ || text_input_client_ != client)
return;
std::vector<int32> prev_input_scopes;
@@ -220,7 +222,7 @@
}
}
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override {
if (!text_input_client_ || text_input_client_ != client)
return;
std::vector<gfx::Rect> prev_rects;
@@ -232,15 +234,15 @@
}
}
- virtual void CancelComposition(const TextInputClient* client) OVERRIDE {
+ virtual void CancelComposition(const TextInputClient* client) override {
if (CanSendRemoteNotification(client))
remote_delegate_->CancelComposition();
}
- virtual void OnInputLocaleChanged() OVERRIDE {
+ virtual void OnInputLocaleChanged() override {
}
- virtual std::string GetInputLocale() OVERRIDE {
+ virtual std::string GetInputLocale() override {
const LCID locale_id = MAKELCID(langid_, SORT_DEFAULT);
std::string language =
GetLocaleString(locale_id, LOCALE_SISO639LANGNAME);
@@ -253,42 +255,42 @@
return language.append(1, '-').append(region);
}
- virtual bool IsActive() OVERRIDE {
+ virtual bool IsActive() override {
return true; // always turned on
}
- virtual TextInputType GetTextInputType() const OVERRIDE {
+ virtual TextInputType GetTextInputType() const override {
return text_input_client_ ? text_input_client_->GetTextInputType()
: TEXT_INPUT_TYPE_NONE;
}
- virtual TextInputMode GetTextInputMode() const OVERRIDE {
+ virtual TextInputMode GetTextInputMode() const override {
return text_input_client_ ? text_input_client_->GetTextInputMode()
: TEXT_INPUT_MODE_DEFAULT;
}
- virtual bool CanComposeInline() const OVERRIDE {
+ virtual bool CanComposeInline() const override {
return text_input_client_ ? text_input_client_->CanComposeInline() : true;
}
- virtual bool IsCandidatePopupOpen() const OVERRIDE {
+ virtual bool IsCandidatePopupOpen() const override {
return is_candidate_popup_open_;
}
- virtual void ShowImeIfNeeded() OVERRIDE {
+ virtual void ShowImeIfNeeded() override {
}
- virtual void AddObserver(InputMethodObserver* observer) OVERRIDE {
+ virtual void AddObserver(InputMethodObserver* observer) override {
observer_list_.AddObserver(observer);
}
- virtual void RemoveObserver(InputMethodObserver* observer) OVERRIDE {
+ virtual void RemoveObserver(InputMethodObserver* observer) override {
observer_list_.RemoveObserver(observer);
}
// Overridden from RemoteInputMethodPrivateWin:
virtual void SetRemoteDelegate(
- internal::RemoteInputMethodDelegateWin* delegate) OVERRIDE{
+ internal::RemoteInputMethodDelegateWin* delegate) override{
remote_delegate_ = delegate;
// Sync initial state.
@@ -298,7 +300,7 @@
}
}
- virtual void OnCandidatePopupChanged(bool visible) OVERRIDE {
+ virtual void OnCandidatePopupChanged(bool visible) override {
is_candidate_popup_open_ = visible;
if (!text_input_client_)
return;
@@ -310,7 +312,7 @@
text_input_client_->OnCandidateWindowHidden();
}
- virtual void OnInputSourceChanged(LANGID langid, bool /*is_ime*/) OVERRIDE {
+ virtual void OnInputSourceChanged(LANGID langid, bool /*is_ime*/) override {
// Note: Currently |is_ime| is not utilized yet.
const bool changed = (langid_ != langid);
langid_ = langid;
@@ -319,13 +321,13 @@
}
virtual void OnCompositionChanged(
- const CompositionText& composition_text) OVERRIDE {
+ const CompositionText& composition_text) override {
if (!text_input_client_)
return;
text_input_client_->SetCompositionText(composition_text);
}
- virtual void OnTextCommitted(const base::string16& text) OVERRIDE {
+ virtual void OnTextCommitted(const base::string16& text) override {
if (!text_input_client_)
return;
if (text_input_client_->GetTextInputType() == TEXT_INPUT_TYPE_NONE) {
@@ -364,6 +366,10 @@
} // namespace
bool IsRemoteInputMethodWinRequired(gfx::AcceleratedWidget widget) {
+ // If the remote input method is already registered then don't do it again.
+ if (ui::g_public_interface_ && ui::g_private_interface_)
+ return false;
+
DWORD process_id = 0;
if (GetWindowThreadProcessId(widget, &process_id) == 0)
return false;
@@ -371,7 +377,9 @@
PROCESS_QUERY_LIMITED_INFORMATION, FALSE, process_id));
if (!process_handle.IsValid())
return false;
- return base::win::IsProcessImmersive(process_handle.Get());
+ return base::win::IsProcessImmersive(process_handle.Get()) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kViewerConnect);
}
RemoteInputMethodPrivateWin::RemoteInputMethodPrivateWin() {}
diff --git a/ui/base/ime/remote_input_method_win_unittest.cc b/ui/base/ime/remote_input_method_win_unittest.cc
index 40269de..5cf8aa3 100644
--- a/ui/base/ime/remote_input_method_win_unittest.cc
+++ b/ui/base/ime/remote_input_method_win_unittest.cc
@@ -87,28 +87,28 @@
private:
// Overriden from DummyTextInputClient.
virtual void SetCompositionText(
- const ui::CompositionText& composition) OVERRIDE {
+ const ui::CompositionText& composition) override {
++call_count_set_composition_text_;
}
- virtual void InsertChar(base::char16 ch, int flags) OVERRIDE {
+ virtual void InsertChar(base::char16 ch, int flags) override {
inserted_text_.append(1, ch);
++call_count_insert_char_;
}
- virtual void InsertText(const base::string16& text) OVERRIDE {
+ virtual void InsertText(const base::string16& text) override {
inserted_text_.append(text);
++call_count_insert_text_;
}
- virtual ui::TextInputType GetTextInputType() const OVERRIDE {
+ virtual ui::TextInputType GetTextInputType() const override {
return text_input_type_;
}
- virtual ui::TextInputMode GetTextInputMode() const OVERRIDE {
+ virtual ui::TextInputMode GetTextInputMode() const override {
return text_input_mode_;
}
virtual gfx::Rect GetCaretBounds() const {
return caret_bounds_;
}
virtual bool GetCompositionCharacterBounds(uint32 index,
- gfx::Rect* rect) const OVERRIDE {
+ gfx::Rect* rect) const override {
// Emulate the situation of crbug.com/328237.
if (emulate_pepper_flash_)
return false;
@@ -117,19 +117,19 @@
*rect = composition_character_bounds_[index];
return true;
}
- virtual bool HasCompositionText() const OVERRIDE {
+ virtual bool HasCompositionText() const override {
return !composition_character_bounds_.empty();
}
- virtual bool GetCompositionTextRange(gfx::Range* range) const OVERRIDE {
+ virtual bool GetCompositionTextRange(gfx::Range* range) const override {
if (composition_character_bounds_.empty())
return false;
*range = gfx::Range(0, composition_character_bounds_.size());
return true;
}
- virtual void OnCandidateWindowShown() OVERRIDE {
+ virtual void OnCandidateWindowShown() override {
is_candidate_window_shown_called_ = true;
}
- virtual void OnCandidateWindowHidden() OVERRIDE {
+ virtual void OnCandidateWindowHidden() override {
is_candidate_window_hidden_called_ = true;
}
@@ -159,7 +159,7 @@
}
private:
- virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) OVERRIDE {
+ virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override {
EXPECT_FALSE(event.HasNativeEvent());
fabricated_key_events_.push_back(event.key_code());
return true;
@@ -197,13 +197,13 @@
}
private:
- virtual void CancelComposition() OVERRIDE {
+ virtual void CancelComposition() override {
cancel_composition_called_ = true;
}
virtual void OnTextInputClientUpdated(
const std::vector<int32>& input_scopes,
- const std::vector<gfx::Rect>& composition_character_bounds) OVERRIDE {
+ const std::vector<gfx::Rect>& composition_character_bounds) override {
text_input_client_updated_called_ = true;
input_scopes_ = input_scopes;
composition_character_bounds_ = composition_character_bounds;
@@ -237,18 +237,18 @@
private:
// Overriden from InputMethodObserver.
- virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnTextInputTypeChanged(const TextInputClient* client) override {
}
- virtual void OnFocus() OVERRIDE {
+ virtual void OnFocus() override {
}
- virtual void OnBlur() OVERRIDE {
+ virtual void OnBlur() override {
}
- virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnCaretBoundsChanged(const TextInputClient* client) override {
}
- virtual void OnTextInputStateChanged(const TextInputClient* client) OVERRIDE {
+ virtual void OnTextInputStateChanged(const TextInputClient* client) override {
++on_text_input_state_changed_;
}
- virtual void OnInputMethodDestroyed(const InputMethod* client) OVERRIDE {
+ virtual void OnInputMethodDestroyed(const InputMethod* client) override {
++on_input_method_destroyed_changed_;
}
virtual void OnShowImeIfNeeded() {
diff --git a/ui/base/ime/win/tsf_input_scope.cc b/ui/base/ime/win/tsf_input_scope.cc
index f40f928..1c248f1 100644
--- a/ui/base/ime/win/tsf_input_scope.cc
+++ b/ui/base/ime/win/tsf_input_scope.cc
@@ -29,18 +29,18 @@
input_scopes->push_back(input_scope);
}
-class TSFInputScope FINAL : public ITfInputScope {
+class TSFInputScope final : public ITfInputScope {
public:
explicit TSFInputScope(const std::vector<InputScope>& input_scopes)
: input_scopes_(input_scopes),
ref_count_(0) {}
// ITfInputScope:
- STDMETHOD_(ULONG, AddRef)() OVERRIDE {
+ STDMETHOD_(ULONG, AddRef)() override {
return InterlockedIncrement(&ref_count_);
}
- STDMETHOD_(ULONG, Release)() OVERRIDE {
+ STDMETHOD_(ULONG, Release)() override {
const LONG count = InterlockedDecrement(&ref_count_);
if (!count) {
delete this;
@@ -49,7 +49,7 @@
return static_cast<ULONG>(count);
}
- STDMETHOD(QueryInterface)(REFIID iid, void** result) OVERRIDE {
+ STDMETHOD(QueryInterface)(REFIID iid, void** result) override {
if (!result)
return E_INVALIDARG;
if (iid == IID_IUnknown || iid == IID_ITfInputScope) {
@@ -62,7 +62,7 @@
return S_OK;
}
- STDMETHOD(GetInputScopes)(InputScope** input_scopes, UINT* count) OVERRIDE {
+ STDMETHOD(GetInputScopes)(InputScope** input_scopes, UINT* count) override {
if (!count || !input_scopes)
return E_INVALIDARG;
*input_scopes = static_cast<InputScope*>(CoTaskMemAlloc(
@@ -78,19 +78,19 @@
return S_OK;
}
- STDMETHOD(GetPhrase)(BSTR** phrases, UINT* count) OVERRIDE {
+ STDMETHOD(GetPhrase)(BSTR** phrases, UINT* count) override {
return E_NOTIMPL;
}
- STDMETHOD(GetRegularExpression)(BSTR* regexp) OVERRIDE {
+ STDMETHOD(GetRegularExpression)(BSTR* regexp) override {
return E_NOTIMPL;
}
- STDMETHOD(GetSRGS)(BSTR* srgs) OVERRIDE {
+ STDMETHOD(GetSRGS)(BSTR* srgs) override {
return E_NOTIMPL;
}
- STDMETHOD(GetXML)(BSTR* xml) OVERRIDE {
+ STDMETHOD(GetXML)(BSTR* xml) override {
return E_NOTIMPL;
}
diff --git a/ui/base/models/list_model_unittest.cc b/ui/base/models/list_model_unittest.cc
index 5666167..8422a12 100644
--- a/ui/base/models/list_model_unittest.cc
+++ b/ui/base/models/list_model_unittest.cc
@@ -47,16 +47,16 @@
}
// ListModelObserver implementation:
- virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE {
+ virtual void ListItemsAdded(size_t start, size_t count) override {
added_count_ += count;
}
- virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE {
+ virtual void ListItemsRemoved(size_t start, size_t count) override {
removed_count_ += count;
}
- virtual void ListItemMoved(size_t index, size_t target_index) OVERRIDE {
+ virtual void ListItemMoved(size_t index, size_t target_index) override {
++moved_count_;
}
- virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE {
+ virtual void ListItemsChanged(size_t start, size_t count) override {
changed_count_ += count;
}
diff --git a/ui/base/models/simple_combobox_model.h b/ui/base/models/simple_combobox_model.h
index c978ec9..4aa28c3 100644
--- a/ui/base/models/simple_combobox_model.h
+++ b/ui/base/models/simple_combobox_model.h
@@ -19,10 +19,10 @@
virtual ~SimpleComboboxModel();
// ui::ComboboxModel:
- virtual int GetItemCount() const OVERRIDE;
- virtual base::string16 GetItemAt(int index) OVERRIDE;
- virtual bool IsItemSeparatorAt(int index) OVERRIDE;
- virtual int GetDefaultIndex() const OVERRIDE;
+ virtual int GetItemCount() const override;
+ virtual base::string16 GetItemAt(int index) override;
+ virtual bool IsItemSeparatorAt(int index) override;
+ virtual int GetDefaultIndex() const override;
private:
const std::vector<base::string16> items_;
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
index 78c8fd6..f1238dd 100644
--- a/ui/base/models/simple_menu_model.h
+++ b/ui/base/models/simple_menu_model.h
@@ -140,33 +140,33 @@
int GetIndexOfCommandId(int command_id);
// Overridden from MenuModel:
- virtual bool HasIcons() const OVERRIDE;
- virtual int GetItemCount() const OVERRIDE;
- virtual ItemType GetTypeAt(int index) const OVERRIDE;
- virtual ui::MenuSeparatorType GetSeparatorTypeAt(int index) const OVERRIDE;
- virtual int GetCommandIdAt(int index) const OVERRIDE;
- virtual base::string16 GetLabelAt(int index) const OVERRIDE;
- virtual base::string16 GetSublabelAt(int index) const OVERRIDE;
- virtual base::string16 GetMinorTextAt(int index) const OVERRIDE;
- virtual bool IsItemDynamicAt(int index) const OVERRIDE;
+ virtual bool HasIcons() const override;
+ virtual int GetItemCount() const override;
+ virtual ItemType GetTypeAt(int index) const override;
+ virtual ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
+ virtual int GetCommandIdAt(int index) const override;
+ virtual base::string16 GetLabelAt(int index) const override;
+ virtual base::string16 GetSublabelAt(int index) const override;
+ virtual base::string16 GetMinorTextAt(int index) const override;
+ virtual bool IsItemDynamicAt(int index) const override;
virtual bool GetAcceleratorAt(int index,
- ui::Accelerator* accelerator) const OVERRIDE;
- virtual bool IsItemCheckedAt(int index) const OVERRIDE;
- virtual int GetGroupIdAt(int index) const OVERRIDE;
- virtual bool GetIconAt(int index, gfx::Image* icon) OVERRIDE;
+ ui::Accelerator* accelerator) const override;
+ virtual bool IsItemCheckedAt(int index) const override;
+ virtual int GetGroupIdAt(int index) const override;
+ virtual bool GetIconAt(int index, gfx::Image* icon) override;
virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(
- int index) const OVERRIDE;
- virtual bool IsEnabledAt(int index) const OVERRIDE;
- virtual bool IsVisibleAt(int index) const OVERRIDE;
- virtual void HighlightChangedTo(int index) OVERRIDE;
- virtual void ActivatedAt(int index) OVERRIDE;
- virtual void ActivatedAt(int index, int event_flags) OVERRIDE;
- virtual MenuModel* GetSubmenuModelAt(int index) const OVERRIDE;
- virtual void MenuWillShow() OVERRIDE;
- virtual void MenuClosed() OVERRIDE;
+ int index) const override;
+ virtual bool IsEnabledAt(int index) const override;
+ virtual bool IsVisibleAt(int index) const override;
+ virtual void HighlightChangedTo(int index) override;
+ virtual void ActivatedAt(int index) override;
+ virtual void ActivatedAt(int index, int event_flags) override;
+ virtual MenuModel* GetSubmenuModelAt(int index) const override;
+ virtual void MenuWillShow() override;
+ virtual void MenuClosed() override;
virtual void SetMenuModelDelegate(
- ui::MenuModelDelegate* menu_model_delegate) OVERRIDE;
- virtual MenuModelDelegate* GetMenuModelDelegate() const OVERRIDE;
+ ui::MenuModelDelegate* menu_model_delegate) override;
+ virtual MenuModelDelegate* GetMenuModelDelegate() const override;
protected:
void set_delegate(Delegate* delegate) { delegate_ = delegate; }
diff --git a/ui/base/models/tree_node_model.h b/ui/base/models/tree_node_model.h
index 003d20f..5df2481 100644
--- a/ui/base/models/tree_node_model.h
+++ b/ui/base/models/tree_node_model.h
@@ -154,7 +154,7 @@
virtual void SetTitle(const base::string16& title) { title_ = title; }
// TreeModelNode:
- virtual const base::string16& GetTitle() const OVERRIDE { return title_; }
+ virtual const base::string16& GetTitle() const override { return title_; }
// Returns true if this == ancestor, or one of this nodes parents is
// ancestor.
@@ -251,40 +251,40 @@
}
// TreeModel:
- virtual NodeType* GetRoot() OVERRIDE {
+ virtual NodeType* GetRoot() override {
return root_.get();
}
- virtual int GetChildCount(TreeModelNode* parent) OVERRIDE {
+ virtual int GetChildCount(TreeModelNode* parent) override {
DCHECK(parent);
return AsNode(parent)->child_count();
}
- virtual NodeType* GetChild(TreeModelNode* parent, int index) OVERRIDE {
+ virtual NodeType* GetChild(TreeModelNode* parent, int index) override {
DCHECK(parent);
return AsNode(parent)->GetChild(index);
}
- virtual int GetIndexOf(TreeModelNode* parent, TreeModelNode* child) OVERRIDE {
+ virtual int GetIndexOf(TreeModelNode* parent, TreeModelNode* child) override {
DCHECK(parent);
return AsNode(parent)->GetIndexOf(AsNode(child));
}
- virtual TreeModelNode* GetParent(TreeModelNode* node) OVERRIDE {
+ virtual TreeModelNode* GetParent(TreeModelNode* node) override {
DCHECK(node);
return AsNode(node)->parent();
}
- virtual void AddObserver(TreeModelObserver* observer) OVERRIDE {
+ virtual void AddObserver(TreeModelObserver* observer) override {
observer_list_.AddObserver(observer);
}
- virtual void RemoveObserver(TreeModelObserver* observer) OVERRIDE {
+ virtual void RemoveObserver(TreeModelObserver* observer) override {
observer_list_.RemoveObserver(observer);
}
virtual void SetTitle(TreeModelNode* node,
- const base::string16& title) OVERRIDE {
+ const base::string16& title) override {
DCHECK(node);
AsNode(node)->SetTitle(title);
NotifyObserverTreeNodeChanged(node);
diff --git a/ui/base/models/tree_node_model_unittest.cc b/ui/base/models/tree_node_model_unittest.cc
index d9d387c..d1a5c88 100644
--- a/ui/base/models/tree_node_model_unittest.cc
+++ b/ui/base/models/tree_node_model_unittest.cc
@@ -37,16 +37,16 @@
virtual void TreeNodesAdded(TreeModel* model,
TreeModelNode* parent,
int start,
- int count) OVERRIDE {
+ int count) override {
added_count_++;
}
virtual void TreeNodesRemoved(TreeModel* model,
TreeModelNode* parent,
int start,
- int count) OVERRIDE {
+ int count) override {
removed_count_++;
}
- virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) OVERRIDE {
+ virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) override {
changed_count_++;
}
diff --git a/ui/base/resource/data_pack.h b/ui/base/resource/data_pack.h
index 2eeb1b2..70cf242 100644
--- a/ui/base/resource/data_pack.h
+++ b/ui/base/resource/data_pack.h
@@ -51,13 +51,13 @@
TextEncodingType textEncodingType);
// ResourceHandle implementation:
- virtual bool HasResource(uint16 resource_id) const OVERRIDE;
+ virtual bool HasResource(uint16 resource_id) const override;
virtual bool GetStringPiece(uint16 resource_id,
- base::StringPiece* data) const OVERRIDE;
+ base::StringPiece* data) const override;
virtual base::RefCountedStaticMemory* GetStaticMemory(
- uint16 resource_id) const OVERRIDE;
- virtual TextEncodingType GetTextEncodingType() const OVERRIDE;
- virtual ui::ScaleFactor GetScaleFactor() const OVERRIDE;
+ uint16 resource_id) const override;
+ virtual TextEncodingType GetTextEncodingType() const override;
+ virtual ui::ScaleFactor GetScaleFactor() const override;
private:
// Does the actual loading of a pack file. Called by Load and LoadFromFile.
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
index b19133a..37f6c77 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -127,7 +127,7 @@
virtual ~ResourceBundleImageSource() {}
// gfx::ImageSkiaSource overrides:
- virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual gfx::ImageSkiaRep GetImageForScale(float scale) override {
SkBitmap image;
bool fell_back_to_1x = false;
ScaleFactor scale_factor = GetSupportedScaleFactor(scale);
diff --git a/ui/base/resource/resource_bundle_unittest.cc b/ui/base/resource/resource_bundle_unittest.cc
index 6a3f71e..488947d 100644
--- a/ui/base/resource/resource_bundle_unittest.cc
+++ b/ui/base/resource/resource_bundle_unittest.cc
@@ -77,20 +77,20 @@
ui::ScaleFactor scale_factor));
virtual bool GetRawDataResource(int resource_id,
ui::ScaleFactor scale_factor,
- base::StringPiece* value) OVERRIDE {
+ base::StringPiece* value) override {
*value = GetRawDataResourceMock(resource_id, scale_factor);
return true;
}
MOCK_METHOD1(GetLocalizedStringMock, base::string16(int message_id));
virtual bool GetLocalizedString(int message_id,
- base::string16* value) OVERRIDE {
+ base::string16* value) override {
*value = GetLocalizedStringMock(message_id);
return true;
}
MOCK_METHOD1(GetFontMock,
gfx::Font*(ui::ResourceBundle::FontStyle style));
virtual scoped_ptr<gfx::Font> GetFont(
- ui::ResourceBundle::FontStyle style) OVERRIDE {
+ ui::ResourceBundle::FontStyle style) override {
return scoped_ptr<gfx::Font>(GetFontMock(style));
}
};
@@ -153,7 +153,7 @@
}
// Overridden from testing::Test:
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
delete resource_bundle_;
}
@@ -383,7 +383,7 @@
virtual ~ResourceBundleImageTest() {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Create a temporary directory to write test resource bundles to.
ASSERT_TRUE(dir_.CreateUniqueTempDir());
}
diff --git a/ui/base/resource/resource_data_dll_win.h b/ui/base/resource/resource_data_dll_win.h
index d45ac83..0aad558 100644
--- a/ui/base/resource/resource_data_dll_win.h
+++ b/ui/base/resource/resource_data_dll_win.h
@@ -18,13 +18,13 @@
virtual ~ResourceDataDLL();
// ResourceHandle implementation:
- virtual bool HasResource(uint16 resource_id) const OVERRIDE;
+ virtual bool HasResource(uint16 resource_id) const override;
virtual bool GetStringPiece(uint16 resource_id,
- base::StringPiece* data) const OVERRIDE;
+ base::StringPiece* data) const override;
virtual base::RefCountedStaticMemory* GetStaticMemory(
- uint16 resource_id) const OVERRIDE;
- virtual TextEncodingType GetTextEncodingType() const OVERRIDE;
- virtual ScaleFactor GetScaleFactor() const OVERRIDE;
+ uint16 resource_id) const override;
+ virtual TextEncodingType GetTextEncodingType() const override;
+ virtual ScaleFactor GetScaleFactor() const override;
private:
const HINSTANCE module_;
diff --git a/ui/base/test/run_all_unittests.cc b/ui/base/test/run_all_unittests.cc
index 26885c8..1254d97 100644
--- a/ui/base/test/run_all_unittests.cc
+++ b/ui/base/test/run_all_unittests.cc
@@ -33,8 +33,8 @@
protected:
// base::TestSuite:
- virtual void Initialize() OVERRIDE;
- virtual void Shutdown() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void Shutdown() override;
private:
DISALLOW_COPY_AND_ASSIGN(UIBaseTestSuite);
diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc
index e6a4c92..2163397 100644
--- a/ui/base/ui_base_switches.cc
+++ b/ui/base/ui_base_switches.cc
@@ -9,7 +9,7 @@
#if defined(OS_MACOSX) && !defined(OS_IOS)
// Enable use of cross-process CALayers to display content directly from the
// GPU process on Mac.
-const char kEnableRemoteCoreAnimation[] = "enable-remote-core-animation";
+const char kDisableRemoteCoreAnimation[] = "disable-remote-core-animation";
#endif
// Disables use of DWM composition for top level windows.
diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h
index a1200f8..629f9af 100644
--- a/ui/base/ui_base_switches.h
+++ b/ui/base/ui_base_switches.h
@@ -13,7 +13,7 @@
namespace switches {
#if defined(OS_MACOSX) && !defined(OS_IOS)
-UI_BASE_EXPORT extern const char kEnableRemoteCoreAnimation[];
+UI_BASE_EXPORT extern const char kDisableRemoteCoreAnimation[];
#endif
UI_BASE_EXPORT extern const char kDisableDwmComposition[];
diff --git a/ui/base/webui/OWNERS b/ui/base/webui/OWNERS
new file mode 100644
index 0000000..262db99
--- /dev/null
+++ b/ui/base/webui/OWNERS
@@ -0,0 +1,2 @@
+dbeam@chromium.org
+estade@chromium.org
diff --git a/ui/base/webui/jstemplate_builder.cc b/ui/base/webui/jstemplate_builder.cc
index 4c89565..413468f 100644
--- a/ui/base/webui/jstemplate_builder.cc
+++ b/ui/base/webui/jstemplate_builder.cc
@@ -34,7 +34,7 @@
output->append("</script>");
}
-// Appends the source for JsTemplates in a script tag.
+// Appends the source for load_time_data.js in a script tag.
void AppendLoadTimeData(std::string* output) {
// fetch and cache the pointer of the jstemplate resource source text.
base::StringPiece load_time_data_src(
@@ -102,6 +102,7 @@
std::string GetI18nTemplateHtml(const base::StringPiece& html_template,
const base::DictionaryValue* json) {
std::string output(html_template.data(), html_template.size());
+ AppendLoadTimeData(&output);
AppendJsonHtml(json, &output);
AppendI18nTemplateSourceHtml(&output);
return output;
diff --git a/ui/base/win/hwnd_subclass_unittest.cc b/ui/base/win/hwnd_subclass_unittest.cc
index 520f52b..b037db9 100644
--- a/ui/base/win/hwnd_subclass_unittest.cc
+++ b/ui/base/win/hwnd_subclass_unittest.cc
@@ -26,7 +26,7 @@
WPARAM w_param,
LPARAM l_param,
LRESULT& result,
- DWORD msg_map_id) OVERRIDE {
+ DWORD msg_map_id) override {
if (message == WM_NCHITTEST)
saw_message = true;
@@ -54,7 +54,7 @@
UINT message,
WPARAM w_param,
LPARAM l_param,
- LRESULT* l_result) OVERRIDE {
+ LRESULT* l_result) override {
if (message == WM_NCHITTEST) {
saw_message = true;
return consume_messages;
diff --git a/ui/base/x/selection_requestor_unittest.cc b/ui/base/x/selection_requestor_unittest.cc
index fe6ee42..f2c7b03 100644
--- a/ui/base/x/selection_requestor_unittest.cc
+++ b/ui/base/x/selection_requestor_unittest.cc
@@ -65,7 +65,7 @@
}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Make X11 synchronous for our display connection.
XSynchronize(x_display_, True);
@@ -85,7 +85,7 @@
requestor_.reset(new SelectionRequestor(x_display_, x_window_, NULL));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
requestor_.reset();
event_source_.reset();
XDestroyWindow(x_display_, x_window_);
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index 524edb6..c595e9d 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -43,12 +43,13 @@
#include "ui/events/x/device_data_manager_x11.h"
#include "ui/events/x/touch_factory_x11.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
+#include "ui/gfx/geometry/point.h"
+#include "ui/gfx/geometry/point_conversions.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_rep.h"
-#include "ui/gfx/point.h"
-#include "ui/gfx/point_conversions.h"
-#include "ui/gfx/rect.h"
-#include "ui/gfx/size.h"
#include "ui/gfx/skia_util.h"
#include "ui/gfx/x/x11_error_tracker.h"
@@ -580,7 +581,7 @@
XDisplay* display = gfx::GetXDisplay();
XID root_window = GetX11RootWindow();
gfx::Rect root_bounds;
- if (!GetWindowRect(root_window, &root_bounds)) {
+ if (!GetOuterWindowBounds(root_window, &root_bounds)) {
LOG(ERROR) << "Failed to get the bounds of the X11 root window";
return;
}
@@ -624,7 +625,7 @@
window_desktop == current_desktop);
}
-bool GetWindowRect(XID window, gfx::Rect* rect) {
+bool GetInnerWindowBounds(XID window, gfx::Rect* rect) {
Window root, child;
int x, y;
unsigned int width, height;
@@ -640,11 +641,31 @@
*rect = gfx::Rect(x, y, width, height);
+ return true;
+}
+
+bool GetWindowExtents(XID window, gfx::Insets* extents) {
std::vector<int> insets;
- if (GetIntArrayProperty(window, "_NET_FRAME_EXTENTS", &insets) &&
- insets.size() == 4) {
- rect->Inset(-insets[0], -insets[2], -insets[1], -insets[3]);
- }
+ if (!GetIntArrayProperty(window, "_NET_FRAME_EXTENTS", &insets))
+ return false;
+ if (insets.size() != 4)
+ return false;
+
+ int left = insets[0];
+ int right = insets[1];
+ int top = insets[2];
+ int bottom = insets[3];
+ extents->Set(-top, -left, -bottom, -right);
+ return true;
+}
+
+bool GetOuterWindowBounds(XID window, gfx::Rect* rect) {
+ if (!GetInnerWindowBounds(window, rect))
+ return false;
+
+ gfx::Insets extents;
+ if (GetWindowExtents(window, &extents))
+ rect->Inset(extents);
// Not all window managers support _NET_FRAME_EXTENTS so return true even if
// requesting the property fails.
@@ -656,7 +677,7 @@
TRACE_EVENT0("ui", "WindowContainsPoint");
gfx::Rect window_rect;
- if (!GetWindowRect(window, &window_rect))
+ if (!GetOuterWindowBounds(window, &window_rect))
return false;
if (!window_rect.Contains(screen_loc))
@@ -1297,7 +1318,7 @@
}
gfx::Rect window_rect;
- if (!ui::GetWindowRect(window, &window_rect))
+ if (!ui::GetOuterWindowBounds(window, &window_rect))
return false;
// We can't use gfx::Screen here because we don't have an aura::Window. So
diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h
index 42e928f5..1346f74 100644
--- a/ui/base/x/x11_util.h
+++ b/ui/base/x/x11_util.h
@@ -20,7 +20,6 @@
#include "ui/base/ui_base_export.h"
#include "ui/events/event_constants.h"
#include "ui/events/keycodes/keyboard_codes.h"
-#include "ui/gfx/point.h"
#include "ui/gfx/x/x11_types.h"
typedef unsigned long XSharedMemoryId; // ShmSeg in the X headers.
@@ -30,6 +29,7 @@
namespace gfx {
class Canvas;
+class Insets;
class Point;
class Rect;
}
@@ -121,8 +121,17 @@
// Returns true if |window| is visible.
UI_BASE_EXPORT bool IsWindowVisible(XID window);
-// Returns the bounds of |window|.
-UI_BASE_EXPORT bool GetWindowRect(XID window, gfx::Rect* rect);
+// Returns the inner bounds of |window| (excluding the non-client area).
+UI_BASE_EXPORT bool GetInnerWindowBounds(XID window, gfx::Rect* rect);
+
+// Returns the non-client area extents of |window|. This is a negative inset; it
+// represents the negative size of the window border on all sides.
+// InnerWindowBounds.Inset(WindowExtents) = OuterWindowBounds.
+// Returns false if the window manager does not provide extents information.
+UI_BASE_EXPORT bool GetWindowExtents(XID window, gfx::Insets* extents);
+
+// Returns the outer bounds of |window| (including the non-client area).
+UI_BASE_EXPORT bool GetOuterWindowBounds(XID window, gfx::Rect* rect);
// Returns true if |window| contains the point |screen_loc|.
UI_BASE_EXPORT bool WindowContainsPoint(XID window, gfx::Point screen_loc);
@@ -295,8 +304,8 @@
: x11_data_(length ? x11_data : NULL), length_(length) {}
// Overridden from RefCountedMemory:
- virtual const unsigned char* front() const OVERRIDE;
- virtual size_t size() const OVERRIDE;
+ virtual const unsigned char* front() const override;
+ virtual size_t size() const override;
private:
virtual ~XRefcountedMemory();
diff --git a/ui/chromeos/network/network_icon.cc b/ui/chromeos/network/network_icon.cc
index 3d274d5..c5cddd6 100644
--- a/ui/chromeos/network/network_icon.cc
+++ b/ui/chromeos/network/network_icon.cc
@@ -214,7 +214,7 @@
: size_(size) {
}
- virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual gfx::ImageSkiaRep GetImageForScale(float scale) override {
gfx::Size pixel_size = gfx::ToFlooredSize(gfx::ScaleSize(size_, scale));
SkBitmap empty_bitmap = GetEmptyBitmap(pixel_size);
return gfx::ImageSkiaRep(empty_bitmap, scale);
@@ -237,7 +237,7 @@
// TODO(pkotwicz): Figure out what to do when a new image resolution becomes
// available.
- virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual gfx::ImageSkiaRep GetImageForScale(float scale) override {
gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale);
if (icon_rep.is_null())
return gfx::ImageSkiaRep();
diff --git a/ui/chromeos/network/network_icon_animation.h b/ui/chromeos/network/network_icon_animation.h
index ad73bb2..8877f5d 100644
--- a/ui/chromeos/network/network_icon_animation.h
+++ b/ui/chromeos/network/network_icon_animation.h
@@ -33,7 +33,7 @@
void RemoveObserver(AnimationObserver* observer);
// gfx::AnimationDelegate implementation.
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
static NetworkIconAnimation* GetInstance();
diff --git a/ui/chromeos/network/network_list.h b/ui/chromeos/network/network_list.h
index 96e9ea1..ca98f5d 100644
--- a/ui/chromeos/network/network_list.h
+++ b/ui/chromeos/network/network_list.h
@@ -51,7 +51,7 @@
bool UpdateInfoLabel(int message_id, int index, views::Label** label);
// network_icon::AnimationObserver:
- virtual void NetworkIconChanged() OVERRIDE;
+ virtual void NetworkIconChanged() override;
NetworkListDelegate* delegate_;
views::View* content_;
diff --git a/ui/chromeos/touch_exploration_controller.cc b/ui/chromeos/touch_exploration_controller.cc
index e9d3e4f..c90e07b 100644
--- a/ui/chromeos/touch_exploration_controller.cc
+++ b/ui/chromeos/touch_exploration_controller.cc
@@ -768,8 +768,8 @@
}
void TouchExplorationController::DispatchEvent(ui::Event* event) {
- ui::EventDispatchDetails result ALLOW_UNUSED =
- root_window_->GetHost()->dispatcher()->OnEventFromSource(event);
+ ignore_result(
+ root_window_->GetHost()->dispatcher()->OnEventFromSource(event));
}
// This is an override for a function that is only called for timer-based events
diff --git a/ui/chromeos/touch_exploration_controller.h b/ui/chromeos/touch_exploration_controller.h
index 3cf4be0..2f428a5 100644
--- a/ui/chromeos/touch_exploration_controller.h
+++ b/ui/chromeos/touch_exploration_controller.h
@@ -177,9 +177,9 @@
// Overridden from ui::EventRewriter
virtual ui::EventRewriteStatus RewriteEvent(
const ui::Event& event,
- scoped_ptr<ui::Event>* rewritten_event) OVERRIDE;
+ scoped_ptr<ui::Event>* rewritten_event) override;
virtual ui::EventRewriteStatus NextDispatchEvent(
- const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) OVERRIDE;
+ const ui::Event& last_event, scoped_ptr<ui::Event>* new_event) override;
// Event handlers based on the current state - see State, below.
ui::EventRewriteStatus InNoFingersDown(
@@ -235,7 +235,7 @@
// the user moves fast enough to trigger a gesture. After the user
// completes their gesture, this method will decide what keyboard
// input their gesture corresponded to.
- virtual void OnGestureEvent(ui::GestureEvent* gesture) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* gesture) override;
// Process the gesture events that have been created.
void ProcessGestureEvents();
diff --git a/ui/chromeos/touch_exploration_controller_unittest.cc b/ui/chromeos/touch_exploration_controller_unittest.cc
index c43885e..3fabbe7 100644
--- a/ui/chromeos/touch_exploration_controller_unittest.cc
+++ b/ui/chromeos/touch_exploration_controller_unittest.cc
@@ -33,7 +33,7 @@
events_.clear();
}
- virtual void OnEvent(ui::Event* event) OVERRIDE {
+ virtual void OnEvent(ui::Event* event) override {
if (event->IsMouseEvent()) {
events_.push_back(
new ui::MouseEvent(static_cast<ui::MouseEvent&>(*event)));
@@ -75,21 +75,21 @@
class MockTouchExplorationControllerDelegate
: public ui::TouchExplorationControllerDelegate {
public:
- virtual void SetOutputLevel(int volume) OVERRIDE {
+ virtual void SetOutputLevel(int volume) override {
volume_changes_.push_back(volume);
}
- virtual void SilenceSpokenFeedback() OVERRIDE {
+ virtual void SilenceSpokenFeedback() override {
}
- virtual void PlayVolumeAdjustEarcon() OVERRIDE {
+ virtual void PlayVolumeAdjustEarcon() override {
++num_times_adjust_sound_played_;
}
- virtual void PlayPassthroughEarcon() OVERRIDE {
+ virtual void PlayPassthroughEarcon() override {
++num_times_passthrough_played_;
}
- virtual void PlayExitScreenEarcon() OVERRIDE {
+ virtual void PlayExitScreenEarcon() override {
++num_times_exit_screen_played_;
}
- virtual void PlayEnterScreenEarcon() OVERRIDE {
+ virtual void PlayEnterScreenEarcon() override {
++num_times_enter_screen_played_;
}
@@ -204,7 +204,7 @@
}
virtual ~TouchExplorationTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
if (gfx::GetGLImplementation() == gfx::kGLImplementationNone)
gfx::GLSurface::InitializeOneOffForTests();
aura::test::AuraTestBase::SetUp();
@@ -217,7 +217,7 @@
cursor_client()->DisableMouseEvents();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
root_window()->RemovePreTargetHandler(&event_capturer_);
SwitchTouchExplorationMode(false);
cursor_client_.reset();
diff --git a/ui/chromeos/user_activity_power_manager_notifier.h b/ui/chromeos/user_activity_power_manager_notifier.h
index 483f1b5..47cbcf9 100644
--- a/ui/chromeos/user_activity_power_manager_notifier.h
+++ b/ui/chromeos/user_activity_power_manager_notifier.h
@@ -26,7 +26,7 @@
virtual ~UserActivityPowerManagerNotifier();
// UserActivityObserver implementation.
- virtual void OnUserActivity(const Event* event) OVERRIDE;
+ virtual void OnUserActivity(const Event* event) override;
private:
::wm::UserActivityDetector* detector_; // not owned
diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn
index 6e89292..38b79ad 100644
--- a/ui/compositor/BUILD.gn
+++ b/ui/compositor/BUILD.gn
@@ -77,8 +77,6 @@
}
}
-if (false) {
-
source_set("test_support") {
testonly = true
sources = [
@@ -111,6 +109,7 @@
deps = [
"//base/test:test_support",
"//cc",
+ "//cc/surfaces",
"//cc:test_support",
"//skia",
"//testing/gtest",
@@ -134,8 +133,6 @@
}
}
-} # if (false)
-
# TODO(GYP) enable this when all dependencies are complete and it links.
#test("compositor_unittests") {
# sources = [
diff --git a/ui/compositor/closure_animation_observer.h b/ui/compositor/closure_animation_observer.h
index 320ea2b..638960a 100644
--- a/ui/compositor/closure_animation_observer.h
+++ b/ui/compositor/closure_animation_observer.h
@@ -23,7 +23,7 @@
virtual ~ClosureAnimationObserver();
// ImplicitAnimationObserver:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ virtual void OnImplicitAnimationsCompleted() override;
const base::Closure closure_;
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 1b6f342..41fa0eb 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -20,6 +20,7 @@
#include "cc/layers/layer.h"
#include "cc/output/begin_frame_args.h"
#include "cc/output/context_provider.h"
+#include "cc/surfaces/surface_id_allocator.h"
#include "cc/trees/layer_tree_host.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/compositor/compositor_observer.h"
@@ -68,12 +69,31 @@
namespace ui {
+class SatisfySwapPromise : public cc::SwapPromise {
+ public:
+ explicit SatisfySwapPromise(uint32_t id) : id_(id) {}
+
+ private:
+ virtual void DidSwap(cc::CompositorFrameMetadata* metadata) override {
+ metadata->satisfies_sequences.push_back(id_);
+ }
+
+ virtual void DidNotSwap(DidNotSwapReason reason) override {
+ // TODO(jbauman): Send to the SurfaceManager immediately.
+ DCHECK(false);
+ }
+ virtual int64 TraceId() const override { return 0; }
+ uint32_t id_;
+};
+
Compositor::Compositor(gfx::AcceleratedWidget widget,
ui::ContextFactory* context_factory,
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: context_factory_(context_factory),
root_layer_(NULL),
widget_(widget),
+ surface_id_allocator_(context_factory->CreateSurfaceIdAllocator()),
+ surface_sequence_number_(0),
compositor_thread_loop_(context_factory->GetCompositorMessageLoop()),
task_runner_(task_runner),
vsync_manager_(new CompositorVSyncManager()),
@@ -142,6 +162,7 @@
host_ = cc::LayerTreeHost::CreateThreaded(
this,
context_factory_->GetSharedBitmapManager(),
+ context_factory_->GetGpuMemoryBufferManager(),
settings,
task_runner_,
compositor_thread_loop_);
@@ -150,6 +171,7 @@
this,
this,
context_factory_->GetSharedBitmapManager(),
+ context_factory_->GetGpuMemoryBufferManager(),
settings,
task_runner_);
}
@@ -406,6 +428,16 @@
host_->SetDebugState(debug_state);
}
+cc::SurfaceSequence Compositor::InsertSurfaceSequenceForNextFrame() {
+ cc::SurfaceSequence sequence;
+ sequence.id_namespace = surface_id_allocator_->id_namespace();
+ sequence.sequence = ++surface_sequence_number_;
+ scoped_ptr<cc::SwapPromise> promise(
+ new SatisfySwapPromise(surface_sequence_number_));
+ host_->QueueSwapPromise(promise.Pass());
+ return sequence;
+}
+
scoped_refptr<CompositorLock> Compositor::GetCompositorLock() {
if (!compositor_lock_) {
compositor_lock_ = new CompositorLock(this);
diff --git a/ui/compositor/compositor.gyp b/ui/compositor/compositor.gyp
index 4a1437e..76cb687 100644
--- a/ui/compositor/compositor.gyp
+++ b/ui/compositor/compositor.gyp
@@ -14,6 +14,7 @@
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/cc/cc.gyp:cc',
+ '<(DEPTH)/cc/cc.gyp:cc_surfaces',
'<(DEPTH)/gpu/gpu.gyp:command_buffer_common',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
@@ -87,6 +88,7 @@
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/cc/cc.gyp:cc',
+ '<(DEPTH)/cc/cc.gyp:cc_surfaces',
'<(DEPTH)/cc/cc_tests.gyp:cc_test_support',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/testing/gtest.gyp:gtest',
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 541f19d..471cfa7 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -13,6 +13,7 @@
#include "base/observer_list.h"
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
+#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -33,10 +34,12 @@
namespace cc {
class ContextProvider;
+class GpuMemoryBufferManager;
class Layer;
class LayerTreeDebugState;
class LayerTreeHost;
class SharedBitmapManager;
+class SurfaceIdAllocator;
}
namespace gfx {
@@ -92,9 +95,15 @@
// Gets the shared bitmap manager for software mode.
virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0;
+ // Gets the GPU memory buffer manager.
+ virtual cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0;
+
// Gets the compositor message loop, or NULL if not using threaded
// compositing.
virtual base::MessageLoopProxy* GetCompositorMessageLoop() = 0;
+
+ // Creates a Surface ID allocator with a new namespace.
+ virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() = 0;
};
// This class represents a lock on the compositor, that can be used to prevent
@@ -228,31 +237,31 @@
void OnSwapBuffersAborted();
// LayerTreeHostClient implementation.
- virtual void WillBeginMainFrame(int frame_id) OVERRIDE {}
- virtual void DidBeginMainFrame() OVERRIDE {}
- virtual void BeginMainFrame(const cc::BeginFrameArgs& args) OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual void WillBeginMainFrame(int frame_id) override {}
+ virtual void DidBeginMainFrame() override {}
+ virtual void BeginMainFrame(const cc::BeginFrameArgs& args) override;
+ virtual void Layout() override;
virtual void ApplyViewportDeltas(
const gfx::Vector2d& inner_delta,
const gfx::Vector2d& outer_delta,
float page_scale,
- float top_controls_delta) OVERRIDE {}
+ float top_controls_delta) override {}
virtual void ApplyViewportDeltas(
const gfx::Vector2d& scroll_delta,
float page_scale,
- float top_controls_delta) OVERRIDE {}
- virtual void RequestNewOutputSurface(bool fallback) OVERRIDE;
- virtual void DidInitializeOutputSurface() OVERRIDE {}
- virtual void WillCommit() OVERRIDE {}
- virtual void DidCommit() OVERRIDE;
- virtual void DidCommitAndDrawFrame() OVERRIDE;
- virtual void DidCompleteSwapBuffers() OVERRIDE;
+ float top_controls_delta) override {}
+ virtual void RequestNewOutputSurface(bool fallback) override;
+ virtual void DidInitializeOutputSurface() override {}
+ virtual void WillCommit() override {}
+ virtual void DidCommit() override;
+ virtual void DidCommitAndDrawFrame() override;
+ virtual void DidCompleteSwapBuffers() override;
// cc::LayerTreeHostSingleThreadClient implementation.
- virtual void ScheduleComposite() OVERRIDE;
- virtual void ScheduleAnimation() OVERRIDE;
- virtual void DidPostSwapBuffers() OVERRIDE;
- virtual void DidAbortSwapBuffers() OVERRIDE;
+ virtual void ScheduleComposite() override;
+ virtual void ScheduleAnimation() override;
+ virtual void DidPostSwapBuffers() override;
+ virtual void DidAbortSwapBuffers() override;
int last_started_frame() { return last_started_frame_; }
int last_ended_frame() { return last_ended_frame_; }
@@ -266,6 +275,14 @@
return &layer_animator_collection_;
}
+ // Inserts a SurfaceSequence that will be satisfied on the next frame this
+ // compositor commits and swaps.
+ cc::SurfaceSequence InsertSurfaceSequenceForNextFrame();
+
+ cc::SurfaceIdAllocator* surface_id_allocator() {
+ return surface_id_allocator_.get();
+ }
+
private:
friend class base::RefCounted<Compositor>;
friend class CompositorLock;
@@ -290,6 +307,8 @@
ObserverList<CompositorAnimationObserver> animation_observer_list_;
gfx::AcceleratedWidget widget_;
+ scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
+ uint32_t surface_sequence_number_;
scoped_refptr<cc::Layer> root_web_layer_;
scoped_ptr<cc::LayerTreeHost> host_;
scoped_refptr<base::MessageLoopProxy> compositor_thread_loop_;
diff --git a/ui/compositor/float_animation_curve_adapter.h b/ui/compositor/float_animation_curve_adapter.h
index 9959772..84a9992 100644
--- a/ui/compositor/float_animation_curve_adapter.h
+++ b/ui/compositor/float_animation_curve_adapter.h
@@ -21,9 +21,9 @@
virtual ~FloatAnimationCurveAdapter() { }
// FloatAnimationCurve implementation.
- virtual double Duration() const OVERRIDE;
- virtual scoped_ptr<cc::AnimationCurve> Clone() const OVERRIDE;
- virtual float GetValue(double t) const OVERRIDE;
+ virtual double Duration() const override;
+ virtual scoped_ptr<cc::AnimationCurve> Clone() const override;
+ virtual float GetValue(double t) const override;
private:
gfx::Tween::Type tween_type_;
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index b08a3d0..dd0de44 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -77,7 +77,7 @@
owner_(NULL),
cc_layer_(NULL),
device_scale_factor_(1.0f) {
- CreateWebLayer();
+ CreateCcLayer();
}
Layer::Layer(LayerType type)
@@ -101,7 +101,7 @@
owner_(NULL),
cc_layer_(NULL),
device_scale_factor_(1.0f) {
- CreateWebLayer();
+ CreateCcLayer();
}
Layer::~Layer() {
@@ -491,6 +491,7 @@
new_layer->SetOpacity(cc_layer_->opacity());
new_layer->SetTransform(cc_layer_->transform());
new_layer->SetPosition(cc_layer_->position());
+ new_layer->SetBackgroundColor(cc_layer_->background_color());
cc_layer_ = new_layer.get();
content_layer_ = NULL;
@@ -529,8 +530,7 @@
const cc::TextureMailbox& mailbox,
scoped_ptr<cc::SingleReleaseCallback> release_callback,
gfx::Size texture_size_in_dip) {
- DCHECK_EQ(type_, LAYER_TEXTURED);
- DCHECK(!solid_color_layer_.get());
+ DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
DCHECK(mailbox.IsValid());
DCHECK(release_callback);
if (!texture_layer_.get()) {
@@ -558,7 +558,7 @@
void Layer::SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider,
gfx::Size frame_size_in_dip) {
- DCHECK_EQ(type_, LAYER_TEXTURED);
+ DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
scoped_refptr<cc::DelegatedRendererLayer> new_layer =
cc::DelegatedRendererLayer::Create(frame_provider);
@@ -570,7 +570,7 @@
}
void Layer::SetShowSurface(cc::SurfaceId id, gfx::Size frame_size_in_dip) {
- DCHECK_EQ(type_, LAYER_TEXTURED);
+ DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
scoped_refptr<cc::SurfaceLayer> new_layer = cc::SurfaceLayer::Create();
new_layer->SetSurfaceId(id);
@@ -581,17 +581,15 @@
RecomputeDrawsContentAndUVRect();
}
-void Layer::SetShowPaintedContent() {
- if (content_layer_.get())
+void Layer::SetShowSolidColorContent() {
+ DCHECK_EQ(type_, LAYER_SOLID_COLOR);
+
+ if (solid_color_layer_.get())
return;
- scoped_refptr<cc::Layer> new_layer;
- if (Layer::UsingPictureLayer())
- new_layer = cc::PictureLayer::Create(this);
- else
- new_layer = cc::ContentLayer::Create(this);
+ scoped_refptr<cc::SolidColorLayer> new_layer = cc::SolidColorLayer::Create();
SwitchToLayer(new_layer);
- content_layer_ = new_layer;
+ solid_color_layer_ = new_layer;
mailbox_ = cc::TextureMailbox();
if (mailbox_release_callback_) {
@@ -627,9 +625,8 @@
void Layer::SetColor(SkColor color) { GetAnimator()->SetColor(color); }
bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) {
- if (type_ == LAYER_SOLID_COLOR ||
- type_ == LAYER_NINE_PATCH ||
- (!delegate_ && !mailbox_.IsValid()))
+ if ((type_ == LAYER_SOLID_COLOR && !texture_layer_.get()) ||
+ type_ == LAYER_NINE_PATCH || (!delegate_ && !mailbox_.IsValid()))
return false;
damaged_region_.op(invalid_rect.x(),
@@ -745,7 +742,7 @@
class LayerDebugInfo : public base::debug::ConvertableToTraceFormat {
public:
explicit LayerDebugInfo(std::string name) : name_(name) { }
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+ virtual void AppendAsTraceFormat(std::string* out) const override {
base::DictionaryValue dictionary;
dictionary.SetString("layer_name", name_);
base::JSONWriter::Write(&dictionary, out);
@@ -873,7 +870,7 @@
void Layer::SetColorFromAnimation(SkColor color) {
DCHECK_EQ(type_, LAYER_SOLID_COLOR);
- solid_color_layer_->SetBackgroundColor(color);
+ cc_layer_->SetBackgroundColor(color);
SetFillsBoundsOpaquely(SkColorGetA(color) == 0xFF);
}
@@ -976,7 +973,7 @@
children_[i]->SendPendingThreadedAnimations();
}
-void Layer::CreateWebLayer() {
+void Layer::CreateCcLayer() {
if (type_ == LAYER_SOLID_COLOR) {
solid_color_layer_ = cc::SolidColorLayer::Create();
cc_layer_ = solid_color_layer_.get();
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h
index d009af4..ed75ff5 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -282,7 +282,8 @@
surface_layer_.get();
}
- void SetShowPaintedContent();
+ // Show a solid color instead of delegated or surface contents.
+ void SetShowSolidColorContent();
// Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR.
void SetColor(SkColor color);
@@ -327,9 +328,9 @@
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE;
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
- virtual bool FillsBoundsCompletely() const OVERRIDE;
+ ContentLayerClient::GraphicsContextStatus gc_status) override;
+ virtual void DidChangeLayerCanUseLCDText() override {}
+ virtual bool FillsBoundsCompletely() const override;
cc::Layer* cc_layer() { return cc_layer_; }
@@ -337,7 +338,7 @@
virtual bool PrepareTextureMailbox(
cc::TextureMailbox* mailbox,
scoped_ptr<cc::SingleReleaseCallback>* release_callback,
- bool use_shared_memory) OVERRIDE;
+ bool use_shared_memory) override;
float device_scale_factor() const { return device_scale_factor_; }
@@ -348,10 +349,10 @@
// LayerClient
virtual scoped_refptr<base::debug::ConvertableToTraceFormat>
- TakeDebugInfo() OVERRIDE;
+ TakeDebugInfo() override;
// LayerAnimationEventObserver
- virtual void OnAnimationStarted(const cc::AnimationEvent& event) OVERRIDE;
+ virtual void OnAnimationStarted(const cc::AnimationEvent& event) override;
// Whether this layer has animations waiting to get sent to its cc::Layer.
bool HasPendingThreadedAnimations() {
@@ -374,30 +375,30 @@
bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const;
// Implementation of LayerAnimatorDelegate
- virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) OVERRIDE;
+ virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) override;
virtual void SetTransformFromAnimation(
- const gfx::Transform& transform) OVERRIDE;
- virtual void SetOpacityFromAnimation(float opacity) OVERRIDE;
- virtual void SetVisibilityFromAnimation(bool visibility) OVERRIDE;
- virtual void SetBrightnessFromAnimation(float brightness) OVERRIDE;
- virtual void SetGrayscaleFromAnimation(float grayscale) OVERRIDE;
- virtual void SetColorFromAnimation(SkColor color) OVERRIDE;
- virtual void ScheduleDrawForAnimation() OVERRIDE;
- virtual const gfx::Rect& GetBoundsForAnimation() const OVERRIDE;
- virtual gfx::Transform GetTransformForAnimation() const OVERRIDE;
- virtual float GetOpacityForAnimation() const OVERRIDE;
- virtual bool GetVisibilityForAnimation() const OVERRIDE;
- virtual float GetBrightnessForAnimation() const OVERRIDE;
- virtual float GetGrayscaleForAnimation() const OVERRIDE;
- virtual SkColor GetColorForAnimation() const OVERRIDE;
- virtual float GetDeviceScaleFactor() const OVERRIDE;
+ const gfx::Transform& transform) override;
+ virtual void SetOpacityFromAnimation(float opacity) override;
+ virtual void SetVisibilityFromAnimation(bool visibility) override;
+ virtual void SetBrightnessFromAnimation(float brightness) override;
+ virtual void SetGrayscaleFromAnimation(float grayscale) override;
+ virtual void SetColorFromAnimation(SkColor color) override;
+ virtual void ScheduleDrawForAnimation() override;
+ virtual const gfx::Rect& GetBoundsForAnimation() const override;
+ virtual gfx::Transform GetTransformForAnimation() const override;
+ virtual float GetOpacityForAnimation() const override;
+ virtual bool GetVisibilityForAnimation() const override;
+ virtual float GetBrightnessForAnimation() const override;
+ virtual float GetGrayscaleForAnimation() const override;
+ virtual SkColor GetColorForAnimation() const override;
+ virtual float GetDeviceScaleFactor() const override;
virtual void AddThreadedAnimation(
- scoped_ptr<cc::Animation> animation) OVERRIDE;
- virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE;
- virtual LayerAnimatorCollection* GetLayerAnimatorCollection() OVERRIDE;
+ scoped_ptr<cc::Animation> animation) override;
+ virtual void RemoveThreadedAnimation(int animation_id) override;
+ virtual LayerAnimatorCollection* GetLayerAnimatorCollection() override;
// Creates a corresponding composited layer for |type_|.
- void CreateWebLayer();
+ void CreateCcLayer();
// Recomputes and sets to |cc_layer_|.
void RecomputeDrawsContentAndUVRect();
diff --git a/ui/compositor/layer_animation_element.cc b/ui/compositor/layer_animation_element.cc
index ade7765..b74aebc 100644
--- a/ui/compositor/layer_animation_element.cc
+++ b/ui/compositor/layer_animation_element.cc
@@ -35,13 +35,13 @@
virtual ~Pause() {}
private:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {}
virtual bool OnProgress(double t,
- LayerAnimationDelegate* delegate) OVERRIDE {
+ LayerAnimationDelegate* delegate) override {
return false;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnGetTarget(TargetValue* target) const override {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
DISALLOW_COPY_AND_ASSIGN(Pause);
};
@@ -57,21 +57,21 @@
virtual ~TransformTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetTransformForAnimation();
}
- virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) override {
delegate->SetTransformFromAnimation(
gfx::Tween::TransformValueBetween(t, start_, target_));
return true;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->transform = target_;
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
private:
gfx::Transform start_;
@@ -92,20 +92,20 @@
virtual ~InterpolatedTransformTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
}
- virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) override {
delegate->SetTransformFromAnimation(
interpolated_transform_->Interpolate(static_cast<float>(t)));
return true;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->transform = interpolated_transform_->Interpolate(1.0f);
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
private:
scoped_ptr<InterpolatedTransform> interpolated_transform_;
@@ -124,21 +124,21 @@
virtual ~BoundsTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetBoundsForAnimation();
}
- virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) override {
delegate->SetBoundsFromAnimation(
gfx::Tween::RectValueBetween(t, start_, target_));
return true;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->bounds = target_;
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
private:
gfx::Rect start_;
@@ -159,21 +159,21 @@
virtual ~OpacityTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetOpacityForAnimation();
}
- virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) override {
delegate->SetOpacityFromAnimation(
gfx::Tween::FloatValueBetween(t, start_, target_));
return true;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->opacity = target_;
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
private:
float start_;
@@ -194,20 +194,20 @@
virtual ~VisibilityTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetVisibilityForAnimation();
}
- virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) override {
delegate->SetVisibilityFromAnimation(t == 1.0 ? target_ : start_);
return t == 1.0;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->visibility = target_;
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
private:
bool start_;
@@ -228,21 +228,21 @@
virtual ~BrightnessTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetBrightnessForAnimation();
}
- virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) override {
delegate->SetBrightnessFromAnimation(
gfx::Tween::FloatValueBetween(t, start_, target_));
return true;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->brightness = target_;
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
private:
float start_;
@@ -263,21 +263,21 @@
virtual ~GrayscaleTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetGrayscaleForAnimation();
}
- virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) override {
delegate->SetGrayscaleFromAnimation(
gfx::Tween::FloatValueBetween(t, start_, target_));
return true;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->grayscale = target_;
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
private:
float start_;
@@ -298,21 +298,21 @@
virtual ~ColorTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetColorForAnimation();
}
- virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual bool OnProgress(double t, LayerAnimationDelegate* delegate) override {
delegate->SetColorFromAnimation(
gfx::Tween::ColorValueBetween(t, start_, target_));
return true;
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->color = target_;
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {}
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {}
private:
SkColor start_;
@@ -331,7 +331,7 @@
}
virtual ~ThreadedLayerAnimationElement() {}
- virtual bool IsThreaded() const OVERRIDE {
+ virtual bool IsThreaded() const override {
return (duration() != base::TimeDelta());
}
@@ -341,7 +341,7 @@
}
virtual bool OnProgress(double t,
- LayerAnimationDelegate* delegate) OVERRIDE {
+ LayerAnimationDelegate* delegate) override {
if (t < 1.0)
return false;
@@ -353,14 +353,14 @@
return true;
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {
if (delegate && Started()) {
delegate->RemoveThreadedAnimation(animation_id());
}
}
virtual void RequestEffectiveStart(
- LayerAnimationDelegate* delegate) OVERRIDE {
+ LayerAnimationDelegate* delegate) override {
DCHECK(animation_group_id());
if (duration() == base::TimeDelta()) {
set_effective_start_time(requested_start_time());
@@ -392,11 +392,11 @@
virtual ~ThreadedOpacityTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetOpacityForAnimation();
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {
if (delegate && Started()) {
ThreadedLayerAnimationElement::OnAbort(delegate);
delegate->SetOpacityFromAnimation(gfx::Tween::FloatValueBetween(
@@ -406,11 +406,11 @@
}
}
- virtual void OnEnd(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnEnd(LayerAnimationDelegate* delegate) override {
delegate->SetOpacityFromAnimation(target_);
}
- virtual scoped_ptr<cc::Animation> CreateCCAnimation() OVERRIDE {
+ virtual scoped_ptr<cc::Animation> CreateCCAnimation() override {
scoped_ptr<cc::AnimationCurve> animation_curve(
new FloatAnimationCurveAdapter(tween_type(),
start_,
@@ -424,7 +424,7 @@
return animation.Pass();
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->opacity = target_;
}
@@ -447,11 +447,11 @@
virtual ~ThreadedTransformTransition() {}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
start_ = delegate->GetTransformForAnimation();
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {
if (delegate && Started()) {
ThreadedLayerAnimationElement::OnAbort(delegate);
delegate->SetTransformFromAnimation(gfx::Tween::TransformValueBetween(
@@ -461,11 +461,11 @@
}
}
- virtual void OnEnd(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnEnd(LayerAnimationDelegate* delegate) override {
delegate->SetTransformFromAnimation(target_);
}
- virtual scoped_ptr<cc::Animation> CreateCCAnimation() OVERRIDE {
+ virtual scoped_ptr<cc::Animation> CreateCCAnimation() override {
scoped_ptr<cc::AnimationCurve> animation_curve(
new TransformAnimationCurveAdapter(tween_type(),
start_,
@@ -479,7 +479,7 @@
return animation.Pass();
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->transform = target_;
}
@@ -512,7 +512,7 @@
}
protected:
- virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnStart(LayerAnimationDelegate* delegate) override {
gfx::Transform start(delegate->GetTransformForAnimation());
effective_start_ = base_transform_ * start;
@@ -533,18 +533,18 @@
base_target_);
}
- virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnAbort(LayerAnimationDelegate* delegate) override {
if (delegate && Started()) {
ThreadedLayerAnimationElement::OnAbort(delegate);
delegate->SetTransformFromAnimation(ComputeCurrentTransform());
}
}
- virtual void OnEnd(LayerAnimationDelegate* delegate) OVERRIDE {
+ virtual void OnEnd(LayerAnimationDelegate* delegate) override {
delegate->SetTransformFromAnimation(computed_target_transform_);
}
- virtual scoped_ptr<cc::Animation> CreateCCAnimation() OVERRIDE {
+ virtual scoped_ptr<cc::Animation> CreateCCAnimation() override {
scoped_ptr<cc::Animation> animation(
cc::Animation::Create(animation_curve_->Clone(),
animation_id(),
@@ -553,7 +553,7 @@
return animation.Pass();
}
- virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
+ virtual void OnGetTarget(TargetValue* target) const override {
target->transform = computed_target_transform_;
}
diff --git a/ui/compositor/layer_animation_observer.h b/ui/compositor/layer_animation_observer.h
index 9ae389d..8db5a4a 100644
--- a/ui/compositor/layer_animation_observer.h
+++ b/ui/compositor/layer_animation_observer.h
@@ -43,7 +43,7 @@
// If the animator is destroyed during an animation, the animations are
// aborted. The resulting NotifyAborted notifications will NOT be sent to
- // this observer if this function returns false. NOTE: IF YOU OVERRIDE THIS
+ // this observer if this function returns false. NOTE: IF YOU override THIS
// FUNCTION TO RETURN TRUE, YOU MUST REMEMBER TO REMOVE YOURSELF AS AN
// OBSERVER WHEN YOU ARE DESTROYED.
virtual bool RequiresNotificationWhenAnimatorDestroyed() const;
@@ -117,15 +117,15 @@
// LayerAnimationObserver implementation
virtual void OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) OVERRIDE;
+ LayerAnimationSequence* sequence) override;
virtual void OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) OVERRIDE;
+ LayerAnimationSequence* sequence) override;
virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) OVERRIDE;
+ LayerAnimationSequence* sequence) override;
virtual void OnAttachedToSequence(
- LayerAnimationSequence* sequence) OVERRIDE;
+ LayerAnimationSequence* sequence) override;
virtual void OnDetachedFromSequence(
- LayerAnimationSequence* sequence) OVERRIDE;
+ LayerAnimationSequence* sequence) override;
// OnImplicitAnimationsCompleted is not fired unless the observer is active.
bool active() const { return active_; }
diff --git a/ui/compositor/layer_animator_collection.h b/ui/compositor/layer_animator_collection.h
index eef06fb..b7bfe2e 100644
--- a/ui/compositor/layer_animator_collection.h
+++ b/ui/compositor/layer_animator_collection.h
@@ -34,7 +34,7 @@
base::TimeTicks last_tick_time() const { return last_tick_time_; }
// CompositorAnimationObserver:
- virtual void OnAnimationStep(base::TimeTicks timestamp) OVERRIDE;
+ virtual void OnAnimationStep(base::TimeTicks timestamp) override;
private:
Compositor* compositor_;
diff --git a/ui/compositor/layer_animator_unittest.cc b/ui/compositor/layer_animator_unittest.cc
index c12647f..ad4ff61 100644
--- a/ui/compositor/layer_animator_unittest.cc
+++ b/ui/compositor/layer_animator_unittest.cc
@@ -80,11 +80,11 @@
private:
// ImplicitAnimationObserver implementation
- virtual void OnImplicitAnimationsCompleted() OVERRIDE {
+ virtual void OnImplicitAnimationsCompleted() override {
animations_completed_ = true;
}
- virtual bool RequiresNotificationWhenAnimatorDestroyed() const OVERRIDE {
+ virtual bool RequiresNotificationWhenAnimatorDestroyed() const override {
return notify_when_animator_destructed_;
}
@@ -102,17 +102,17 @@
}
virtual void OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) OVERRIDE {
+ LayerAnimationSequence* sequence) override {
animator_->StopAnimating();
}
virtual void OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) OVERRIDE {
+ LayerAnimationSequence* sequence) override {
animator_->StopAnimating();
}
virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) OVERRIDE {
+ LayerAnimationSequence* sequence) override {
}
private:
@@ -158,7 +158,7 @@
}
virtual void ProgressAnimation(LayerAnimationSequence* sequence,
- base::TimeTicks now) OVERRIDE {
+ base::TimeTicks now) override {
EXPECT_TRUE(HasAnimation(sequence));
LayerAnimator::ProgressAnimation(sequence, now);
}
@@ -1948,7 +1948,7 @@
max_width_(max_width) {
}
- virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) OVERRIDE {
+ virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) override {
TestLayerAnimationDelegate::SetBoundsFromAnimation(bounds);
if (bounds.width() > max_width_)
animator_->StopAnimating();
@@ -2282,19 +2282,19 @@
// LayerAnimationObserver implementation.
virtual void OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) OVERRIDE {
+ LayerAnimationSequence* sequence) override {
if (delete_on_animation_ended_)
delete this;
}
virtual void OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) OVERRIDE {
+ LayerAnimationSequence* sequence) override {
if (delete_on_animation_aborted_)
delete this;
}
virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) OVERRIDE {
+ LayerAnimationSequence* sequence) override {
if (delete_on_animation_scheduled_)
delete this;
}
@@ -2508,7 +2508,7 @@
virtual ~CollectionLayerAnimationDelegate() {}
// LayerAnimationDelegate:
- virtual LayerAnimatorCollection* GetLayerAnimatorCollection() OVERRIDE {
+ virtual LayerAnimatorCollection* GetLayerAnimatorCollection() override {
return &collection;
}
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index e83eb33..6ebe72b 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -62,17 +62,17 @@
virtual ~ColoredLayer() { }
// Overridden from LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override {
canvas->DrawColor(color_);
}
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
+ const gfx::Rect& damage_rect_in_dip) override {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {
}
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
+ virtual base::Closure PrepareForLayerBoundsChange() override {
return base::Closure();
}
@@ -92,7 +92,7 @@
virtual ~LayerWithRealCompositorTest() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
bool enable_pixel_output = true;
ui::ContextFactory* context_factory =
InitializeContextFactoryForTests(enable_pixel_output);
@@ -103,7 +103,7 @@
compositor_host_->Show();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
compositor_host_.reset();
TerminateContextFactoryForTests();
}
@@ -228,10 +228,10 @@
}
// Overridden from LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override {
SkISize size = canvas->sk_canvas()->getBaseLayerSize();
paint_size_ = gfx::Size(size.width(), size.height());
- canvas->FillRect(gfx::Rect(paint_size_), colors_[color_index_]);
+ canvas->DrawColor(colors_[color_index_]);
color_index_ = (color_index_ + 1) % static_cast<int>(colors_.size());
const SkMatrix& matrix = canvas->sk_canvas()->getTotalMatrix();
scale_x_ = matrix.getScaleX();
@@ -239,13 +239,13 @@
}
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
+ const gfx::Rect& damage_rect_in_dip) override {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {
device_scale_factor_ = device_scale_factor;
}
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
+ virtual base::Closure PrepareForLayerBoundsChange() override {
return base::Closure();
}
@@ -281,14 +281,15 @@
private:
// Overridden from LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override {
painted_ = true;
+ canvas->DrawColor(SK_ColorWHITE);
}
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
+ const gfx::Rect& damage_rect_in_dip) override {}
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {
}
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
+ virtual base::Closure PrepareForLayerBoundsChange() override {
return base::Closure();
}
@@ -305,11 +306,11 @@
private:
// Overridden from LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {}
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override {}
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {}
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
+ const gfx::Rect& damage_rect_in_dip) override {}
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
+ virtual base::Closure PrepareForLayerBoundsChange() override {
return base::Closure();
}
@@ -334,24 +335,24 @@
}
private:
- virtual void OnCompositingDidCommit(Compositor* compositor) OVERRIDE {
+ virtual void OnCompositingDidCommit(Compositor* compositor) override {
committed_ = true;
}
virtual void OnCompositingStarted(Compositor* compositor,
- base::TimeTicks start_time) OVERRIDE {
+ base::TimeTicks start_time) override {
started_ = true;
}
- virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE {
+ virtual void OnCompositingEnded(Compositor* compositor) override {
ended_ = true;
}
- virtual void OnCompositingAborted(Compositor* compositor) OVERRIDE {
+ virtual void OnCompositingAborted(Compositor* compositor) override {
aborted_ = true;
}
- virtual void OnCompositingLockStateChanged(Compositor* compositor) OVERRIDE {
+ virtual void OnCompositingLockStateChanged(Compositor* compositor) override {
}
bool committed_;
@@ -399,7 +400,7 @@
virtual ~LayerWithDelegateTest() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
bool enable_pixel_output = false;
ui::ContextFactory* context_factory =
InitializeContextFactoryForTests(enable_pixel_output);
@@ -410,7 +411,7 @@
compositor_host_->Show();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
compositor_host_.reset();
TerminateContextFactoryForTests();
}
@@ -607,12 +608,12 @@
LayerWithNullDelegateTest() {}
virtual ~LayerWithNullDelegateTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
LayerWithDelegateTest::SetUp();
default_layer_delegate_.reset(new NullLayerDelegate());
}
- virtual Layer* CreateLayer(LayerType type) OVERRIDE {
+ virtual Layer* CreateLayer(LayerType type) override {
Layer* layer = new Layer(type);
layer->set_delegate(default_layer_delegate_.get());
return layer;
@@ -630,7 +631,7 @@
return layer;
}
- virtual Layer* CreateNoTextureLayer(const gfx::Rect& bounds) OVERRIDE {
+ virtual Layer* CreateNoTextureLayer(const gfx::Rect& bounds) override {
Layer* layer = CreateLayer(LAYER_NOT_DRAWN);
layer->SetBounds(bounds);
return layer;
@@ -667,8 +668,7 @@
}
TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) {
- scoped_ptr<Layer> l1(CreateColorLayer(SK_ColorRED,
- gfx::Rect(20, 20, 400, 400)));
+ scoped_ptr<Layer> l1(CreateLayer(LAYER_SOLID_COLOR));
l1->SetFillsBoundsOpaquely(true);
l1->SetForceRenderSurface(true);
l1->SetVisible(false);
@@ -706,7 +706,7 @@
EXPECT_TRUE(callback1_run);
EXPECT_FALSE(callback2_run);
- l1->SetShowPaintedContent();
+ l1->SetShowSolidColorContent();
EXPECT_EQ(gfx::Point3F(), l1->cc_layer()->transform_origin());
EXPECT_TRUE(l1->cc_layer()->DrawsContent());
EXPECT_TRUE(l1->cc_layer()->contents_opaque());
@@ -1196,7 +1196,7 @@
private:
// Overridden from LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override {
paint_count_++;
if (!schedule_paint_rect_.IsEmpty()) {
layer_->SchedulePaint(schedule_paint_rect_);
@@ -1208,12 +1208,12 @@
}
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
+ const gfx::Rect& damage_rect_in_dip) override {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {
}
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
+ virtual base::Closure PrepareForLayerBoundsChange() override {
return base::Closure();
}
@@ -1491,15 +1491,16 @@
TEST_F(LayerWithDelegateTest, ExternalContent) {
scoped_ptr<Layer> root(CreateNoTextureLayer(gfx::Rect(0, 0, 1000, 1000)));
- scoped_ptr<Layer> child(CreateLayer(LAYER_TEXTURED));
+ scoped_ptr<Layer> child(CreateLayer(LAYER_SOLID_COLOR));
child->SetBounds(gfx::Rect(0, 0, 10, 10));
child->SetVisible(true);
root->Add(child.get());
- // The layer is already showing painted content, so the cc layer won't change.
+ // The layer is already showing solid color content, so the cc layer won't
+ // change.
scoped_refptr<cc::Layer> before = child->cc_layer();
- child->SetShowPaintedContent();
+ child->SetShowSolidColorContent();
EXPECT_TRUE(child->cc_layer());
EXPECT_EQ(before.get(), child->cc_layer());
@@ -1517,7 +1518,7 @@
// Changing to painted content should change the underlying cc layer.
before = child->cc_layer();
- child->SetShowPaintedContent();
+ child->SetShowSolidColorContent();
EXPECT_TRUE(child->cc_layer());
EXPECT_NE(before.get(), child->cc_layer());
}
@@ -1712,7 +1713,7 @@
FrameDamageCheckingDelegate() : delegated_frame_damage_called_(false) {}
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE {
+ const gfx::Rect& damage_rect_in_dip) override {
delegated_frame_damage_called_ = true;
delegated_frame_damage_rect_ = damage_rect_in_dip;
}
diff --git a/ui/compositor/scoped_layer_animation_settings.cc b/ui/compositor/scoped_layer_animation_settings.cc
index 487f96a..462f537 100644
--- a/ui/compositor/scoped_layer_animation_settings.cc
+++ b/ui/compositor/scoped_layer_animation_settings.cc
@@ -34,10 +34,10 @@
inverse_layers_.push_back(inverse_layer);
}
- virtual void OnImplicitAnimationsCompleted() OVERRIDE {}
+ virtual void OnImplicitAnimationsCompleted() override {}
virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) OVERRIDE {
+ LayerAnimationSequence* sequence) override {
DCHECK(base_layer_ != NULL)
<< "Must set base layer with ScopedLayerAnimationSettings::"
<< "SetInverslyAnimatedBaseLayer";
diff --git a/ui/compositor/test/draw_waiter_for_test.h b/ui/compositor/test/draw_waiter_for_test.h
index 051c58f..9d8c169 100644
--- a/ui/compositor/test/draw_waiter_for_test.h
+++ b/ui/compositor/test/draw_waiter_for_test.h
@@ -32,12 +32,12 @@
void WaitImpl(Compositor* compositor);
// CompositorObserver implementation.
- virtual void OnCompositingDidCommit(Compositor* compositor) OVERRIDE;
+ virtual void OnCompositingDidCommit(Compositor* compositor) override;
virtual void OnCompositingStarted(Compositor* compositor,
- base::TimeTicks start_time) OVERRIDE;
- virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE;
- virtual void OnCompositingAborted(Compositor* compositor) OVERRIDE;
- virtual void OnCompositingLockStateChanged(Compositor* compositor) OVERRIDE;
+ base::TimeTicks start_time) override;
+ virtual void OnCompositingEnded(Compositor* compositor) override;
+ virtual void OnCompositingAborted(Compositor* compositor) override;
+ virtual void OnCompositingLockStateChanged(Compositor* compositor) override;
scoped_ptr<base::RunLoop> wait_run_loop_;
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc
index fa2380f..3bf0d3e 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -6,7 +6,8 @@
#include "base/command_line.h"
#include "base/threading/thread.h"
-#include "cc/output/output_surface.h"
+#include "cc/surfaces/surface_id_allocator.h"
+#include "cc/test/pixel_test_output_surface.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "ui/compositor/compositor_switches.h"
#include "ui/compositor/reflector.h"
@@ -19,7 +20,7 @@
namespace ui {
InProcessContextFactory::InProcessContextFactory()
- : shared_bitmap_manager_(new cc::TestSharedBitmapManager()) {
+ : next_surface_id_namespace_(1u) {
DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone)
<< "If running tests, ensure that main() is calling "
<< "gfx::GLSurface::InitializeOneOffForTests()";
@@ -59,7 +60,7 @@
scoped_refptr<ContextProviderInProcess> context_provider =
ContextProviderInProcess::Create(context3d.Pass(), "UICompositor");
- return make_scoped_ptr(new cc::OutputSurface(context_provider));
+ return make_scoped_ptr(new cc::PixelTestOutputSurface(context_provider));
}
scoped_refptr<Reflector> InProcessContextFactory::CreateReflector(
@@ -93,7 +94,12 @@
bool InProcessContextFactory::DoesCreateTestContexts() { return false; }
cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() {
- return shared_bitmap_manager_.get();
+ return &shared_bitmap_manager_;
+}
+
+cc::GpuMemoryBufferManager*
+InProcessContextFactory::GetGpuMemoryBufferManager() {
+ return &gpu_memory_buffer_manager_;
}
base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() {
@@ -102,4 +108,10 @@
return compositor_thread_->message_loop_proxy().get();
}
+scoped_ptr<cc::SurfaceIdAllocator>
+InProcessContextFactory::CreateSurfaceIdAllocator() {
+ return make_scoped_ptr(
+ new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
+}
+
} // namespace ui
diff --git a/ui/compositor/test/in_process_context_factory.h b/ui/compositor/test/in_process_context_factory.h
index 1179729..70d7214 100644
--- a/ui/compositor/test/in_process_context_factory.h
+++ b/ui/compositor/test/in_process_context_factory.h
@@ -5,6 +5,8 @@
#ifndef UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_
#define UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_
+#include "cc/test/test_gpu_memory_buffer_manager.h"
+#include "cc/test/test_shared_bitmap_manager.h"
#include "ui/compositor/compositor.h"
namespace base {
@@ -27,25 +29,30 @@
// ContextFactory implementation
virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
Compositor* compositor,
- bool software_fallback) OVERRIDE;
+ bool software_fallback) override;
virtual scoped_refptr<Reflector> CreateReflector(
Compositor* mirrored_compositor,
- Layer* mirroring_layer) OVERRIDE;
- virtual void RemoveReflector(scoped_refptr<Reflector> reflector) OVERRIDE;
+ Layer* mirroring_layer) override;
+ virtual void RemoveReflector(scoped_refptr<Reflector> reflector) override;
virtual scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider()
- OVERRIDE;
- virtual void RemoveCompositor(Compositor* compositor) OVERRIDE;
- virtual bool DoesCreateTestContexts() OVERRIDE;
- virtual cc::SharedBitmapManager* GetSharedBitmapManager() OVERRIDE;
- virtual base::MessageLoopProxy* GetCompositorMessageLoop() OVERRIDE;
+ override;
+ virtual void RemoveCompositor(Compositor* compositor) override;
+ virtual bool DoesCreateTestContexts() override;
+ virtual cc::SharedBitmapManager* GetSharedBitmapManager() override;
+ virtual cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
+ virtual base::MessageLoopProxy* GetCompositorMessageLoop() override;
+ virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator()
+ override;
private:
scoped_ptr<base::Thread> compositor_thread_;
scoped_refptr<webkit::gpu::ContextProviderInProcess>
shared_main_thread_contexts_;
- scoped_ptr<cc::SharedBitmapManager> shared_bitmap_manager_;
+ cc::TestSharedBitmapManager shared_bitmap_manager_;
+ cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
+ uint32_t next_surface_id_namespace_;
DISALLOW_COPY_AND_ASSIGN(InProcessContextFactory);
};
diff --git a/ui/compositor/test/test_compositor_host_mac.mm b/ui/compositor/test/test_compositor_host_mac.mm
index d7b4ab2..da3a8c2 100644
--- a/ui/compositor/test/test_compositor_host_mac.mm
+++ b/ui/compositor/test/test_compositor_host_mac.mm
@@ -88,8 +88,8 @@
private:
// TestCompositorHost:
- virtual void Show() OVERRIDE;
- virtual ui::Compositor* GetCompositor() OVERRIDE;
+ virtual void Show() override;
+ virtual ui::Compositor* GetCompositor() override;
gfx::Rect bounds_;
diff --git a/ui/compositor/test/test_compositor_host_ozone.cc b/ui/compositor/test/test_compositor_host_ozone.cc
index de4721e..4871564 100644
--- a/ui/compositor/test/test_compositor_host_ozone.cc
+++ b/ui/compositor/test/test_compositor_host_ozone.cc
@@ -24,8 +24,8 @@
private:
// Overridden from TestCompositorHost:
- virtual void Show() OVERRIDE;
- virtual ui::Compositor* GetCompositor() OVERRIDE;
+ virtual void Show() override;
+ virtual ui::Compositor* GetCompositor() override;
void Draw();
diff --git a/ui/compositor/test/test_compositor_host_win.cc b/ui/compositor/test/test_compositor_host_win.cc
index 4693a03..99a5a85 100644
--- a/ui/compositor/test/test_compositor_host_win.cc
+++ b/ui/compositor/test/test_compositor_host_win.cc
@@ -29,10 +29,10 @@
}
// Overridden from TestCompositorHost:
- virtual void Show() OVERRIDE {
+ virtual void Show() override {
ShowWindow(hwnd(), SW_SHOWNORMAL);
}
- virtual ui::Compositor* GetCompositor() OVERRIDE {
+ virtual ui::Compositor* GetCompositor() override {
return compositor_.get();
}
diff --git a/ui/compositor/test/test_compositor_host_x11.cc b/ui/compositor/test/test_compositor_host_x11.cc
index 43b7429..d881d15 100644
--- a/ui/compositor/test/test_compositor_host_x11.cc
+++ b/ui/compositor/test/test_compositor_host_x11.cc
@@ -27,8 +27,8 @@
private:
// Overridden from TestCompositorHost:
- virtual void Show() OVERRIDE;
- virtual ui::Compositor* GetCompositor() OVERRIDE;
+ virtual void Show() override;
+ virtual ui::Compositor* GetCompositor() override;
void Draw();
diff --git a/ui/compositor/test/test_layer_animation_delegate.h b/ui/compositor/test/test_layer_animation_delegate.h
index 0732c99..3ccb108 100644
--- a/ui/compositor/test/test_layer_animation_delegate.h
+++ b/ui/compositor/test/test_layer_animation_delegate.h
@@ -19,27 +19,27 @@
virtual ~TestLayerAnimationDelegate();
// Implementation of LayerAnimationDelegate
- virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) OVERRIDE;
+ virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) override;
virtual void SetTransformFromAnimation(
- const gfx::Transform& transform) OVERRIDE;
- virtual void SetOpacityFromAnimation(float opacity) OVERRIDE;
- virtual void SetVisibilityFromAnimation(bool visibility) OVERRIDE;
- virtual void SetBrightnessFromAnimation(float brightness) OVERRIDE;
- virtual void SetGrayscaleFromAnimation(float grayscale) OVERRIDE;
- virtual void SetColorFromAnimation(SkColor color) OVERRIDE;
- virtual void ScheduleDrawForAnimation() OVERRIDE;
- virtual const gfx::Rect& GetBoundsForAnimation() const OVERRIDE;
- virtual gfx::Transform GetTransformForAnimation() const OVERRIDE;
- virtual float GetOpacityForAnimation() const OVERRIDE;
- virtual bool GetVisibilityForAnimation() const OVERRIDE;
- virtual float GetBrightnessForAnimation() const OVERRIDE;
- virtual float GetGrayscaleForAnimation() const OVERRIDE;
- virtual SkColor GetColorForAnimation() const OVERRIDE;
- virtual float GetDeviceScaleFactor() const OVERRIDE;
+ const gfx::Transform& transform) override;
+ virtual void SetOpacityFromAnimation(float opacity) override;
+ virtual void SetVisibilityFromAnimation(bool visibility) override;
+ virtual void SetBrightnessFromAnimation(float brightness) override;
+ virtual void SetGrayscaleFromAnimation(float grayscale) override;
+ virtual void SetColorFromAnimation(SkColor color) override;
+ virtual void ScheduleDrawForAnimation() override;
+ virtual const gfx::Rect& GetBoundsForAnimation() const override;
+ virtual gfx::Transform GetTransformForAnimation() const override;
+ virtual float GetOpacityForAnimation() const override;
+ virtual bool GetVisibilityForAnimation() const override;
+ virtual float GetBrightnessForAnimation() const override;
+ virtual float GetGrayscaleForAnimation() const override;
+ virtual SkColor GetColorForAnimation() const override;
+ virtual float GetDeviceScaleFactor() const override;
virtual void AddThreadedAnimation(
- scoped_ptr<cc::Animation> animation) OVERRIDE;
- virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE;
- virtual LayerAnimatorCollection* GetLayerAnimatorCollection() OVERRIDE;
+ scoped_ptr<cc::Animation> animation) override;
+ virtual void RemoveThreadedAnimation(int animation_id) override;
+ virtual LayerAnimatorCollection* GetLayerAnimatorCollection() override;
private:
gfx::Rect bounds_;
diff --git a/ui/compositor/test/test_layer_animation_observer.h b/ui/compositor/test/test_layer_animation_observer.h
index 52789f8..bfdcd28 100644
--- a/ui/compositor/test/test_layer_animation_observer.h
+++ b/ui/compositor/test/test_layer_animation_observer.h
@@ -20,15 +20,15 @@
virtual ~TestLayerAnimationObserver();
virtual void OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) OVERRIDE;
+ LayerAnimationSequence* sequence) override;
virtual void OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) OVERRIDE;
+ LayerAnimationSequence* sequence) override;
virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) OVERRIDE;
+ LayerAnimationSequence* sequence) override;
- virtual bool RequiresNotificationWhenAnimatorDestroyed() const OVERRIDE;
+ virtual bool RequiresNotificationWhenAnimatorDestroyed() const override;
const LayerAnimationSequence* last_ended_sequence() const {
return last_ended_sequence_;
diff --git a/ui/compositor/test/test_suite.h b/ui/compositor/test/test_suite.h
index 2d86fdc..3daf439 100644
--- a/ui/compositor/test/test_suite.h
+++ b/ui/compositor/test/test_suite.h
@@ -24,8 +24,8 @@
protected:
// Overridden from base::TestSuite:
- virtual void Initialize() OVERRIDE;
- virtual void Shutdown() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void Shutdown() override;
private:
scoped_ptr<base::MessageLoop> message_loop_;
diff --git a/ui/compositor/transform_animation_curve_adapter.cc b/ui/compositor/transform_animation_curve_adapter.cc
index e875ca0..e0ae5ef 100644
--- a/ui/compositor/transform_animation_curve_adapter.cc
+++ b/ui/compositor/transform_animation_curve_adapter.cc
@@ -71,7 +71,9 @@
target_value_.IsIdentityOrTranslation();
}
-bool TransformAnimationCurveAdapter::MaximumScale(float* max_scale) const {
+bool TransformAnimationCurveAdapter::MaximumTargetScale(
+ bool forward_direction,
+ float* max_scale) const {
return false;
}
@@ -134,7 +136,8 @@
base_curve_.IsTranslation();
}
-bool InverseTransformCurveAdapter::MaximumScale(float* max_scale) const {
+bool InverseTransformCurveAdapter::MaximumTargetScale(bool forward_direction,
+ float* max_scale) const {
return false;
}
diff --git a/ui/compositor/transform_animation_curve_adapter.h b/ui/compositor/transform_animation_curve_adapter.h
index c410ac0..6c63ba1 100644
--- a/ui/compositor/transform_animation_curve_adapter.h
+++ b/ui/compositor/transform_animation_curve_adapter.h
@@ -25,14 +25,15 @@
virtual ~TransformAnimationCurveAdapter();
// TransformAnimationCurve implementation.
- virtual double Duration() const OVERRIDE;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
- virtual gfx::Transform GetValue(double t) const OVERRIDE;
+ virtual double Duration() const override;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
+ virtual gfx::Transform GetValue(double t) const override;
virtual bool AnimatedBoundsForBox(const gfx::BoxF& box,
- gfx::BoxF* bounds) const OVERRIDE;
- virtual bool AffectsScale() const OVERRIDE;
- virtual bool IsTranslation() const OVERRIDE;
- virtual bool MaximumScale(float* max_scale) const OVERRIDE;
+ gfx::BoxF* bounds) const override;
+ virtual bool AffectsScale() const override;
+ virtual bool IsTranslation() const override;
+ virtual bool MaximumTargetScale(bool forward_direction,
+ float* max_scale) const override;
private:
gfx::Tween::Type tween_type_;
@@ -54,14 +55,15 @@
virtual ~InverseTransformCurveAdapter();
- virtual double Duration() const OVERRIDE;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
- virtual gfx::Transform GetValue(double t) const OVERRIDE;
+ virtual double Duration() const override;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
+ virtual gfx::Transform GetValue(double t) const override;
virtual bool AnimatedBoundsForBox(const gfx::BoxF& box,
- gfx::BoxF* bounds) const OVERRIDE;
- virtual bool AffectsScale() const OVERRIDE;
- virtual bool IsTranslation() const OVERRIDE;
- virtual bool MaximumScale(float* max_scale) const OVERRIDE;
+ gfx::BoxF* bounds) const override;
+ virtual bool AffectsScale() const override;
+ virtual bool IsTranslation() const override;
+ virtual bool MaximumTargetScale(bool forward_direction,
+ float* max_scale) const override;
private:
TransformAnimationCurveAdapter base_curve_;
diff --git a/ui/display/chromeos/display_configurator.h b/ui/display/chromeos/display_configurator.h
index bd0576c..bbc7b53 100644
--- a/ui/display/chromeos/display_configurator.h
+++ b/ui/display/chromeos/display_configurator.h
@@ -186,7 +186,7 @@
bool SetDisplayMode(MultipleDisplayState new_state);
// NativeDisplayDelegate::Observer overrides:
- virtual void OnConfigurationChanged() OVERRIDE;
+ virtual void OnConfigurationChanged() override;
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
diff --git a/ui/display/chromeos/display_configurator_unittest.cc b/ui/display/chromeos/display_configurator_unittest.cc
index 79cfd7b..7ecb145 100644
--- a/ui/display/chromeos/display_configurator_unittest.cc
+++ b/ui/display/chromeos/display_configurator_unittest.cc
@@ -154,24 +154,24 @@
void set_hdcp_state(HDCPState state) { hdcp_state_ = state; }
// DisplayConfigurator::Delegate overrides:
- virtual void Initialize() OVERRIDE { log_->AppendAction(kInitXRandR); }
- virtual void GrabServer() OVERRIDE { log_->AppendAction(kGrab); }
- virtual void UngrabServer() OVERRIDE { log_->AppendAction(kUngrab); }
- virtual void SyncWithServer() OVERRIDE { log_->AppendAction(kSync); }
- virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE {
+ virtual void Initialize() override { log_->AppendAction(kInitXRandR); }
+ virtual void GrabServer() override { log_->AppendAction(kGrab); }
+ virtual void UngrabServer() override { log_->AppendAction(kUngrab); }
+ virtual void SyncWithServer() override { log_->AppendAction(kSync); }
+ virtual void SetBackgroundColor(uint32_t color_argb) override {
log_->AppendAction(GetBackgroundAction(color_argb));
}
- virtual void ForceDPMSOn() OVERRIDE { log_->AppendAction(kForceDPMS); }
- virtual std::vector<DisplaySnapshot*> GetDisplays() OVERRIDE {
+ virtual void ForceDPMSOn() override { log_->AppendAction(kForceDPMS); }
+ virtual std::vector<DisplaySnapshot*> GetDisplays() override {
return outputs_;
}
virtual void AddMode(const DisplaySnapshot& output,
- const DisplayMode* mode) OVERRIDE {
+ const DisplayMode* mode) override {
log_->AppendAction(GetAddOutputModeAction(output, mode));
}
virtual bool Configure(const DisplaySnapshot& output,
const DisplayMode* mode,
- const gfx::Point& origin) OVERRIDE {
+ const gfx::Point& origin) override {
log_->AppendAction(GetCrtcAction(output, mode, origin));
if (max_configurable_pixels_ == 0)
@@ -182,38 +182,38 @@
return mode->size().GetArea() <= max_configurable_pixels_;
}
- virtual void CreateFrameBuffer(const gfx::Size& size) OVERRIDE {
+ virtual void CreateFrameBuffer(const gfx::Size& size) override {
log_->AppendAction(
GetFramebufferAction(size,
outputs_.size() >= 1 ? outputs_[0] : NULL,
outputs_.size() >= 2 ? outputs_[1] : NULL));
}
virtual bool GetHDCPState(const DisplaySnapshot& output,
- HDCPState* state) OVERRIDE {
+ HDCPState* state) override {
*state = hdcp_state_;
return true;
}
virtual bool SetHDCPState(const DisplaySnapshot& output,
- HDCPState state) OVERRIDE {
+ HDCPState state) override {
log_->AppendAction(GetSetHDCPStateAction(output, state));
return true;
}
virtual std::vector<ui::ColorCalibrationProfile>
- GetAvailableColorCalibrationProfiles(const DisplaySnapshot& output) OVERRIDE {
+ GetAvailableColorCalibrationProfiles(const DisplaySnapshot& output) override {
return std::vector<ui::ColorCalibrationProfile>();
}
virtual bool SetColorCalibrationProfile(
const DisplaySnapshot& output,
- ui::ColorCalibrationProfile new_profile) OVERRIDE {
+ ui::ColorCalibrationProfile new_profile) override {
return false;
}
- virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE {}
+ virtual void AddObserver(NativeDisplayObserver* observer) override {}
- virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE {}
+ virtual void RemoveObserver(NativeDisplayObserver* observer) override {}
private:
// Outputs to be returned by GetDisplays().
@@ -262,13 +262,13 @@
// DisplayConfigurator::Observer overrides:
virtual void OnDisplayModeChanged(
- const DisplayConfigurator::DisplayStateList& outputs) OVERRIDE {
+ const DisplayConfigurator::DisplayStateList& outputs) override {
num_changes_++;
latest_outputs_ = outputs;
}
virtual void OnDisplayModeChangeFailed(MultipleDisplayState failed_new_state)
- OVERRIDE {
+ override {
num_failures_++;
latest_failed_state_ = failed_new_state;
}
@@ -296,11 +296,11 @@
// DisplayConfigurator::StateController overrides:
virtual MultipleDisplayState GetStateForDisplayIds(
- const std::vector<int64_t>& outputs) const OVERRIDE {
+ const std::vector<int64_t>& outputs) const override {
return state_;
}
virtual bool GetResolutionForDisplayId(int64_t display_id,
- gfx::Size* size) const OVERRIDE {
+ gfx::Size* size) const override {
return false;
}
@@ -316,11 +316,11 @@
TestMirroringController() : software_mirroring_enabled_(false) {}
virtual ~TestMirroringController() {}
- virtual void SetSoftwareMirroring(bool enabled) OVERRIDE {
+ virtual void SetSoftwareMirroring(bool enabled) override {
software_mirroring_enabled_ = enabled;
}
- virtual bool SoftwareMirroringEnabled() const OVERRIDE {
+ virtual bool SoftwareMirroringEnabled() const override {
return software_mirroring_enabled_;
}
@@ -339,7 +339,7 @@
test_api_(&configurator_) {}
virtual ~DisplayConfiguratorTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
log_.reset(new ActionLogger());
native_display_delegate_ = new TestNativeDisplayDelegate(log_.get());
diff --git a/ui/display/chromeos/test/test_display_snapshot.h b/ui/display/chromeos/test/test_display_snapshot.h
index 3d52f79..95653ca 100644
--- a/ui/display/chromeos/test/test_display_snapshot.h
+++ b/ui/display/chromeos/test/test_display_snapshot.h
@@ -39,7 +39,7 @@
}
// DisplaySnapshot overrides:
- virtual std::string ToString() const OVERRIDE;
+ virtual std::string ToString() const override;
private:
DISALLOW_COPY_AND_ASSIGN(TestDisplaySnapshot);
diff --git a/ui/display/chromeos/x11/display_snapshot_x11.h b/ui/display/chromeos/x11/display_snapshot_x11.h
index 01a44c6..50128b4 100644
--- a/ui/display/chromeos/x11/display_snapshot_x11.h
+++ b/ui/display/chromeos/x11/display_snapshot_x11.h
@@ -38,7 +38,7 @@
int index() const { return index_; }
// DisplaySnapshot overrides:
- virtual std::string ToString() const OVERRIDE;
+ virtual std::string ToString() const override;
private:
RROutput output_;
diff --git a/ui/display/chromeos/x11/native_display_delegate_x11.cc b/ui/display/chromeos/x11/native_display_delegate_x11.cc
index 6959f46..50dc322 100644
--- a/ui/display/chromeos/x11/native_display_delegate_x11.cc
+++ b/ui/display/chromeos/x11/native_display_delegate_x11.cc
@@ -83,14 +83,14 @@
// NativeDisplayDelegateX11::HelperDelegate overrides:
virtual void UpdateXRandRConfiguration(const base::NativeEvent& event)
- OVERRIDE {
+ override {
XRRUpdateConfiguration(event);
}
virtual const std::vector<DisplaySnapshot*>& GetCachedDisplays() const
- OVERRIDE {
+ override {
return delegate_->cached_outputs_.get();
}
- virtual void NotifyDisplayObservers() OVERRIDE {
+ virtual void NotifyDisplayObservers() override {
FOR_EACH_OBSERVER(
NativeDisplayObserver, delegate_->observers_, OnConfigurationChanged());
}
diff --git a/ui/display/chromeos/x11/native_display_delegate_x11.h b/ui/display/chromeos/x11/native_display_delegate_x11.h
index d349843..4208d38 100644
--- a/ui/display/chromeos/x11/native_display_delegate_x11.h
+++ b/ui/display/chromeos/x11/native_display_delegate_x11.h
@@ -68,31 +68,31 @@
virtual ~NativeDisplayDelegateX11();
// NativeDisplayDelegate overrides:
- virtual void Initialize() OVERRIDE;
- virtual void GrabServer() OVERRIDE;
- virtual void UngrabServer() OVERRIDE;
- virtual void SyncWithServer() OVERRIDE;
- virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE;
- virtual void ForceDPMSOn() OVERRIDE;
- virtual std::vector<DisplaySnapshot*> GetDisplays() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void GrabServer() override;
+ virtual void UngrabServer() override;
+ virtual void SyncWithServer() override;
+ virtual void SetBackgroundColor(uint32_t color_argb) override;
+ virtual void ForceDPMSOn() override;
+ virtual std::vector<DisplaySnapshot*> GetDisplays() override;
virtual void AddMode(const DisplaySnapshot& output,
- const DisplayMode* mode) OVERRIDE;
+ const DisplayMode* mode) override;
virtual bool Configure(const DisplaySnapshot& output,
const DisplayMode* mode,
- const gfx::Point& origin) OVERRIDE;
- virtual void CreateFrameBuffer(const gfx::Size& size) OVERRIDE;
+ const gfx::Point& origin) override;
+ virtual void CreateFrameBuffer(const gfx::Size& size) override;
virtual bool GetHDCPState(const DisplaySnapshot& output,
- HDCPState* state) OVERRIDE;
+ HDCPState* state) override;
virtual bool SetHDCPState(const DisplaySnapshot& output,
- HDCPState state) OVERRIDE;
+ HDCPState state) override;
virtual std::vector<ColorCalibrationProfile>
GetAvailableColorCalibrationProfiles(
- const DisplaySnapshot& output) OVERRIDE;
+ const DisplaySnapshot& output) override;
virtual bool SetColorCalibrationProfile(
const DisplaySnapshot& output,
- ColorCalibrationProfile new_profile) OVERRIDE;
- virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE;
- virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE;
+ ColorCalibrationProfile new_profile) override;
+ virtual void AddObserver(NativeDisplayObserver* observer) override;
+ virtual void RemoveObserver(NativeDisplayObserver* observer) override;
private:
class HelperDelegateX11;
diff --git a/ui/display/chromeos/x11/native_display_event_dispatcher_x11.h b/ui/display/chromeos/x11/native_display_event_dispatcher_x11.h
index e490074..e3ff9c0 100644
--- a/ui/display/chromeos/x11/native_display_event_dispatcher_x11.h
+++ b/ui/display/chromeos/x11/native_display_event_dispatcher_x11.h
@@ -25,8 +25,8 @@
virtual ~NativeDisplayEventDispatcherX11();
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override;
void SetTickClockForTest(scoped_ptr<base::TickClock> tick_clock);
diff --git a/ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc b/ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
index d7cf589..45bca9f 100644
--- a/ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
+++ b/ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
@@ -58,10 +58,10 @@
// NativeDisplayDelegateX11::HelperDelegate overrides:
virtual void UpdateXRandRConfiguration(const base::NativeEvent& event)
- OVERRIDE;
+ override;
virtual const std::vector<DisplaySnapshot*>& GetCachedDisplays() const
- OVERRIDE;
- virtual void NotifyDisplayObservers() OVERRIDE;
+ override;
+ virtual void NotifyDisplayObservers() override;
private:
int num_calls_update_xrandr_config_;
diff --git a/ui/events/BUILD.gn b/ui/events/BUILD.gn
index 7277cb3..c697e54 100644
--- a/ui/events/BUILD.gn
+++ b/ui/events/BUILD.gn
@@ -16,6 +16,8 @@
component("events_base") {
sources = [
+ "android/scroller.cc",
+ "android/scroller.h",
"device_data_manager.cc",
"device_data_manager.h",
"device_hotplug_event_observer.h",
@@ -23,6 +25,7 @@
"event_switches.cc",
"event_switches.h",
"events_base_export.h",
+ "gesture_curve.h",
"gesture_event_details.cc",
"gesture_event_details.h",
"gestures/fling_curve.cc",
@@ -273,6 +276,7 @@
test("events_unittests") {
sources = [
+ "android/scroller_unittest.cc",
"cocoa/events_mac_unittest.mm",
"event_dispatcher_unittest.cc",
"event_processor_unittest.cc",
diff --git a/ui/events/android/OWNERS b/ui/events/android/OWNERS
new file mode 100644
index 0000000..77debc1
--- /dev/null
+++ b/ui/events/android/OWNERS
@@ -0,0 +1 @@
+jdduke@chromium.org
diff --git a/ui/gfx/android/scroller.cc b/ui/events/android/scroller.cc
similarity index 86%
rename from ui/gfx/android/scroller.cc
rename to ui/events/android/scroller.cc
index b9aea38..17c457b 100644
--- a/ui/gfx/android/scroller.cc
+++ b/ui/events/android/scroller.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/android/scroller.h"
+#include "ui/events/android/scroller.h"
#include <cmath>
#include "base/lazy_instance.h"
-namespace gfx {
+namespace ui {
namespace {
// Default scroll duration from android.widget.Scroller.
@@ -122,9 +122,7 @@
}
private:
- enum {
- NUM_SAMPLES = 100
- };
+ enum { NUM_SAMPLES = 100 };
float spline_position_[NUM_SAMPLES + 1];
float spline_time_[NUM_SAMPLES + 1];
@@ -160,8 +158,8 @@
} // namespace
Scroller::Config::Config()
- : fling_friction(kDefaultFriction),
- flywheel_enabled(false) {}
+ : fling_friction(kDefaultFriction), flywheel_enabled(false) {
+}
Scroller::Scroller(const Config& config)
: mode_(UNDEFINED),
@@ -187,9 +185,27 @@
distance_(0),
fling_friction_(config.fling_friction),
deceleration_(ComputeDeceleration(fling_friction_)),
- tuning_coeff_(ComputeDeceleration(0.84f)) {}
+ tuning_coeff_(ComputeDeceleration(0.84f)) {
+}
-Scroller::~Scroller() {}
+Scroller::~Scroller() {
+}
+
+bool Scroller::ComputeScrollOffset(base::TimeTicks time,
+ gfx::Vector2dF* offset,
+ gfx::Vector2dF* velocity) {
+ DCHECK(offset);
+ DCHECK(velocity);
+ if (!ComputeScrollOffsetInternal(time)) {
+ *offset = gfx::Vector2dF(GetFinalX(), GetFinalY());
+ *velocity = gfx::Vector2dF();
+ return false;
+ }
+
+ *offset = gfx::Vector2dF(GetCurrX(), GetCurrY());
+ *velocity = gfx::Vector2dF(GetCurrVelocityX(), GetCurrVelocityY());
+ return true;
+}
void Scroller::StartScroll(float start_x,
float start_y,
@@ -210,6 +226,7 @@
float dy,
base::TimeTicks start_time,
base::TimeDelta duration) {
+ DCHECK_GT(duration.ToInternalValue(), 0);
mode_ = SCROLL_MODE;
finished_ = false;
duration_ = duration;
@@ -232,6 +249,8 @@
float min_y,
float max_y,
base::TimeTicks start_time) {
+ DCHECK(velocity_x || velocity_y);
+
// Continue a scroll or fling in progress.
if (flywheel_enabled_ && !finished_) {
float old_velocity_x = GetCurrVelocityX();
@@ -250,6 +269,7 @@
velocity_ = velocity;
duration_ = GetSplineFlingDuration(velocity);
+ DCHECK_GT(duration_.ToInternalValue(), 0);
duration_seconds_reciprocal_ = 1.0 / duration_.InSecondsF();
start_time_ = start_time;
curr_time_ = start_time_;
@@ -276,68 +296,6 @@
RecomputeDeltas();
}
-bool Scroller::ComputeScrollOffset(base::TimeTicks time) {
- if (finished_)
- return false;
-
- if (time == curr_time_)
- return true;
-
- base::TimeDelta time_passed = time - start_time_;
-
- if (time_passed < base::TimeDelta()) {
- time_passed = base::TimeDelta();
- }
-
- if (time_passed >= duration_) {
- curr_x_ = final_x_;
- curr_y_ = final_y_;
- curr_time_ = start_time_ + duration_;
- finished_ = true;
- return true;
- }
-
- curr_time_ = time;
-
- const float t = time_passed.InSecondsF() * duration_seconds_reciprocal_;
-
- switch (mode_) {
- case UNDEFINED:
- NOTREACHED() << "|StartScroll()| or |Fling()| must be called prior to "
- "scroll offset computation.";
- return false;
-
- case SCROLL_MODE: {
- float x = g_viscosity_constants.Get().ApplyViscosity(t);
-
- curr_x_ = start_x_ + x * delta_x_;
- curr_y_ = start_y_ + x * delta_y_;
- } break;
-
- case FLING_MODE: {
- float distance_coef = 1.f;
- float velocity_coef = 0.f;
- g_spline_constants.Get().CalculateCoefficients(
- t, &distance_coef, &velocity_coef);
-
- curr_velocity_ = velocity_coef * distance_ * duration_seconds_reciprocal_;
-
- curr_x_ = start_x_ + distance_coef * delta_x_;
- curr_x_ = Clamped(curr_x_, min_x_, max_x_);
-
- curr_y_ = start_y_ + distance_coef * delta_y_;
- curr_y_ = Clamped(curr_y_, min_y_, max_y_);
-
- float diff_x = std::abs(curr_x_ - final_x_);
- float diff_y = std::abs(curr_y_ - final_y_);
- if (diff_x < kThresholdForFlingEnd && diff_y < kThresholdForFlingEnd)
- finished_ = true;
- } break;
- }
-
- return true;
-}
-
void Scroller::ExtendDuration(base::TimeDelta extend) {
base::TimeDelta passed = GetTimePassed();
duration_ = passed + extend;
@@ -365,19 +323,29 @@
finished_ = true;
}
-void Scroller::ForceFinished(bool finished) { finished_ = finished; }
+void Scroller::ForceFinished(bool finished) {
+ finished_ = finished;
+}
-bool Scroller::IsFinished() const { return finished_; }
+bool Scroller::IsFinished() const {
+ return finished_;
+}
base::TimeDelta Scroller::GetTimePassed() const {
return curr_time_ - start_time_;
}
-base::TimeDelta Scroller::GetDuration() const { return duration_; }
+base::TimeDelta Scroller::GetDuration() const {
+ return duration_;
+}
-float Scroller::GetCurrX() const { return curr_x_; }
+float Scroller::GetCurrX() const {
+ return curr_x_;
+}
-float Scroller::GetCurrY() const { return curr_y_; }
+float Scroller::GetCurrY() const {
+ return curr_y_;
+}
float Scroller::GetCurrVelocity() const {
if (finished_)
@@ -395,19 +363,83 @@
return delta_y_norm_ * GetCurrVelocity();
}
-float Scroller::GetStartX() const { return start_x_; }
+float Scroller::GetStartX() const {
+ return start_x_;
+}
-float Scroller::GetStartY() const { return start_y_; }
+float Scroller::GetStartY() const {
+ return start_y_;
+}
-float Scroller::GetFinalX() const { return final_x_; }
+float Scroller::GetFinalX() const {
+ return final_x_;
+}
-float Scroller::GetFinalY() const { return final_y_; }
+float Scroller::GetFinalY() const {
+ return final_y_;
+}
bool Scroller::IsScrollingInDirection(float xvel, float yvel) const {
return !finished_ && Signum(xvel) == Signum(delta_x_) &&
Signum(yvel) == Signum(delta_y_);
}
+bool Scroller::ComputeScrollOffsetInternal(base::TimeTicks time) {
+ if (finished_)
+ return false;
+
+ if (time <= start_time_)
+ return true;
+
+ if (time == curr_time_)
+ return true;
+
+ base::TimeDelta time_passed = time - start_time_;
+ if (time_passed >= duration_) {
+ AbortAnimation();
+ return false;
+ }
+
+ curr_time_ = time;
+
+ const float u = time_passed.InSecondsF() * duration_seconds_reciprocal_;
+ switch (mode_) {
+ case UNDEFINED:
+ NOTREACHED() << "|StartScroll()| or |Fling()| must be called prior to "
+ "scroll offset computation.";
+ return false;
+
+ case SCROLL_MODE: {
+ float x = g_viscosity_constants.Get().ApplyViscosity(u);
+
+ curr_x_ = start_x_ + x * delta_x_;
+ curr_y_ = start_y_ + x * delta_y_;
+ } break;
+
+ case FLING_MODE: {
+ float distance_coef = 1.f;
+ float velocity_coef = 0.f;
+ g_spline_constants.Get().CalculateCoefficients(
+ u, &distance_coef, &velocity_coef);
+
+ curr_velocity_ = velocity_coef * distance_ * duration_seconds_reciprocal_;
+
+ curr_x_ = start_x_ + distance_coef * delta_x_;
+ curr_x_ = Clamped(curr_x_, min_x_, max_x_);
+
+ curr_y_ = start_y_ + distance_coef * delta_y_;
+ curr_y_ = Clamped(curr_y_, min_y_, max_y_);
+
+ float diff_x = std::abs(curr_x_ - final_x_);
+ float diff_y = std::abs(curr_y_ - final_y_);
+ if (diff_x < kThresholdForFlingEnd && diff_y < kThresholdForFlingEnd)
+ AbortAnimation();
+ } break;
+ }
+
+ return !finished_;
+}
+
void Scroller::RecomputeDeltas() {
delta_x_ = final_x_ - start_x_;
delta_y_ = final_y_ - start_y_;
@@ -441,4 +473,4 @@
std::exp(kDecelerationRate / decel_minus_one * l);
}
-} // namespace gfx
+} // namespace ui
diff --git a/ui/gfx/android/scroller.h b/ui/events/android/scroller.h
similarity index 85%
rename from ui/gfx/android/scroller.h
rename to ui/events/android/scroller.h
index 39d7255..f276a83 100644
--- a/ui/gfx/android/scroller.h
+++ b/ui/events/android/scroller.h
@@ -2,18 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_ANDROID_SCROLLER_H_
-#define UI_GFX_ANDROID_SCROLLER_H_
+#ifndef UI_EVENTS_ANDROID_SCROLLER_H_
+#define UI_EVENTS_ANDROID_SCROLLER_H_
#include "base/time/time.h"
-#include "ui/gfx/gfx_export.h"
+#include "ui/events/events_base_export.h"
+#include "ui/events/gesture_curve.h"
+#include "ui/gfx/geometry/vector2d_f.h"
-namespace gfx {
+namespace ui {
// Native port of android.widget.Scroller.
// * Change-Id: I4365946f890a76fcfa78ca9d69f2a8e0848095a9
// * Please update the Change-Id as upstream Android changes are pulled.
-class GFX_EXPORT Scroller {
+class EVENTS_BASE_EXPORT Scroller : public GestureCurve {
public:
struct Config {
Config();
@@ -26,7 +28,12 @@
};
explicit Scroller(const Config& config);
- ~Scroller();
+ virtual ~Scroller();
+
+ // GestureCurve implementation.
+ virtual bool ComputeScrollOffset(base::TimeTicks time,
+ gfx::Vector2dF* offset,
+ gfx::Vector2dF* velocity) override;
// Start scrolling by providing a starting point and the distance to travel.
// The default value of 250 milliseconds will be used for the duration.
@@ -57,10 +64,6 @@
float max_y,
base::TimeTicks start_time);
- // Call this when you want to know the new location. If it returns true,
- // the animation is not yet finished.
- bool ComputeScrollOffset(base::TimeTicks time);
-
// Extend the scroll animation by |extend|. This allows a running animation
// to scroll further and longer when used with |SetFinalX()| or |SetFinalY()|.
void ExtendDuration(base::TimeDelta extend);
@@ -102,7 +105,7 @@
FLING_MODE,
};
- void OnDurationChanged();
+ bool ComputeScrollOffsetInternal(base::TimeTicks time);
void RecomputeDeltas();
double GetSplineDeceleration(float velocity) const;
@@ -143,6 +146,6 @@
float tuning_coeff_;
};
-} // namespace gfx
+} // namespace ui
-#endif // UI_GFX_ANDROID_SCROLLER_H_
+#endif // UI_EVENTS_ANDROID_SCROLLER_H_
diff --git a/ui/events/android/scroller_unittest.cc b/ui/events/android/scroller_unittest.cc
new file mode 100644
index 0000000..759984e
--- /dev/null
+++ b/ui/events/android/scroller_unittest.cc
@@ -0,0 +1,176 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/time/time.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/events/android/scroller.h"
+
+namespace ui {
+namespace {
+
+const float kDefaultStartX = 7.f;
+const float kDefaultStartY = 25.f;
+const float kDefaultDeltaX = -20.f;
+const float kDefaultDeltaY = 73.f;
+const float kDefaultVelocityX = -350.f;
+const float kDefaultVelocityY = 220.f;
+const float kEpsilon = 1e-3f;
+
+Scroller::Config DefaultConfig() {
+ return Scroller::Config();
+}
+
+} // namespace
+
+class ScrollerTest : public testing::Test {};
+
+TEST_F(ScrollerTest, Scroll) {
+ Scroller scroller(DefaultConfig());
+ base::TimeTicks start_time = base::TimeTicks::Now();
+
+ // Start a scroll and verify initialized values.
+ scroller.StartScroll(kDefaultStartX,
+ kDefaultStartY,
+ kDefaultDeltaX,
+ kDefaultDeltaY,
+ start_time);
+
+ EXPECT_EQ(kDefaultStartX, scroller.GetStartX());
+ EXPECT_EQ(kDefaultStartY, scroller.GetStartY());
+ EXPECT_EQ(kDefaultStartX, scroller.GetCurrX());
+ EXPECT_EQ(kDefaultStartY, scroller.GetCurrY());
+ EXPECT_EQ(kDefaultStartX + kDefaultDeltaX, scroller.GetFinalX());
+ EXPECT_EQ(kDefaultStartY + kDefaultDeltaY, scroller.GetFinalY());
+ EXPECT_FALSE(scroller.IsFinished());
+ EXPECT_EQ(base::TimeDelta(), scroller.GetTimePassed());
+
+ // Advance halfway through the scroll.
+ const base::TimeDelta scroll_duration = scroller.GetDuration();
+ gfx::Vector2dF offset, velocity;
+ EXPECT_TRUE(scroller.ComputeScrollOffset(
+ start_time + scroll_duration / 2, &offset, &velocity));
+
+ // Ensure we've moved in the direction of the delta, but have yet to reach
+ // the target.
+ EXPECT_GT(kDefaultStartX, offset.x());
+ EXPECT_LT(kDefaultStartY, offset.y());
+ EXPECT_LT(scroller.GetFinalX(), offset.x());
+ EXPECT_GT(scroller.GetFinalY(), offset.y());
+ EXPECT_FALSE(scroller.IsFinished());
+
+ // Ensure our velocity is non-zero and in the same direction as the delta.
+ EXPECT_GT(0.f, velocity.x() * kDefaultDeltaX);
+ EXPECT_GT(0.f, velocity.y() * kDefaultDeltaY);
+ EXPECT_TRUE(scroller.IsScrollingInDirection(kDefaultDeltaX, kDefaultDeltaY));
+
+ // Repeated offset computations at the same timestamp should yield identical
+ // results.
+ float curr_x = offset.x();
+ float curr_y = offset.y();
+ float curr_velocity_x = velocity.x();
+ float curr_velocity_y = velocity.y();
+ EXPECT_TRUE(scroller.ComputeScrollOffset(
+ start_time + scroll_duration / 2, &offset, &velocity));
+ EXPECT_EQ(curr_x, offset.x());
+ EXPECT_EQ(curr_y, offset.y());
+ EXPECT_EQ(curr_velocity_x, velocity.x());
+ EXPECT_EQ(curr_velocity_y, velocity.y());
+
+ // Advance to the end.
+ EXPECT_FALSE(scroller.ComputeScrollOffset(
+ start_time + scroll_duration, &offset, &velocity));
+ EXPECT_EQ(scroller.GetFinalX(), offset.x());
+ EXPECT_EQ(scroller.GetFinalY(), offset.y());
+ EXPECT_TRUE(scroller.IsFinished());
+ EXPECT_EQ(scroll_duration, scroller.GetTimePassed());
+ EXPECT_NEAR(0.f, velocity.x(), kEpsilon);
+ EXPECT_NEAR(0.f, velocity.y(), kEpsilon);
+
+ // Try to advance further; nothing should change.
+ EXPECT_FALSE(scroller.ComputeScrollOffset(
+ start_time + scroll_duration * 2, &offset, &velocity));
+ EXPECT_EQ(scroller.GetFinalX(), offset.x());
+ EXPECT_EQ(scroller.GetFinalY(), offset.y());
+ EXPECT_TRUE(scroller.IsFinished());
+ EXPECT_EQ(scroll_duration, scroller.GetTimePassed());
+}
+
+TEST_F(ScrollerTest, Fling) {
+ Scroller scroller(DefaultConfig());
+ base::TimeTicks start_time = base::TimeTicks::Now();
+
+ // Start a fling and verify initialized values.
+ scroller.Fling(kDefaultStartX,
+ kDefaultStartY,
+ kDefaultVelocityX,
+ kDefaultVelocityY,
+ INT_MIN,
+ INT_MAX,
+ INT_MIN,
+ INT_MAX,
+ start_time);
+
+ EXPECT_EQ(kDefaultStartX, scroller.GetStartX());
+ EXPECT_EQ(kDefaultStartY, scroller.GetStartY());
+ EXPECT_EQ(kDefaultStartX, scroller.GetCurrX());
+ EXPECT_EQ(kDefaultStartY, scroller.GetCurrY());
+ EXPECT_GT(kDefaultStartX, scroller.GetFinalX());
+ EXPECT_LT(kDefaultStartY, scroller.GetFinalY());
+ EXPECT_FALSE(scroller.IsFinished());
+ EXPECT_EQ(base::TimeDelta(), scroller.GetTimePassed());
+
+ // Advance halfway through the fling.
+ const base::TimeDelta scroll_duration = scroller.GetDuration();
+ gfx::Vector2dF offset, velocity;
+ scroller.ComputeScrollOffset(
+ start_time + scroll_duration / 2, &offset, &velocity);
+
+ // Ensure we've moved in the direction of the velocity, but have yet to reach
+ // the target.
+ EXPECT_GT(kDefaultStartX, offset.x());
+ EXPECT_LT(kDefaultStartY, offset.y());
+ EXPECT_LT(scroller.GetFinalX(), offset.x());
+ EXPECT_GT(scroller.GetFinalY(), offset.y());
+ EXPECT_FALSE(scroller.IsFinished());
+
+ // Ensure our velocity is non-zero and in the same direction as the original
+ // velocity.
+ EXPECT_LT(0.f, velocity.x() * kDefaultVelocityX);
+ EXPECT_LT(0.f, velocity.y() * kDefaultVelocityY);
+ EXPECT_TRUE(
+ scroller.IsScrollingInDirection(kDefaultVelocityX, kDefaultVelocityY));
+
+ // Repeated offset computations at the same timestamp should yield identical
+ // results.
+ float curr_x = offset.x();
+ float curr_y = offset.y();
+ float curr_velocity_x = velocity.x();
+ float curr_velocity_y = velocity.y();
+ EXPECT_TRUE(scroller.ComputeScrollOffset(
+ start_time + scroll_duration / 2, &offset, &velocity));
+ EXPECT_EQ(curr_x, offset.x());
+ EXPECT_EQ(curr_y, offset.y());
+ EXPECT_EQ(curr_velocity_x, velocity.x());
+ EXPECT_EQ(curr_velocity_y, velocity.y());
+
+ // Advance to the end.
+ EXPECT_FALSE(scroller.ComputeScrollOffset(
+ start_time + scroll_duration, &offset, &velocity));
+ EXPECT_EQ(scroller.GetFinalX(), offset.x());
+ EXPECT_EQ(scroller.GetFinalY(), offset.y());
+ EXPECT_TRUE(scroller.IsFinished());
+ EXPECT_EQ(scroll_duration, scroller.GetTimePassed());
+ EXPECT_NEAR(0.f, velocity.x(), kEpsilon);
+ EXPECT_NEAR(0.f, velocity.y(), kEpsilon);
+
+ // Try to advance further; nothing should change.
+ EXPECT_FALSE(scroller.ComputeScrollOffset(
+ start_time + scroll_duration * 2, &offset, &velocity));
+ EXPECT_EQ(scroller.GetFinalX(), offset.x());
+ EXPECT_EQ(scroller.GetFinalY(), offset.y());
+ EXPECT_TRUE(scroller.IsFinished());
+ EXPECT_EQ(scroll_duration, scroller.GetTimePassed());
+}
+
+} // namespace ui
diff --git a/ui/events/device_data_manager.h b/ui/events/device_data_manager.h
index aae8272..54c139b 100644
--- a/ui/events/device_data_manager.h
+++ b/ui/events/device_data_manager.h
@@ -61,7 +61,7 @@
// DeviceHotplugEventObserver:
virtual void OnTouchscreenDevicesUpdated(
- const std::vector<TouchscreenDevice>& devices) OVERRIDE;
+ const std::vector<TouchscreenDevice>& devices) override;
double touch_radius_scale_map_[kMaxDeviceNum];
diff --git a/ui/events/event.h b/ui/events/event.h
index 8f2c79a..e970826 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -470,7 +470,7 @@
// Overridden from LocatedEvent.
virtual void UpdateForRootTransform(
- const gfx::Transform& inverted_root_transform) OVERRIDE;
+ const gfx::Transform& inverted_root_transform) override;
private:
gfx::Vector2d offset_;
@@ -522,7 +522,7 @@
// Overridden from LocatedEvent.
virtual void UpdateForRootTransform(
- const gfx::Transform& inverted_root_transform) OVERRIDE;
+ const gfx::Transform& inverted_root_transform) override;
protected:
void set_radius(float radius_x, float radius_y) {
diff --git a/ui/events/event_dispatcher_unittest.cc b/ui/events/event_dispatcher_unittest.cc
index 248784a..415add7 100644
--- a/ui/events/event_dispatcher_unittest.cc
+++ b/ui/events/event_dispatcher_unittest.cc
@@ -38,19 +38,19 @@
private:
// Overridden from EventTarget:
- virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE {
+ virtual bool CanAcceptEvent(const ui::Event& event) override {
return true;
}
- virtual EventTarget* GetParentTarget() OVERRIDE {
+ virtual EventTarget* GetParentTarget() override {
return parent_;
}
- virtual scoped_ptr<EventTargetIterator> GetChildIterator() const OVERRIDE {
+ virtual scoped_ptr<EventTargetIterator> GetChildIterator() const override {
return scoped_ptr<EventTargetIterator>();
}
- virtual EventTargeter* GetEventTargeter() OVERRIDE {
+ virtual EventTargeter* GetEventTargeter() override {
return NULL;
}
@@ -94,7 +94,7 @@
private:
// Overridden from EventHandler:
- virtual void OnEvent(Event* event) OVERRIDE {
+ virtual void OnEvent(Event* event) override {
ui::EventHandler::OnEvent(event);
ReceivedEvent(event);
SetStatusOnEvent(event);
@@ -141,7 +141,7 @@
virtual ~EventHandlerDestroyDispatcherDelegate() {}
private:
- virtual void ReceivedEvent(Event* event) OVERRIDE {
+ virtual void ReceivedEvent(Event* event) override {
TestEventHandler::ReceivedEvent(event);
delete dispatcher_delegate_;
}
@@ -158,7 +158,7 @@
virtual ~InvalidateTargetEventHandler() {}
private:
- virtual void ReceivedEvent(Event* event) OVERRIDE {
+ virtual void ReceivedEvent(Event* event) override {
TestEventHandler::ReceivedEvent(event);
TestTarget* target = static_cast<TestTarget*>(event->target());
target->set_valid(false);
@@ -186,7 +186,7 @@
}
private:
- virtual void ReceivedEvent(Event* event) OVERRIDE {
+ virtual void ReceivedEvent(Event* event) override {
TestEventHandler::ReceivedEvent(event);
delete to_destroy_;
to_destroy_ = NULL;
@@ -215,7 +215,7 @@
private:
// Overridden from EventDispatcherDelegate:
- virtual bool CanDispatchToTarget(EventTarget* target) OVERRIDE {
+ virtual bool CanDispatchToTarget(EventTarget* target) override {
TestTarget* test_target = static_cast<TestTarget*>(target);
return test_target->valid();
}
diff --git a/ui/events/event_processor_unittest.cc b/ui/events/event_processor_unittest.cc
index d6720a8..33a8162 100644
--- a/ui/events/event_processor_unittest.cc
+++ b/ui/events/event_processor_unittest.cc
@@ -23,7 +23,7 @@
virtual ~EventProcessorTest() {}
// testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
processor_.SetRoot(scoped_ptr<EventTarget>(new TestEventTarget()));
processor_.Reset();
root()->SetEventTargeter(make_scoped_ptr(new EventTargeter()));
@@ -69,7 +69,7 @@
protected:
virtual bool SubtreeShouldBeExploredForEvent(
- EventTarget* target, const LocatedEvent& event) OVERRIDE {
+ EventTarget* target, const LocatedEvent& event) override {
T* t = static_cast<T*>(target);
return (t->bounds().Contains(event.location()));
}
@@ -107,7 +107,7 @@
private:
// EventTarget:
virtual void ConvertEventToTarget(EventTarget* target,
- LocatedEvent* event) OVERRIDE {
+ LocatedEvent* event) override {
event->ConvertLocationToTarget(this,
static_cast<BoundsTestTarget*>(target));
}
@@ -185,7 +185,7 @@
virtual ~ReDispatchEventHandler() {}
// TestEventHandler:
- virtual void OnMouseEvent(MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(MouseEvent* event) override {
TestEventHandler::OnMouseEvent(event);
EXPECT_EQ(expected_target_, event->target());
@@ -327,7 +327,7 @@
private:
// EventTargeter:
virtual bool SubtreeShouldBeExploredForEvent(
- EventTarget* target, const LocatedEvent& event) OVERRIDE {
+ EventTarget* target, const LocatedEvent& event) override {
return false;
}
};
@@ -369,12 +369,12 @@
private:
// EventTargeter:
virtual EventTarget* FindTargetForEvent(EventTarget* root,
- Event* event) OVERRIDE {
+ Event* event) override {
return initial_target_;
}
virtual EventTarget* FindNextBestTarget(EventTarget* previous_target,
- Event* event) OVERRIDE {
+ Event* event) override {
return previous_target->GetParentTarget();
}
diff --git a/ui/events/event_rewriter_unittest.cc b/ui/events/event_rewriter_unittest.cc
index 11a05c9..08e592f 100644
--- a/ui/events/event_rewriter_unittest.cc
+++ b/ui/events/event_rewriter_unittest.cc
@@ -45,7 +45,7 @@
void CheckAllReceived() { EXPECT_TRUE(expected_events_.empty()); }
// EventProcessor:
- virtual EventDispatchDetails OnEventFromSource(Event* event) OVERRIDE {
+ virtual EventDispatchDetails OnEventFromSource(Event* event) override {
EXPECT_FALSE(expected_events_.empty());
EXPECT_EQ(expected_events_.front(), event->type());
expected_events_.pop_front();
@@ -62,7 +62,7 @@
public:
explicit TestEventRewriteSource(EventProcessor* processor)
: processor_(processor) {}
- virtual EventProcessor* GetEventProcessor() OVERRIDE { return processor_; }
+ virtual EventProcessor* GetEventProcessor() override { return processor_; }
void Send(EventType type) {
scoped_ptr<Event> event(new TestEvent(type));
(void)SendEventToProcessor(event.get());
@@ -85,14 +85,14 @@
virtual EventRewriteStatus RewriteEvent(const Event& event,
scoped_ptr<Event>* rewritten_event)
- OVERRIDE {
+ override {
if (status_ == EVENT_REWRITE_REWRITTEN)
rewritten_event->reset(new TestEvent(type_));
return status_;
}
virtual EventRewriteStatus NextDispatchEvent(const Event& last_event,
scoped_ptr<Event>* new_event)
- OVERRIDE {
+ override {
NOTREACHED();
return status_;
}
@@ -115,7 +115,7 @@
}
virtual EventRewriteStatus RewriteEvent(const Event& event,
scoped_ptr<Event>* rewritten_event)
- OVERRIDE {
+ override {
RewriteRules::iterator find =
rules_.find(RewriteCase(state_, event.type()));
if (find == rules_.end())
@@ -132,7 +132,7 @@
}
virtual EventRewriteStatus NextDispatchEvent(const Event& last_event,
scoped_ptr<Event>* new_event)
- OVERRIDE {
+ override {
EXPECT_TRUE(last_rewritten_event_);
const TestEvent* arg_last = static_cast<const TestEvent*>(&last_event);
EXPECT_EQ(last_rewritten_event_->unique_id(), arg_last->unique_id());
diff --git a/ui/events/event_target.h b/ui/events/event_target.h
index 3ffec55..cf8ff8a 100644
--- a/ui/events/event_target.h
+++ b/ui/events/event_target.h
@@ -85,12 +85,12 @@
EventHandler* target_handler() { return target_handler_; }
// Overridden from EventHandler:
- virtual void OnEvent(Event* event) OVERRIDE;
- virtual void OnKeyEvent(KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ScrollEvent* event) OVERRIDE;
- virtual void OnTouchEvent(TouchEvent* event) OVERRIDE;
- virtual void OnGestureEvent(GestureEvent* event) OVERRIDE;
+ virtual void OnEvent(Event* event) override;
+ virtual void OnKeyEvent(KeyEvent* event) override;
+ virtual void OnMouseEvent(MouseEvent* event) override;
+ virtual void OnScrollEvent(ScrollEvent* event) override;
+ virtual void OnTouchEvent(TouchEvent* event) override;
+ virtual void OnGestureEvent(GestureEvent* event) override;
private:
friend class EventDispatcher;
diff --git a/ui/events/event_target_iterator.h b/ui/events/event_target_iterator.h
index 3083c83..28b4a30 100644
--- a/ui/events/event_target_iterator.h
+++ b/ui/events/event_target_iterator.h
@@ -30,7 +30,7 @@
}
virtual ~EventTargetIteratorImpl() {}
- virtual EventTarget* GetNextTarget() OVERRIDE {
+ virtual EventTarget* GetNextTarget() override {
if (begin_ == end_)
return NULL;
EventTarget* target = *(begin_);
diff --git a/ui/events/event_targeter.cc b/ui/events/event_targeter.cc
index 3cdc83e..5d43b29 100644
--- a/ui/events/event_targeter.cc
+++ b/ui/events/event_targeter.cc
@@ -39,9 +39,8 @@
continue;
target->ConvertEventToTarget(child, event);
target = child;
- EventTarget* child_target = targeter ?
- targeter->FindTargetForLocatedEvent(child, event) :
- FindTargetForLocatedEvent(child, event);
+ EventTarget* child_target =
+ targeter->FindTargetForLocatedEvent(child, event);
if (child_target)
return child_target;
}
diff --git a/ui/events/events.gyp b/ui/events/events.gyp
index 40ccca6..8af08c5 100644
--- a/ui/events/events.gyp
+++ b/ui/events/events.gyp
@@ -38,6 +38,8 @@
],
'sources': [
# Note: sources list duplicated in GN build.
+ 'android/scroller.cc',
+ 'android/scroller.h',
'device_data_manager.cc',
'device_data_manager.h',
'device_hotplug_event_observer.h',
@@ -45,6 +47,7 @@
'event_switches.cc',
'event_switches.h',
'events_base_export.h',
+ 'gesture_curve.h',
'gesture_event_details.cc',
'gesture_event_details.h',
'gestures/fling_curve.cc',
@@ -307,6 +310,7 @@
],
'sources': [
# Note: sources list duplicated in GN build.
+ 'android/scroller_unittest.cc',
'cocoa/events_mac_unittest.mm',
'event_dispatcher_unittest.cc',
'event_processor_unittest.cc',
diff --git a/ui/events/gesture_curve.h b/ui/events/gesture_curve.h
new file mode 100644
index 0000000..7300e32
--- /dev/null
+++ b/ui/events/gesture_curve.h
@@ -0,0 +1,31 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_GESTURE_CURVE_H_
+#define UI_EVENTS_GESTURE_CURVE_H_
+
+#include "base/time/time.h"
+#include "ui/gfx/geometry/vector2d_f.h"
+
+namespace ui {
+
+// An abstraction of curve-based gesture motion, allowing platform-specific
+// motion tailoring.
+class EVENTS_BASE_EXPORT GestureCurve {
+ public:
+ virtual ~GestureCurve() {}
+
+ // The output |offset| represents the total movement of the curve from its
+ // start until |time|.
+ // The output |velocity| represents the instantenous velocity at |time|.
+ // Returns false if |time| exceeds the fling duration, in which case
+ // the terminal offset will be reported.
+ virtual bool ComputeScrollOffset(base::TimeTicks time,
+ gfx::Vector2dF* offset,
+ gfx::Vector2dF* velocity) = 0;
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_GESTURE_CURVE_H_
diff --git a/ui/events/gesture_detection/filtered_gesture_provider.h b/ui/events/gesture_detection/filtered_gesture_provider.h
index 4d63be6..a2ac7fc 100644
--- a/ui/events/gesture_detection/filtered_gesture_provider.h
+++ b/ui/events/gesture_detection/filtered_gesture_provider.h
@@ -40,10 +40,10 @@
private:
// GestureProviderClient implementation.
- virtual void OnGestureEvent(const ui::GestureEventData& event) OVERRIDE;
+ virtual void OnGestureEvent(const ui::GestureEventData& event) override;
// TouchDispositionGestureFilterClient implementation.
- virtual void ForwardGestureEvent(const ui::GestureEventData& event) OVERRIDE;
+ virtual void ForwardGestureEvent(const ui::GestureEventData& event) override;
GestureProviderClient* const client_;
diff --git a/ui/events/gesture_detection/gesture_config_helper_aura.cc b/ui/events/gesture_detection/gesture_config_helper_aura.cc
index 94469c5..a536bbc 100644
--- a/ui/events/gesture_detection/gesture_config_helper_aura.cc
+++ b/ui/events/gesture_detection/gesture_config_helper_aura.cc
@@ -18,11 +18,11 @@
GestureDetector::Config config;
config.longpress_timeout = base::TimeDelta::FromMilliseconds(
- GestureConfiguration::long_press_time_in_seconds() * 1000.);
+ GestureConfiguration::long_press_time_in_ms());
config.showpress_timeout = base::TimeDelta::FromMilliseconds(
GestureConfiguration::show_press_delay_in_ms());
config.double_tap_timeout = base::TimeDelta::FromMilliseconds(
- GestureConfiguration::semi_long_press_time_in_seconds() * 1000.);
+ GestureConfiguration::semi_long_press_time_in_ms());
config.touch_slop =
GestureConfiguration::max_touch_move_in_pixels_for_click();
config.double_tap_slop =
@@ -38,25 +38,21 @@
config.two_finger_tap_max_separation =
GestureConfiguration::max_distance_for_two_finger_tap_in_pixels();
config.two_finger_tap_timeout = base::TimeDelta::FromMilliseconds(
- GestureConfiguration::max_touch_down_duration_in_seconds_for_click() *
- 1000.);
+ GestureConfiguration::max_touch_down_duration_for_click_in_ms());
return config;
}
ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig() {
ScaleGestureDetector::Config config;
- double min_pinch_update_distance =
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kCompensateForUnstablePinchZoom)
- ? GestureConfiguration::min_pinch_update_distance_in_pixels()
- : 0;
-
config.span_slop =
GestureConfiguration::max_touch_move_in_pixels_for_click() * 2;
config.min_scaling_touch_major = GestureConfiguration::default_radius() * 2;
config.min_scaling_span = GestureConfiguration::min_scaling_span_in_pixels();
- config.min_pinch_update_span_delta = min_pinch_update_distance;
+ config.min_pinch_update_span_delta =
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kCompensateForUnstablePinchZoom) ?
+ GestureConfiguration::min_pinch_update_distance_in_pixels() : 0;
return config;
}
diff --git a/ui/events/gesture_detection/gesture_provider.cc b/ui/events/gesture_detection/gesture_provider.cc
index 51d119b..6925c6c 100644
--- a/ui/events/gesture_detection/gesture_provider.cc
+++ b/ui/events/gesture_detection/gesture_provider.cc
@@ -195,21 +195,21 @@
// ScaleGestureListener implementation.
virtual bool OnScaleBegin(const ScaleGestureDetector& detector,
- const MotionEvent& e) OVERRIDE {
+ const MotionEvent& e) override {
if (ignore_multitouch_zoom_events_ && !detector.InDoubleTapMode())
return false;
return true;
}
virtual void OnScaleEnd(const ScaleGestureDetector& detector,
- const MotionEvent& e) OVERRIDE {
+ const MotionEvent& e) override {
if (!pinch_event_sent_)
return;
Send(CreateGesture(ET_GESTURE_PINCH_END, e));
}
virtual bool OnScale(const ScaleGestureDetector& detector,
- const MotionEvent& e) OVERRIDE {
+ const MotionEvent& e) override {
if (ignore_multitouch_zoom_events_ && !detector.InDoubleTapMode())
return false;
if (!pinch_event_sent_) {
@@ -264,7 +264,7 @@
}
// GestureListener implementation.
- virtual bool OnDown(const MotionEvent& e) OVERRIDE {
+ virtual bool OnDown(const MotionEvent& e) override {
GestureEventDetails tap_details(ET_GESTURE_TAP_DOWN);
Send(CreateGesture(tap_details, e));
@@ -275,7 +275,7 @@
virtual bool OnScroll(const MotionEvent& e1,
const MotionEvent& e2,
float raw_distance_x,
- float raw_distance_y) OVERRIDE {
+ float raw_distance_y) override {
float distance_x = raw_distance_x;
float distance_y = raw_distance_y;
if (!scroll_event_sent_) {
@@ -348,7 +348,7 @@
virtual bool OnFling(const MotionEvent& e1,
const MotionEvent& e2,
float velocity_x,
- float velocity_y) OVERRIDE {
+ float velocity_y) override {
if (snap_scroll_controller_.IsSnappingScrolls()) {
if (snap_scroll_controller_.IsSnapHorizontal()) {
velocity_y = 0;
@@ -378,14 +378,14 @@
virtual bool OnSwipe(const MotionEvent& e1,
const MotionEvent& e2,
float velocity_x,
- float velocity_y) OVERRIDE {
+ float velocity_y) override {
GestureEventDetails swipe_details(ET_GESTURE_SWIPE, velocity_x, velocity_y);
Send(CreateGesture(swipe_details, e2));
return true;
}
virtual bool OnTwoFingerTap(const MotionEvent& e1,
- const MotionEvent& e2) OVERRIDE {
+ const MotionEvent& e2) override {
// The location of the two finger tap event should be the location of the
// primary pointer.
GestureEventDetails two_finger_tap_details(
@@ -404,13 +404,13 @@
return true;
}
- virtual void OnShowPress(const MotionEvent& e) OVERRIDE {
+ virtual void OnShowPress(const MotionEvent& e) override {
GestureEventDetails show_press_details(ET_GESTURE_SHOW_PRESS);
show_press_event_sent_ = true;
Send(CreateGesture(show_press_details, e));
}
- virtual bool OnSingleTapUp(const MotionEvent& e) OVERRIDE {
+ virtual bool OnSingleTapUp(const MotionEvent& e) override {
// This is a hack to address the issue where user hovers
// over a link for longer than double_tap_timeout_, then
// OnSingleTapConfirmed() is not triggered. But we still
@@ -444,7 +444,7 @@
}
// DoubleTapListener implementation.
- virtual bool OnSingleTapConfirmed(const MotionEvent& e) OVERRIDE {
+ virtual bool OnSingleTapConfirmed(const MotionEvent& e) override {
// Long taps in the edges of the screen have their events delayed by
// ContentViewHolder for tab swipe operations. As a consequence of the delay
// this method might be called after receiving the up event.
@@ -458,11 +458,11 @@
return true;
}
- virtual bool OnDoubleTap(const MotionEvent& e) OVERRIDE {
+ virtual bool OnDoubleTap(const MotionEvent& e) override {
return scale_gesture_detector_.OnDoubleTap(e);
}
- virtual bool OnDoubleTapEvent(const MotionEvent& e) OVERRIDE {
+ virtual bool OnDoubleTapEvent(const MotionEvent& e) override {
switch (e.GetAction()) {
case MotionEvent::ACTION_DOWN:
gesture_detector_.set_longpress_enabled(false);
@@ -481,7 +481,7 @@
return false;
}
- virtual void OnLongPress(const MotionEvent& e) OVERRIDE {
+ virtual void OnLongPress(const MotionEvent& e) override {
DCHECK(!IsDoubleTapInProgress());
SetIgnoreSingleTap(true);
GestureEventDetails long_press_details(ET_GESTURE_LONG_PRESS);
diff --git a/ui/events/gesture_detection/gesture_provider_unittest.cc b/ui/events/gesture_detection/gesture_provider_unittest.cc
index a25a0b5..da305ff 100644
--- a/ui/events/gesture_detection/gesture_provider_unittest.cc
+++ b/ui/events/gesture_detection/gesture_provider_unittest.cc
@@ -123,15 +123,15 @@
}
// Test
- virtual void SetUp() OVERRIDE { SetUpWithConfig(GetDefaultConfig()); }
+ virtual void SetUp() override { SetUpWithConfig(GetDefaultConfig()); }
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
gestures_.clear();
gesture_provider_.reset();
}
// GestureProviderClient
- virtual void OnGestureEvent(const GestureEventData& gesture) OVERRIDE {
+ virtual void OnGestureEvent(const GestureEventData& gesture) override {
if (gesture.type() == ET_GESTURE_SCROLL_BEGIN)
active_scroll_begin_event_.reset(new GestureEventData(gesture));
gestures_.push_back(gesture);
diff --git a/ui/events/gesture_detection/motion_event.h b/ui/events/gesture_detection/motion_event.h
index bb17ef1..2277277 100644
--- a/ui/events/gesture_detection/motion_event.h
+++ b/ui/events/gesture_detection/motion_event.h
@@ -42,7 +42,7 @@
// The implementer promises that |GetPointerId()| will never exceed
// MAX_POINTER_ID.
- enum { MAX_POINTER_ID = 31, MAX_TOUCH_POINT_COUNT = 12 };
+ enum { MAX_POINTER_ID = 31, MAX_TOUCH_POINT_COUNT = 16 };
virtual ~MotionEvent() {}
diff --git a/ui/events/gesture_detection/motion_event_buffer.cc b/ui/events/gesture_detection/motion_event_buffer.cc
index e8e0eb1..11d2df7 100644
--- a/ui/events/gesture_detection/motion_event_buffer.cc
+++ b/ui/events/gesture_detection/motion_event_buffer.cc
@@ -175,96 +175,96 @@
}
virtual ~CompoundMotionEvent() {}
- virtual int GetId() const OVERRIDE { return latest().GetId(); }
+ virtual int GetId() const override { return latest().GetId(); }
- virtual Action GetAction() const OVERRIDE { return latest().GetAction(); }
+ virtual Action GetAction() const override { return latest().GetAction(); }
- virtual int GetActionIndex() const OVERRIDE {
+ virtual int GetActionIndex() const override {
return latest().GetActionIndex();
}
- virtual size_t GetPointerCount() const OVERRIDE {
+ virtual size_t GetPointerCount() const override {
return latest().GetPointerCount();
}
- virtual int GetPointerId(size_t pointer_index) const OVERRIDE {
+ virtual int GetPointerId(size_t pointer_index) const override {
return latest().GetPointerId(pointer_index);
}
- virtual float GetX(size_t pointer_index) const OVERRIDE {
+ virtual float GetX(size_t pointer_index) const override {
return latest().GetX(pointer_index);
}
- virtual float GetY(size_t pointer_index) const OVERRIDE {
+ virtual float GetY(size_t pointer_index) const override {
return latest().GetY(pointer_index);
}
- virtual float GetRawX(size_t pointer_index) const OVERRIDE {
+ virtual float GetRawX(size_t pointer_index) const override {
return latest().GetRawX(pointer_index);
}
- virtual float GetRawY(size_t pointer_index) const OVERRIDE {
+ virtual float GetRawY(size_t pointer_index) const override {
return latest().GetRawY(pointer_index);
}
- virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE {
+ virtual float GetTouchMajor(size_t pointer_index) const override {
return latest().GetTouchMajor(pointer_index);
}
- virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE {
+ virtual float GetTouchMinor(size_t pointer_index) const override {
return latest().GetTouchMinor(pointer_index);
}
- virtual float GetOrientation(size_t pointer_index) const OVERRIDE {
+ virtual float GetOrientation(size_t pointer_index) const override {
return latest().GetOrientation(pointer_index);
}
- virtual float GetPressure(size_t pointer_index) const OVERRIDE {
+ virtual float GetPressure(size_t pointer_index) const override {
return latest().GetPressure(pointer_index);
}
- virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE {
+ virtual ToolType GetToolType(size_t pointer_index) const override {
return latest().GetToolType(pointer_index);
}
- virtual int GetButtonState() const OVERRIDE {
+ virtual int GetButtonState() const override {
return latest().GetButtonState();
}
- virtual int GetFlags() const OVERRIDE { return latest().GetFlags(); }
+ virtual int GetFlags() const override { return latest().GetFlags(); }
- virtual base::TimeTicks GetEventTime() const OVERRIDE {
+ virtual base::TimeTicks GetEventTime() const override {
return latest().GetEventTime();
}
- virtual size_t GetHistorySize() const OVERRIDE { return events_.size() - 1; }
+ virtual size_t GetHistorySize() const override { return events_.size() - 1; }
virtual base::TimeTicks GetHistoricalEventTime(
- size_t historical_index) const OVERRIDE {
+ size_t historical_index) const override {
DCHECK_LT(historical_index, GetHistorySize());
return events_[historical_index]->GetEventTime();
}
virtual float GetHistoricalTouchMajor(
size_t pointer_index,
- size_t historical_index) const OVERRIDE {
+ size_t historical_index) const override {
DCHECK_LT(historical_index, GetHistorySize());
return events_[historical_index]->GetTouchMajor();
}
virtual float GetHistoricalX(size_t pointer_index,
- size_t historical_index) const OVERRIDE {
+ size_t historical_index) const override {
DCHECK_LT(historical_index, GetHistorySize());
return events_[historical_index]->GetX(pointer_index);
}
virtual float GetHistoricalY(size_t pointer_index,
- size_t historical_index) const OVERRIDE {
+ size_t historical_index) const override {
DCHECK_LT(historical_index, GetHistorySize());
return events_[historical_index]->GetY(pointer_index);
}
- virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE {
+ virtual scoped_ptr<MotionEvent> Clone() const override {
MotionEventVector cloned_events;
cloned_events.reserve(events_.size());
for (size_t i = 0; i < events_.size(); ++i)
@@ -273,7 +273,7 @@
new CompoundMotionEvent(cloned_events.Pass()));
}
- virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE {
+ virtual scoped_ptr<MotionEvent> Cancel() const override {
return latest().Cancel();
}
diff --git a/ui/events/gesture_detection/motion_event_buffer_unittest.cc b/ui/events/gesture_detection/motion_event_buffer_unittest.cc
index f51897f..badbd98 100644
--- a/ui/events/gesture_detection/motion_event_buffer_unittest.cc
+++ b/ui/events/gesture_detection/motion_event_buffer_unittest.cc
@@ -44,11 +44,11 @@
virtual ~MotionEventBufferTest() {}
// MotionEventBufferClient implementation.
- virtual void ForwardMotionEvent(const MotionEvent& event) OVERRIDE {
+ virtual void ForwardMotionEvent(const MotionEvent& event) override {
forwarded_events_.push_back(event.Clone().release());
}
- virtual void SetNeedsFlush() OVERRIDE { needs_flush_ = true; }
+ virtual void SetNeedsFlush() override { needs_flush_ = true; }
bool GetAndResetNeedsFlush() {
bool needs_flush = needs_flush_;
diff --git a/ui/events/gesture_detection/motion_event_generic.h b/ui/events/gesture_detection/motion_event_generic.h
index 2750cb2..41911c1 100644
--- a/ui/events/gesture_detection/motion_event_generic.h
+++ b/ui/events/gesture_detection/motion_event_generic.h
@@ -39,25 +39,25 @@
virtual ~MotionEventGeneric();
// MotionEvent implementation.
- virtual int GetId() const OVERRIDE;
- virtual Action GetAction() const OVERRIDE;
- virtual int GetActionIndex() const OVERRIDE;
- virtual size_t GetPointerCount() const OVERRIDE;
- virtual int GetPointerId(size_t pointer_index) const OVERRIDE;
- virtual float GetX(size_t pointer_index) const OVERRIDE;
- virtual float GetY(size_t pointer_index) const OVERRIDE;
- virtual float GetRawX(size_t pointer_index) const OVERRIDE;
- virtual float GetRawY(size_t pointer_index) const OVERRIDE;
- virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE;
- virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE;
- virtual float GetOrientation(size_t pointer_index) const OVERRIDE;
- virtual float GetPressure(size_t pointer_index) const OVERRIDE;
- virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE;
- virtual int GetButtonState() const OVERRIDE;
- virtual int GetFlags() const OVERRIDE;
- virtual base::TimeTicks GetEventTime() const OVERRIDE;
- virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
- virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
+ virtual int GetId() const override;
+ virtual Action GetAction() const override;
+ virtual int GetActionIndex() const override;
+ virtual size_t GetPointerCount() const override;
+ virtual int GetPointerId(size_t pointer_index) const override;
+ virtual float GetX(size_t pointer_index) const override;
+ virtual float GetY(size_t pointer_index) const override;
+ virtual float GetRawX(size_t pointer_index) const override;
+ virtual float GetRawY(size_t pointer_index) const override;
+ virtual float GetTouchMajor(size_t pointer_index) const override;
+ virtual float GetTouchMinor(size_t pointer_index) const override;
+ virtual float GetOrientation(size_t pointer_index) const override;
+ virtual float GetPressure(size_t pointer_index) const override;
+ virtual ToolType GetToolType(size_t pointer_index) const override;
+ virtual int GetButtonState() const override;
+ virtual int GetFlags() const override;
+ virtual base::TimeTicks GetEventTime() const override;
+ virtual scoped_ptr<MotionEvent> Clone() const override;
+ virtual scoped_ptr<MotionEvent> Cancel() const override;
void PushPointer(const PointerProperties& pointer);
diff --git a/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc b/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
index 7e99c94..d8a2551 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
@@ -26,17 +26,17 @@
virtual ~TouchDispositionGestureFilterTest() {}
// testing::Test
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
queue_.reset(new TouchDispositionGestureFilter(this));
touch_event_.set_flags(kDefaultEventFlags);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
queue_.reset();
}
// TouchDispositionGestureFilterClient
- virtual void ForwardGestureEvent(const GestureEventData& event) OVERRIDE {
+ virtual void ForwardGestureEvent(const GestureEventData& event) override {
++sent_gesture_count_;
last_sent_gesture_.reset(new GestureEventData(event));
sent_gestures_.push_back(event.type());
diff --git a/ui/events/gesture_detection/velocity_tracker.cc b/ui/events/gesture_detection/velocity_tracker.cc
index 16454e8..a3fd83e 100644
--- a/ui/events/gesture_detection/velocity_tracker.cc
+++ b/ui/events/gesture_detection/velocity_tracker.cc
@@ -121,13 +121,13 @@
Weighting weighting = WEIGHTING_NONE);
virtual ~LeastSquaresVelocityTrackerStrategy();
- virtual void Clear() OVERRIDE;
- virtual void ClearPointers(BitSet32 id_bits) OVERRIDE;
+ virtual void Clear() override;
+ virtual void ClearPointers(BitSet32 id_bits) override;
virtual void AddMovement(const TimeTicks& event_time,
BitSet32 id_bits,
- const Position* positions) OVERRIDE;
+ const Position* positions) override;
virtual bool GetEstimator(uint32_t id,
- Estimator* out_estimator) const OVERRIDE;
+ Estimator* out_estimator) const override;
private:
// Sample horizon.
@@ -160,13 +160,13 @@
explicit IntegratingVelocityTrackerStrategy(uint32_t degree);
virtual ~IntegratingVelocityTrackerStrategy();
- virtual void Clear() OVERRIDE;
- virtual void ClearPointers(BitSet32 id_bits) OVERRIDE;
+ virtual void Clear() override;
+ virtual void ClearPointers(BitSet32 id_bits) override;
virtual void AddMovement(const TimeTicks& event_time,
BitSet32 id_bits,
- const Position* positions) OVERRIDE;
+ const Position* positions) override;
virtual bool GetEstimator(uint32_t id,
- Estimator* out_estimator) const OVERRIDE;
+ Estimator* out_estimator) const override;
private:
// Current state estimate for a particular pointer.
diff --git a/ui/events/gestures/fling_curve.cc b/ui/events/gestures/fling_curve.cc
index 6f63019..00d29a4 100644
--- a/ui/events/gestures/fling_curve.cc
+++ b/ui/events/gestures/fling_curve.cc
@@ -38,8 +38,10 @@
base::TimeTicks start_timestamp)
: curve_duration_(GetTimeAtVelocity(0)),
start_timestamp_(start_timestamp),
+ previous_timestamp_(start_timestamp_),
time_offset_(0),
position_offset_(0) {
+ DCHECK(!velocity.IsZero());
float max_start_velocity = std::max(fabs(velocity.x()), fabs(velocity.y()));
if (max_start_velocity > GetVelocityAtTime(0))
max_start_velocity = GetVelocityAtTime(0);
@@ -49,32 +51,57 @@
velocity.y() / max_start_velocity);
time_offset_ = GetTimeAtVelocity(max_start_velocity);
position_offset_ = GetPositionAtTime(time_offset_);
- last_timestamp_ = start_timestamp_ + base::TimeDelta::FromSecondsD(
- curve_duration_ - time_offset_);
}
FlingCurve::~FlingCurve() {
}
-gfx::Vector2dF FlingCurve::GetScrollAmountAtTime(base::TimeTicks current) {
- if (current < start_timestamp_)
- return gfx::Vector2dF();
-
- float displacement = 0;
- if (current < last_timestamp_) {
- float time = time_offset_ + (current - start_timestamp_).InSecondsF();
- CHECK_LT(time, curve_duration_);
- displacement = GetPositionAtTime(time) - position_offset_;
- } else {
- displacement = GetPositionAtTime(curve_duration_) - position_offset_;
+bool FlingCurve::ComputeScrollOffset(base::TimeTicks time,
+ gfx::Vector2dF* offset,
+ gfx::Vector2dF* velocity) {
+ DCHECK(offset);
+ DCHECK(velocity);
+ base::TimeDelta elapsed_time = time - start_timestamp_;
+ if (elapsed_time < base::TimeDelta()) {
+ *offset = gfx::Vector2dF();
+ *velocity = gfx::Vector2dF();
+ return true;
}
- gfx::Vector2dF scroll(displacement * displacement_ratio_.x(),
- displacement * displacement_ratio_.y());
- gfx::Vector2dF scroll_increment(scroll.x() - cumulative_scroll_.x(),
- scroll.y() - cumulative_scroll_.y());
- cumulative_scroll_ = scroll;
- return scroll_increment;
+ bool still_active = true;
+ float scalar_offset;
+ float scalar_velocity;
+ double offset_time = elapsed_time.InSecondsF() + time_offset_;
+ if (offset_time < curve_duration_) {
+ scalar_offset = GetPositionAtTime(offset_time) - position_offset_;
+ scalar_velocity = GetVelocityAtTime(offset_time);
+ } else {
+ scalar_offset = GetPositionAtTime(curve_duration_) - position_offset_;
+ scalar_velocity = 0;
+ still_active = false;
+ }
+
+ *offset = gfx::ScaleVector2d(displacement_ratio_, scalar_offset);
+ *velocity = gfx::ScaleVector2d(displacement_ratio_, scalar_velocity);
+ return still_active;
+}
+
+bool FlingCurve::ComputeScrollDeltaAtTime(base::TimeTicks current,
+ gfx::Vector2dF* delta) {
+ DCHECK(delta);
+ if (current <= previous_timestamp_) {
+ *delta = gfx::Vector2dF();
+ return true;
+ }
+
+ previous_timestamp_ = current;
+
+ gfx::Vector2dF offset, velocity;
+ bool still_active = ComputeScrollOffset(current, &offset, &velocity);
+
+ *delta = offset - cumulative_scroll_;
+ cumulative_scroll_ = offset;
+ return still_active;
}
} // namespace ui
diff --git a/ui/events/gestures/fling_curve.h b/ui/events/gestures/fling_curve.h
index 583e172..bebf6ab 100644
--- a/ui/events/gestures/fling_curve.h
+++ b/ui/events/gestures/fling_curve.h
@@ -7,6 +7,7 @@
#include "base/time/time.h"
#include "ui/events/events_base_export.h"
+#include "ui/events/gesture_curve.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/vector2d_f.h"
@@ -14,13 +15,21 @@
// FlingCurve can be used to scroll a UI element suitable for touch screen-based
// flings.
-class EVENTS_BASE_EXPORT FlingCurve {
+class EVENTS_BASE_EXPORT FlingCurve : public GestureCurve {
public:
FlingCurve(const gfx::Vector2dF& velocity, base::TimeTicks start_timestamp);
- ~FlingCurve();
+ virtual ~FlingCurve();
- gfx::Vector2dF GetScrollAmountAtTime(base::TimeTicks current_timestamp);
- base::TimeTicks start_timestamp() const { return start_timestamp_; }
+ // GestureCurve implementation.
+ virtual bool ComputeScrollOffset(base::TimeTicks time,
+ gfx::Vector2dF* offset,
+ gfx::Vector2dF* velocity) override;
+
+ // In contrast to |ComputeScrollOffset()|, this method is stateful and
+ // returns the *change* in scroll offset between successive calls.
+ // Returns true as long as the curve is still active and requires additional
+ // animation ticks.
+ bool ComputeScrollDeltaAtTime(base::TimeTicks current, gfx::Vector2dF* delta);
private:
const float curve_duration_;
@@ -28,7 +37,7 @@
gfx::Vector2dF displacement_ratio_;
gfx::Vector2dF cumulative_scroll_;
- base::TimeTicks last_timestamp_;
+ base::TimeTicks previous_timestamp_;
float time_offset_;
float position_offset_;
diff --git a/ui/events/gestures/fling_curve_unittest.cc b/ui/events/gestures/fling_curve_unittest.cc
index 653a5ef..d6dffef 100644
--- a/ui/events/gestures/fling_curve_unittest.cc
+++ b/ui/events/gestures/fling_curve_unittest.cc
@@ -14,23 +14,25 @@
base::TimeTicks now = gfx::FrameTime::Now();
FlingCurve curve(velocity, now);
- gfx::Vector2dF scroll =
- curve.GetScrollAmountAtTime(now + base::TimeDelta::FromMilliseconds(20));
- EXPECT_EQ(0, scroll.x());
- EXPECT_NEAR(scroll.y(), 96, 1);
+ gfx::Vector2dF delta;
+ EXPECT_TRUE(curve.ComputeScrollDeltaAtTime(
+ now + base::TimeDelta::FromMilliseconds(20), &delta));
+ EXPECT_EQ(0, delta.x());
+ EXPECT_NEAR(delta.y(), 96, 1);
- scroll =
- curve.GetScrollAmountAtTime(now + base::TimeDelta::FromMilliseconds(250));
- EXPECT_EQ(0, scroll.x());
- EXPECT_NEAR(scroll.y(), 705, 1);
+ EXPECT_TRUE(curve.ComputeScrollDeltaAtTime(
+ now + base::TimeDelta::FromMilliseconds(250), &delta));
+ EXPECT_EQ(0, delta.x());
+ EXPECT_NEAR(delta.y(), 705, 1);
- scroll =
- curve.GetScrollAmountAtTime(now + base::TimeDelta::FromSeconds(10));
- EXPECT_EQ(0, scroll.x());
- EXPECT_NEAR(scroll.y(), 392, 1);
+ EXPECT_FALSE(curve.ComputeScrollDeltaAtTime(
+ now + base::TimeDelta::FromSeconds(10), &delta));
+ EXPECT_EQ(0, delta.x());
+ EXPECT_NEAR(delta.y(), 392, 1);
- EXPECT_TRUE(curve.GetScrollAmountAtTime(
- now + base::TimeDelta::FromSeconds(20)).IsZero());
+ EXPECT_FALSE(curve.ComputeScrollDeltaAtTime(
+ now + base::TimeDelta::FromSeconds(20), &delta));
+ EXPECT_TRUE(delta.IsZero());
}
} // namespace ui
diff --git a/ui/events/gestures/gesture_configuration.cc b/ui/events/gestures/gesture_configuration.cc
index 1ce13d7..78f6b57 100644
--- a/ui/events/gestures/gesture_configuration.cc
+++ b/ui/events/gestures/gesture_configuration.cc
@@ -6,30 +6,28 @@
namespace ui {
-int GestureConfiguration::default_radius_ = 25;
+float GestureConfiguration::default_radius_ = 25;
int GestureConfiguration::fling_max_cancel_to_down_time_in_ms_ = 400;
int GestureConfiguration::fling_max_tap_gap_time_in_ms_ = 200;
float GestureConfiguration::fling_velocity_cap_ = 17000.0f;
int GestureConfiguration::tab_scrub_activation_delay_in_ms_ = 200;
-double GestureConfiguration::long_press_time_in_seconds_ = 1.0;
-double GestureConfiguration::semi_long_press_time_in_seconds_ = 0.4;
-double GestureConfiguration::max_distance_for_two_finger_tap_in_pixels_ = 300;
-double GestureConfiguration::max_seconds_between_double_click_ = 0.7;
-double
- GestureConfiguration::max_separation_for_gesture_touches_in_pixels_ = 150;
+int GestureConfiguration::long_press_time_in_ms_ = 1000;
+int GestureConfiguration::semi_long_press_time_in_ms_ = 400;
+float GestureConfiguration::max_distance_for_two_finger_tap_in_pixels_ = 300;
+int GestureConfiguration::max_time_between_double_click_in_ms_ = 700;
+float GestureConfiguration::max_separation_for_gesture_touches_in_pixels_ = 150;
float GestureConfiguration::max_swipe_deviation_angle_ = 20;
-double
- GestureConfiguration::max_touch_down_duration_in_seconds_for_click_ = 0.8;
-double GestureConfiguration::max_touch_move_in_pixels_for_click_ = 15;
-double GestureConfiguration::max_distance_between_taps_for_double_tap_ = 20;
-double GestureConfiguration::min_distance_for_pinch_scroll_in_pixels_ = 20;
-double GestureConfiguration::min_pinch_update_distance_in_pixels_ = 5;
+int GestureConfiguration::max_touch_down_duration_for_click_in_ms_ = 800;
+float GestureConfiguration::max_touch_move_in_pixels_for_click_ = 15;
+float GestureConfiguration::max_distance_between_taps_for_double_tap_ = 20;
+float GestureConfiguration::min_distance_for_pinch_scroll_in_pixels_ = 20;
+float GestureConfiguration::min_pinch_update_distance_in_pixels_ = 5;
float GestureConfiguration::min_scroll_velocity_ = 30.0f;
-double GestureConfiguration::min_swipe_speed_ = 20;
+float GestureConfiguration::min_swipe_speed_ = 20;
// If this is too small, we currently can get single finger pinch zoom. See
// crbug.com/357237 for details.
-int GestureConfiguration::min_scaling_span_in_pixels_ = 125;
+float GestureConfiguration::min_scaling_span_in_pixels_ = 125;
int GestureConfiguration::show_press_delay_in_ms_ = 150;
// TODO(jdduke): Disable and remove entirely when issues with intermittent
diff --git a/ui/events/gestures/gesture_configuration.h b/ui/events/gestures/gesture_configuration.h
index 1537b8e..c72208e 100644
--- a/ui/events/gestures/gesture_configuration.h
+++ b/ui/events/gestures/gesture_configuration.h
@@ -18,10 +18,12 @@
public:
// Ordered alphabetically ignoring underscores, to align with the
// associated list of prefs in gesture_prefs_aura.cc.
- static int default_radius() {
+ static float default_radius() {
return default_radius_;
}
- static void set_default_radius(int radius) { default_radius_ = radius; }
+ static void set_default_radius(float radius) {
+ default_radius_ = radius;
+ }
static int fling_max_cancel_to_down_time_in_ms() {
return fling_max_cancel_to_down_time_in_ms_;
}
@@ -34,34 +36,34 @@
static void set_fling_max_tap_gap_time_in_ms(int val) {
fling_max_tap_gap_time_in_ms_ = val;
}
- static double long_press_time_in_seconds() {
- return long_press_time_in_seconds_;
+ static int long_press_time_in_ms() {
+ return long_press_time_in_ms_;
}
- static double semi_long_press_time_in_seconds() {
- return semi_long_press_time_in_seconds_;
+ static int semi_long_press_time_in_ms() {
+ return semi_long_press_time_in_ms_;
}
- static double max_distance_for_two_finger_tap_in_pixels() {
+ static float max_distance_for_two_finger_tap_in_pixels() {
return max_distance_for_two_finger_tap_in_pixels_;
}
- static void set_max_distance_for_two_finger_tap_in_pixels(double val) {
+ static void set_max_distance_for_two_finger_tap_in_pixels(float val) {
max_distance_for_two_finger_tap_in_pixels_ = val;
}
- static void set_long_press_time_in_seconds(double val) {
- long_press_time_in_seconds_ = val;
+ static void set_long_press_time_in_ms(int val) {
+ long_press_time_in_ms_ = val;
}
- static void set_semi_long_press_time_in_seconds(double val) {
- semi_long_press_time_in_seconds_ = val;
+ static void set_semi_long_press_time_in_ms(int val) {
+ semi_long_press_time_in_ms_ = val;
}
- static double max_seconds_between_double_click() {
- return max_seconds_between_double_click_;
+ static int max_time_between_double_click_in_ms() {
+ return max_time_between_double_click_in_ms_;
}
- static void set_max_seconds_between_double_click(double val) {
- max_seconds_between_double_click_ = val;
+ static void set_max_time_between_double_click_in_ms(int val) {
+ max_time_between_double_click_in_ms_ = val;
}
- static int max_separation_for_gesture_touches_in_pixels() {
+ static float max_separation_for_gesture_touches_in_pixels() {
return max_separation_for_gesture_touches_in_pixels_;
}
- static void set_max_separation_for_gesture_touches_in_pixels(int val) {
+ static void set_max_separation_for_gesture_touches_in_pixels(float val) {
max_separation_for_gesture_touches_in_pixels_ = val;
}
static float max_swipe_deviation_angle() {
@@ -70,34 +72,34 @@
static void set_max_swipe_deviation_angle(float val) {
max_swipe_deviation_angle_ = val;
}
- static double max_touch_down_duration_in_seconds_for_click() {
- return max_touch_down_duration_in_seconds_for_click_;
+ static int max_touch_down_duration_for_click_in_ms() {
+ return max_touch_down_duration_for_click_in_ms_;
}
- static void set_max_touch_down_duration_in_seconds_for_click(double val) {
- max_touch_down_duration_in_seconds_for_click_ = val;
+ static void set_max_touch_down_duration_for_click_in_ms(int val) {
+ max_touch_down_duration_for_click_in_ms_ = val;
}
- static double max_touch_move_in_pixels_for_click() {
+ static float max_touch_move_in_pixels_for_click() {
return max_touch_move_in_pixels_for_click_;
}
- static void set_max_touch_move_in_pixels_for_click(double val) {
+ static void set_max_touch_move_in_pixels_for_click(float val) {
max_touch_move_in_pixels_for_click_ = val;
}
- static double max_distance_between_taps_for_double_tap() {
+ static float max_distance_between_taps_for_double_tap() {
return max_distance_between_taps_for_double_tap_;
}
- static void set_max_distance_between_taps_for_double_tap(double val) {
+ static void set_max_distance_between_taps_for_double_tap(float val) {
max_distance_between_taps_for_double_tap_ = val;
}
- static double min_distance_for_pinch_scroll_in_pixels() {
+ static float min_distance_for_pinch_scroll_in_pixels() {
return min_distance_for_pinch_scroll_in_pixels_;
}
- static void set_min_distance_for_pinch_scroll_in_pixels(double val) {
+ static void set_min_distance_for_pinch_scroll_in_pixels(float val) {
min_distance_for_pinch_scroll_in_pixels_ = val;
}
- static double min_pinch_update_distance_in_pixels() {
+ static float min_pinch_update_distance_in_pixels() {
return min_pinch_update_distance_in_pixels_;
}
- static void set_min_pinch_update_distance_in_pixels(double val) {
+ static void set_min_pinch_update_distance_in_pixels(float val) {
min_pinch_update_distance_in_pixels_ = val;
}
static float min_scroll_velocity() {
@@ -106,16 +108,16 @@
static void set_min_scroll_velocity(float val) {
min_scroll_velocity_ = val;
}
- static double min_swipe_speed() {
+ static float min_swipe_speed() {
return min_swipe_speed_;
}
- static void set_min_swipe_speed(double val) {
+ static void set_min_swipe_speed(float val) {
min_swipe_speed_ = val;
}
- static int min_scaling_span_in_pixels() {
+ static float min_scaling_span_in_pixels() {
return min_scaling_span_in_pixels_;
};
- static void set_min_scaling_span_in_pixels(int val) {
+ static void set_min_scaling_span_in_pixels(float val) {
min_scaling_span_in_pixels_ = val;
}
static int show_press_delay_in_ms() {
@@ -151,12 +153,12 @@
// The default touch radius length used when the only information given
// by the device is the touch center.
- static int default_radius_;
+ static float default_radius_;
// The maximum allowed distance between two fingers for a two finger tap. If
// the distance between two fingers is greater than this value, we will not
// recognize a two finger tap.
- static double max_distance_for_two_finger_tap_in_pixels_;
+ static float max_distance_for_two_finger_tap_in_pixels_;
// Maximum time between a GestureFlingCancel and a mousedown such that the
// mousedown is considered associated with the cancel event.
@@ -166,20 +168,20 @@
// suppressable tap.
static int fling_max_tap_gap_time_in_ms_;
- static double long_press_time_in_seconds_;
- static double semi_long_press_time_in_seconds_;
- static double max_seconds_between_double_click_;
- static double max_separation_for_gesture_touches_in_pixels_;
+ static int long_press_time_in_ms_;
+ static int semi_long_press_time_in_ms_;
+ static int max_time_between_double_click_in_ms_;
+ static float max_separation_for_gesture_touches_in_pixels_;
static float max_swipe_deviation_angle_;
- static double max_touch_down_duration_in_seconds_for_click_;
- static double max_touch_move_in_pixels_for_click_;
- static double max_distance_between_taps_for_double_tap_;
- static double min_distance_for_pinch_scroll_in_pixels_;
+ static int max_touch_down_duration_for_click_in_ms_;
+ static float max_touch_move_in_pixels_for_click_;
+ static float max_distance_between_taps_for_double_tap_;
+ static float min_distance_for_pinch_scroll_in_pixels_;
// Only used with --compensate-for-unstable-pinch-zoom.
- static double min_pinch_update_distance_in_pixels_;
+ static float min_pinch_update_distance_in_pixels_;
static float min_scroll_velocity_;
- static double min_swipe_speed_;
- static int min_scaling_span_in_pixels_;
+ static float min_swipe_speed_;
+ static float min_scaling_span_in_pixels_;
static int show_press_delay_in_ms_;
static int scroll_debounce_interval_in_ms_;
static float fling_velocity_cap_;
diff --git a/ui/events/gestures/gesture_provider_aura.cc b/ui/events/gestures/gesture_provider_aura.cc
index a731357..d3ef218 100644
--- a/ui/events/gestures/gesture_provider_aura.cc
+++ b/ui/events/gestures/gesture_provider_aura.cc
@@ -122,12 +122,11 @@
const GestureEventData& current_tap) const {
if (current_tap.time - previous_tap.time >
base::TimeDelta::FromMilliseconds(
- ui::GestureConfiguration::max_seconds_between_double_click() *
- 1000)) {
+ ui::GestureConfiguration::max_time_between_double_click_in_ms())) {
return false;
}
- double double_tap_slop_square =
+ float double_tap_slop_square =
GestureConfiguration::max_distance_between_taps_for_double_tap();
double_tap_slop_square *= double_tap_slop_square;
const float delta_x = previous_tap.x - current_tap.x;
diff --git a/ui/events/gestures/gesture_provider_aura.h b/ui/events/gestures/gesture_provider_aura.h
index 712b84f..6b649dc 100644
--- a/ui/events/gestures/gesture_provider_aura.h
+++ b/ui/events/gestures/gesture_provider_aura.h
@@ -35,7 +35,7 @@
ScopedVector<GestureEvent>* GetAndResetPendingGestures();
// GestureProviderClient implementation
- virtual void OnGestureEvent(const GestureEventData& gesture) OVERRIDE;
+ virtual void OnGestureEvent(const GestureEventData& gesture) override;
private:
bool IsConsideredDoubleTap(const GestureEventData& previous_tap,
diff --git a/ui/events/gestures/gesture_provider_aura_unittest.cc b/ui/events/gestures/gesture_provider_aura_unittest.cc
index e2b1523..11cc3ca 100644
--- a/ui/events/gestures/gesture_provider_aura_unittest.cc
+++ b/ui/events/gestures/gesture_provider_aura_unittest.cc
@@ -17,13 +17,13 @@
virtual ~GestureProviderAuraTest() {}
- virtual void OnGestureEvent(GestureEvent* event) OVERRIDE {}
+ virtual void OnGestureEvent(GestureEvent* event) override {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
provider_.reset(new GestureProviderAura(this));
}
- virtual void TearDown() OVERRIDE { provider_.reset(); }
+ virtual void TearDown() override { provider_.reset(); }
GestureProviderAura* provider() { return provider_.get(); }
diff --git a/ui/events/gestures/gesture_recognizer_impl.cc b/ui/events/gestures/gesture_recognizer_impl.cc
index 5f6cfda..9f6eb3e 100644
--- a/ui/events/gestures/gesture_recognizer_impl.cc
+++ b/ui/events/gestures/gesture_recognizer_impl.cc
@@ -91,12 +91,12 @@
GestureConsumer* GestureRecognizerImpl::GetTargetForLocation(
const gfx::PointF& location, int source_device_id) {
- const int max_distance =
+ const float max_distance =
GestureConfiguration::max_separation_for_gesture_touches_in_pixels();
gfx::PointF closest_point;
int closest_touch_id = 0;
- float closest_distance_squared = std::numeric_limits<float>::infinity();
+ double closest_distance_squared = std::numeric_limits<double>::infinity();
std::map<GestureConsumer*, GestureProviderAura*>::iterator i;
for (i = consumer_gesture_provider_.begin();
@@ -109,7 +109,7 @@
gfx::PointF point(pointer_state.GetX(j), pointer_state.GetY(j));
// Relative distance is all we need here, so LengthSquared() is
// appropriate, and cheaper than Length().
- float distance_squared = (point - location).LengthSquared();
+ double distance_squared = (point - location).LengthSquared();
if (distance_squared < closest_distance_squared) {
closest_point = point;
closest_touch_id = pointer_state.GetPointerId(j);
diff --git a/ui/events/gestures/gesture_recognizer_impl.h b/ui/events/gestures/gesture_recognizer_impl.h
index 7ba74f3..60edfba 100644
--- a/ui/events/gestures/gesture_recognizer_impl.h
+++ b/ui/events/gestures/gesture_recognizer_impl.h
@@ -37,16 +37,16 @@
// Overridden from GestureRecognizer
virtual GestureConsumer* GetTouchLockedTarget(
- const TouchEvent& event) OVERRIDE;
+ const TouchEvent& event) override;
virtual GestureConsumer* GetTargetForGestureEvent(
- const GestureEvent& event) OVERRIDE;
+ const GestureEvent& event) override;
virtual GestureConsumer* GetTargetForLocation(
- const gfx::PointF& location, int source_device_id) OVERRIDE;
+ const gfx::PointF& location, int source_device_id) override;
virtual void TransferEventsTo(GestureConsumer* current_consumer,
- GestureConsumer* new_consumer) OVERRIDE;
+ GestureConsumer* new_consumer) override;
virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer,
- gfx::PointF* point) OVERRIDE;
- virtual bool CancelActiveTouches(GestureConsumer* consumer) OVERRIDE;
+ gfx::PointF* point) override;
+ virtual bool CancelActiveTouches(GestureConsumer* consumer) override;
protected:
virtual GestureProviderAura* GetGestureProviderForConsumer(
@@ -60,25 +60,25 @@
// Overridden from GestureRecognizer
virtual bool ProcessTouchEventPreDispatch(const TouchEvent& event,
- GestureConsumer* consumer) OVERRIDE;
+ GestureConsumer* consumer) override;
virtual Gestures* ProcessTouchEventPostDispatch(
const TouchEvent& event,
ui::EventResult result,
- GestureConsumer* consumer) OVERRIDE;
+ GestureConsumer* consumer) override;
virtual Gestures* ProcessTouchEventOnAsyncAck(
const TouchEvent& event,
ui::EventResult result,
- GestureConsumer* consumer) OVERRIDE;
+ GestureConsumer* consumer) override;
virtual bool CleanupStateForConsumer(GestureConsumer* consumer)
- OVERRIDE;
- virtual void AddGestureEventHelper(GestureEventHelper* helper) OVERRIDE;
- virtual void RemoveGestureEventHelper(GestureEventHelper* helper) OVERRIDE;
+ override;
+ virtual void AddGestureEventHelper(GestureEventHelper* helper) override;
+ virtual void RemoveGestureEventHelper(GestureEventHelper* helper) override;
// Overridden from GestureProviderAuraClient
- virtual void OnGestureEvent(GestureEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(GestureEvent* event) override;
// Convenience method to find the GestureEventHelper that can dispatch events
// to a specific |consumer|.
diff --git a/ui/events/gestures/gesture_recognizer_impl_mac.cc b/ui/events/gestures/gesture_recognizer_impl_mac.cc
index 4dfa311..b123593 100644
--- a/ui/events/gestures/gesture_recognizer_impl_mac.cc
+++ b/ui/events/gestures/gesture_recognizer_impl_mac.cc
@@ -19,48 +19,48 @@
private:
virtual bool ProcessTouchEventPreDispatch(
const TouchEvent& event,
- GestureConsumer* consumer) OVERRIDE {
+ GestureConsumer* consumer) override {
return false;
}
virtual Gestures* ProcessTouchEventPostDispatch(
const TouchEvent& event,
ui::EventResult result,
- GestureConsumer* consumer) OVERRIDE {
+ GestureConsumer* consumer) override {
return NULL;
}
virtual Gestures* ProcessTouchEventOnAsyncAck(
const TouchEvent& event,
ui::EventResult result,
- GestureConsumer* consumer) OVERRIDE {
+ GestureConsumer* consumer) override {
return NULL;
};
- virtual bool CleanupStateForConsumer(GestureConsumer* consumer) OVERRIDE {
+ virtual bool CleanupStateForConsumer(GestureConsumer* consumer) override {
return false;
}
virtual GestureConsumer* GetTouchLockedTarget(
- const TouchEvent& event) OVERRIDE {
+ const TouchEvent& event) override {
return NULL;
}
virtual GestureConsumer* GetTargetForGestureEvent(
- const GestureEvent& event) OVERRIDE {
+ const GestureEvent& event) override {
return NULL;
}
virtual GestureConsumer* GetTargetForLocation(const gfx::PointF& location,
- int source_device_id) OVERRIDE {
+ int source_device_id) override {
return NULL;
}
virtual void TransferEventsTo(GestureConsumer* current_consumer,
- GestureConsumer* new_consumer) OVERRIDE {}
+ GestureConsumer* new_consumer) override {}
virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer,
- gfx::PointF* point) OVERRIDE {
+ gfx::PointF* point) override {
return false;
}
- virtual bool CancelActiveTouches(GestureConsumer* consumer) OVERRIDE {
+ virtual bool CancelActiveTouches(GestureConsumer* consumer) override {
return false;
}
- virtual void AddGestureEventHelper(GestureEventHelper* helper) OVERRIDE {}
- virtual void RemoveGestureEventHelper(GestureEventHelper* helper) OVERRIDE {}
+ virtual void AddGestureEventHelper(GestureEventHelper* helper) override {}
+ virtual void RemoveGestureEventHelper(GestureEventHelper* helper) override {}
DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImplMac);
};
diff --git a/ui/events/gestures/motion_event_aura.h b/ui/events/gestures/motion_event_aura.h
index ec956fc..7ba2726 100644
--- a/ui/events/gestures/motion_event_aura.h
+++ b/ui/events/gestures/motion_event_aura.h
@@ -24,26 +24,26 @@
void OnTouch(const TouchEvent& touch);
// MotionEvent implementation.
- virtual int GetId() const OVERRIDE;
- virtual Action GetAction() const OVERRIDE;
- virtual int GetActionIndex() const OVERRIDE;
- virtual size_t GetPointerCount() const OVERRIDE;
- virtual int GetPointerId(size_t pointer_index) const OVERRIDE;
- virtual float GetX(size_t pointer_index) const OVERRIDE;
- virtual float GetY(size_t pointer_index) const OVERRIDE;
- virtual float GetRawX(size_t pointer_index) const OVERRIDE;
- virtual float GetRawY(size_t pointer_index) const OVERRIDE;
- virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE;
- virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE;
- virtual float GetOrientation(size_t pointer_index) const OVERRIDE;
- virtual float GetPressure(size_t pointer_index) const OVERRIDE;
- virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE;
- virtual int GetButtonState() const OVERRIDE;
- virtual int GetFlags() const OVERRIDE;
- virtual base::TimeTicks GetEventTime() const OVERRIDE;
+ virtual int GetId() const override;
+ virtual Action GetAction() const override;
+ virtual int GetActionIndex() const override;
+ virtual size_t GetPointerCount() const override;
+ virtual int GetPointerId(size_t pointer_index) const override;
+ virtual float GetX(size_t pointer_index) const override;
+ virtual float GetY(size_t pointer_index) const override;
+ virtual float GetRawX(size_t pointer_index) const override;
+ virtual float GetRawY(size_t pointer_index) const override;
+ virtual float GetTouchMajor(size_t pointer_index) const override;
+ virtual float GetTouchMinor(size_t pointer_index) const override;
+ virtual float GetOrientation(size_t pointer_index) const override;
+ virtual float GetPressure(size_t pointer_index) const override;
+ virtual ToolType GetToolType(size_t pointer_index) const override;
+ virtual int GetButtonState() const override;
+ virtual int GetFlags() const override;
+ virtual base::TimeTicks GetEventTime() const override;
- virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
- virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
+ virtual scoped_ptr<MotionEvent> Clone() const override;
+ virtual scoped_ptr<MotionEvent> Cancel() const override;
int GetSourceDeviceId(size_t pointer_index) const;
diff --git a/ui/events/keycodes/keyboard_code_conversion_x.cc b/ui/events/keycodes/keyboard_code_conversion_x.cc
index daba811..a4a810e 100644
--- a/ui/events/keycodes/keyboard_code_conversion_x.cc
+++ b/ui/events/keycodes/keyboard_code_conversion_x.cc
@@ -485,11 +485,24 @@
} else {
xkeyevent.xkey = xev->xkey;
}
+ KeyboardCode keycode = VKEY_UNKNOWN;
XKeyEvent* xkey = &xkeyevent.xkey;
- xkey->state &= (~0xFF | Mod2Mask); // Clears the xkey's state except numlock.
// XLookupKeysym does not take into consideration the state of the lock/shift
// etc. keys. So it is necessary to use XLookupString instead.
XLookupString(xkey, NULL, 0, &keysym, NULL);
+ if (IsKeypadKey(keysym) || IsPrivateKeypadKey(keysym) ||
+ IsCursorKey(keysym) || IsPFKey(keysym) || IsFunctionKey(keysym) ||
+ IsModifierKey(keysym)) {
+ return KeyboardCodeFromXKeysym(keysym);
+ }
+
+ // If |xkey| has modifiers set, other than NumLock, then determine the
+ // un-modified KeySym and use that to map, so that e.g. Ctrl+D correctly
+ // generates VKEY_D.
+ if (xkey->state & 0xFF & ~Mod2Mask) {
+ xkey->state &= (~0xFF | Mod2Mask);
+ XLookupString(xkey, NULL, 0, &keysym, NULL);
+ }
// [a-z] cases.
if (keysym >= XK_a && keysym <= XK_z)
@@ -499,8 +512,6 @@
if (keysym >= XK_0 && keysym <= XK_9)
return static_cast<KeyboardCode>(VKEY_0 + keysym - XK_0);
- KeyboardCode keycode = VKEY_UNKNOWN;
-
if (!IsKeypadKey(keysym) && !IsPrivateKeypadKey(keysym) &&
!IsCursorKey(keysym) && !IsPFKey(keysym) && !IsFunctionKey(keysym) &&
!IsModifierKey(keysym)) {
@@ -535,7 +546,7 @@
// On Linux some keys has AltGr char but not on Windows.
// So if cannot find VKEY with (ch0+sc+ch1+ch2) in map3, tries to fallback
// to just find VKEY with (ch0+sc+ch1). This is the best we could do.
- MAP3 key4 = {keysym & 0xFFFF, xkey->keycode, keysym_shift & 0xFFFF, 0xFFFF,
+ MAP3 key4 = {keysym & 0xFFFF, xkey->keycode, keysym_shift & 0xFFFF, 0,
0};
const MAP3* p =
std::lower_bound(map3, map3 + arraysize(map3), key4, MAP3());
@@ -769,6 +780,8 @@
// https://bugs.freedesktop.org/show_bug.cgi?id=5783
// In Chrome, we map these X key symbols back to F13-18 since we don't have
// VKEYs for these XF86XK symbols.
+ case XF86XK_Tools:
+ return VKEY_F13;
case XF86XK_Launch5:
return VKEY_F14;
case XF86XK_Launch6:
@@ -816,13 +829,6 @@
case XF86XK_LaunchB: // F4 on an Apple keyboard.
case XF86XK_Calculator:
return VKEY_MEDIA_LAUNCH_APP2;
-
- // XF86XK_Tools is generated from HID Usage AL_CONSUMER_CONTROL_CONFIG
- // (Usage 0x0183, Page 0x0C) and most commonly launches the OS default
- // media player (see crbug.com/398345).
- case XF86XK_Tools:
- return VKEY_MEDIA_LAUNCH_MEDIA_SELECT;
-
case XF86XK_WLAN:
return VKEY_WLAN;
case XF86XK_PowerOff:
diff --git a/ui/events/latency_info.cc b/ui/events/latency_info.cc
index 5cd1521..fe96055 100644
--- a/ui/events/latency_info.cc
+++ b/ui/events/latency_info.cc
@@ -29,6 +29,9 @@
CASE_TYPE(INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT);
CASE_TYPE(WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT);
CASE_TYPE(WINDOW_OLD_SNAPSHOT_FRAME_NUMBER_COMPONENT);
+ CASE_TYPE(INPUT_EVENT_BROWSER_COMPOSITE_COMPONENT);
+ CASE_TYPE(INPUT_EVENT_BROWSER_SWAP_BUFFER_COMPONENT);
+ CASE_TYPE(INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT);
CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT);
CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT);
CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_GESTURE_COMPONENT);
@@ -73,7 +76,7 @@
static scoped_refptr<ConvertableToTraceFormat> FromValue(
scoped_ptr<base::Value> value);
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE;
+ virtual void AppendAsTraceFormat(std::string* out) const override;
private:
explicit LatencyInfoTracedValue(base::Value* value);
diff --git a/ui/events/ozone/device/device_manager_manual.h b/ui/events/ozone/device/device_manager_manual.h
index 9d1cf61..9104774 100644
--- a/ui/events/ozone/device/device_manager_manual.h
+++ b/ui/events/ozone/device/device_manager_manual.h
@@ -17,9 +17,9 @@
private:
// DeviceManager overrides:
- virtual void ScanDevices(DeviceEventObserver* observer) OVERRIDE;
- virtual void AddObserver(DeviceEventObserver* observer) OVERRIDE;
- virtual void RemoveObserver(DeviceEventObserver* observer) OVERRIDE;
+ virtual void ScanDevices(DeviceEventObserver* observer) override;
+ virtual void AddObserver(DeviceEventObserver* observer) override;
+ virtual void RemoveObserver(DeviceEventObserver* observer) override;
DISALLOW_COPY_AND_ASSIGN(DeviceManagerManual);
};
diff --git a/ui/events/ozone/device/udev/device_manager_udev.h b/ui/events/ozone/device/udev/device_manager_udev.h
index 8a7537a..13c76b9 100644
--- a/ui/events/ozone/device/udev/device_manager_udev.h
+++ b/ui/events/ozone/device/udev/device_manager_udev.h
@@ -28,13 +28,13 @@
void CreateMonitor();
// DeviceManager overrides:
- virtual void ScanDevices(DeviceEventObserver* observer) OVERRIDE;
- virtual void AddObserver(DeviceEventObserver* observer) OVERRIDE;
- virtual void RemoveObserver(DeviceEventObserver* observer) OVERRIDE;
+ virtual void ScanDevices(DeviceEventObserver* observer) override;
+ virtual void AddObserver(DeviceEventObserver* observer) override;
+ virtual void RemoveObserver(DeviceEventObserver* observer) override;
// base::MessagePumpLibevent::Watcher overrides:
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override;
device::ScopedUdevPtr udev_;
device::ScopedUdevMonitorPtr monitor_;
diff --git a/ui/events/ozone/evdev/event_converter_evdev.h b/ui/events/ozone/evdev/event_converter_evdev.h
index b4b2463..fc12037 100644
--- a/ui/events/ozone/evdev/event_converter_evdev.h
+++ b/ui/events/ozone/evdev/event_converter_evdev.h
@@ -8,15 +8,12 @@
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/message_loop/message_loop.h"
+#include "ui/events/ozone/evdev/event_dispatch_callback.h"
#include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
#include "ui/gfx/geometry/size.h"
namespace ui {
-class Event;
-
-typedef base::Callback<void(Event*)> EventDispatchCallback;
-
class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev
: public base::MessagePumpLibevent::Watcher {
public:
@@ -25,6 +22,8 @@
int id() const { return id_; }
+ const base::FilePath& path() { return path_; }
+
// Start reading events.
void Start();
@@ -40,7 +39,7 @@
protected:
// base::MessagePumpLibevent::Watcher:
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override;
// File descriptor to read.
int fd_;
diff --git a/ui/events/ozone/evdev/event_device_util.h b/ui/events/ozone/evdev/event_device_util.h
index ddb7b80..2b65b3b 100644
--- a/ui/events/ozone/evdev/event_device_util.h
+++ b/ui/events/ozone/evdev/event_device_util.h
@@ -12,7 +12,7 @@
#define EVDEV_LONG_BITS (CHAR_BIT * sizeof(long))
#define EVDEV_BITS_TO_LONGS(x) (((x) + EVDEV_LONG_BITS - 1) / EVDEV_LONG_BITS)
-static inline int EvdevBitIsSet(const unsigned long* data, int bit) {
+static inline bool EvdevBitIsSet(const unsigned long* data, int bit) {
return data[bit / EVDEV_LONG_BITS] & (1UL << (bit % EVDEV_LONG_BITS));
}
diff --git a/ui/events/ozone/evdev/event_dispatch_callback.h b/ui/events/ozone/evdev/event_dispatch_callback.h
new file mode 100644
index 0000000..1974d51
--- /dev/null
+++ b/ui/events/ozone/evdev/event_dispatch_callback.h
@@ -0,0 +1,18 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_
+#define UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_
+
+#include "base/callback.h"
+
+namespace ui {
+
+class Event;
+
+typedef base::Callback<void(Event*)> EventDispatchCallback;
+
+} // namspace ui
+
+#endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_
diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc
index 88ec979..0895c0a 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.cc
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -33,6 +33,24 @@
namespace {
+typedef base::Callback<void(scoped_ptr<EventConverterEvdev>)>
+ OpenInputDeviceReplyCallback;
+
+struct OpenInputDeviceParams {
+ // Unique identifier for the new device.
+ int id;
+
+ // Device path to open.
+ base::FilePath path;
+
+ // Callback for dispatching events. Call on UI thread only.
+ EventDispatchCallback dispatch_callback;
+
+ // State shared between devices. Must not be dereferenced on worker thread.
+ EventModifiersEvdev* modifiers;
+ CursorDelegateEvdev* cursor;
+};
+
#if defined(USE_EVDEV_GESTURES)
bool UseGesturesLibraryForDevice(const EventDeviceInfo& devinfo) {
if (devinfo.HasAbsXY() && !devinfo.IsMappedToScreen())
@@ -46,24 +64,21 @@
#endif
scoped_ptr<EventConverterEvdev> CreateConverter(
+ const OpenInputDeviceParams& params,
int fd,
- const base::FilePath& path,
- int id,
- const EventDeviceInfo& devinfo,
- const EventDispatchCallback& dispatch,
- EventModifiersEvdev* modifiers,
- CursorDelegateEvdev* cursor) {
+ const EventDeviceInfo& devinfo) {
#if defined(USE_EVDEV_GESTURES)
// Touchpad or mouse: use gestures library.
// EventReaderLibevdevCros -> GestureInterpreterLibevdevCros -> DispatchEvent
if (UseGesturesLibraryForDevice(devinfo)) {
- scoped_ptr<GestureInterpreterLibevdevCros> gesture_interp = make_scoped_ptr(
- new GestureInterpreterLibevdevCros(modifiers, cursor, dispatch));
+ scoped_ptr<GestureInterpreterLibevdevCros> gesture_interp =
+ make_scoped_ptr(new GestureInterpreterLibevdevCros(
+ params.modifiers, params.cursor, params.dispatch_callback));
scoped_ptr<EventReaderLibevdevCros> libevdev_reader =
make_scoped_ptr(new EventReaderLibevdevCros(
fd,
- path,
- id,
+ params.path,
+ params.id,
gesture_interp.PassAs<EventReaderLibevdevCros::Delegate>()));
return libevdev_reader.PassAs<EventConverterEvdev>();
}
@@ -72,12 +87,12 @@
// Touchscreen: use TouchEventConverterEvdev.
scoped_ptr<EventConverterEvdev> converter;
if (devinfo.HasAbsXY())
- return make_scoped_ptr<EventConverterEvdev>(
- new TouchEventConverterEvdev(fd, path, id, devinfo, dispatch));
+ return make_scoped_ptr<EventConverterEvdev>(new TouchEventConverterEvdev(
+ fd, params.path, params.id, devinfo, params.dispatch_callback));
// Everything else: use KeyEventConverterEvdev.
- return make_scoped_ptr<EventConverterEvdev>(
- new KeyEventConverterEvdev(fd, path, id, modifiers, dispatch));
+ return make_scoped_ptr<EventConverterEvdev>(new KeyEventConverterEvdev(
+ fd, params.path, params.id, params.modifiers, params.dispatch_callback));
}
// Open an input device. Opening may put the calling thread to sleep, and
@@ -86,14 +101,11 @@
//
// This takes a TaskRunner and runs the reply on that thread, so that we
// can hop threads if necessary (back to the UI thread).
-void OpenInputDevice(
- const base::FilePath& path,
- EventModifiersEvdev* modifiers,
- CursorDelegateEvdev* cursor,
- int device_id,
- scoped_refptr<base::TaskRunner> reply_runner,
- const EventDispatchCallback& dispatch,
- base::Callback<void(scoped_ptr<EventConverterEvdev>)> reply_callback) {
+void OpenInputDevice(scoped_ptr<OpenInputDeviceParams> params,
+ scoped_refptr<base::TaskRunner> reply_runner,
+ const OpenInputDeviceReplyCallback& reply_callback) {
+ const base::FilePath& path = params->path;
+
TRACE_EVENT1("ozone", "OpenInputDevice", "path", path.value());
int fd = open(path.value().c_str(), O_RDONLY | O_NONBLOCK);
@@ -116,8 +128,8 @@
return;
}
- scoped_ptr<EventConverterEvdev> converter = CreateConverter(
- fd, path, device_id, devinfo, dispatch, modifiers, cursor);
+ scoped_ptr<EventConverterEvdev> converter =
+ CreateConverter(*params, fd, devinfo);
// Reply with the constructed converter.
reply_runner->PostTask(FROM_HERE,
@@ -154,8 +166,9 @@
}
void EventFactoryEvdev::AttachInputDevice(
- const base::FilePath& path,
scoped_ptr<EventConverterEvdev> converter) {
+ const base::FilePath& path = converter->path();
+
TRACE_EVENT1("ozone", "AttachInputDevice", "path", path.value());
DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
@@ -180,20 +193,24 @@
case DeviceEvent::CHANGE: {
TRACE_EVENT1("ozone", "OnDeviceAdded", "path", event.path().value());
+ scoped_ptr<OpenInputDeviceParams> params(new OpenInputDeviceParams);
+ params->id = NextDeviceId();
+ params->path = event.path();
+ params->dispatch_callback = dispatch_callback_;
+ params->modifiers = &modifiers_;
+ params->cursor = cursor_;
+
+ OpenInputDeviceReplyCallback reply_callback =
+ base::Bind(&EventFactoryEvdev::AttachInputDevice,
+ weak_ptr_factory_.GetWeakPtr());
+
// Dispatch task to open from the worker pool, since open may block.
- base::WorkerPool::PostTask(
- FROM_HERE,
- base::Bind(&OpenInputDevice,
- event.path(),
- &modifiers_,
- cursor_,
- NextDeviceId(),
- ui_task_runner_,
- dispatch_callback_,
- base::Bind(&EventFactoryEvdev::AttachInputDevice,
- weak_ptr_factory_.GetWeakPtr(),
- event.path())),
- true);
+ base::WorkerPool::PostTask(FROM_HERE,
+ base::Bind(&OpenInputDevice,
+ base::Passed(¶ms),
+ ui_task_runner_,
+ reply_callback),
+ true /* task_is_slow */);
}
break;
case DeviceEvent::REMOVE: {
diff --git a/ui/events/ozone/evdev/event_factory_evdev.h b/ui/events/ozone/evdev/event_factory_evdev.h
index 15031e4..806ec29 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.h
+++ b/ui/events/ozone/evdev/event_factory_evdev.h
@@ -41,8 +41,7 @@
private:
// Open device at path & starting processing events (on UI thread).
- void AttachInputDevice(const base::FilePath& file_path,
- scoped_ptr<EventConverterEvdev> converter);
+ void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter);
// Close device at path (on UI thread).
void DetachInputDevice(const base::FilePath& file_path);
@@ -54,10 +53,10 @@
// DeviceEventObserver overrides:
//
// Callback for device add (on UI thread).
- virtual void OnDeviceEvent(const DeviceEvent& event) OVERRIDE;
+ virtual void OnDeviceEvent(const DeviceEvent& event) override;
// PlatformEventSource:
- virtual void OnDispatcherListChanged() OVERRIDE;
+ virtual void OnDispatcherListChanged() override;
// Owned per-device event converters (by path).
std::map<base::FilePath, EventConverterEvdev*> converters_;
diff --git a/ui/events/ozone/evdev/key_event_converter_evdev.h b/ui/events/ozone/evdev/key_event_converter_evdev.h
index d1cab8c..9a2f771 100644
--- a/ui/events/ozone/evdev/key_event_converter_evdev.h
+++ b/ui/events/ozone/evdev/key_event_converter_evdev.h
@@ -27,7 +27,7 @@
virtual ~KeyEventConverterEvdev();
// EventConverterEvdev:
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
void ProcessEvents(const struct input_event* inputs, int count);
diff --git a/ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc
index 575e86d..a144bce 100644
--- a/ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc
+++ b/ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc
@@ -57,7 +57,7 @@
KeyEventConverterEvdevTest() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Set up pipe to satisfy message pump (unused).
int evdev_io[2];
@@ -69,7 +69,7 @@
modifiers_ = new ui::EventModifiersEvdev();
device_ = new ui::MockKeyEventConverterEvdev(events_in_, modifiers_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
delete device_;
delete modifiers_;
close(events_in_);
diff --git a/ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h b/ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h
index a67d037..c056496 100644
--- a/ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h
+++ b/ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h
@@ -42,7 +42,7 @@
~EventReaderLibevdevCros();
// EventConverterEvdev:
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
private:
static void OnSynReport(void* data,
diff --git a/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.h b/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.h
index 1044a11..f097fb4 100644
--- a/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.h
+++ b/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.h
@@ -11,18 +11,16 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
+#include "ui/events/ozone/evdev/event_dispatch_callback.h"
#include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
#include "ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h"
namespace ui {
-class Event;
class EventDeviceInfo;
class EventModifiersEvdev;
class CursorDelegateEvdev;
-typedef base::Callback<void(Event*)> EventDispatchCallback;
-
// Convert libevdev-cros events to ui::Events using libgestures.
//
// This builds a GestureInterpreter for an input device (touchpad or
@@ -46,10 +44,10 @@
// Overriden from ui::EventReaderLibevdevCros::Delegate
virtual void OnLibEvdevCrosOpen(Evdev* evdev,
- EventStateRec* evstate) OVERRIDE;
+ EventStateRec* evstate) override;
virtual void OnLibEvdevCrosEvent(Evdev* evdev,
EventStateRec* evstate,
- const timeval& time) OVERRIDE;
+ const timeval& time) override;
// Handler for gesture events generated from libgestures.
void OnGestureReady(const Gesture* gesture);
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev.h b/ui/events/ozone/evdev/touch_event_converter_evdev.h
index f85e0fe..83aa13a 100644
--- a/ui/events/ozone/evdev/touch_event_converter_evdev.h
+++ b/ui/events/ozone/evdev/touch_event_converter_evdev.h
@@ -33,8 +33,8 @@
virtual ~TouchEventConverterEvdev();
// EventConverterEvdev:
- virtual bool HasTouchscreen() const OVERRIDE;
- virtual gfx::Size GetTouchscreenSize() const OVERRIDE;
+ virtual bool HasTouchscreen() const override;
+ virtual gfx::Size GetTouchscreenSize() const override;
private:
friend class MockTouchEventConverterEvdev;
@@ -43,7 +43,7 @@
void Init(const EventDeviceInfo& info);
// Overidden from base::MessagePumpLibevent::Watcher.
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
virtual bool Reinitialize();
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
index 95dc5c4..3e76476 100644
--- a/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
+++ b/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
@@ -59,7 +59,7 @@
new TouchEvent(*static_cast<TouchEvent*>(event)));
}
- virtual bool Reinitialize() OVERRIDE { return true; }
+ virtual bool Reinitialize() override { return true; }
private:
int read_pipe_;
@@ -120,7 +120,7 @@
TouchEventConverterEvdevTest() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Set up pipe to satisfy message pump (unused).
int evdev_io[2];
if (pipe(evdev_io))
@@ -133,7 +133,7 @@
events_in_, base::FilePath(kTestDevicePath));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
delete device_;
delete loop_;
}
diff --git a/ui/events/platform/platform_event_source_unittest.cc b/ui/events/platform/platform_event_source_unittest.cc
index cdbd0c4..cc34960 100644
--- a/ui/events/platform/platform_event_source_unittest.cc
+++ b/ui/events/platform/platform_event_source_unittest.cc
@@ -65,7 +65,7 @@
}
// PlatformEventSource:
- virtual void StopCurrentEventStream() OVERRIDE {
+ virtual void StopCurrentEventStream() override {
stop_stream_ = true;
}
@@ -93,11 +93,11 @@
protected:
// PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE {
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override {
return true;
}
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE {
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override {
list_->push_back(id_);
return post_dispatch_action_;
}
@@ -123,11 +123,11 @@
protected:
// PlatformEventObserver:
- virtual void WillProcessEvent(const PlatformEvent& event) OVERRIDE {
+ virtual void WillProcessEvent(const PlatformEvent& event) override {
list_->push_back(id_);
}
- virtual void DidProcessEvent(const PlatformEvent& event) OVERRIDE {}
+ virtual void DidProcessEvent(const PlatformEvent& event) override {}
private:
int id_;
@@ -145,7 +145,7 @@
protected:
// testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
source_.reset(new TestPlatformEventSource());
}
@@ -342,7 +342,7 @@
protected:
// PlatformEventDispatcher:
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE {
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override {
if (!callback_.is_null())
callback_.Run();
return TestPlatformEventDispatcher::DispatchEvent(event);
@@ -530,7 +530,7 @@
: public PlatformEventTestWithMessageLoop {
public:
// PlatformEventTestWithMessageLoop:
- virtual void RunTestImpl() OVERRIDE {
+ virtual void RunTestImpl() override {
std::vector<int> list;
TestPlatformEventDispatcher dispatcher(10, &list);
TestPlatformEventObserver observer(15, &list);
@@ -581,11 +581,11 @@
private:
// PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE {
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override {
return true;
}
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE {
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override {
handler_.reset();
uint32_t action = TestPlatformEventDispatcher::DispatchEvent(event);
if (!callback_.is_null()) {
@@ -640,7 +640,7 @@
}
// PlatformEventTestWithMessageLoop:
- virtual void RunTestImpl() OVERRIDE {
+ virtual void RunTestImpl() override {
std::vector<int> list;
TestPlatformEventDispatcher dispatcher(10, &list);
TestPlatformEventObserver observer(15, &list);
@@ -740,7 +740,7 @@
}
// PlatformEventTestWithMessageLoop:
- virtual void RunTestImpl() OVERRIDE {
+ virtual void RunTestImpl() override {
std::vector<int> list;
TestPlatformEventDispatcher dispatcher(10, &list);
TestPlatformEventObserver observer(15, &list);
diff --git a/ui/events/platform/x11/x11_event_source.h b/ui/events/platform/x11/x11_event_source.h
index 598afa8..206ca5a 100644
--- a/ui/events/platform/x11/x11_event_source.h
+++ b/ui/events/platform/x11/x11_event_source.h
@@ -48,8 +48,8 @@
private:
// PlatformEventSource:
- virtual uint32_t DispatchEvent(XEvent* xevent) OVERRIDE;
- virtual void StopCurrentEventStream() OVERRIDE;
+ virtual uint32_t DispatchEvent(XEvent* xevent) override;
+ virtual void StopCurrentEventStream() override;
// The connection to the X11 server used to receive the events.
XDisplay* display_;
diff --git a/ui/events/platform/x11/x11_event_source_libevent.cc b/ui/events/platform/x11/x11_event_source_libevent.cc
index d92e12a..8ad7931 100644
--- a/ui/events/platform/x11/x11_event_source_libevent.cc
+++ b/ui/events/platform/x11/x11_event_source_libevent.cc
@@ -39,16 +39,16 @@
}
// PlatformEventSource:
- virtual void OnDispatcherListChanged() OVERRIDE {
+ virtual void OnDispatcherListChanged() override {
AddEventWatcher();
}
// base::MessagePumpLibevent::Watcher:
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE {
+ virtual void OnFileCanReadWithoutBlocking(int fd) override {
DispatchXEvents();
}
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override {
NOTREACHED();
}
diff --git a/ui/events/test/mock_motion_event.h b/ui/events/test/mock_motion_event.h
index 9ae9a71..5c34b71 100644
--- a/ui/events/test/mock_motion_event.h
+++ b/ui/events/test/mock_motion_event.h
@@ -40,8 +40,8 @@
virtual ~MockMotionEvent();
// MotionEvent methods.
- virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
- virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
+ virtual scoped_ptr<MotionEvent> Clone() const override;
+ virtual scoped_ptr<MotionEvent> Cancel() const override;
// Utility methods.
void PressPoint(float x, float y);
diff --git a/ui/events/test/platform_event_waiter.h b/ui/events/test/platform_event_waiter.h
index 259662c..647a011 100644
--- a/ui/events/test/platform_event_waiter.h
+++ b/ui/events/test/platform_event_waiter.h
@@ -23,8 +23,8 @@
virtual ~PlatformEventWaiter();
// PlatformEventObserver:
- virtual void WillProcessEvent(const PlatformEvent& event) OVERRIDE;
- virtual void DidProcessEvent(const PlatformEvent& event) OVERRIDE;
+ virtual void WillProcessEvent(const PlatformEvent& event) override;
+ virtual void DidProcessEvent(const PlatformEvent& event) override;
base::Closure success_callback_;
PlatformEventMatcher event_matcher_;
diff --git a/ui/events/test/test_event_handler.h b/ui/events/test/test_event_handler.h
index 8937b25..d501233 100644
--- a/ui/events/test/test_event_handler.h
+++ b/ui/events/test/test_event_handler.h
@@ -40,11 +40,11 @@
}
// EventHandler overrides:
- virtual void OnKeyEvent(KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ScrollEvent* event) OVERRIDE;
- virtual void OnTouchEvent(TouchEvent* event) OVERRIDE;
- virtual void OnGestureEvent(GestureEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(KeyEvent* event) override;
+ virtual void OnMouseEvent(MouseEvent* event) override;
+ virtual void OnScrollEvent(ScrollEvent* event) override;
+ virtual void OnTouchEvent(TouchEvent* event) override;
+ virtual void OnGestureEvent(GestureEvent* event) override;
private:
// How many events have been received of each type?
diff --git a/ui/events/test/test_event_processor.h b/ui/events/test/test_event_processor.h
index 5b9a99b..1e42aa1 100644
--- a/ui/events/test/test_event_processor.h
+++ b/ui/events/test/test_event_processor.h
@@ -32,11 +32,11 @@
void Reset();
// EventProcessor:
- virtual bool CanDispatchToTarget(EventTarget* target) OVERRIDE;
- virtual EventTarget* GetRootTarget() OVERRIDE;
- virtual EventDispatchDetails OnEventFromSource(Event* event) OVERRIDE;
- virtual void OnEventProcessingStarted(Event* event) OVERRIDE;
- virtual void OnEventProcessingFinished(Event* event) OVERRIDE;
+ virtual bool CanDispatchToTarget(EventTarget* target) override;
+ virtual EventTarget* GetRootTarget() override;
+ virtual EventDispatchDetails OnEventFromSource(Event* event) override;
+ virtual void OnEventProcessingStarted(Event* event) override;
+ virtual void OnEventProcessingFinished(Event* event) override;
private:
scoped_ptr<EventTarget> root_;
diff --git a/ui/events/test/test_event_target.h b/ui/events/test/test_event_target.h
index 368e295..cadcfa9 100644
--- a/ui/events/test/test_event_target.h
+++ b/ui/events/test/test_event_target.h
@@ -54,13 +54,13 @@
bool Contains(TestEventTarget* target) const;
// EventTarget:
- virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
- virtual EventTarget* GetParentTarget() OVERRIDE;
- virtual scoped_ptr<EventTargetIterator> GetChildIterator() const OVERRIDE;
- virtual EventTargeter* GetEventTargeter() OVERRIDE;
+ virtual bool CanAcceptEvent(const ui::Event& event) override;
+ virtual EventTarget* GetParentTarget() override;
+ virtual scoped_ptr<EventTargetIterator> GetChildIterator() const override;
+ virtual EventTargeter* GetEventTargeter() override;
// EventHandler:
- virtual void OnEvent(Event* event) OVERRIDE;
+ virtual void OnEvent(Event* event) override;
private:
void set_parent(TestEventTarget* parent) { parent_ = parent; }
diff --git a/ui/events/x/events_x_unittest.cc b/ui/events/x/events_x_unittest.cc
index d8e2c83..32b121c 100644
--- a/ui/events/x/events_x_unittest.cc
+++ b/ui/events/x/events_x_unittest.cc
@@ -85,7 +85,7 @@
EventsXTest() {}
virtual ~EventsXTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
DeviceDataManagerX11::CreateInstance();
ui::TouchFactory::GetInstance()->ResetForTest();
}
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/bottom_base_center.png b/ui/file_manager/audio_player/assets/100/bottom_base_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/bottom_base_center.png
rename to ui/file_manager/audio_player/assets/100/bottom_base_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/bottom_base_left.png b/ui/file_manager/audio_player/assets/100/bottom_base_left.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/bottom_base_left.png
rename to ui/file_manager/audio_player/assets/100/bottom_base_left.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/bottom_base_right.png b/ui/file_manager/audio_player/assets/100/bottom_base_right.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/bottom_base_right.png
rename to ui/file_manager/audio_player/assets/100/bottom_base_right.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_next.png b/ui/file_manager/audio_player/assets/100/player_button_next.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_next.png
rename to ui/file_manager/audio_player/assets/100/player_button_next.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_pause.png b/ui/file_manager/audio_player/assets/100/player_button_pause.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_pause.png
rename to ui/file_manager/audio_player/assets/100/player_button_pause.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_play.png b/ui/file_manager/audio_player/assets/100/player_button_play.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_play.png
rename to ui/file_manager/audio_player/assets/100/player_button_play.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_playlist.png b/ui/file_manager/audio_player/assets/100/player_button_playlist.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_playlist.png
rename to ui/file_manager/audio_player/assets/100/player_button_playlist.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_playlist_active.png b/ui/file_manager/audio_player/assets/100/player_button_playlist_active.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_playlist_active.png
rename to ui/file_manager/audio_player/assets/100/player_button_playlist_active.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_pressed.png b/ui/file_manager/audio_player/assets/100/player_button_pressed.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_pressed.png
rename to ui/file_manager/audio_player/assets/100/player_button_pressed.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_previous.png b/ui/file_manager/audio_player/assets/100/player_button_previous.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_previous.png
rename to ui/file_manager/audio_player/assets/100/player_button_previous.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_repeat.png b/ui/file_manager/audio_player/assets/100/player_button_repeat.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_repeat.png
rename to ui/file_manager/audio_player/assets/100/player_button_repeat.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_repeat_active.png b/ui/file_manager/audio_player/assets/100/player_button_repeat_active.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_repeat_active.png
rename to ui/file_manager/audio_player/assets/100/player_button_repeat_active.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_shuffle.png b/ui/file_manager/audio_player/assets/100/player_button_shuffle.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_shuffle.png
rename to ui/file_manager/audio_player/assets/100/player_button_shuffle.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_shuffle_active.png b/ui/file_manager/audio_player/assets/100/player_button_shuffle_active.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_shuffle_active.png
rename to ui/file_manager/audio_player/assets/100/player_button_shuffle_active.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_volume.png b/ui/file_manager/audio_player/assets/100/player_button_volume.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_volume.png
rename to ui/file_manager/audio_player/assets/100/player_button_volume.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_button_volume_active.png b/ui/file_manager/audio_player/assets/100/player_button_volume_active.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_button_volume_active.png
rename to ui/file_manager/audio_player/assets/100/player_button_volume_active.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_timeline_base_center.png b/ui/file_manager/audio_player/assets/100/player_timeline_base_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_timeline_base_center.png
rename to ui/file_manager/audio_player/assets/100/player_timeline_base_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_timeline_base_left.png b/ui/file_manager/audio_player/assets/100/player_timeline_base_left.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_timeline_base_left.png
rename to ui/file_manager/audio_player/assets/100/player_timeline_base_left.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_timeline_base_right.png b/ui/file_manager/audio_player/assets/100/player_timeline_base_right.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_timeline_base_right.png
rename to ui/file_manager/audio_player/assets/100/player_timeline_base_right.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_timeline_handler.png b/ui/file_manager/audio_player/assets/100/player_timeline_handler.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_timeline_handler.png
rename to ui/file_manager/audio_player/assets/100/player_timeline_handler.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_timeline_handler_pressed.png b/ui/file_manager/audio_player/assets/100/player_timeline_handler_pressed.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_timeline_handler_pressed.png
rename to ui/file_manager/audio_player/assets/100/player_timeline_handler_pressed.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_timeline_played_center.png b/ui/file_manager/audio_player/assets/100/player_timeline_played_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_timeline_played_center.png
rename to ui/file_manager/audio_player/assets/100/player_timeline_played_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_timeline_played_left.png b/ui/file_manager/audio_player/assets/100/player_timeline_played_left.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_timeline_played_left.png
rename to ui/file_manager/audio_player/assets/100/player_timeline_played_left.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_timeline_played_right.png b/ui/file_manager/audio_player/assets/100/player_timeline_played_right.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_timeline_played_right.png
rename to ui/file_manager/audio_player/assets/100/player_timeline_played_right.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_volume_base_bottom.png b/ui/file_manager/audio_player/assets/100/player_volume_base_bottom.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_volume_base_bottom.png
rename to ui/file_manager/audio_player/assets/100/player_volume_base_bottom.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_volume_base_center.png b/ui/file_manager/audio_player/assets/100/player_volume_base_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_volume_base_center.png
rename to ui/file_manager/audio_player/assets/100/player_volume_base_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_volume_base_top.png b/ui/file_manager/audio_player/assets/100/player_volume_base_top.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_volume_base_top.png
rename to ui/file_manager/audio_player/assets/100/player_volume_base_top.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_volume_level_bottom.png b/ui/file_manager/audio_player/assets/100/player_volume_level_bottom.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_volume_level_bottom.png
rename to ui/file_manager/audio_player/assets/100/player_volume_level_bottom.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_volume_level_center.png b/ui/file_manager/audio_player/assets/100/player_volume_level_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_volume_level_center.png
rename to ui/file_manager/audio_player/assets/100/player_volume_level_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/100/player_volume_level_top.png b/ui/file_manager/audio_player/assets/100/player_volume_level_top.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/100/player_volume_level_top.png
rename to ui/file_manager/audio_player/assets/100/player_volume_level_top.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/bottom_base_center.png b/ui/file_manager/audio_player/assets/200/bottom_base_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/bottom_base_center.png
rename to ui/file_manager/audio_player/assets/200/bottom_base_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/bottom_base_left.png b/ui/file_manager/audio_player/assets/200/bottom_base_left.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/bottom_base_left.png
rename to ui/file_manager/audio_player/assets/200/bottom_base_left.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/bottom_base_right.png b/ui/file_manager/audio_player/assets/200/bottom_base_right.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/bottom_base_right.png
rename to ui/file_manager/audio_player/assets/200/bottom_base_right.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_next.png b/ui/file_manager/audio_player/assets/200/player_button_next.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_next.png
rename to ui/file_manager/audio_player/assets/200/player_button_next.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_pause.png b/ui/file_manager/audio_player/assets/200/player_button_pause.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_pause.png
rename to ui/file_manager/audio_player/assets/200/player_button_pause.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_play.png b/ui/file_manager/audio_player/assets/200/player_button_play.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_play.png
rename to ui/file_manager/audio_player/assets/200/player_button_play.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_playlist.png b/ui/file_manager/audio_player/assets/200/player_button_playlist.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_playlist.png
rename to ui/file_manager/audio_player/assets/200/player_button_playlist.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_playlist_active.png b/ui/file_manager/audio_player/assets/200/player_button_playlist_active.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_playlist_active.png
rename to ui/file_manager/audio_player/assets/200/player_button_playlist_active.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_pressed.png b/ui/file_manager/audio_player/assets/200/player_button_pressed.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_pressed.png
rename to ui/file_manager/audio_player/assets/200/player_button_pressed.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_previous.png b/ui/file_manager/audio_player/assets/200/player_button_previous.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_previous.png
rename to ui/file_manager/audio_player/assets/200/player_button_previous.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_repeat.png b/ui/file_manager/audio_player/assets/200/player_button_repeat.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_repeat.png
rename to ui/file_manager/audio_player/assets/200/player_button_repeat.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_repeat_active.png b/ui/file_manager/audio_player/assets/200/player_button_repeat_active.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_repeat_active.png
rename to ui/file_manager/audio_player/assets/200/player_button_repeat_active.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_shuffle.png b/ui/file_manager/audio_player/assets/200/player_button_shuffle.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_shuffle.png
rename to ui/file_manager/audio_player/assets/200/player_button_shuffle.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_shuffle_active.png b/ui/file_manager/audio_player/assets/200/player_button_shuffle_active.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_shuffle_active.png
rename to ui/file_manager/audio_player/assets/200/player_button_shuffle_active.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_volume.png b/ui/file_manager/audio_player/assets/200/player_button_volume.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_volume.png
rename to ui/file_manager/audio_player/assets/200/player_button_volume.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_button_volume_active.png b/ui/file_manager/audio_player/assets/200/player_button_volume_active.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_button_volume_active.png
rename to ui/file_manager/audio_player/assets/200/player_button_volume_active.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_timeline_base_center.png b/ui/file_manager/audio_player/assets/200/player_timeline_base_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_timeline_base_center.png
rename to ui/file_manager/audio_player/assets/200/player_timeline_base_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_timeline_base_left.png b/ui/file_manager/audio_player/assets/200/player_timeline_base_left.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_timeline_base_left.png
rename to ui/file_manager/audio_player/assets/200/player_timeline_base_left.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_timeline_base_right.png b/ui/file_manager/audio_player/assets/200/player_timeline_base_right.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_timeline_base_right.png
rename to ui/file_manager/audio_player/assets/200/player_timeline_base_right.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_timeline_handler.png b/ui/file_manager/audio_player/assets/200/player_timeline_handler.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_timeline_handler.png
rename to ui/file_manager/audio_player/assets/200/player_timeline_handler.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_timeline_handler_pressed.png b/ui/file_manager/audio_player/assets/200/player_timeline_handler_pressed.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_timeline_handler_pressed.png
rename to ui/file_manager/audio_player/assets/200/player_timeline_handler_pressed.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_timeline_played_center.png b/ui/file_manager/audio_player/assets/200/player_timeline_played_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_timeline_played_center.png
rename to ui/file_manager/audio_player/assets/200/player_timeline_played_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_timeline_played_left.png b/ui/file_manager/audio_player/assets/200/player_timeline_played_left.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_timeline_played_left.png
rename to ui/file_manager/audio_player/assets/200/player_timeline_played_left.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_timeline_played_right.png b/ui/file_manager/audio_player/assets/200/player_timeline_played_right.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_timeline_played_right.png
rename to ui/file_manager/audio_player/assets/200/player_timeline_played_right.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_volume_base_bottom.png b/ui/file_manager/audio_player/assets/200/player_volume_base_bottom.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_volume_base_bottom.png
rename to ui/file_manager/audio_player/assets/200/player_volume_base_bottom.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_volume_base_center.png b/ui/file_manager/audio_player/assets/200/player_volume_base_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_volume_base_center.png
rename to ui/file_manager/audio_player/assets/200/player_volume_base_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_volume_base_top.png b/ui/file_manager/audio_player/assets/200/player_volume_base_top.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_volume_base_top.png
rename to ui/file_manager/audio_player/assets/200/player_volume_base_top.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_volume_level_bottom.png b/ui/file_manager/audio_player/assets/200/player_volume_level_bottom.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_volume_level_bottom.png
rename to ui/file_manager/audio_player/assets/200/player_volume_level_bottom.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_volume_level_center.png b/ui/file_manager/audio_player/assets/200/player_volume_level_center.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_volume_level_center.png
rename to ui/file_manager/audio_player/assets/200/player_volume_level_center.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/assets/200/player_volume_level_top.png b/ui/file_manager/audio_player/assets/200/player_volume_level_top.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/assets/200/player_volume_level_top.png
rename to ui/file_manager/audio_player/assets/200/player_volume_level_top.png
Binary files differ
diff --git a/ui/file_manager/audio_player/audio_player.html b/ui/file_manager/audio_player/audio_player.html
new file mode 100644
index 0000000..974ab37
--- /dev/null
+++ b/ui/file_manager/audio_player/audio_player.html
@@ -0,0 +1,206 @@
+<!--
+ -- Copyright 2014 The Chromium Authors. All rights reserved.
+ -- Use of this source code is governed by a BSD-style license that can be
+ -- found in the LICENSE file.
+ -->
+<!DOCTYPE HTML>
+<html>
+<head>
+ <!-- We have to set some default title, or chrome will use the page name.
+ -- As soon as the i18n'd strings are loaded we replace it with the correct
+ -- string. Until then, use an invisible non-whitespace character.
+ -->
+ <title></title>
+ <link rel="stylesheet" type="text/css" href="css/audio_player.css">
+
+ <!-- Don't load mediaplayer_scripts.js when flattening is disabled -->
+ <if expr="False"><!-- </if>
+ <script src="js/audio_player_scripts.js"></script>
+ <if expr="False"> --></if>
+ <if expr="False">
+ <!-- This section is used when the file manager is loaded with
+ 'filemgr-ext-path' command-line flag. -->
+ <!-- Keep the list in sync with audio_player_scripts.js. -->
+ <script src="../../webui//resources/js/cr.js"></script>
+ <script src="../../webui/resources/js/cr/event_target.js"></script>
+ <script src="../../webui/resources/js/cr/ui/array_data_model.js">
+ </script>
+
+ <script src="../../../third_party/polymer/platform/platform.js"></script>
+ <script src="../../../third_party/polymer/polymer/polymer.js"></script>
+
+ <script src="../file_manager/common/js/async_util.js"></script>
+ <script src="../file_manager/common/js/util.js"></script>
+ <script src="../file_manager/common/js/volume_manager_common.js"></script>
+ <script src="../file_manager/foreground/js/file_type.js"></script>
+ <script src="../file_manager/foreground/js/volume_manager_wrapper.js"></script>
+ <script src="../file_manager/foreground/js/metadata/metadata_cache.js"></script>
+
+ <script src="js/audio_player.js"></script>
+
+ <script src="elements/track_list.js"></script>
+ <script src="elements/control_panel.js"></script>
+ <script src="elements/volume_controller.js"></script>
+ <script src="elements/audio_player.js"></script>
+ </if>
+ </head>
+<body>
+ <!-- Definition of <track-list> tag. -->
+ <polymer-element name="track-list" attributes="tracks">
+ <template>
+ <link rel="stylesheet" href="elements/track_list.css"></link>
+ <template id="tracks" repeat="{{track, index in tracks}}">
+ <div class="track" active?="{{track.active}}" index="{{index}}" on-click="{{trackClicked}}">
+ <div class="data">
+ <div class="data-title">{{track.title}}</div>
+ <div class="data-artist">{{track.artist}}</div>
+ </div>
+ </div>
+ </template>
+ </template>
+ </polymer-element>
+
+ <!-- Definition of <control-panel> tag. -->
+ <polymer-element name="control-panel">
+ <template>
+ <link rel="stylesheet" href="elements/control_panel.css"></link>
+
+ <div class="controls">
+ <div class="upper-controls time-controls">
+ <div class="time media-control">
+ <div class="current">{{timeString_}}</div>
+ </div>
+ <div class="progress media-control custom-slider">
+ <input name="timeInput"
+ type="range"
+ min="0" max="{{duration}}" value="{{time}}">
+ <div class="bar">
+ <div class="filled" style="width: {{time/duration*100}}%;"></div>
+ <div class="cap left"></div>
+ <div class="cap right"></div>
+ </div>
+ </div>
+ <div class="time media-control">
+ <div class="duration">{{durationString_}}</div>
+ </div>
+ </div>
+ <div class="lower-controls audio-controls">
+ <!-- Shuffle toggle button in the bottom line. -->
+ <button class="shuffle-mode media-button toggle" state="default">
+ <label>
+ <input id="shuffleCheckbox"
+ type="checkbox"
+ checked="{{model.shuffle}}"></input>
+ <span class="icon"></span>
+ </label>
+ </button>
+
+ <!-- Repeat toggle button in the bottom line. -->
+ <button class="repeat media-button toggle" state="default">
+ <label>
+ <input id="repeatCheckbox"
+ type="checkbox"
+ checked="{{model.repeat}}"></input>
+ <span class="icon"></span>
+ </label>
+ </button>
+
+ <!-- Prev button in the bottom line. -->
+ <button class="previous media-button"
+ state="default"
+ on-click="{{previousClick}}">
+ <div class="normal default"></div>
+ <div class="disabled"></div>
+ </button>
+
+ <!-- Play button in the bottom line. -->
+ <button class="play media-control media-button"
+ state='{{playing ? "playing" : "ended"}}'
+ on-click="{{playClick}}">
+ <div class="normal playing"></div>
+ <div class="normal ended"></div>
+ <div class="disabled"></div>
+ </button>
+
+ <!-- Next button in the bottom line. -->
+ <button class="next media-button"
+ state="default"
+ on-click="{{nextClick}}">
+ <div class="normal default"></div>
+ <div class="disabled"></div>
+ </button>
+
+ <div id="volumeContainer"
+ class="default-hidden"
+ anchor-point="bottom center">
+ <volume-controller id="volumeSlider"
+ width="32" height="85" value="50">
+ </volume-controller>
+
+ <polymer-anchor-point id="anchorHelper"></polymer-anchor-point>
+ </div>
+
+ <!-- Volume button in the bottom line. -->
+ <button id="volumeButton"
+ class="volume media-button toggle"
+ state="default"
+ on-click="{{volumeButtonClick}}"
+ anchor-point="bottom center">
+ <label>
+ <input type="checkbox" checked="{{volumeSliderShown}}"></input>
+ <span class="icon"></span>
+ </label>
+ </button>
+
+ <!-- Playlist button in the bottom line. -->
+ <button id="playlistButton"
+ class="playlist media-button toggle"
+ state="default">
+ <label>
+ <input type="checkbox" checked="{{model.expanded}}"></input>
+ <span class="icon"></span>
+ </label>
+ </button>
+ </div>
+ </div>
+ </template>
+ </polymer-element>
+
+ <!-- Definition of <volume-controller> tag. -->
+ <polymer-element name="volume-controller" attributes="width height value">
+ <template>
+ <link rel="stylesheet" href="elements/volume_controller.css"></link>
+
+ <div id="background"></div>
+ <input name="rawValueInput" id="rawValueInput"
+ type="range" min="0" max="100" value="{{rawValue}}">
+ <div id="bar">
+ <div class="filled" style="height: {{rawValue}}%;"></div>
+ <div class="cap left"></div>
+ <div class="cap right"></div>
+ </div>
+ </template>
+ </polymer-element>
+
+ <!-- Definition of <audio-player> tag. -->
+ <polymer-element name="audio-player"
+ attributes="playing currenttrackurl playcount">
+ <template>
+ <link rel="stylesheet" href="elements/audio_player.css"></link>
+
+ <track-list id="trackList" expanded?="{{model.expanded}}"
+ on-replay="{{onReplayCurrentTrack}}"></track-list>
+ <control-panel id="audioController"
+ on-next-clicked="{{onControllerNextClicked}}"
+ on-previous-clicked="{{onControllerPreviousClicked}}">
+ </control-panel>
+ <audio id="audio"></audio>
+ </template>
+ </polymer-element>
+
+ <div class="audio-player">
+ <!-- Place the audio player. -->
+ <audio-player></audio-player>
+ </div>
+</body>
+</html>
diff --git a/ui/file_manager/file_manager/audio_player/css/audio_player.css b/ui/file_manager/audio_player/css/audio_player.css
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/css/audio_player.css
rename to ui/file_manager/audio_player/css/audio_player.css
diff --git a/ui/file_manager/file_manager/audio_player/elements/audio_player.css b/ui/file_manager/audio_player/elements/audio_player.css
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/elements/audio_player.css
rename to ui/file_manager/audio_player/elements/audio_player.css
diff --git a/ui/file_manager/file_manager/audio_player/elements/audio_player.js b/ui/file_manager/audio_player/elements/audio_player.js
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/elements/audio_player.js
rename to ui/file_manager/audio_player/elements/audio_player.js
diff --git a/ui/file_manager/file_manager/audio_player/elements/control_panel.css b/ui/file_manager/audio_player/elements/control_panel.css
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/elements/control_panel.css
rename to ui/file_manager/audio_player/elements/control_panel.css
diff --git a/ui/file_manager/file_manager/audio_player/elements/control_panel.js b/ui/file_manager/audio_player/elements/control_panel.js
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/elements/control_panel.js
rename to ui/file_manager/audio_player/elements/control_panel.js
diff --git a/ui/file_manager/file_manager/audio_player/elements/track_list.css b/ui/file_manager/audio_player/elements/track_list.css
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/elements/track_list.css
rename to ui/file_manager/audio_player/elements/track_list.css
diff --git a/ui/file_manager/file_manager/audio_player/elements/track_list.js b/ui/file_manager/audio_player/elements/track_list.js
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/elements/track_list.js
rename to ui/file_manager/audio_player/elements/track_list.js
diff --git a/ui/file_manager/file_manager/audio_player/elements/volume_controller.css b/ui/file_manager/audio_player/elements/volume_controller.css
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/elements/volume_controller.css
rename to ui/file_manager/audio_player/elements/volume_controller.css
diff --git a/ui/file_manager/file_manager/audio_player/elements/volume_controller.js b/ui/file_manager/audio_player/elements/volume_controller.js
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/elements/volume_controller.js
rename to ui/file_manager/audio_player/elements/volume_controller.js
diff --git a/ui/file_manager/file_manager/audio_player/icons/audio-player-128.png b/ui/file_manager/audio_player/icons/audio-player-128.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/icons/audio-player-128.png
rename to ui/file_manager/audio_player/icons/audio-player-128.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/icons/audio-player-256.png b/ui/file_manager/audio_player/icons/audio-player-256.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/icons/audio-player-256.png
rename to ui/file_manager/audio_player/icons/audio-player-256.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/icons/audio-player-32.png b/ui/file_manager/audio_player/icons/audio-player-32.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/icons/audio-player-32.png
rename to ui/file_manager/audio_player/icons/audio-player-32.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/icons/audio-player-48.png b/ui/file_manager/audio_player/icons/audio-player-48.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/icons/audio-player-48.png
rename to ui/file_manager/audio_player/icons/audio-player-48.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/icons/audio-player-64.png b/ui/file_manager/audio_player/icons/audio-player-64.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/icons/audio-player-64.png
rename to ui/file_manager/audio_player/icons/audio-player-64.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/icons/audio-player-96.png b/ui/file_manager/audio_player/icons/audio-player-96.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/icons/audio-player-96.png
rename to ui/file_manager/audio_player/icons/audio-player-96.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/icons/audio-player-favicon-16.png b/ui/file_manager/audio_player/icons/audio-player-favicon-16.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/icons/audio-player-favicon-16.png
rename to ui/file_manager/audio_player/icons/audio-player-favicon-16.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/icons/audio-player-favicon-32.png b/ui/file_manager/audio_player/icons/audio-player-favicon-32.png
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/icons/audio-player-favicon-32.png
rename to ui/file_manager/audio_player/icons/audio-player-favicon-32.png
Binary files differ
diff --git a/ui/file_manager/file_manager/audio_player/js/audio_player.js b/ui/file_manager/audio_player/js/audio_player.js
similarity index 98%
rename from ui/file_manager/file_manager/audio_player/js/audio_player.js
rename to ui/file_manager/audio_player/js/audio_player.js
index a9a053f..932dee3 100644
--- a/ui/file_manager/file_manager/audio_player/js/audio_player.js
+++ b/ui/file_manager/audio_player/js/audio_player.js
@@ -5,6 +5,13 @@
'use strict';
/**
+ * Overrided metadata worker's path.
+ * @type {string}
+ * @const
+ */
+ContentProvider.WORKER_SCRIPT = '/js/metadata_worker.js';
+
+/**
* @param {HTMLElement} container Container element.
* @constructor
*/
diff --git a/ui/file_manager/file_manager/audio_player/js/audio_player_model.js b/ui/file_manager/audio_player/js/audio_player_model.js
similarity index 100%
rename from ui/file_manager/file_manager/audio_player/js/audio_player_model.js
rename to ui/file_manager/audio_player/js/audio_player_model.js
diff --git a/ui/file_manager/audio_player/js/audio_player_scripts.js b/ui/file_manager/audio_player/js/audio_player_scripts.js
new file mode 100644
index 0000000..5d730cf
--- /dev/null
+++ b/ui/file_manager/audio_player/js/audio_player_scripts.js
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+<include src="../../../webui/resources/js/cr.js"/>
+<include src="../../../webui/resources/js/cr/event_target.js"/>
+<include src="../../../webui/resources/js/cr/ui/array_data_model.js"/>
+
+// Hack for polymer, notifying that CSP is enabled here.
+// TODO(yoshiki): Find a way to remove the hack.
+if (!('securityPolicy' in document))
+ document['securityPolicy'] = {};
+if (!('allowsEval' in document.securityPolicy))
+ document.securityPolicy['allowsEval'] = false;
+
+// Force Polymer into dirty-checking mode, see http://crbug.com/351967
+Object['observe'] = undefined;
+
+<include src="../../../../third_party/polymer/components/platform/platform.js">
+<include src="../../../../third_party/polymer/components/polymer/polymer.js">
+
+(function() {
+
+// 'strict mode' is invoked for this scope.
+'use strict';
+
+<include src="../../file_manager/common/js/async_util.js"/>
+<include src="../../file_manager/common/js/util.js"/>
+<include src="../../file_manager/common/js/volume_manager_common.js"/>
+<include src="../../file_manager/foreground/js/file_type.js"/>
+<include src="../../file_manager/foreground/js/volume_manager_wrapper.js">
+<include src="../../file_manager/foreground/js/metadata/metadata_cache.js"/>
+
+<include src="audio_player.js"/>
+<include src="audio_player_model.js"/>
+
+<include src="../elements/track_list.js"/>
+<include src="../elements/control_panel.js"/>
+<include src="../elements/volume_controller.js"/>
+<include src="../elements/audio_player.js"/>
+
+window.reload = reload;
+window.unload = unload;
+window.AudioPlayer = AudioPlayer;
+
+})();
diff --git a/ui/file_manager/audio_player/js/background.js b/ui/file_manager/audio_player/js/background.js
new file mode 100644
index 0000000..23cf74c
--- /dev/null
+++ b/ui/file_manager/audio_player/js/background.js
@@ -0,0 +1,166 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+/**
+ * Icon of the audio player.
+ * TODO(yoshiki): Consider providing an exact size icon, instead of relying
+ * on downsampling by ash.
+ *
+ * @type {string}
+ * @const
+ */
+var AUDIO_PLAYER_ICON = 'audio_player/icons/audio-player-64.png';
+
+/**
+ * Configuration of the audio player panel.
+ * @type {Object}
+ */
+var audioPlayerCreateOptions = {
+ id: 'audio-player',
+ type: 'panel',
+ minHeight: 44 + 73, // 44px: track, 73px: controller
+ minWidth: 292,
+ height: 44 + 73, // collapsed
+ width: 292
+};
+
+/**
+ * Backgound object. This is necessary for AppWindowWrapper.
+ * @type {BackgroundBase}
+ */
+var background = new BackgroundBase();
+
+/**
+ * Wrapper of audio player window.
+ * @type {SingletonAppWindowWrapper}
+ */
+var audioPlayer = new SingletonAppWindowWrapper('audio_player.html',
+ audioPlayerCreateOptions);
+
+/**
+ * Queue to serialize initialization.
+ * @type {AsyncUtil.Queue}
+ */
+var initializeQueue = new AsyncUtil.Queue();
+
+// Initializes the strings. This needs for the volume manager.
+initializeQueue.run(function(fulfill) {
+ chrome.fileManagerPrivate.getStrings(function(stringData) {
+ loadTimeData.data = stringData;
+ fulfill();
+ });
+});
+
+// Initializes the volume manager. This needs for isolated entries.
+initializeQueue.run(function(fulfill) {
+ VolumeManager.getInstance(fulfill);
+});
+
+// Registers the handlers.
+chrome.app.runtime.onLaunched.addListener(onLaunched);
+chrome.app.runtime.onRestarted.addListener(onRestarted);
+
+/**
+ * Called when an app is launched.
+ * @param {Object} launchData Launch data.
+ */
+function onLaunched(launchData) {
+ if (!launchData || !launchData.items || launchData.items.length == 0)
+ return;
+
+ var playlist = {};
+
+ initializeQueue.run(function(fulfill) {
+ var isolatedEntries = launchData.items.map(function(item) {
+ return item.entry;
+ });
+
+ chrome.fileManagerPrivate.resolveIsolatedEntries(isolatedEntries,
+ function(externalEntries) {
+ var urls = util.entriesToURLs(externalEntries);
+ playlist = {items: urls, position: 0};
+ fulfill();
+ });
+ });
+
+ initializeQueue.run(function(fulfill) {
+ open(playlist, false);
+ fulfill();
+ });
+}
+
+/**
+ * Called when an app is restarted.
+ */
+function onRestarted() {
+ audioPlayer.reopen(function() {
+ // If the audioPlayer is reopened, change its window's icon. Otherwise
+ // there is no reopened window so just skip the call of setIcon.
+ if (audioPlayer.rawAppWindow)
+ audioPlayer.setIcon(AUDIO_PLAYER_ICON);
+ });
+}
+
+/**
+ * Opens player window.
+ * @param {Object} playlist List of audios to play and index to start playing.
+ * @param {Promise} Promise to be fulfilled on success, or rejected on error.
+ */
+function open(playlist, reopen) {
+ var items = playlist.items;
+ var position = playlist.position;
+ var startUrl = (position < items.length) ? items[position] : '';
+
+ return new Promise(function(fulfill, reject) {
+ if (items.length === 0) {
+ reject('No file to open.');
+ return;
+ }
+
+ // Gets the current list of the children of the parent.
+ window.webkitResolveLocalFileSystemURL(items[0], function(fileEntry) {
+ fileEntry.getParent(function(parentEntry) {
+ var dirReader = parentEntry.createReader();
+ var entries = [];
+
+ // Call the reader.readEntries() until no more results are returned.
+ var readEntries = function() {
+ dirReader.readEntries(function(results) {
+ if (!results.length) {
+ fulfill(entries.sort(util.compareName));
+ } else {
+ entries = entries.concat(Array.prototype.slice.call(results, 0));
+ readEntries();
+ }
+ }, reject);
+ };
+
+ // Start reading.
+ readEntries();
+ }, reject);
+ }, reject);
+ }).then(function(entries) {
+ // Omits non-audio files.
+ var audioEntries = entries.filter(FileType.isAudio);
+
+ // Adjusts the position to start playing.
+ var maybePosition = util.entriesToURLs(audioEntries).indexOf(startUrl);
+ if (maybePosition !== -1)
+ position = maybePosition;
+
+ // Opens the audio player panel.
+ return new Promise(function(fulfill, reject) {
+ var urls = util.entriesToURLs(audioEntries);
+ audioPlayer.launch({items: urls, position: position}, reopen, fulfill);
+ });
+ }).then(function() {
+ audioPlayer.setIcon('icons/audio-player-64.png');
+ AppWindowWrapper.focusOnDesktop(audioPlayer.rawAppWindow);
+ }).catch(function(error) {
+ console.error('Launch failed' + error.stack || error);
+ return Promise.reject(error);
+ });
+}
diff --git a/ui/file_manager/audio_player/js/metadata_worker.js b/ui/file_manager/audio_player/js/metadata_worker.js
new file mode 100644
index 0000000..56ea36c
--- /dev/null
+++ b/ui/file_manager/audio_player/js/metadata_worker.js
@@ -0,0 +1,10 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+// Load the worker script of Files.app.
+importScripts(
+ 'chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/' +
+ 'foreground/js/metadata/metadata_dispatcher.js');
diff --git a/ui/file_manager/audio_player/manifest.json b/ui/file_manager/audio_player/manifest.json
new file mode 100644
index 0000000..a5565c2
--- /dev/null
+++ b/ui/file_manager/audio_player/manifest.json
@@ -0,0 +1,68 @@
+{
+ // chrome-extension://cjbfomnbifhcdnihkgipgfcihmgjfhbf/
+ "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsU2jLo1oiASjXO+/+qYfgojW4Y5TCIBNFzcAdxaF78BRteygWkJqbUVyGZxtSk/RDe3NdNyQCxsyU1YfYXZQvGRNDwKw5tzGyE4dcedveipaJW174VGd3GViS0WWist3HRxfYRZvRP5E8l/4NxXB0+crfq2WolO8La25js1QkCsggQ1lC8g24NRrPnTAWZxvSD6L64R0UoVoe68HdC4mRISe9/OqjyiAfb4Ajgooq8dyzkV8AJTKRjFTmYPlcc5Ba21rXzRt22TnDh2U38m/OEvTu69cyTIxAkBjUa/2gu7N588k9XzaMhTjiolSWxBDQuLZRp8fNjO0R27jouo3FwIDAQAB",
+ "manifest_version": 2,
+ "name": "Audio Player",
+ "version": "1.0",
+ "description": "Audio Player",
+ "display_in_launcher": false,
+ "incognito" : "split",
+ "icons": {
+ "16": "icons/audio-player-favicon-16.png",
+ "32": "icons/audio-player-32.png",
+ "48": "icons/audio-player-48.png",
+ "64": "icons/audio-player-64.png",
+ "96": "icons/audio-player-96.png",
+ "128": "icons/audio-player-128.png",
+ "256": "icons/audio-player-256.png"
+ },
+ "permissions": [
+ "commandLinePrivate",
+ "fileSystem",
+ "fileBrowserHandler",
+ "fileManagerPrivate",
+ "fullscreen",
+ "mediaPlayerPrivate",
+ "power",
+ "storage",
+ "chrome://resources/",
+ "chrome://theme/"
+ ],
+ "file_handlers": {
+ "audio": {
+ "types": [
+ "audio/*"
+ ],
+ "extensions": [
+ "amr",
+ "flac",
+ "m4a",
+ "mp3",
+ "oga",
+ "ogg",
+ "wav"
+ ]
+ }
+ },
+ "app": {
+ "background": {
+ "scripts": [
+ "chrome://resources/js/cr.js",
+ "chrome://resources/js/cr/event_target.js",
+ "chrome://resources/js/cr/ui/array_data_model.js",
+ "chrome://resources/js/load_time_data.js",
+ "chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/common/js/util.js",
+ "chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/common/js/async_util.js",
+ "chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/common/js/volume_manager_common.js",
+ "chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/background/js/app_window_wrapper.js",
+ "chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/background/js/background_base.js",
+ "chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/background/js/test_util.js",
+ "chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/background/js/volume_manager.js",
+ "chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/foreground/js/file_type.js",
+ // The main background script must be at the end.
+ "js/background.js"
+ ]
+ },
+ "content_security_policy": "default-src 'none'; script-src 'self' chrome://resources chrome-extension://boadgeojelhgndaghljhdicfkmllpafd chrome-extension://dliochdbjfkdbacpmhlcpmleaejidimm chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj chrome-extension://enhhojjnijigcajfphajepfemndkmdlo; style-src 'self' chrome://resources 'unsafe-inline'; img-src 'self' chrome://theme chrome://resources data: https://www.googledrive.com; media-src 'self'; object-src 'self'"
+ }
+}
diff --git a/ui/file_manager/file_manager/audio_player/js/audio_player_scripts.js b/ui/file_manager/file_manager/audio_player/js/audio_player_scripts.js
deleted file mode 100644
index 11844dd..0000000
--- a/ui/file_manager/file_manager/audio_player/js/audio_player_scripts.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-<include src="../../../../webui/resources/js/cr.js">
-<include src="../../../../webui/resources/js/cr/event_target.js">
-<include src="../../../../webui/resources/js/cr/ui/array_data_model.js">
-
-// Hack for polymer, notifying that CSP is enabled here.
-// TODO(yoshiki): Find a way to remove the hack.
-if (!('securityPolicy' in document))
- document['securityPolicy'] = {};
-if (!('allowsEval' in document.securityPolicy))
- document.securityPolicy['allowsEval'] = false;
-
-// Force Polymer into dirty-checking mode, see http://crbug.com/351967
-Object['observe'] = undefined;
-
-<include src="../../../../../third_party/polymer/components/platform/platform.js">
-<include src="../../../../../third_party/polymer/components/polymer/polymer.js">
-
-(function() {
-
-// 'strict mode' is invoked for this scope.
-'use strict';
-
-<include src="../../common/js/async_util.js">
-<include src="../../common/js/util.js">
-<include src="../../common/js/volume_manager_common.js">
-<include src="../../foreground/js/file_type.js">
-<include src="../../foreground/js/volume_manager_wrapper.js">
-<include src="../../foreground/js/metadata/metadata_cache.js">
-
-<include src="audio_player.js">
-<include src="audio_player_model.js">
-
-<include src="../elements/track_list.js">
-<include src="../elements/control_panel.js">
-<include src="../elements/volume_controller.js">
-<include src="../elements/audio_player.js">
-
-window.reload = reload;
-window.unload = unload;
-window.AudioPlayer = AudioPlayer;
-
-})();
diff --git a/ui/file_manager/file_manager/background/js/background.js b/ui/file_manager/file_manager/background/js/background.js
index 37a07ae..6990c2d 100644
--- a/ui/file_manager/file_manager/background/js/background.js
+++ b/ui/file_manager/file_manager/background/js/background.js
@@ -379,7 +379,7 @@
FILE_MANAGER_WINDOW_CREATE_OPTIONS);
appWindow.launch(opt_appState || {}, false, function() {
AppWindowWrapper.focusOnDesktop(
- appWindow.window_, (opt_appState || {}).displayedId);
+ appWindow.rawAppWindow, (opt_appState || {}).displayedId);
if (opt_callback)
opt_callback(appId);
onTaskCompleted();
@@ -408,87 +408,25 @@
* @private
*/
FileBrowserBackground.prototype.onExecute_ = function(action, details) {
- switch (action) {
- case 'play':
- var urls = util.entriesToURLs(details.entries);
- launchAudioPlayer({items: urls, position: 0});
- break;
+ var appState = {
+ params: {action: action},
+ // It is not allowed to call getParent() here, since there may be
+ // no permissions to access it at this stage. Therefore we are passing
+ // the selectionURL only, and the currentDirectory will be resolved
+ // later.
+ selectionURL: details.entries[0].toURL()
+ };
- default:
- var appState = {
- params: {action: action},
- // It is not allowed to call getParent() here, since there may be
- // no permissions to access it at this stage. Therefore we are passing
- // the selectionURL only, and the currentDirectory will be resolved
- // later.
- selectionURL: details.entries[0].toURL()
- };
-
- // Every other action opens a Files app window.
- // For mounted devices just focus any Files.app window. The mounted
- // volume will appear on the navigation list.
- launchFileManager(
- appState,
- /* App ID */ null,
- LaunchType.FOCUS_SAME_OR_CREATE);
- break;
- }
+ // Every other action opens a Files app window.
+ // For mounted devices just focus any Files.app window. The mounted
+ // volume will appear on the navigation list.
+ launchFileManager(
+ appState,
+ /* App ID */ null,
+ LaunchType.FOCUS_SAME_OR_CREATE);
};
/**
- * Icon of the audio player.
- * TODO(yoshiki): Consider providing an exact size icon, instead of relying
- * on downsampling by ash.
- *
- * @type {string}
- * @const
- */
-var AUDIO_PLAYER_ICON = 'audio_player/icons/audio-player-64.png';
-
-// The instance of audio player. Until it's ready, this is null.
-var audioPlayer = null;
-
-// Queue to serializes the initialization, launching and reloading of the audio
-// player, so races won't happen.
-var audioPlayerInitializationQueue = new AsyncUtil.Queue();
-
-audioPlayerInitializationQueue.run(function(callback) {
- /**
- * Audio player window create options.
- * @type {Object}
- */
- var audioPlayerCreateOptions = Object.freeze({
- type: 'panel',
- hidden: true,
- minHeight: 44 + 73, // 44px: track, 73px: controller
- minWidth: 292,
- height: 44 + 73, // collapsed
- width: 292
- });
-
- audioPlayer = new SingletonAppWindowWrapper('audio_player.html',
- audioPlayerCreateOptions);
- callback();
-});
-
-/**
- * Launches the audio player.
- * @param {Object} playlist Playlist.
- * @param {string=} opt_displayedId ProfileID of the desktop where the audio
- * player should show.
- */
-function launchAudioPlayer(playlist, opt_displayedId) {
- audioPlayerInitializationQueue.run(function(callback) {
- audioPlayer.launch(playlist, false, function(appWindow) {
- audioPlayer.setIcon(AUDIO_PLAYER_ICON);
- AppWindowWrapper.focusOnDesktop(audioPlayer.rawAppWindow,
- opt_displayedId);
- });
- callback();
- });
-}
-
-/**
* Launches the app.
* @private
*/
@@ -530,17 +468,6 @@
}
}
});
-
- // Reopen audio player.
- audioPlayerInitializationQueue.run(function(callback) {
- audioPlayer.reopen(function() {
- // If the audioPlayer is reopened, change its window's icon. Otherwise
- // there is no reopened window so just skip the call of setIcon.
- if (audioPlayer.rawAppWindow)
- audioPlayer.setIcon(AUDIO_PLAYER_ICON);
- });
- callback();
- });
};
/**
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js
index eb7828e..ec44c1e 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -173,6 +173,18 @@
DirectoryModel.prototype.onWatcherDirectoryChanged_ = function(event) {
var directoryEntry = this.getCurrentDirEntry();
+ // If the change is deletion of currentDir, move up to its parent directory.
+ directoryEntry.getDirectory(directoryEntry.fullPath, {create: false},
+ null,
+ function() {
+ var volumeInfo = this.volumeManager_.getVolumeInfo(directoryEntry);
+ if (volumeInfo) {
+ volumeInfo.resolveDisplayRoot().then(function(displayRoot) {
+ this.changeDirectoryEntry(displayRoot);
+ }.bind(this));
+ }
+ }.bind(this));
+
if (event.changedFiles) {
var addedOrUpdatedFileUrls = [];
var deletedFileUrls = [];
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks.js b/ui/file_manager/file_manager/foreground/js/file_tasks.js
index 1ed2818..2c578cc 100644
--- a/ui/file_manager/file_manager/foreground/js/file_tasks.js
+++ b/ui/file_manager/file_manager/foreground/js/file_tasks.js
@@ -536,25 +536,6 @@
FileTasks.prototype.executeInternalTask_ = function(id, entries) {
var fm = this.fileManager_;
- if (id === 'play') {
- var selectedEntry = entries[0];
- if (entries.length === 1) {
- // If just a single audio file is selected pass along every audio file
- // in the directory.
- entries = fm.getAllEntriesInCurrentDirectory().filter(FileType.isAudio);
- }
- // TODO(mtomasz): Move conversion from entry to url to custom bindings.
- // crbug.com/345527.
- var urls = util.entriesToURLs(entries);
- var position = urls.indexOf(selectedEntry.toURL());
- chrome.fileManagerPrivate.getProfiles(
- function(profiles, currentId, displayedId) {
- fm.backgroundPage.launchAudioPlayer(
- {items: urls, position: position}, displayedId);
- });
- return;
- }
-
if (id === 'mount-archive') {
this.mountArchivesInternal_(entries);
return;
diff --git a/ui/file_manager/file_manager/foreground/js/file_watcher.js b/ui/file_manager/file_manager/foreground/js/file_watcher.js
index d55af87..9db0971 100644
--- a/ui/file_manager/file_manager/foreground/js/file_watcher.js
+++ b/ui/file_manager/file_manager/foreground/js/file_watcher.js
@@ -47,11 +47,30 @@
* @private
*/
FileWatcher.prototype.onDirectoryChanged_ = function(event) {
- if (this.watchedDirectoryEntry_ &&
- event.entry.toURL() === this.watchedDirectoryEntry_.toURL()) {
+ var fireWatcherDirectoryChanged = function(changedFiles) {
var e = new Event('watcher-directory-changed');
- e.changedFiles = event.changedFiles;
+
+ if (changedFiles)
+ e.changedFiles = changedFiles;
+
this.dispatchEvent(e);
+ }.bind(this);
+
+ if (this.watchedDirectoryEntry_) {
+ var eventURL = event.entry.toURL();
+ var watchedDirURL = this.watchedDirectoryEntry_.toURL();
+
+ if (eventURL === watchedDirURL) {
+ fireWatcherDirectoryChanged(event.changedFiles);
+ } else if (watchedDirURL.match(new RegExp('^' + eventURL))) {
+ // When watched directory is deleted by the change in parent directory,
+ // notify it as watcher directory changed.
+ this.watchedDirectoryEntry_.getDirectory(
+ this.watchedDirectoryEntry_.fullPath,
+ {create: false},
+ null,
+ function() { fireWatcherDirectoryChanged(null); });
+ }
}
};
diff --git a/ui/file_manager/file_manager/manifest.json b/ui/file_manager/file_manager/manifest.json
index 56e2a84..818dce3 100644
--- a/ui/file_manager/file_manager/manifest.json
+++ b/ui/file_manager/file_manager/manifest.json
@@ -42,20 +42,6 @@
],
"file_browser_handlers": [
{
- "id": "play",
- "default_title": "__MSG_PLAY_MEDIA__",
- "default_icon": "common/images/file_types/200/audio.png",
- "file_filters": [
- "filesystem:*.amr",
- "filesystem:*.flac",
- "filesystem:*.m4a",
- "filesystem:*.mp3",
- "filesystem:*.oga",
- "filesystem:*.ogg",
- "filesystem:*.wav"
- ]
- },
- {
"id": "mount-archive",
"default_title": "__MSG_MOUNT_ARCHIVE__",
"default_icon": "common/images/file_types/200/archive.png",
diff --git a/ui/file_manager/file_manager_resources.grd b/ui/file_manager/file_manager_resources.grd
index 7896892..529c136 100644
--- a/ui/file_manager/file_manager_resources.grd
+++ b/ui/file_manager/file_manager_resources.grd
@@ -58,7 +58,6 @@
<include name="IDR_FILE_MANAGER_ICON_96" file="file_manager/common/images/icon96.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_ICON_128" file="file_manager/common/images/icon128.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_ICON_256" file="file_manager/common/images/icon256.png" type="BINDATA" />
- <include name="IDR_FILE_MANAGER_AUDIO_PLAYER_ICON_64" file="file_manager/audio_player/icons/audio-player-64.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_GALLERY_ICON_16" file="gallery/images/icon16.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_GALLERY_ICON_32" file="gallery/images/icon32.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_GALLERY_ICON_48" file="gallery/images/icon48.png" type="BINDATA" />
@@ -73,10 +72,6 @@
<include name="IDR_FILE_MANAGER_IMG_UI_DRIVE_WELCOME_LOGO" file="file_manager/foreground/images/files/ui/drive_logo.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_IMG_UI_2X_DRIVE_WELCOME_LOGO" file="file_manager/foreground/images/files/ui/2x/drive_logo.png" type="BINDATA" />
- <!-- Audio player pages and scripts. -->
- <include name="IDR_FILE_MANAGER_AUDIO_PLAYER" file="file_manager/audio_player.html" allowexternalscript="true" flattenhtml="true" type="BINDATA" />
- <include name="IDR_FILE_MANAGER_AUDIO_PLAYER_SCRIPTS_JS" file="file_manager/audio_player/js/audio_player_scripts.js" flattenhtml="true" type="BINDATA" />
-
<!-- VideoPlayer.app pages and scripts. -->
<include name="IDR_VIDEO_PLAYER_MANIFEST" file="video_player/manifest.json" type="BINDATA" />
<include name="IDR_VIDEO_PLAYER" file="video_player/video_player.html" allowexternalscript="true" flattenhtml="true" type="BINDATA" />
@@ -93,6 +88,20 @@
<include name="IDR_VIDEO_PLAYER_ICON_256" file="video_player/images/icon/video-player-256.png" type="BINDATA" />
<include name="IDR_VIDEO_PLAYER_ICON_FAVICON_32" file="video_player/images/icon/video-player-favicon-32.png" type="BINDATA" />
+ <!-- AudioPlayer.app pages and scripts. -->
+ <include name="IDR_AUDIO_PLAYER_MANIFEST" file="audio_player/manifest.json" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_BKGND_JS" file="audio_player/js/background.js" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER" file="audio_player/audio_player.html" allowexternalscript="true" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_JS" file="audio_player/js/audio_player_scripts.js" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_ICON_FAVICON_16" file="audio_player/icons/audio-player-favicon-16.png" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_ICON_FAVICON_32" file="audio_player/icons/audio-player-favicon-32.png" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_ICON_32" file="audio_player/icons/audio-player-32.png" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_ICON_48" file="audio_player/icons/audio-player-48.png" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_ICON_64" file="audio_player/icons/audio-player-64.png" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_ICON_96" file="audio_player/icons/audio-player-96.png" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_ICON_128" file="audio_player/icons/audio-player-128.png" type="BINDATA" />
+ <include name="IDR_AUDIO_PLAYER_ICON_256" file="audio_player/icons/audio-player-256.png" type="BINDATA" />
+
<!-- Gallery.app pages and scripts. -->
<include name="IDR_GALLERY_MANIFEST" file="gallery/manifest.json" type="BINDATA" />
<include name="IDR_GALLERY" file="gallery/gallery.html" allowexternalscript="true" flattenhtml="true" type="BINDATA" />
diff --git a/ui/file_manager/gallery/js/gallery.js b/ui/file_manager/gallery/js/gallery.js
index 0a7a067..04e539f 100644
--- a/ui/file_manager/gallery/js/gallery.js
+++ b/ui/file_manager/gallery/js/gallery.js
@@ -237,7 +237,7 @@
* @const
* @type {number}
*/
-Gallery.FADE_TIMEOUT = 3000;
+Gallery.FADE_TIMEOUT = 2000;
/**
* First time tools fade-out timeout in milliseconds.
@@ -401,8 +401,8 @@
cr.dispatchSimpleEvent(this, 'image-saved');
}.bind(this));
- var deleteButton = this.initToolbarButton_('delete', 'GALLERY_DELETE');
- deleteButton.addEventListener('click', this.delete_.bind(this));
+ this.deleteButton_ = this.initToolbarButton_('delete', 'GALLERY_DELETE');
+ this.deleteButton_.addEventListener('click', this.delete_.bind(this));
this.shareButton_ = this.initToolbarButton_('share', 'GALLERY_SHARE');
this.shareButton_.addEventListener(
@@ -851,6 +851,12 @@
// If it's selecting something, update the variable values.
if (numSelectedItems) {
+ // Delete button is available when all images are NOT readOnly.
+ this.deleteButton_.disabled = !this.selectionModel_.selectedIndexes
+ .every(function(i) {
+ return !this.dataModel_.item(i).getLocationInfo().isReadOnly;
+ }, this);
+
// Obtains selected item.
var selectedItem =
this.dataModel_.item(this.selectionModel_.selectedIndex);
@@ -885,6 +891,7 @@
} else {
document.title = '';
this.filenameEdit_.disabled = true;
+ this.deleteButton_.disabled = true;
this.filenameEdit_.value = '';
this.shareButton_.hidden = true;
}
diff --git a/ui/file_manager/gallery/js/slide_mode.js b/ui/file_manager/gallery/js/slide_mode.js
index 9de3d88..1f0edc2 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -197,12 +197,12 @@
this.editButton_ = this.toolbar_.querySelector('button.edit');
this.editButton_.title = this.displayStringFunction_('GALLERY_EDIT');
- this.editButton_.setAttribute('disabled', ''); // Disabled by default.
+ this.editButton_.disabled = true; // Disabled by default.
this.editButton_.addEventListener('click', this.toggleEditor.bind(this));
this.printButton_ = this.toolbar_.querySelector('button.print');
this.printButton_.title = this.displayStringFunction_('GALLERY_PRINT');
- this.printButton_.setAttribute('disabled', ''); // Disabled by default.
+ this.printButton_.disabled = true; // Disabled by default.
this.printButton_.addEventListener('click', this.print_.bind(this));
this.editBarSpacer_ = this.toolbar_.querySelector('.edit-bar-spacer');
@@ -354,8 +354,8 @@
}
// Disable the slide-mode only buttons when leaving.
- this.editButton_.setAttribute('disabled', '');
- this.printButton_.setAttribute('disabled', '');
+ this.editButton_.disabled = true;
+ this.printButton_.disabled = true;
// Disable touch operation.
this.touchHandlers_.enabled = false;
@@ -435,7 +435,7 @@
*/
SlideMode.prototype.onSelection_ = function() {
if (this.selectionModel_.selectedIndexes.length === 0)
- return; // Temporary empty selection.
+ return; // Ignore temporary empty selection.
// Forget the saved selection if the user changed the selection manually.
if (!this.isSlideshowOn_())
@@ -581,9 +581,12 @@
// Removed item is the rightmost, but there are more items.
this.select(event.index - 1); // Select the new last index.
} else {
- // No items left. Unload the image and show the banner.
+ // No items left. Unload the image, disable edit and print button, and
+ // show the banner.
this.commitItem_(function() {
this.unloadImage_();
+ this.printButton_.disabled = true;
+ this.editButton_.disabled = true;
this.errorBanner_.show('GALLERY_NO_IMAGES');
}.bind(this));
}
@@ -717,11 +720,11 @@
// Enable or disable buttons for editing and printing.
if (error) {
- this.editButton_.setAttribute('disabled', '');
- this.printButton_.setAttribute('disabled', '');
+ this.editButton_.disabled = true;
+ this.printButton_.disabled = true;
} else {
- this.editButton_.removeAttribute('disabled');
- this.printButton_.removeAttribute('disabled');
+ this.editButton_.disabled = false;
+ this.printButton_.disabled = false;
}
// For once edited image, disallow the 'overwrite' setting change.
@@ -856,12 +859,12 @@
switch (keyID) {
case 'Ctrl-U+0050': // Ctrl+'p' prints the current image.
- if (!this.printButton_.hasAttribute('disabled'))
+ if (!this.printButton_.disabled)
this.print_();
break;
case 'U+0045': // 'e' toggles the editor.
- if (!this.editButton_.hasAttribute('disabled'))
+ if (!this.editButton_.disabled)
this.toggleEditor(event);
break;
diff --git a/ui/file_manager/video_player/js/cast/caster.js b/ui/file_manager/video_player/js/cast/caster.js
index 75082f9..e7dfaff 100644
--- a/ui/file_manager/video_player/js/cast/caster.js
+++ b/ui/file_manager/video_player/js/cast/caster.js
@@ -10,9 +10,7 @@
// cast extension. This line prevents an exception on using localStorage.
window.__defineGetter__('localStorage', function() { return {}; });
-// THIS IS A TEST APP.
-// TODO(yoshiki): Fix this before launch.
-var APPLICATION_ID = '214CC863';
+var APPLICATION_ID = '4CCB98DA';
util.addPageLoadHandler(function() {
initialize();
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index 291b2b6..ed3cc56 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -27,8 +27,6 @@
"android/gfx_jni_registrar.h",
"android/java_bitmap.cc",
"android/java_bitmap.h",
- "android/scroller.cc",
- "android/scroller.h",
"android/shared_device_display_info.cc",
"android/shared_device_display_info.h",
"android/view_configuration.cc",
@@ -206,6 +204,8 @@
"utf16_indexing.cc",
"utf16_indexing.h",
"vsync_provider.h",
+ "win/direct_write.cc",
+ "win/direct_write.h",
"win/dpi.cc",
"win/dpi.h",
"win/hwnd_util.cc",
@@ -434,6 +434,7 @@
"codec/jpeg_codec_unittest.cc",
"codec/png_codec_unittest.cc",
"color_analysis_unittest.cc",
+ "color_profile_mac_unittest.mm",
"color_utils_unittest.cc",
"display_change_notifier_unittest.cc",
"display_unittest.cc",
diff --git a/ui/gfx/android/scroller_unittest.cc b/ui/gfx/android/scroller_unittest.cc
deleted file mode 100644
index bb5eec2..0000000
--- a/ui/gfx/android/scroller_unittest.cc
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/time/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/android/scroller.h"
-
-namespace gfx {
-
-namespace {
-
-const float kDefaultStartX = 7.f;
-const float kDefaultStartY = 25.f;
-const float kDefaultDeltaX = -20.f;
-const float kDefaultDeltaY = 73.f;
-const float kDefaultVelocityX = -350.f;
-const float kDefaultVelocityY = 220.f;
-const float kEpsilon = 1e-3f;
-
-Scroller::Config DefaultConfig() {
- return Scroller::Config();
-}
-
-} // namespace
-
-class ScrollerTest : public testing::Test {};
-
-TEST_F(ScrollerTest, Scroll) {
- Scroller scroller(DefaultConfig());
- base::TimeTicks start_time = base::TimeTicks::Now();
-
- // Start a scroll and verify initialized values.
- scroller.StartScroll(kDefaultStartX,
- kDefaultStartY,
- kDefaultDeltaX,
- kDefaultDeltaY,
- start_time);
-
- EXPECT_EQ(kDefaultStartX, scroller.GetStartX());
- EXPECT_EQ(kDefaultStartY, scroller.GetStartY());
- EXPECT_EQ(kDefaultStartX, scroller.GetCurrX());
- EXPECT_EQ(kDefaultStartY, scroller.GetCurrY());
- EXPECT_EQ(kDefaultStartX + kDefaultDeltaX, scroller.GetFinalX());
- EXPECT_EQ(kDefaultStartY + kDefaultDeltaY, scroller.GetFinalY());
- EXPECT_FALSE(scroller.IsFinished());
- EXPECT_EQ(base::TimeDelta(), scroller.GetTimePassed());
-
- // Advance halfway through the scroll.
- const base::TimeDelta scroll_duration = scroller.GetDuration();
- scroller.ComputeScrollOffset(start_time + scroll_duration / 2);
-
- // Ensure we've moved in the direction of the delta, but have yet to reach
- // the target.
- EXPECT_GT(kDefaultStartX, scroller.GetCurrX());
- EXPECT_LT(kDefaultStartY, scroller.GetCurrY());
- EXPECT_LT(scroller.GetFinalX(), scroller.GetCurrX());
- EXPECT_GT(scroller.GetFinalY(), scroller.GetCurrY());
- EXPECT_FALSE(scroller.IsFinished());
-
- // Ensure our velocity is non-zero and in the same direction as the delta.
- EXPECT_GT(0.f, scroller.GetCurrVelocityX() * kDefaultDeltaX);
- EXPECT_GT(0.f, scroller.GetCurrVelocityY() * kDefaultDeltaY);
- EXPECT_TRUE(scroller.IsScrollingInDirection(kDefaultDeltaX, kDefaultDeltaY));
-
- // Repeated offset computations at the same timestamp should yield identical
- // results.
- float curr_x = scroller.GetCurrX();
- float curr_y = scroller.GetCurrY();
- float curr_velocity_x = scroller.GetCurrVelocityX();
- float curr_velocity_y = scroller.GetCurrVelocityY();
- scroller.ComputeScrollOffset(start_time + scroll_duration / 2);
- EXPECT_EQ(curr_x, scroller.GetCurrX());
- EXPECT_EQ(curr_y, scroller.GetCurrY());
- EXPECT_EQ(curr_velocity_x, scroller.GetCurrVelocityX());
- EXPECT_EQ(curr_velocity_y, scroller.GetCurrVelocityY());
-
- // Advance to the end.
- scroller.ComputeScrollOffset(start_time + scroll_duration);
- EXPECT_EQ(scroller.GetFinalX(), scroller.GetCurrX());
- EXPECT_EQ(scroller.GetFinalY(), scroller.GetCurrY());
- EXPECT_TRUE(scroller.IsFinished());
- EXPECT_EQ(scroll_duration, scroller.GetTimePassed());
- EXPECT_NEAR(0.f, scroller.GetCurrVelocityX(), kEpsilon);
- EXPECT_NEAR(0.f, scroller.GetCurrVelocityY(), kEpsilon);
-
- // Try to advance further; nothing should change.
- scroller.ComputeScrollOffset(start_time + scroll_duration * 2);
- EXPECT_EQ(scroller.GetFinalX(), scroller.GetCurrX());
- EXPECT_EQ(scroller.GetFinalY(), scroller.GetCurrY());
- EXPECT_TRUE(scroller.IsFinished());
- EXPECT_EQ(scroll_duration, scroller.GetTimePassed());
-}
-
-TEST_F(ScrollerTest, Fling) {
- Scroller scroller(DefaultConfig());
- base::TimeTicks start_time = base::TimeTicks::Now();
-
- // Start a fling and verify initialized values.
- scroller.Fling(kDefaultStartX,
- kDefaultStartY,
- kDefaultVelocityX,
- kDefaultVelocityY,
- INT_MIN,
- INT_MAX,
- INT_MIN,
- INT_MAX,
- start_time);
-
- EXPECT_EQ(kDefaultStartX, scroller.GetStartX());
- EXPECT_EQ(kDefaultStartY, scroller.GetStartY());
- EXPECT_EQ(kDefaultStartX, scroller.GetCurrX());
- EXPECT_EQ(kDefaultStartY, scroller.GetCurrY());
- EXPECT_GT(kDefaultStartX, scroller.GetFinalX());
- EXPECT_LT(kDefaultStartY, scroller.GetFinalY());
- EXPECT_FALSE(scroller.IsFinished());
- EXPECT_EQ(base::TimeDelta(), scroller.GetTimePassed());
-
- // Advance halfway through the fling.
- const base::TimeDelta scroll_duration = scroller.GetDuration();
- scroller.ComputeScrollOffset(start_time + scroll_duration / 2);
-
- // Ensure we've moved in the direction of the velocity, but have yet to reach
- // the target.
- EXPECT_GT(kDefaultStartX, scroller.GetCurrX());
- EXPECT_LT(kDefaultStartY, scroller.GetCurrY());
- EXPECT_LT(scroller.GetFinalX(), scroller.GetCurrX());
- EXPECT_GT(scroller.GetFinalY(), scroller.GetCurrY());
- EXPECT_FALSE(scroller.IsFinished());
-
- // Ensure our velocity is non-zero and in the same direction as the original
- // velocity.
- EXPECT_LT(0.f, scroller.GetCurrVelocityX() * kDefaultVelocityX);
- EXPECT_LT(0.f, scroller.GetCurrVelocityY() * kDefaultVelocityY);
- EXPECT_TRUE(
- scroller.IsScrollingInDirection(kDefaultVelocityX, kDefaultVelocityY));
-
- // Repeated offset computations at the same timestamp should yield identical
- // results.
- float curr_x = scroller.GetCurrX();
- float curr_y = scroller.GetCurrY();
- float curr_velocity_x = scroller.GetCurrVelocityX();
- float curr_velocity_y = scroller.GetCurrVelocityY();
- scroller.ComputeScrollOffset(start_time + scroll_duration / 2);
- EXPECT_EQ(curr_x, scroller.GetCurrX());
- EXPECT_EQ(curr_y, scroller.GetCurrY());
- EXPECT_EQ(curr_velocity_x, scroller.GetCurrVelocityX());
- EXPECT_EQ(curr_velocity_y, scroller.GetCurrVelocityY());
-
- // Advance to the end.
- scroller.ComputeScrollOffset(start_time + scroll_duration);
- EXPECT_EQ(scroller.GetFinalX(), scroller.GetCurrX());
- EXPECT_EQ(scroller.GetFinalY(), scroller.GetCurrY());
- EXPECT_TRUE(scroller.IsFinished());
- EXPECT_EQ(scroll_duration, scroller.GetTimePassed());
- EXPECT_NEAR(0.f, scroller.GetCurrVelocityX(), kEpsilon);
- EXPECT_NEAR(0.f, scroller.GetCurrVelocityY(), kEpsilon);
-
- // Try to advance further; nothing should change.
- scroller.ComputeScrollOffset(start_time + scroll_duration * 2);
- EXPECT_EQ(scroller.GetFinalX(), scroller.GetCurrX());
- EXPECT_EQ(scroller.GetFinalY(), scroller.GetCurrY());
- EXPECT_TRUE(scroller.IsFinished());
- EXPECT_EQ(scroll_duration, scroller.GetTimePassed());
-}
-
-} // namespace gfx
diff --git a/ui/gfx/animation/animation.h b/ui/gfx/animation/animation.h
index 32d297e..e98f506 100644
--- a/ui/gfx/animation/animation.h
+++ b/ui/gfx/animation/animation.h
@@ -81,9 +81,9 @@
AnimationDelegate* delegate() { return delegate_; }
// AnimationContainer::Element overrides
- virtual void SetStartTime(base::TimeTicks start_time) OVERRIDE;
+ virtual void SetStartTime(base::TimeTicks start_time) override;
virtual void Step(base::TimeTicks time_now) = 0;
- virtual base::TimeDelta GetTimerInterval() const OVERRIDE;
+ virtual base::TimeDelta GetTimerInterval() const override;
private:
// Interval for the animation.
diff --git a/ui/gfx/animation/animation_container_unittest.cc b/ui/gfx/animation/animation_container_unittest.cc
index 70d3b0e..ba8e2c9 100644
--- a/ui/gfx/animation/animation_container_unittest.cc
+++ b/ui/gfx/animation/animation_container_unittest.cc
@@ -26,12 +26,12 @@
private:
virtual void AnimationContainerProgressed(
- AnimationContainer* container) OVERRIDE {
+ AnimationContainer* container) override {
progressed_count_++;
}
// Invoked when no more animations are being managed by this container.
- virtual void AnimationContainerEmpty(AnimationContainer* container) OVERRIDE {
+ virtual void AnimationContainerEmpty(AnimationContainer* container) override {
empty_ = true;
}
@@ -47,7 +47,7 @@
: LinearAnimation(20, 20, delegate) {
}
- virtual void AnimateToState(double state) OVERRIDE {
+ virtual void AnimateToState(double state) override {
}
private:
diff --git a/ui/gfx/animation/animation_unittest.cc b/ui/gfx/animation/animation_unittest.cc
index 00f1e26..d86f87a 100644
--- a/ui/gfx/animation/animation_unittest.cc
+++ b/ui/gfx/animation/animation_unittest.cc
@@ -29,7 +29,7 @@
: LinearAnimation(frame_rate, delegate) {
}
- virtual void AnimateToState(double state) OVERRIDE {
+ virtual void AnimateToState(double state) override {
EXPECT_LE(0.0, state);
EXPECT_GE(1.0, state);
}
@@ -44,7 +44,7 @@
: LinearAnimation(duration, frame_rate, delegate) {
}
- virtual void AnimateToState(double state) OVERRIDE {
+ virtual void AnimateToState(double state) override {
if (state >= 0.5)
Stop();
}
@@ -59,7 +59,7 @@
: LinearAnimation(duration, frame_rate, delegate) {
}
- virtual void AnimateToState(double state) OVERRIDE {
+ virtual void AnimateToState(double state) override {
if (state >= 0.5)
End();
}
@@ -71,7 +71,7 @@
// AnimationDelegate implementation that deletes the animation in ended.
class DeletingAnimationDelegate : public AnimationDelegate {
public:
- virtual void AnimationEnded(const Animation* animation) OVERRIDE {
+ virtual void AnimationEnded(const Animation* animation) override {
delete animation;
base::MessageLoop::current()->Quit();
}
diff --git a/ui/gfx/animation/linear_animation.h b/ui/gfx/animation/linear_animation.h
index 401f1be..d74b847 100644
--- a/ui/gfx/animation/linear_animation.h
+++ b/ui/gfx/animation/linear_animation.h
@@ -30,7 +30,7 @@
// Gets the value for the current state, according to the animation curve in
// use. This class provides only for a linear relationship, however subclasses
// can override this to provide others.
- virtual double GetCurrentValue() const OVERRIDE;
+ virtual double GetCurrentValue() const override;
// Change the current state of the animation to |new_value|.
void SetCurrentValue(double new_value);
@@ -50,16 +50,16 @@
// Invoked by the AnimationContainer when the animation is running to advance
// the animation. Use |time_now| rather than Time::Now to avoid multiple
// animations running at the same time diverging.
- virtual void Step(base::TimeTicks time_now) OVERRIDE;
+ virtual void Step(base::TimeTicks time_now) override;
// Overriden to initialize state.
- virtual void AnimationStarted() OVERRIDE;
+ virtual void AnimationStarted() override;
// Overriden to advance to the end (if End was invoked).
- virtual void AnimationStopped() OVERRIDE;
+ virtual void AnimationStopped() override;
// Overriden to return true if state is not 1.
- virtual bool ShouldSendCanceledFromStop() OVERRIDE;
+ virtual bool ShouldSendCanceledFromStop() override;
private:
base::TimeDelta duration_;
diff --git a/ui/gfx/animation/multi_animation.h b/ui/gfx/animation/multi_animation.h
index f048098..bbcbae4 100644
--- a/ui/gfx/animation/multi_animation.h
+++ b/ui/gfx/animation/multi_animation.h
@@ -57,15 +57,15 @@
// Returns the current value. The current value for a MultiAnimation is
// determined from the tween type of the current part.
- virtual double GetCurrentValue() const OVERRIDE;
+ virtual double GetCurrentValue() const override;
// Returns the index of the current part.
size_t current_part_index() const { return current_part_index_; }
protected:
// Animation overrides.
- virtual void Step(base::TimeTicks time_now) OVERRIDE;
- virtual void SetStartTime(base::TimeTicks start_time) OVERRIDE;
+ virtual void Step(base::TimeTicks time_now) override;
+ virtual void SetStartTime(base::TimeTicks start_time) override;
private:
// Returns the part containing the specified time. |time_ms| is reset to be
diff --git a/ui/gfx/animation/slide_animation.h b/ui/gfx/animation/slide_animation.h
index 8fdf8f8..3795e36 100644
--- a/ui/gfx/animation/slide_animation.h
+++ b/ui/gfx/animation/slide_animation.h
@@ -66,7 +66,7 @@
int GetSlideDuration() const { return slide_duration_; }
void SetTweenType(Tween::Type tween_type) { tween_type_ = tween_type; }
- virtual double GetCurrentValue() const OVERRIDE;
+ virtual double GetCurrentValue() const override;
bool IsShowing() const { return showing_; }
bool IsClosing() const { return !showing_ && value_end_ < value_current_; }
@@ -74,7 +74,7 @@
private:
// Overridden from Animation.
- virtual void AnimateToState(double state) OVERRIDE;
+ virtual void AnimateToState(double state) override;
AnimationDelegate* target_;
diff --git a/ui/gfx/animation/throb_animation.h b/ui/gfx/animation/throb_animation.h
index 8bea7f8..27da800 100644
--- a/ui/gfx/animation/throb_animation.h
+++ b/ui/gfx/animation/throb_animation.h
@@ -29,13 +29,13 @@
void SetThrobDuration(int duration) { throb_duration_ = duration; }
// Overridden to reset to the slide duration.
- virtual void Reset() OVERRIDE;
- virtual void Reset(double value) OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
+ virtual void Reset() override;
+ virtual void Reset(double value) override;
+ virtual void Show() override;
+ virtual void Hide() override;
// Overridden to maintain the slide duration.
- virtual void SetSlideDuration(int duration) OVERRIDE;
+ virtual void SetSlideDuration(int duration) override;
// The number of cycles remaining until the animation stops.
void set_cycles_remaining(int value) { cycles_remaining_ = value; }
@@ -43,7 +43,7 @@
protected:
// Overriden to continually throb (assuming we're throbbing).
- virtual void Step(base::TimeTicks time_now) OVERRIDE;
+ virtual void Step(base::TimeTicks time_now) override;
private:
// Resets state such that we behave like SlideAnimation.
diff --git a/ui/gfx/color_analysis.h b/ui/gfx/color_analysis.h
index dd273bc..b3bd4d2 100644
--- a/ui/gfx/color_analysis.h
+++ b/ui/gfx/color_analysis.h
@@ -42,7 +42,7 @@
GridSampler();
virtual ~GridSampler();
- virtual int GetSample(int width, int height) OVERRIDE;
+ virtual int GetSample(int width, int height) override;
private:
// The number of times GetSample has been called.
diff --git a/ui/gfx/color_analysis_unittest.cc b/ui/gfx/color_analysis_unittest.cc
index 601089f..128209a 100644
--- a/ui/gfx/color_analysis_unittest.cc
+++ b/ui/gfx/color_analysis_unittest.cc
@@ -120,7 +120,7 @@
prebaked_sample_results_.push_back(sample);
}
- virtual int GetSample(int width, int height) OVERRIDE {
+ virtual int GetSample(int width, int height) override {
if (current_result_index_ >= prebaked_sample_results_.size()) {
current_result_index_ = 0;
}
diff --git a/ui/gfx/color_profile.h b/ui/gfx/color_profile.h
index 790bfe5..37a5634 100644
--- a/ui/gfx/color_profile.h
+++ b/ui/gfx/color_profile.h
@@ -17,7 +17,7 @@
class GFX_EXPORT ColorProfile {
public:
- // On Windows, this reads a file from disk so it shouldn't be run on the UI
+ // On Windows, this reads a file from disk so it should not be run on the UI
// or IO thread.
ColorProfile();
~ColorProfile();
@@ -35,9 +35,11 @@
}
// Return the color profile of the display nearest the screen bounds. On Win32,
-// this may read a file from disk, so it shouldn't be run on the UI/IO threads.
+// this may read a file from disk so it should not be run on the UI/IO threads.
// If the given bounds are empty, or are off-screen, return false meaning there
-// is no color profile associated with the bounds.
+// is no color profile associated with the bounds. Otherwise return true after
+// storing the display's color profile in |profile|, which will be empty if the
+// standard sRGB color profile should be assumed.
GFX_EXPORT bool GetDisplayColorProfile(const gfx::Rect& bounds,
std::vector<char>* profile);
} // namespace gfx
diff --git a/ui/gfx/color_profile_mac.mm b/ui/gfx/color_profile_mac.mm
index c36072d..ac877c0 100644
--- a/ui/gfx/color_profile_mac.mm
+++ b/ui/gfx/color_profile_mac.mm
@@ -4,16 +4,53 @@
#include "ui/gfx/color_profile.h"
+#import <Cocoa/Cocoa.h>
+
#include "base/mac/mac_util.h"
+#include "ui/gfx/mac/coordinate_conversion.h"
+
+namespace {
+
+NSScreen* GetNSScreenFromBounds(const gfx::Rect& bounds) {
+ NSScreen* screen = nil;
+ int overlap = 0;
+
+ for (NSScreen* monitor in [NSScreen screens]) {
+ gfx::Rect monitor_rect = gfx::ScreenRectFromNSRect([monitor frame]);
+ gfx::Rect overlap_rect = gfx::IntersectRects(monitor_rect, bounds);
+ int overlap_size = overlap_rect.width() * overlap_rect.height();
+ if (overlap_size > overlap) {
+ overlap = overlap_size;
+ screen = monitor;
+ }
+ }
+
+ return screen;
+}
+
+} // namespace
namespace gfx {
bool GetDisplayColorProfile(const gfx::Rect& bounds,
std::vector<char>* profile) {
- if (bounds.IsEmpty())
+ DCHECK(profile->empty());
+
+ NSScreen* screen = GetNSScreenFromBounds(bounds);
+ if (!screen || bounds.IsEmpty())
return false;
- // TODO(noel): implement.
- return false;
+ NSColorSpace* color_space = [screen colorSpace];
+ if (!color_space)
+ return false;
+
+ if ([color_space isEqual:[NSColorSpace sRGBColorSpace]])
+ return true;
+ NSData* profile_data = [color_space ICCProfileData];
+ const char* data = static_cast<const char*>([profile_data bytes]);
+ size_t length = [profile_data length];
+ if (data && !gfx::InvalidColorProfileLength(length))
+ profile->assign(data, data + length);
+ return true;
}
void ReadColorProfile(std::vector<char>* profile) {
diff --git a/ui/gfx/color_profile_mac_unittest.mm b/ui/gfx/color_profile_mac_unittest.mm
new file mode 100644
index 0000000..59efb61
--- /dev/null
+++ b/ui/gfx/color_profile_mac_unittest.mm
@@ -0,0 +1,96 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/mac/scoped_nsobject.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/color_profile.h"
+#include "ui/gfx/mac/coordinate_conversion.h"
+#import "ui/gfx/test/ui_cocoa_test_helper.h"
+
+namespace {
+
+class ColorProfileTest : public ui::CocoaTest {
+ public:
+ virtual void SetUp() override {
+ ui::CocoaTest::SetUp();
+
+ // Verify the primary screen origin.
+ NSRect primary_screen_frame = PrimaryScreenFrame();
+ EXPECT_EQ(0, primary_screen_frame.origin.x);
+ EXPECT_EQ(0, primary_screen_frame.origin.y);
+
+ // Move the test window onto the screen.
+ MoveTestWindowTo(gfx::Rect(0, 0, 200, 200));
+
+ // Verify it is contained by the screen.
+ BOOL screen_contains_test_window = NSContainsRect(
+ primary_screen_frame, [test_window() frame]);
+ EXPECT_TRUE(screen_contains_test_window);
+ }
+
+ void MoveTestWindowTo(gfx::Rect bounds) {
+ [test_window() setFrame:gfx::ScreenRectToNSRect(bounds) display:NO];
+ EXPECT_EQ(bounds.ToString(), TestWindowBounds().ToString());
+ }
+
+ gfx::Rect TestWindowBounds() {
+ return gfx::ScreenRectFromNSRect([test_window() frame]);
+ }
+
+ BOOL TestWindowOnScreen() {
+ return NSIntersectsRect(PrimaryScreenFrame(), [test_window() frame]);
+ }
+
+ BOOL TestWindowContainedOnScreen() {
+ return NSContainsRect(PrimaryScreenFrame(), [test_window() frame]);
+ }
+
+ NSRect PrimaryScreenFrame() {
+ return [[[NSScreen screens] objectAtIndex:0] frame];
+ }
+};
+
+bool TestColorProfileForBounds(const gfx::Rect& bounds) {
+ std::vector<char> color_profile;
+ return gfx::GetDisplayColorProfile(bounds, &color_profile);
+}
+
+TEST_F(ColorProfileTest, GetDisplayColorProfileForOnScreenBounds) {
+ MoveTestWindowTo(gfx::Rect(10, 10, 100, 100));
+ EXPECT_FALSE(TestWindowBounds().IsEmpty());
+ EXPECT_TRUE(TestWindowContainedOnScreen());
+ EXPECT_TRUE(TestColorProfileForBounds(TestWindowBounds()));
+}
+
+TEST_F(ColorProfileTest, GetDisplayColorProfileForPartiallyOnScreenBounds) {
+ MoveTestWindowTo(gfx::Rect(-50, -50, 80, 80));
+ EXPECT_FALSE(TestWindowBounds().IsEmpty());
+ EXPECT_TRUE(TestWindowOnScreen());
+ EXPECT_TRUE(TestColorProfileForBounds(TestWindowBounds()));
+}
+
+TEST_F(ColorProfileTest, GetDisplayColorProfileForOffScreenBounds) {
+ MoveTestWindowTo(gfx::Rect(-100, -100, 10, 10));
+ EXPECT_FALSE(TestWindowBounds().IsEmpty());
+ EXPECT_FALSE(TestWindowOnScreen());
+ EXPECT_FALSE(TestColorProfileForBounds(TestWindowBounds()));
+}
+
+TEST_F(ColorProfileTest, GetDisplayColorProfileForEmptyOnScreenBounds) {
+ MoveTestWindowTo(gfx::Rect(10, 10, 0, 0));
+ EXPECT_TRUE(TestWindowBounds().IsEmpty());
+ EXPECT_FALSE(TestWindowOnScreen());
+ EXPECT_FALSE(TestColorProfileForBounds(TestWindowBounds()));
+}
+
+TEST_F(ColorProfileTest, GetDisplayColorProfileForEmptyOffScreenBounds) {
+ MoveTestWindowTo(gfx::Rect(-100, -100, 0, 0));
+ EXPECT_TRUE(TestWindowBounds().IsEmpty());
+ EXPECT_FALSE(TestWindowOnScreen());
+ EXPECT_FALSE(TestColorProfileForBounds(TestWindowBounds()));
+}
+
+} // namespace
diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc
index ffdbec5..37cfe30 100644
--- a/ui/gfx/color_utils.cc
+++ b/ui/gfx/color_utils.cc
@@ -151,6 +151,21 @@
calcHue(temp1, temp2, hue - 1.0 / 3.0));
}
+void ClampHSL(HSL* hsl) {
+ if (hsl->h < 0)
+ hsl->h = 0;
+ if (hsl->h > 1)
+ hsl->h = 1;
+ if (hsl->s < 0)
+ hsl->s = 0;
+ if (hsl->s > 1)
+ hsl->s = 1;
+ if (hsl->l < 0)
+ hsl->l = 0;
+ if (hsl->l > 1)
+ hsl->l = 1;
+}
+
bool IsWithinHSLRange(const HSL& hsl,
const HSL& lower_bound,
const HSL& upper_bound) {
diff --git a/ui/gfx/color_utils.h b/ui/gfx/color_utils.h
index 9446654..0f4f9c4 100644
--- a/ui/gfx/color_utils.h
+++ b/ui/gfx/color_utils.h
@@ -29,6 +29,13 @@
GFX_EXPORT void SkColorToHSL(SkColor c, HSL* hsl);
GFX_EXPORT SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha);
+// Validates an |hsl| value passed in from an untrusted source.
+//
+// If we were starting from scratch, we'd throw some sort of exception to the
+// user here, but there's already code out there that acts as if -1 == 0 and
+// 1 == 2, so just Clamp the values to [0, 1] instead.
+GFX_EXPORT void ClampHSL(HSL* hsl);
+
// Determines whether the given |hsl| falls within the given range for each
// component. All components of |hsl| are expected to be in the range [0, 1].
//
diff --git a/ui/gfx/display_change_notifier_unittest.cc b/ui/gfx/display_change_notifier_unittest.cc
index 769c770..700793a 100644
--- a/ui/gfx/display_change_notifier_unittest.cc
+++ b/ui/gfx/display_change_notifier_unittest.cc
@@ -21,16 +21,16 @@
virtual ~MockDisplayObserver() { }
- virtual void OnDisplayAdded(const Display& display) OVERRIDE {
+ virtual void OnDisplayAdded(const Display& display) override {
display_added_++;
}
- virtual void OnDisplayRemoved(const Display& display) OVERRIDE {
+ virtual void OnDisplayRemoved(const Display& display) override {
display_removed_++;
}
virtual void OnDisplayMetricsChanged(const Display& display,
- uint32_t metrics) OVERRIDE {
+ uint32_t metrics) override {
display_changed_++;
latest_metrics_change_ = metrics;
}
diff --git a/ui/gfx/font_fallback_win_unittest.cc b/ui/gfx/font_fallback_win_unittest.cc
index ff807cc..e378db8 100644
--- a/ui/gfx/font_fallback_win_unittest.cc
+++ b/ui/gfx/font_fallback_win_unittest.cc
@@ -24,7 +24,7 @@
test_linked_fonts.push_back(font);
}
- virtual const std::vector<Font>* GetLinkedFonts() const OVERRIDE {
+ virtual const std::vector<Font>* GetLinkedFonts() const override {
return &test_linked_fonts;
}
diff --git a/ui/gfx/font_render_params_linux_unittest.cc b/ui/gfx/font_render_params_linux_unittest.cc
index 46c82b4..a9b230f 100644
--- a/ui/gfx/font_render_params_linux_unittest.cc
+++ b/ui/gfx/font_render_params_linux_unittest.cc
@@ -27,15 +27,15 @@
void set_params(const FontRenderParams& params) { params_ = params; }
- virtual FontRenderParams GetDefaultFontRenderParams() const OVERRIDE {
+ virtual FontRenderParams GetDefaultFontRenderParams() const override {
return params_;
}
virtual scoped_ptr<ScopedPangoFontDescription>
- GetDefaultPangoFontDescription() const OVERRIDE {
+ GetDefaultPangoFontDescription() const override {
NOTIMPLEMENTED();
return scoped_ptr<ScopedPangoFontDescription>();
}
- virtual double GetFontDPI() const OVERRIDE {
+ virtual double GetFontDPI() const override {
NOTIMPLEMENTED();
return 96.0;
}
diff --git a/ui/gfx/font_render_params_win.cc b/ui/gfx/font_render_params_win.cc
index a6fc618..372435d 100644
--- a/ui/gfx/font_render_params_win.cc
+++ b/ui/gfx/font_render_params_win.cc
@@ -59,7 +59,7 @@
virtual void OnWndProc(HWND hwnd,
UINT message,
WPARAM wparam,
- LPARAM lparam) OVERRIDE {
+ LPARAM lparam) override {
if (message == WM_SETTINGCHANGE) {
params_.reset();
gfx::SingletonHwnd::GetInstance()->RemoveObserver(this);
diff --git a/ui/gfx/gdi_util.cc b/ui/gfx/gdi_util.cc
index dc7d83f..996d01e 100644
--- a/ui/gfx/gdi_util.cc
+++ b/ui/gfx/gdi_util.cc
@@ -7,13 +7,11 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-namespace gfx {
+namespace {
-void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr) {
- CreateBitmapHeaderWithColorDepth(width, height, 32, hdr);
-}
-
-void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth,
+void CreateBitmapHeaderWithColorDepth(LONG width,
+ LONG height,
+ WORD color_depth,
BITMAPINFOHEADER* hdr) {
// These values are shared with gfx::PlatformDevice
hdr->biSize = sizeof(BITMAPINFOHEADER);
@@ -29,6 +27,14 @@
hdr->biClrImportant = 0;
}
+} // namespace
+
+namespace gfx {
+
+void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr) {
+ CreateBitmapHeaderWithColorDepth(width, height, 32, hdr);
+}
+
void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr) {
// Because bmp v4 header is just an extension, we just create a v3 header and
// copy the bits over to the v4 header.
@@ -49,17 +55,7 @@
void CreateMonochromeBitmapHeader(int width,
int height,
BITMAPINFOHEADER* hdr) {
- hdr->biSize = sizeof(BITMAPINFOHEADER);
- hdr->biWidth = width;
- hdr->biHeight = -height;
- hdr->biPlanes = 1;
- hdr->biBitCount = 1;
- hdr->biCompression = BI_RGB;
- hdr->biSizeImage = 0;
- hdr->biXPelsPerMeter = 1;
- hdr->biYPelsPerMeter = 1;
- hdr->biClrUsed = 0;
- hdr->biClrImportant = 0;
+ CreateBitmapHeaderWithColorDepth(width, height, 1, hdr);
}
void SubtractRectanglesFromRegion(HRGN hrgn,
@@ -96,7 +92,7 @@
}
-double CalculatePageScale(HDC dc, int page_width, int page_height) {
+float CalculatePageScale(HDC dc, int page_width, int page_height) {
int dc_width = GetDeviceCaps(dc, HORZRES);
int dc_height = GetDeviceCaps(dc, VERTRES);
@@ -104,15 +100,15 @@
if (dc_width >= page_width && dc_height >= page_height)
return 1.0;
- double x_factor =
- static_cast<double>(dc_width) / static_cast<double>(page_width);
- double y_factor =
- static_cast<double>(dc_height) / static_cast<double>(page_height);
+ float x_factor =
+ static_cast<float>(dc_width) / static_cast<float>(page_width);
+ float y_factor =
+ static_cast<float>(dc_height) / static_cast<float>(page_height);
return std::min(x_factor, y_factor);
}
// Apply scaling to the DC.
-bool ScaleDC(HDC dc, double scale_factor) {
+bool ScaleDC(HDC dc, float scale_factor) {
SetGraphicsMode(dc, GM_ADVANCED);
XFORM xform = {0};
xform.eM11 = xform.eM22 = scale_factor;
diff --git a/ui/gfx/gdi_util.h b/ui/gfx/gdi_util.h
index d8563b6..f1c0f50 100644
--- a/ui/gfx/gdi_util.h
+++ b/ui/gfx/gdi_util.h
@@ -18,11 +18,6 @@
GFX_EXPORT void CreateBitmapHeader(int width, int height,
BITMAPINFOHEADER* hdr);
-// Creates a BITMAPINFOHEADER structure given the bitmap's size and
-// color depth in bits per pixel.
-void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth,
- BITMAPINFOHEADER* hdr);
-
// Creates a BITMAPV4HEADER structure given the bitmap's size. You probably
// only need to use BMP V4 if you need transparency (alpha channel). This
// function sets the AlphaMask to 0xff000000.
@@ -40,10 +35,10 @@
GFX_EXPORT HRGN ConvertPathToHRGN(const gfx::Path& path);
// Calculate scale to fit an entire page on DC.
-GFX_EXPORT double CalculatePageScale(HDC dc, int page_width, int page_height);
+GFX_EXPORT float CalculatePageScale(HDC dc, int page_width, int page_height);
// Apply scaling to the DC.
-GFX_EXPORT bool ScaleDC(HDC dc, double scale_factor);
+GFX_EXPORT bool ScaleDC(HDC dc, float scale_factor);
GFX_EXPORT void StretchDIBits(HDC hdc,
int dest_x, int dest_y, int dest_w, int dest_h,
diff --git a/ui/gfx/geometry/r_tree_base.h b/ui/gfx/geometry/r_tree_base.h
index 21dc86b..b83aeef 100644
--- a/ui/gfx/geometry/r_tree_base.h
+++ b/ui/gfx/geometry/r_tree_base.h
@@ -96,10 +96,10 @@
virtual ~RecordBase();
virtual void AppendIntersectingRecords(const Rect& query_rect,
- Records* records_out) const OVERRIDE;
- virtual void AppendAllRecords(Records* records_out) const OVERRIDE;
- virtual scoped_ptr<NodeBase> RemoveAndReturnLastChild() OVERRIDE;
- virtual int Level() const OVERRIDE;
+ Records* records_out) const override;
+ virtual void AppendAllRecords(Records* records_out) const override;
+ virtual scoped_ptr<NodeBase> RemoveAndReturnLastChild() override;
+ virtual int Level() const override;
private:
friend class RTreeTest;
@@ -115,10 +115,10 @@
virtual ~Node();
virtual void AppendIntersectingRecords(const Rect& query_rect,
- Records* records_out) const OVERRIDE;
- virtual scoped_ptr<NodeBase> RemoveAndReturnLastChild() OVERRIDE;
- virtual int Level() const OVERRIDE;
- virtual void AppendAllRecords(Records* matches_out) const OVERRIDE;
+ Records* records_out) const override;
+ virtual scoped_ptr<NodeBase> RemoveAndReturnLastChild() override;
+ virtual int Level() const override;
+ virtual void AppendAllRecords(Records* matches_out) const override;
// Constructs a new Node that is the parent of this Node and already has
// this Node as its sole child. Valid to call only on root Nodes, meaning
@@ -219,7 +219,7 @@
Rects* vertical_bounds,
Rects* horizontal_bounds);
- virtual void RecomputeLocalBounds() OVERRIDE;
+ virtual void RecomputeLocalBounds() override;
// Returns the increase in overlap value, as defined in Beckmann et al. as
// the sum of the areas of the intersection of all child rectangles
diff --git a/ui/gfx/gfx.gyp b/ui/gfx/gfx.gyp
index 10f2bfa..edd4394 100644
--- a/ui/gfx/gfx.gyp
+++ b/ui/gfx/gfx.gyp
@@ -109,8 +109,6 @@
'android/gfx_jni_registrar.h',
'android/java_bitmap.cc',
'android/java_bitmap.h',
- 'android/scroller.cc',
- 'android/scroller.h',
'android/shared_device_display_info.cc',
'android/shared_device_display_info.h',
'android/view_configuration.cc',
@@ -303,6 +301,8 @@
'utf16_indexing.cc',
'utf16_indexing.h',
'vsync_provider.h',
+ 'win/direct_write.cc',
+ 'win/direct_write.h',
'win/dpi.cc',
'win/dpi.h',
'win/hwnd_util.cc',
diff --git a/ui/gfx/gfx_tests.gyp b/ui/gfx/gfx_tests.gyp
index a6a68e0..c61701e 100644
--- a/ui/gfx/gfx_tests.gyp
+++ b/ui/gfx/gfx_tests.gyp
@@ -25,7 +25,6 @@
],
'all_sources': [
'<@(_common_sources)',
- 'android/scroller_unittest.cc',
'animation/animation_container_unittest.cc',
'animation/animation_unittest.cc',
'animation/multi_animation_unittest.cc',
@@ -38,6 +37,7 @@
'codec/jpeg_codec_unittest.cc',
'codec/png_codec_unittest.cc',
'color_analysis_unittest.cc',
+ 'color_profile_mac_unittest.mm',
'color_utils_unittest.cc',
'display_change_notifier_unittest.cc',
'display_unittest.cc',
diff --git a/ui/gfx/gpu_memory_buffer.cc b/ui/gfx/gpu_memory_buffer.cc
index 3e36cd1..18de4f0 100644
--- a/ui/gfx/gpu_memory_buffer.cc
+++ b/ui/gfx/gpu_memory_buffer.cc
@@ -13,10 +13,6 @@
,
io_surface_id(0u)
#endif
-#if defined(OS_ANDROID)
- ,
- buffer_id(0)
-#endif
#if defined(USE_X11)
,
pixmap(0)
@@ -24,8 +20,4 @@
{
}
-GpuMemoryBuffer::GpuMemoryBuffer() {}
-
-GpuMemoryBuffer::~GpuMemoryBuffer() {}
-
} // namespace gfx
diff --git a/ui/gfx/gpu_memory_buffer.h b/ui/gfx/gpu_memory_buffer.h
index 932c8d6..e33a189 100644
--- a/ui/gfx/gpu_memory_buffer.h
+++ b/ui/gfx/gpu_memory_buffer.h
@@ -13,6 +13,8 @@
#include "ui/gfx/x/x11_types.h"
#endif
+extern "C" typedef struct _ClientBuffer* ClientBuffer;
+
namespace gfx {
enum GpuMemoryBufferType {
@@ -26,18 +28,6 @@
GPU_MEMORY_BUFFER_TYPE_LAST = OZONE_NATIVE_BUFFER
};
-// TODO(alexst): Merge this with GpuMemoryBufferId as part of switchover to
-// the new API for GpuMemoryBuffer allocation when it's done.
-#if defined(OS_ANDROID)
-struct SurfaceTextureId {
- SurfaceTextureId() : primary_id(0), secondary_id(0) {}
- SurfaceTextureId(int32 primary_id, int32 secondary_id)
- : primary_id(primary_id), secondary_id(secondary_id) {}
- int32 primary_id;
- int32 secondary_id;
-};
-#endif
-
struct GpuMemoryBufferId {
GpuMemoryBufferId() : primary_id(0), secondary_id(0) {}
GpuMemoryBufferId(int32 primary_id, int32 secondary_id)
@@ -55,10 +45,6 @@
#if defined(OS_MACOSX)
uint32 io_surface_id;
#endif
-#if defined(OS_ANDROID)
- long buffer_id;
- SurfaceTextureId surface_texture_id;
-#endif
#if defined(USE_X11)
XID pixmap;
#endif
@@ -69,8 +55,15 @@
// regular CPU code, but can also be read by the GPU.
class GFX_EXPORT GpuMemoryBuffer {
public:
- GpuMemoryBuffer();
- virtual ~GpuMemoryBuffer();
+ // The format needs to be taken into account when mapping a buffer into the
+ // client's address space.
+ enum Format { RGBA_8888, RGBX_8888, BGRA_8888, FORMAT_LAST = BGRA_8888 };
+
+ // The usage mode affects how a buffer can be used. Only buffers created with
+ // MAP can be mapped into the client's address space and accessed by the CPU.
+ enum Usage { MAP, SCANOUT, USAGE_LAST = SCANOUT };
+
+ virtual ~GpuMemoryBuffer() {}
// Maps the buffer into the client's address space so it can be written to by
// the CPU. This call may block, for instance if the GPU needs to finish
@@ -85,11 +78,17 @@
// Returns true iff the buffer is mapped.
virtual bool IsMapped() const = 0;
+ // Returns the format for the buffer.
+ virtual Format GetFormat() const = 0;
+
// Returns the stride in bytes for the buffer.
virtual uint32 GetStride() const = 0;
// Returns a platform specific handle for this buffer.
virtual GpuMemoryBufferHandle GetHandle() const = 0;
+
+ // Type-checking downcast routine.
+ virtual ClientBuffer AsClientBuffer() = 0;
};
} // namespace gfx
diff --git a/ui/gfx/icon_util_unittest.cc b/ui/gfx/icon_util_unittest.cc
index f0f2cde..280c25f 100644
--- a/ui/gfx/icon_util_unittest.cc
+++ b/ui/gfx/icon_util_unittest.cc
@@ -26,7 +26,7 @@
class IconUtilTest : public testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
gfx::RegisterPathProvider();
ASSERT_TRUE(PathService::Get(gfx::DIR_TEST_DATA, &test_data_directory_));
temp_directory_.CreateUniqueTempDir();
diff --git a/ui/gfx/image/canvas_image_source.h b/ui/gfx/image/canvas_image_source.h
index 0ce170d..33d97cb 100644
--- a/ui/gfx/image/canvas_image_source.h
+++ b/ui/gfx/image/canvas_image_source.h
@@ -30,7 +30,7 @@
const gfx::Size& size() const { return size_; };
// Overridden from gfx::ImageSkiaSource.
- virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE;
+ virtual gfx::ImageSkiaRep GetImageForScale(float scale) override;
protected:
virtual ~CanvasImageSource() {}
diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc
index 70ab5ed..bd8cb20 100644
--- a/ui/gfx/image/image.cc
+++ b/ui/gfx/image/image.cc
@@ -68,7 +68,7 @@
PNGImageSource() {}
virtual ~PNGImageSource() {}
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
if (image_skia_reps_.empty())
return ImageSkiaRep();
@@ -224,15 +224,15 @@
virtual ~ImageRepPNG() {
}
- virtual int Width() const OVERRIDE {
+ virtual int Width() const override {
return Size().width();
}
- virtual int Height() const OVERRIDE {
+ virtual int Height() const override {
return Size().height();
}
- virtual gfx::Size Size() const OVERRIDE {
+ virtual gfx::Size Size() const override {
// Read the PNG data to get the image size, caching it.
if (!size_cache_) {
for (std::vector<ImagePNGRep>::const_iterator it = image_reps().begin();
@@ -270,15 +270,15 @@
virtual ~ImageRepSkia() {
}
- virtual int Width() const OVERRIDE {
+ virtual int Width() const override {
return image_->width();
}
- virtual int Height() const OVERRIDE {
+ virtual int Height() const override {
return image_->height();
}
- virtual gfx::Size Size() const OVERRIDE {
+ virtual gfx::Size Size() const override {
return image_->size();
}
@@ -304,15 +304,15 @@
image_ = nil;
}
- virtual int Width() const OVERRIDE {
+ virtual int Width() const override {
return Size().width();
}
- virtual int Height() const OVERRIDE {
+ virtual int Height() const override {
return Size().height();
}
- virtual gfx::Size Size() const OVERRIDE {
+ virtual gfx::Size Size() const override {
return internal::UIImageSize(image_);
}
@@ -337,15 +337,15 @@
image_ = nil;
}
- virtual int Width() const OVERRIDE {
+ virtual int Width() const override {
return Size().width();
}
- virtual int Height() const OVERRIDE {
+ virtual int Height() const override {
return Size().height();
}
- virtual gfx::Size Size() const OVERRIDE {
+ virtual gfx::Size Size() const override {
return internal::NSImageSize(image_);
}
diff --git a/ui/gfx/image/image_family_unittest.cc b/ui/gfx/image/image_family_unittest.cc
index 2e80ccf..f9dd401 100644
--- a/ui/gfx/image/image_family_unittest.cc
+++ b/ui/gfx/image/image_family_unittest.cc
@@ -26,7 +26,7 @@
class ImageFamilyTest : public testing::Test {
public:
// Construct an ImageFamily. Implicitly tests Add and Empty.
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
EXPECT_TRUE(image_family_.empty());
// Aspect ratio 1:1.
diff --git a/ui/gfx/image/image_ios_unittest.mm b/ui/gfx/image/image_ios_unittest.mm
index 81bd82e..789fe72 100644
--- a/ui/gfx/image/image_ios_unittest.mm
+++ b/ui/gfx/image/image_ios_unittest.mm
@@ -48,11 +48,11 @@
ImageIOSTest() {}
virtual ~ImageIOSTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
original_scale_factors_ = gfx::ImageSkia::GetSupportedScales();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
gfx::ImageSkia::SetSupportedScales(original_scale_factors_);
}
diff --git a/ui/gfx/image/image_skia_operations.cc b/ui/gfx/image/image_skia_operations.cc
index c7e0eec..d172d54 100644
--- a/ui/gfx/image/image_skia_operations.cc
+++ b/ui/gfx/image/image_skia_operations.cc
@@ -58,7 +58,7 @@
}
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
ImageSkiaRep first_rep = first_.GetRepresentation(scale);
ImageSkiaRep second_rep = second_.GetRepresentation(scale);
if (first_rep.pixel_size() != second_rep.pixel_size()) {
@@ -112,7 +112,7 @@
// BinaryImageSource overrides:
virtual ImageSkiaRep CreateImageSkiaRep(
const ImageSkiaRep& first_rep,
- const ImageSkiaRep& second_rep) const OVERRIDE {
+ const ImageSkiaRep& second_rep) const override {
SkBitmap blended = SkBitmapOperations::CreateBlendedBitmap(
first_rep.sk_bitmap(), second_rep.sk_bitmap(), alpha_);
return ImageSkiaRep(blended, first_rep.scale());
@@ -136,7 +136,7 @@
virtual ~SuperimposedImageSource() {}
// gfx::CanvasImageSource override.
- virtual void Draw(Canvas* canvas) OVERRIDE {
+ virtual void Draw(Canvas* canvas) override {
canvas->DrawImageInt(first_, 0, 0);
canvas->DrawImageInt(second_,
(first_.width() - second_.width()) / 2,
@@ -161,7 +161,7 @@
private:
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
ImageSkiaRep image_rep = image_.GetRepresentation(scale);
SkBitmap alpha;
alpha.allocN32Pixels(image_rep.pixel_width(),
@@ -190,7 +190,7 @@
// BinaryImageSource overrides:
virtual ImageSkiaRep CreateImageSkiaRep(
const ImageSkiaRep& first_rep,
- const ImageSkiaRep& second_rep) const OVERRIDE {
+ const ImageSkiaRep& second_rep) const override {
return ImageSkiaRep(SkBitmapOperations::CreateMaskedBitmap(
first_rep.sk_bitmap(), second_rep.sk_bitmap()),
first_rep.scale());
@@ -216,7 +216,7 @@
}
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
ImageSkiaRep source_rep = source_.GetRepresentation(scale);
gfx::Rect bounds = DIPToPixelBounds(gfx::Rect(src_x_, src_y_, dst_w_,
dst_h_), source_rep.scale());
@@ -249,7 +249,7 @@
}
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
ImageSkiaRep image_rep = image_.GetRepresentation(scale);
return gfx::ImageSkiaRep(
SkBitmapOperations::CreateHSLShiftedBitmap(image_rep.sk_bitmap(),
@@ -279,7 +279,7 @@
}
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
ImageSkiaRep image_rep = image_.GetRepresentation(scale);
ImageSkiaRep mask_rep = mask_.GetRepresentation(scale);
if (image_rep.scale() != mask_rep.scale()) {
@@ -314,7 +314,7 @@
}
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
ImageSkiaRep image_rep = image_.GetRepresentation(scale);
SkIRect subset_bounds_in_pixel = RectToSkIRect(
DIPToPixelBounds(subset_bounds_, image_rep.scale()));
@@ -346,7 +346,7 @@
virtual ~ResizeSource() {}
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
const ImageSkiaRep& image_rep = source_.GetRepresentation(scale);
if (image_rep.GetWidth() == target_dip_size_.width() &&
image_rep.GetHeight() == target_dip_size_.height())
@@ -381,7 +381,7 @@
virtual ~DropShadowSource() {}
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
const ImageSkiaRep& image_rep = source_.GetRepresentation(scale);
ShadowValues shadows_in_pixel;
@@ -413,7 +413,7 @@
virtual ~RotatedSource() {}
// gfx::ImageSkiaSource overrides:
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
const ImageSkiaRep& image_rep = source_.GetRepresentation(scale);
const SkBitmap rotated_bitmap =
SkBitmapOperations::Rotate(image_rep.sk_bitmap(), rotation_);
diff --git a/ui/gfx/interpolated_transform.cc b/ui/gfx/interpolated_transform.cc
index 4c807f1..693b656 100644
--- a/ui/gfx/interpolated_transform.cc
+++ b/ui/gfx/interpolated_transform.cc
@@ -230,8 +230,8 @@
gfx::Transform result;
float scale_x = ValueBetween(t, start_scale_.x(), end_scale_.x());
float scale_y = ValueBetween(t, start_scale_.y(), end_scale_.y());
- // TODO(vollick) 3d xforms.
- result.Scale(scale_x, scale_y);
+ float scale_z = ValueBetween(t, start_scale_.z(), end_scale_.z());
+ result.Scale3d(scale_x, scale_y, scale_z);
return result;
}
@@ -255,14 +255,28 @@
end_pos_(end_pos) {
}
+InterpolatedTranslation::InterpolatedTranslation(const gfx::Point3F& start_pos,
+ const gfx::Point3F& end_pos)
+ : InterpolatedTransform(), start_pos_(start_pos), end_pos_(end_pos) {
+}
+
+InterpolatedTranslation::InterpolatedTranslation(const gfx::Point3F& start_pos,
+ const gfx::Point3F& end_pos,
+ float start_time,
+ float end_time)
+ : InterpolatedTransform(start_time, end_time),
+ start_pos_(start_pos),
+ end_pos_(end_pos) {
+}
+
InterpolatedTranslation::~InterpolatedTranslation() {}
gfx::Transform
InterpolatedTranslation::InterpolateButDoNotCompose(float t) const {
gfx::Transform result;
- // TODO(vollick) 3d xforms.
- result.Translate(ValueBetween(t, start_pos_.x(), end_pos_.x()),
- ValueBetween(t, start_pos_.y(), end_pos_.y()));
+ result.Translate3d(ValueBetween(t, start_pos_.x(), end_pos_.x()),
+ ValueBetween(t, start_pos_.y(), end_pos_.y()),
+ ValueBetween(t, start_pos_.z(), end_pos_.z()));
return result;
}
diff --git a/ui/gfx/interpolated_transform.h b/ui/gfx/interpolated_transform.h
index dea9ce9..441af38 100644
--- a/ui/gfx/interpolated_transform.h
+++ b/ui/gfx/interpolated_transform.h
@@ -94,7 +94,7 @@
virtual ~InterpolatedRotation();
protected:
- virtual gfx::Transform InterpolateButDoNotCompose(float t) const OVERRIDE;
+ virtual gfx::Transform InterpolateButDoNotCompose(float t) const override;
private:
const float start_degrees_;
@@ -122,7 +122,7 @@
virtual ~InterpolatedAxisAngleRotation();
protected:
- virtual gfx::Transform InterpolateButDoNotCompose(float t) const OVERRIDE;
+ virtual gfx::Transform InterpolateButDoNotCompose(float t) const override;
private:
gfx::Vector3dF axis_;
@@ -152,7 +152,7 @@
virtual ~InterpolatedScale();
protected:
- virtual gfx::Transform InterpolateButDoNotCompose(float t) const OVERRIDE;
+ virtual gfx::Transform InterpolateButDoNotCompose(float t) const override;
private:
const gfx::Point3F start_scale_;
@@ -169,14 +169,20 @@
const gfx::Point& end_pos,
float start_time,
float end_time);
+ InterpolatedTranslation(const gfx::Point3F& start_pos,
+ const gfx::Point3F& end_pos);
+ InterpolatedTranslation(const gfx::Point3F& start_pos,
+ const gfx::Point3F& end_pos,
+ float start_time,
+ float end_time);
virtual ~InterpolatedTranslation();
protected:
- virtual gfx::Transform InterpolateButDoNotCompose(float t) const OVERRIDE;
+ virtual gfx::Transform InterpolateButDoNotCompose(float t) const override;
private:
- const gfx::Point start_pos_;
- const gfx::Point end_pos_;
+ const gfx::Point3F start_pos_;
+ const gfx::Point3F end_pos_;
DISALLOW_COPY_AND_ASSIGN(InterpolatedTranslation);
};
@@ -196,7 +202,7 @@
virtual ~InterpolatedConstantTransform();
protected:
- virtual gfx::Transform InterpolateButDoNotCompose(float t) const OVERRIDE;
+ virtual gfx::Transform InterpolateButDoNotCompose(float t) const override;
private:
const gfx::Transform transform_;
@@ -227,7 +233,7 @@
virtual ~InterpolatedTransformAboutPivot();
protected:
- virtual gfx::Transform InterpolateButDoNotCompose(float t) const OVERRIDE;
+ virtual gfx::Transform InterpolateButDoNotCompose(float t) const override;
private:
void Init(const gfx::Point& pivot, InterpolatedTransform* transform);
@@ -250,7 +256,7 @@
virtual ~InterpolatedMatrixTransform();
protected:
- virtual gfx::Transform InterpolateButDoNotCompose(float t) const OVERRIDE;
+ virtual gfx::Transform InterpolateButDoNotCompose(float t) const override;
private:
void Init(const gfx::Transform& start_transform,
diff --git a/ui/gfx/interpolated_transform_unittest.cc b/ui/gfx/interpolated_transform_unittest.cc
index 5215a8b..af6be9d 100644
--- a/ui/gfx/interpolated_transform_unittest.cc
+++ b/ui/gfx/interpolated_transform_unittest.cc
@@ -44,7 +44,7 @@
for (int i = 0; i <= 100; ++i) {
gfx::Transform scale;
- scale.Scale(i, i);
+ scale.Scale3d(i, i, i);
gfx::Transform interpolated = interpolated_scale.Interpolate(i / 100.0f);
CheckApproximatelyEqual(scale, interpolated);
interpolated = interpolated_scale_diff_start_end.Interpolate(i + 100);
@@ -69,6 +69,23 @@
}
}
+TEST(InterpolatedTransformTest, InterpolatedTranslate3d) {
+ ui::InterpolatedTranslation interpolated_xform(gfx::Point3F(0, 0, 0),
+ gfx::Point3F(100, 100, 100));
+
+ ui::InterpolatedTranslation interpolated_xform_diff_start_end(
+ gfx::Point3F(0, 0, 0), gfx::Point3F(100, 100, 100), 100, 200);
+
+ for (int i = 0; i <= 100; ++i) {
+ gfx::Transform xform;
+ xform.Translate3d(i, i, i);
+ gfx::Transform interpolated = interpolated_xform.Interpolate(i / 100.0f);
+ CheckApproximatelyEqual(xform, interpolated);
+ interpolated = interpolated_xform_diff_start_end.Interpolate(i + 100);
+ CheckApproximatelyEqual(xform, interpolated);
+ }
+}
+
TEST(InterpolatedTransformTest, InterpolatedRotationAboutPivot) {
gfx::Point pivot(100, 100);
gfx::Point above_pivot(100, 200);
diff --git a/ui/gfx/mac/coordinate_conversion_unittest.mm b/ui/gfx/mac/coordinate_conversion_unittest.mm
index a96bb04..ea0898d 100644
--- a/ui/gfx/mac/coordinate_conversion_unittest.mm
+++ b/ui/gfx/mac/coordinate_conversion_unittest.mm
@@ -35,8 +35,8 @@
MacCoordinateConversionTest() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
private:
scoped_ptr<base::mac::ScopedObjCClassSwizzler> swizzle_frame_;
diff --git a/ui/gfx/platform_font_ios.h b/ui/gfx/platform_font_ios.h
index 1d287c3..bb0aeaa 100644
--- a/ui/gfx/platform_font_ios.h
+++ b/ui/gfx/platform_font_ios.h
@@ -17,17 +17,17 @@
int font_size);
// Overridden from PlatformFont:
- virtual Font DeriveFont(int size_delta, int style) const OVERRIDE;
- virtual int GetHeight() const OVERRIDE;
- virtual int GetBaseline() const OVERRIDE;
- virtual int GetCapHeight() const OVERRIDE;
- virtual int GetExpectedTextWidth(int length) const OVERRIDE;
- virtual int GetStyle() const OVERRIDE;
- virtual std::string GetFontName() const OVERRIDE;
- virtual std::string GetActualFontNameForTesting() const OVERRIDE;
- virtual int GetFontSize() const OVERRIDE;
- virtual const FontRenderParams& GetFontRenderParams() const OVERRIDE;
- virtual NativeFont GetNativeFont() const OVERRIDE;
+ virtual Font DeriveFont(int size_delta, int style) const override;
+ virtual int GetHeight() const override;
+ virtual int GetBaseline() const override;
+ virtual int GetCapHeight() const override;
+ virtual int GetExpectedTextWidth(int length) const override;
+ virtual int GetStyle() const override;
+ virtual std::string GetFontName() const override;
+ virtual std::string GetActualFontNameForTesting() const override;
+ virtual int GetFontSize() const override;
+ virtual const FontRenderParams& GetFontRenderParams() const override;
+ virtual NativeFont GetNativeFont() const override;
private:
PlatformFontIOS(const std::string& font_name, int font_size, int style);
diff --git a/ui/gfx/platform_font_mac.h b/ui/gfx/platform_font_mac.h
index 6def51a..05c1249 100644
--- a/ui/gfx/platform_font_mac.h
+++ b/ui/gfx/platform_font_mac.h
@@ -19,17 +19,17 @@
int font_size);
// Overridden from PlatformFont:
- virtual Font DeriveFont(int size_delta, int style) const OVERRIDE;
- virtual int GetHeight() const OVERRIDE;
- virtual int GetBaseline() const OVERRIDE;
- virtual int GetCapHeight() const OVERRIDE;
- virtual int GetExpectedTextWidth(int length) const OVERRIDE;
- virtual int GetStyle() const OVERRIDE;
- virtual std::string GetFontName() const OVERRIDE;
- virtual std::string GetActualFontNameForTesting() const OVERRIDE;
- virtual int GetFontSize() const OVERRIDE;
- virtual const FontRenderParams& GetFontRenderParams() const OVERRIDE;
- virtual NativeFont GetNativeFont() const OVERRIDE;
+ virtual Font DeriveFont(int size_delta, int style) const override;
+ virtual int GetHeight() const override;
+ virtual int GetBaseline() const override;
+ virtual int GetCapHeight() const override;
+ virtual int GetExpectedTextWidth(int length) const override;
+ virtual int GetStyle() const override;
+ virtual std::string GetFontName() const override;
+ virtual std::string GetActualFontNameForTesting() const override;
+ virtual int GetFontSize() const override;
+ virtual const FontRenderParams& GetFontRenderParams() const override;
+ virtual NativeFont GetNativeFont() const override;
private:
PlatformFontMac(const std::string& font_name, int font_size, int font_style);
diff --git a/ui/gfx/platform_font_pango.h b/ui/gfx/platform_font_pango.h
index a636db2..5041bbb 100644
--- a/ui/gfx/platform_font_pango.h
+++ b/ui/gfx/platform_font_pango.h
@@ -41,17 +41,17 @@
#endif
// Overridden from PlatformFont:
- virtual Font DeriveFont(int size_delta, int style) const OVERRIDE;
- virtual int GetHeight() const OVERRIDE;
- virtual int GetBaseline() const OVERRIDE;
- virtual int GetCapHeight() const OVERRIDE;
- virtual int GetExpectedTextWidth(int length) const OVERRIDE;
- virtual int GetStyle() const OVERRIDE;
- virtual std::string GetFontName() const OVERRIDE;
- virtual std::string GetActualFontNameForTesting() const OVERRIDE;
- virtual int GetFontSize() const OVERRIDE;
- virtual const FontRenderParams& GetFontRenderParams() const OVERRIDE;
- virtual NativeFont GetNativeFont() const OVERRIDE;
+ virtual Font DeriveFont(int size_delta, int style) const override;
+ virtual int GetHeight() const override;
+ virtual int GetBaseline() const override;
+ virtual int GetCapHeight() const override;
+ virtual int GetExpectedTextWidth(int length) const override;
+ virtual int GetStyle() const override;
+ virtual std::string GetFontName() const override;
+ virtual std::string GetActualFontNameForTesting() const override;
+ virtual int GetFontSize() const override;
+ virtual const FontRenderParams& GetFontRenderParams() const override;
+ virtual NativeFont GetNativeFont() const override;
private:
// Create a new instance of this object with the specified properties. Called
diff --git a/ui/gfx/platform_font_win.h b/ui/gfx/platform_font_win.h
index 1434fe6..90160aa 100644
--- a/ui/gfx/platform_font_win.h
+++ b/ui/gfx/platform_font_win.h
@@ -54,17 +54,17 @@
Font DeriveFontWithHeight(int height, int style);
// Overridden from PlatformFont:
- virtual Font DeriveFont(int size_delta, int style) const OVERRIDE;
- virtual int GetHeight() const OVERRIDE;
- virtual int GetBaseline() const OVERRIDE;
- virtual int GetCapHeight() const OVERRIDE;
- virtual int GetExpectedTextWidth(int length) const OVERRIDE;
- virtual int GetStyle() const OVERRIDE;
- virtual std::string GetFontName() const OVERRIDE;
- virtual std::string GetActualFontNameForTesting() const OVERRIDE;
- virtual int GetFontSize() const OVERRIDE;
- virtual const FontRenderParams& GetFontRenderParams() const OVERRIDE;
- virtual NativeFont GetNativeFont() const OVERRIDE;
+ virtual Font DeriveFont(int size_delta, int style) const override;
+ virtual int GetHeight() const override;
+ virtual int GetBaseline() const override;
+ virtual int GetCapHeight() const override;
+ virtual int GetExpectedTextWidth(int length) const override;
+ virtual int GetStyle() const override;
+ virtual std::string GetFontName() const override;
+ virtual std::string GetActualFontNameForTesting() const override;
+ virtual int GetFontSize() const override;
+ virtual const FontRenderParams& GetFontRenderParams() const override;
+ virtual NativeFont GetNativeFont() const override;
private:
virtual ~PlatformFontWin() {}
diff --git a/ui/gfx/render_text_harfbuzz.h b/ui/gfx/render_text_harfbuzz.h
index 8936e53..329be9f 100644
--- a/ui/gfx/render_text_harfbuzz.h
+++ b/ui/gfx/render_text_harfbuzz.h
@@ -80,28 +80,28 @@
virtual ~RenderTextHarfBuzz();
// Overridden from RenderText.
- virtual Size GetStringSize() OVERRIDE;
- virtual SizeF GetStringSizeF() OVERRIDE;
- virtual SelectionModel FindCursorPosition(const Point& point) OVERRIDE;
- virtual std::vector<FontSpan> GetFontSpansForTesting() OVERRIDE;
- virtual Range GetGlyphBounds(size_t index) OVERRIDE;
+ virtual Size GetStringSize() override;
+ virtual SizeF GetStringSizeF() override;
+ virtual SelectionModel FindCursorPosition(const Point& point) override;
+ virtual std::vector<FontSpan> GetFontSpansForTesting() override;
+ virtual Range GetGlyphBounds(size_t index) override;
protected:
// Overridden from RenderText.
- virtual int GetLayoutTextBaseline() OVERRIDE;
+ virtual int GetLayoutTextBaseline() override;
virtual SelectionModel AdjacentCharSelectionModel(
const SelectionModel& selection,
- VisualCursorDirection direction) OVERRIDE;
+ VisualCursorDirection direction) override;
virtual SelectionModel AdjacentWordSelectionModel(
const SelectionModel& selection,
- VisualCursorDirection direction) OVERRIDE;
- virtual std::vector<Rect> GetSubstringBounds(const Range& range) OVERRIDE;
- virtual size_t TextIndexToLayoutIndex(size_t index) const OVERRIDE;
- virtual size_t LayoutIndexToTextIndex(size_t index) const OVERRIDE;
- virtual bool IsValidCursorIndex(size_t index) OVERRIDE;
- virtual void ResetLayout() OVERRIDE;
- virtual void EnsureLayout() OVERRIDE;
- virtual void DrawVisualText(Canvas* canvas) OVERRIDE;
+ VisualCursorDirection direction) override;
+ virtual std::vector<Rect> GetSubstringBounds(const Range& range) override;
+ virtual size_t TextIndexToLayoutIndex(size_t index) const override;
+ virtual size_t LayoutIndexToTextIndex(size_t index) const override;
+ virtual bool IsValidCursorIndex(size_t index) override;
+ virtual void ResetLayout() override;
+ virtual void EnsureLayout() override;
+ virtual void DrawVisualText(Canvas* canvas) override;
private:
friend class RenderTextTest;
diff --git a/ui/gfx/render_text_mac.h b/ui/gfx/render_text_mac.h
index ad03b84..f69bedb 100644
--- a/ui/gfx/render_text_mac.h
+++ b/ui/gfx/render_text_mac.h
@@ -26,28 +26,28 @@
virtual ~RenderTextMac();
// Overridden from RenderText:
- virtual Size GetStringSize() OVERRIDE;
- virtual SizeF GetStringSizeF() OVERRIDE;
- virtual SelectionModel FindCursorPosition(const Point& point) OVERRIDE;
- virtual std::vector<FontSpan> GetFontSpansForTesting() OVERRIDE;
+ virtual Size GetStringSize() override;
+ virtual SizeF GetStringSizeF() override;
+ virtual SelectionModel FindCursorPosition(const Point& point) override;
+ virtual std::vector<FontSpan> GetFontSpansForTesting() override;
protected:
// Overridden from RenderText:
- virtual int GetLayoutTextBaseline() OVERRIDE;
+ virtual int GetLayoutTextBaseline() override;
virtual SelectionModel AdjacentCharSelectionModel(
const SelectionModel& selection,
- VisualCursorDirection direction) OVERRIDE;
+ VisualCursorDirection direction) override;
virtual SelectionModel AdjacentWordSelectionModel(
const SelectionModel& selection,
- VisualCursorDirection direction) OVERRIDE;
- virtual Range GetGlyphBounds(size_t index) OVERRIDE;
- virtual std::vector<Rect> GetSubstringBounds(const Range& range) OVERRIDE;
- virtual size_t TextIndexToLayoutIndex(size_t index) const OVERRIDE;
- virtual size_t LayoutIndexToTextIndex(size_t index) const OVERRIDE;
- virtual bool IsValidCursorIndex(size_t index) OVERRIDE;
- virtual void ResetLayout() OVERRIDE;
- virtual void EnsureLayout() OVERRIDE;
- virtual void DrawVisualText(Canvas* canvas) OVERRIDE;
+ VisualCursorDirection direction) override;
+ virtual Range GetGlyphBounds(size_t index) override;
+ virtual std::vector<Rect> GetSubstringBounds(const Range& range) override;
+ virtual size_t TextIndexToLayoutIndex(size_t index) const override;
+ virtual size_t LayoutIndexToTextIndex(size_t index) const override;
+ virtual bool IsValidCursorIndex(size_t index) override;
+ virtual void ResetLayout() override;
+ virtual void EnsureLayout() override;
+ virtual void DrawVisualText(Canvas* canvas) override;
private:
struct TextRun {
diff --git a/ui/gfx/render_text_pango.h b/ui/gfx/render_text_pango.h
index 4c62e0a..9e4c55c 100644
--- a/ui/gfx/render_text_pango.h
+++ b/ui/gfx/render_text_pango.h
@@ -19,27 +19,27 @@
virtual ~RenderTextPango();
// Overridden from RenderText:
- virtual Size GetStringSize() OVERRIDE;
- virtual SelectionModel FindCursorPosition(const Point& point) OVERRIDE;
- virtual std::vector<FontSpan> GetFontSpansForTesting() OVERRIDE;
+ virtual Size GetStringSize() override;
+ virtual SelectionModel FindCursorPosition(const Point& point) override;
+ virtual std::vector<FontSpan> GetFontSpansForTesting() override;
protected:
// Overridden from RenderText:
- virtual int GetLayoutTextBaseline() OVERRIDE;
+ virtual int GetLayoutTextBaseline() override;
virtual SelectionModel AdjacentCharSelectionModel(
const SelectionModel& selection,
- VisualCursorDirection direction) OVERRIDE;
+ VisualCursorDirection direction) override;
virtual SelectionModel AdjacentWordSelectionModel(
const SelectionModel& selection,
- VisualCursorDirection direction) OVERRIDE;
- virtual Range GetGlyphBounds(size_t index) OVERRIDE;
- virtual std::vector<Rect> GetSubstringBounds(const Range& range) OVERRIDE;
- virtual size_t TextIndexToLayoutIndex(size_t index) const OVERRIDE;
- virtual size_t LayoutIndexToTextIndex(size_t index) const OVERRIDE;
- virtual bool IsValidCursorIndex(size_t index) OVERRIDE;
- virtual void ResetLayout() OVERRIDE;
- virtual void EnsureLayout() OVERRIDE;
- virtual void DrawVisualText(Canvas* canvas) OVERRIDE;
+ VisualCursorDirection direction) override;
+ virtual Range GetGlyphBounds(size_t index) override;
+ virtual std::vector<Rect> GetSubstringBounds(const Range& range) override;
+ virtual size_t TextIndexToLayoutIndex(size_t index) const override;
+ virtual size_t LayoutIndexToTextIndex(size_t index) const override;
+ virtual bool IsValidCursorIndex(size_t index) override;
+ virtual void ResetLayout() override;
+ virtual void EnsureLayout() override;
+ virtual void DrawVisualText(Canvas* canvas) override;
private:
friend class RenderTextTest;
diff --git a/ui/gfx/render_text_win.h b/ui/gfx/render_text_win.h
index bfe3793..aaf3a1e 100644
--- a/ui/gfx/render_text_win.h
+++ b/ui/gfx/render_text_win.h
@@ -63,27 +63,27 @@
virtual ~RenderTextWin();
// Overridden from RenderText:
- virtual Size GetStringSize() OVERRIDE;
- virtual SelectionModel FindCursorPosition(const Point& point) OVERRIDE;
- virtual std::vector<FontSpan> GetFontSpansForTesting() OVERRIDE;
+ virtual Size GetStringSize() override;
+ virtual SelectionModel FindCursorPosition(const Point& point) override;
+ virtual std::vector<FontSpan> GetFontSpansForTesting() override;
protected:
// Overridden from RenderText:
- virtual int GetLayoutTextBaseline() OVERRIDE;
+ virtual int GetLayoutTextBaseline() override;
virtual SelectionModel AdjacentCharSelectionModel(
const SelectionModel& selection,
- VisualCursorDirection direction) OVERRIDE;
+ VisualCursorDirection direction) override;
virtual SelectionModel AdjacentWordSelectionModel(
const SelectionModel& selection,
- VisualCursorDirection direction) OVERRIDE;
- virtual Range GetGlyphBounds(size_t index) OVERRIDE;
- virtual std::vector<Rect> GetSubstringBounds(const Range& range) OVERRIDE;
- virtual size_t TextIndexToLayoutIndex(size_t index) const OVERRIDE;
- virtual size_t LayoutIndexToTextIndex(size_t index) const OVERRIDE;
- virtual bool IsValidCursorIndex(size_t index) OVERRIDE;
- virtual void ResetLayout() OVERRIDE;
- virtual void EnsureLayout() OVERRIDE;
- virtual void DrawVisualText(Canvas* canvas) OVERRIDE;
+ VisualCursorDirection direction) override;
+ virtual Range GetGlyphBounds(size_t index) override;
+ virtual std::vector<Rect> GetSubstringBounds(const Range& range) override;
+ virtual size_t TextIndexToLayoutIndex(size_t index) const override;
+ virtual size_t LayoutIndexToTextIndex(size_t index) const override;
+ virtual bool IsValidCursorIndex(size_t index) override;
+ virtual void ResetLayout() override;
+ virtual void EnsureLayout() override;
+ virtual void DrawVisualText(Canvas* canvas) override;
private:
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_BreakRunsByUnicodeBlocks);
diff --git a/ui/gfx/screen_android.cc b/ui/gfx/screen_android.cc
index 31e3baa..4f04353 100644
--- a/ui/gfx/screen_android.cc
+++ b/ui/gfx/screen_android.cc
@@ -15,22 +15,22 @@
public:
ScreenAndroid() {}
- virtual bool IsDIPEnabled() OVERRIDE { return true; }
+ virtual bool IsDIPEnabled() override { return true; }
- virtual gfx::Point GetCursorScreenPoint() OVERRIDE { return gfx::Point(); }
+ virtual gfx::Point GetCursorScreenPoint() override { return gfx::Point(); }
- virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE {
+ virtual gfx::NativeWindow GetWindowUnderCursor() override {
NOTIMPLEMENTED();
return NULL;
}
virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
- OVERRIDE {
+ override {
NOTIMPLEMENTED();
return NULL;
}
- virtual gfx::Display GetPrimaryDisplay() const OVERRIDE {
+ virtual gfx::Display GetPrimaryDisplay() const override {
gfx::DeviceDisplayInfo device_info;
const float device_scale_factor = device_info.GetDIPScale();
// Note: GetPhysicalDisplayWidth/Height() does not subtract window
@@ -54,31 +54,31 @@
}
virtual gfx::Display GetDisplayNearestWindow(
- gfx::NativeView view) const OVERRIDE {
+ gfx::NativeView view) const override {
return GetPrimaryDisplay();
}
virtual gfx::Display GetDisplayNearestPoint(
- const gfx::Point& point) const OVERRIDE {
+ const gfx::Point& point) const override {
return GetPrimaryDisplay();
}
- virtual int GetNumDisplays() const OVERRIDE { return 1; }
+ virtual int GetNumDisplays() const override { return 1; }
- virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE {
+ virtual std::vector<gfx::Display> GetAllDisplays() const override {
return std::vector<gfx::Display>(1, GetPrimaryDisplay());
}
virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const OVERRIDE {
+ const gfx::Rect& match_rect) const override {
return GetPrimaryDisplay();
}
- virtual void AddObserver(DisplayObserver* observer) OVERRIDE {
+ virtual void AddObserver(DisplayObserver* observer) override {
// no display change on Android.
}
- virtual void RemoveObserver(DisplayObserver* observer) OVERRIDE {
+ virtual void RemoveObserver(DisplayObserver* observer) override {
// no display change on Android.
}
diff --git a/ui/gfx/screen_ios.mm b/ui/gfx/screen_ios.mm
index f630f00..ac5ccc4 100644
--- a/ui/gfx/screen_ios.mm
+++ b/ui/gfx/screen_ios.mm
@@ -12,27 +12,27 @@
namespace {
class ScreenIos : public gfx::Screen {
- virtual bool IsDIPEnabled() OVERRIDE {
+ virtual bool IsDIPEnabled() override {
return true;
}
- virtual gfx::Point GetCursorScreenPoint() OVERRIDE {
+ virtual gfx::Point GetCursorScreenPoint() override {
NOTIMPLEMENTED();
return gfx::Point(0, 0);
}
- virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE {
+ virtual gfx::NativeWindow GetWindowUnderCursor() override {
NOTIMPLEMENTED();
return gfx::NativeWindow();
}
virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
- OVERRIDE {
+ override {
NOTIMPLEMENTED();
return gfx::NativeWindow();
}
- virtual int GetNumDisplays() const OVERRIDE {
+ virtual int GetNumDisplays() const override {
#if TARGET_IPHONE_SIMULATOR
// UIScreen does not reliably return correct results on the simulator.
return 1;
@@ -41,34 +41,34 @@
#endif
}
- virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE {
+ virtual std::vector<gfx::Display> GetAllDisplays() const override {
NOTIMPLEMENTED();
return std::vector<gfx::Display>(1, GetPrimaryDisplay());
}
// Returns the display nearest the specified window.
virtual gfx::Display GetDisplayNearestWindow(
- gfx::NativeView view) const OVERRIDE {
+ gfx::NativeView view) const override {
NOTIMPLEMENTED();
return gfx::Display();
}
// Returns the the display nearest the specified point.
virtual gfx::Display GetDisplayNearestPoint(
- const gfx::Point& point) const OVERRIDE {
+ const gfx::Point& point) const override {
NOTIMPLEMENTED();
return gfx::Display();
}
// Returns the display that most closely intersects the provided bounds.
virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const OVERRIDE {
+ const gfx::Rect& match_rect) const override {
NOTIMPLEMENTED();
return gfx::Display();
}
// Returns the primary display.
- virtual gfx::Display GetPrimaryDisplay() const OVERRIDE {
+ virtual gfx::Display GetPrimaryDisplay() const override {
UIScreen* mainScreen = [UIScreen mainScreen];
CHECK(mainScreen);
gfx::Display display(0, gfx::Rect(mainScreen.bounds));
@@ -76,11 +76,11 @@
return display;
}
- virtual void AddObserver(gfx::DisplayObserver* observer) OVERRIDE {
+ virtual void AddObserver(gfx::DisplayObserver* observer) override {
// no display change on iOS.
}
- virtual void RemoveObserver(gfx::DisplayObserver* observer) OVERRIDE {
+ virtual void RemoveObserver(gfx::DisplayObserver* observer) override {
// no display change on iOS.
}
};
diff --git a/ui/gfx/screen_mac.mm b/ui/gfx/screen_mac.mm
index 0b1f41f..c07dd80 100644
--- a/ui/gfx/screen_mac.mm
+++ b/ui/gfx/screen_mac.mm
@@ -91,11 +91,11 @@
ScreenMac::DisplayReconfigurationCallBack, this);
}
- virtual bool IsDIPEnabled() OVERRIDE {
+ virtual bool IsDIPEnabled() override {
return true;
}
- virtual gfx::Point GetCursorScreenPoint() OVERRIDE {
+ virtual gfx::Point GetCursorScreenPoint() override {
NSPoint mouseLocation = [NSEvent mouseLocation];
// Flip coordinates to gfx (0,0 in top-left corner) using primary screen.
NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
@@ -103,28 +103,28 @@
return gfx::Point(mouseLocation.x, mouseLocation.y);
}
- virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE {
+ virtual gfx::NativeWindow GetWindowUnderCursor() override {
NOTIMPLEMENTED();
return gfx::NativeWindow();
}
virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
- OVERRIDE {
+ override {
NOTIMPLEMENTED();
return gfx::NativeWindow();
}
- virtual int GetNumDisplays() const OVERRIDE {
+ virtual int GetNumDisplays() const override {
return GetAllDisplays().size();
}
- virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE {
+ virtual std::vector<gfx::Display> GetAllDisplays() const override {
return displays_;
}
virtual gfx::Display GetDisplayNearestWindow(
- gfx::NativeView view) const OVERRIDE {
+ gfx::NativeView view) const override {
NSWindow* window = nil;
#if !defined(USE_AURA)
if (view)
@@ -139,7 +139,7 @@
}
virtual gfx::Display GetDisplayNearestPoint(
- const gfx::Point& point) const OVERRIDE {
+ const gfx::Point& point) const override {
NSPoint ns_point = NSPointFromCGPoint(point.ToCGPoint());
NSArray* screens = [NSScreen screens];
@@ -154,13 +154,13 @@
// Returns the display that most closely intersects the provided bounds.
virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const OVERRIDE {
+ const gfx::Rect& match_rect) const override {
NSScreen* match_screen = GetMatchingScreen(match_rect);
return GetDisplayForScreen(match_screen);
}
// Returns the primary display.
- virtual gfx::Display GetPrimaryDisplay() const OVERRIDE {
+ virtual gfx::Display GetPrimaryDisplay() const override {
// Primary display is defined as the display with the menubar,
// which is always at index 0.
NSScreen* primary = [[NSScreen screens] objectAtIndex:0];
@@ -168,11 +168,11 @@
return display;
}
- virtual void AddObserver(gfx::DisplayObserver* observer) OVERRIDE {
+ virtual void AddObserver(gfx::DisplayObserver* observer) override {
change_notifier_.AddObserver(observer);
}
- virtual void RemoveObserver(gfx::DisplayObserver* observer) OVERRIDE {
+ virtual void RemoveObserver(gfx::DisplayObserver* observer) override {
change_notifier_.RemoveObserver(observer);
}
diff --git a/ui/gfx/screen_win.h b/ui/gfx/screen_win.h
index 6ca5601..7d7d2b0 100644
--- a/ui/gfx/screen_win.h
+++ b/ui/gfx/screen_win.h
@@ -21,28 +21,28 @@
protected:
// Overridden from gfx::Screen:
- virtual bool IsDIPEnabled() OVERRIDE;
- virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
- virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE;
+ virtual bool IsDIPEnabled() override;
+ virtual gfx::Point GetCursorScreenPoint() override;
+ virtual gfx::NativeWindow GetWindowUnderCursor() override;
virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
- OVERRIDE;
- virtual int GetNumDisplays() const OVERRIDE;
- virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE;
+ override;
+ virtual int GetNumDisplays() const override;
+ virtual std::vector<gfx::Display> GetAllDisplays() const override;
virtual gfx::Display GetDisplayNearestWindow(
- gfx::NativeView window) const OVERRIDE;
+ gfx::NativeView window) const override;
virtual gfx::Display GetDisplayNearestPoint(
- const gfx::Point& point) const OVERRIDE;
+ const gfx::Point& point) const override;
virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const OVERRIDE;
- virtual gfx::Display GetPrimaryDisplay() const OVERRIDE;
- virtual void AddObserver(DisplayObserver* observer) OVERRIDE;
- virtual void RemoveObserver(DisplayObserver* observer) OVERRIDE;
+ const gfx::Rect& match_rect) const override;
+ virtual gfx::Display GetPrimaryDisplay() const override;
+ virtual void AddObserver(DisplayObserver* observer) override;
+ virtual void RemoveObserver(DisplayObserver* observer) override;
// Overriden from gfx::SingletonHwnd::Observer.
virtual void OnWndProc(HWND hwnd,
UINT message,
WPARAM wparam,
- LPARAM lparam) OVERRIDE;
+ LPARAM lparam) override;
// Returns the HWND associated with the NativeView.
virtual HWND GetHWNDFromNativeView(NativeView window) const;
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
index ad7c9b9..90813d0 100644
--- a/ui/gfx/switches.cc
+++ b/ui/gfx/switches.cc
@@ -20,4 +20,12 @@
// Overrides the device scale factor for the browser UI and the contents.
const char kForceDeviceScaleFactor[] = "force-device-scale-factor";
+#if defined(OS_WIN)
+// Disables the DirectWrite font rendering system on windows.
+const char kDisableDirectWrite[] = "disable-direct-write";
+
+// Enables DirectWrite font rendering for general UI elements.
+const char kEnableDirectWriteForUI[] = "enable-directwrite-for-ui";
+#endif
+
} // namespace switches
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
index 1fb28a1..e85dabf 100644
--- a/ui/gfx/switches.h
+++ b/ui/gfx/switches.h
@@ -5,6 +5,7 @@
#ifndef UI_GFX_SWITCHES_H_
#define UI_GFX_SWITCHES_H_
+#include "build/build_config.h"
#include "ui/gfx/gfx_export.h"
namespace switches {
@@ -15,6 +16,11 @@
GFX_EXPORT extern const char kEnableWebkitTextSubpixelPositioning[];
GFX_EXPORT extern const char kForceDeviceScaleFactor[];
+#if defined(OS_WIN)
+GFX_EXPORT extern const char kDisableDirectWrite[];
+GFX_EXPORT extern const char kEnableDirectWriteForUI[];
+#endif
+
} // namespace switches
#endif // UI_GFX_SWITCHES_H_
diff --git a/ui/gfx/sys_color_change_listener.cc b/ui/gfx/sys_color_change_listener.cc
index 4a394ae..7f52f89 100644
--- a/ui/gfx/sys_color_change_listener.cc
+++ b/ui/gfx/sys_color_change_listener.cc
@@ -65,7 +65,7 @@
virtual void OnWndProc(HWND hwnd,
UINT message,
WPARAM wparam,
- LPARAM lparam) OVERRIDE;
+ LPARAM lparam) override;
ObserverList<SysColorChangeListener> listeners_;
};
diff --git a/ui/gfx/test/run_all_unittests.cc b/ui/gfx/test/run_all_unittests.cc
index 14ceef9..5282da1 100644
--- a/ui/gfx/test/run_all_unittests.cc
+++ b/ui/gfx/test/run_all_unittests.cc
@@ -24,7 +24,7 @@
GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
protected:
- virtual void Initialize() OVERRIDE {
+ virtual void Initialize() override {
base::TestSuite::Initialize();
#if defined(OS_ANDROID)
@@ -38,7 +38,7 @@
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
}
- virtual void Shutdown() OVERRIDE {
+ virtual void Shutdown() override {
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
diff --git a/ui/gfx/test/ui_cocoa_test_helper.h b/ui/gfx/test/ui_cocoa_test_helper.h
index c75c7bd..faf66dd 100644
--- a/ui/gfx/test/ui_cocoa_test_helper.h
+++ b/ui/gfx/test/ui_cocoa_test_helper.h
@@ -59,7 +59,7 @@
// to close them before CocoaTest::TearDown is called. A standard way of doing
// this would be to create them in SetUp (after calling CocoaTest::Setup) and
// then close them in TearDown before calling CocoaTest::TearDown.
- virtual void TearDown() OVERRIDE;
+ virtual void TearDown() override;
// Retuns a test window that can be used by views and other UI objects
// as part of their tests. Is created lazily, and will be closed correctly
diff --git a/ui/gfx/win/direct_write.cc b/ui/gfx/win/direct_write.cc
new file mode 100644
index 0000000..fcc185c
--- /dev/null
+++ b/ui/gfx/win/direct_write.cc
@@ -0,0 +1,48 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gfx/win/direct_write.h"
+
+#include "base/basictypes.h"
+#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
+#include "base/win/windows_version.h"
+#include "ui/gfx/switches.h"
+#include "ui/gfx/win/dpi.h"
+
+namespace gfx {
+namespace win {
+
+bool ShouldUseDirectWrite() {
+ // If the flag is currently on, and we're on Win7 or above, we enable
+ // DirectWrite. Skia does not require the additions to DirectWrite in QFE
+ // 2670838, but a simple 'better than XP' check is not enough.
+ if (base::win::GetVersion() < base::win::VERSION_WIN7)
+ return false;
+
+ base::win::OSInfo::VersionNumber os_version =
+ base::win::OSInfo::GetInstance()->version_number();
+ if ((os_version.major == 6) && (os_version.minor == 1)) {
+ // We can't use DirectWrite for pre-release versions of Windows 7.
+ if (os_version.build < 7600)
+ return false;
+ }
+ // If forced off, don't use it.
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kDisableDirectWrite))
+ return false;
+
+ // Can't use GDI on HiDPI.
+ if (gfx::GetDPIScale() > 1.0f)
+ return true;
+
+ // Otherwise, check the field trial.
+ const std::string group_name =
+ base::FieldTrialList::FindFullName("DirectWrite");
+ return group_name != "Disabled";
+}
+
+} // namespace win
+} // namespace gfx
diff --git a/ui/gfx/win/direct_write.h b/ui/gfx/win/direct_write.h
new file mode 100644
index 0000000..b621bf8
--- /dev/null
+++ b/ui/gfx/win/direct_write.h
@@ -0,0 +1,19 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GFX_WIN_DIRECT_WRITE_H_
+#define UI_GFX_WIN_DIRECT_WRITE_H_
+
+#include "ui/gfx/gfx_export.h"
+
+namespace gfx {
+namespace win {
+
+// Returns whether DirectWrite font rendering should be used.
+GFX_EXPORT bool ShouldUseDirectWrite();
+
+} // namespace win
+} // namespace gfx
+
+#endif // UI_GFX_WIN_DIRECT_WRITE_H_
diff --git a/ui/gfx/win/dpi.cc b/ui/gfx/win/dpi.cc
index 88766ce..2777f7c 100644
--- a/ui/gfx/win/dpi.cc
+++ b/ui/gfx/win/dpi.cc
@@ -5,12 +5,10 @@
#include "ui/gfx/win/dpi.h"
#include <windows.h>
-#include "base/command_line.h"
#include "base/win/scoped_hdc.h"
#include "base/win/windows_version.h"
#include "base/win/registry.h"
#include "ui/gfx/display.h"
-#include "ui/gfx/switches.h"
#include "ui/gfx/point_conversions.h"
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/size_conversions.h"
diff --git a/ui/gfx/win/hwnd_util.cc b/ui/gfx/win/hwnd_util.cc
index 050aa9b..41eead4 100644
--- a/ui/gfx/win/hwnd_util.cc
+++ b/ui/gfx/win/hwnd_util.cc
@@ -112,7 +112,7 @@
void* GetWindowUserData(HWND hwnd) {
DWORD process_id = 0;
- DWORD thread_id = GetWindowThreadProcessId(hwnd, &process_id);
+ GetWindowThreadProcessId(hwnd, &process_id);
// A window outside the current process needs to be ignored.
if (process_id != ::GetCurrentProcessId())
return NULL;
diff --git a/ui/gfx/win/singleton_hwnd.h b/ui/gfx/win/singleton_hwnd.h
index 50fb9fd..631da25 100644
--- a/ui/gfx/win/singleton_hwnd.h
+++ b/ui/gfx/win/singleton_hwnd.h
@@ -42,7 +42,7 @@
WPARAM wparam,
LPARAM lparam,
LRESULT& result,
- DWORD msg_map_id) OVERRIDE;
+ DWORD msg_map_id) override;
private:
friend struct DefaultSingletonTraits<SingletonHwnd>;
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn
index e3ceac3..fddbde7 100644
--- a/ui/gl/BUILD.gn
+++ b/ui/gl/BUILD.gn
@@ -32,8 +32,6 @@
"android/surface_texture.h",
"android/surface_texture_listener.cc",
"android/surface_texture_listener.h",
- "android/surface_texture_tracker.cc",
- "android/surface_texture_tracker.h",
"gl_bindings.h",
"gl_bindings_skia_in_process.cc",
"gl_bindings_skia_in_process.h",
@@ -153,6 +151,10 @@
}
if (is_linux) {
deps += [ "//third_party/libevent" ]
+ sources += [
+ "gl_image_linux_dma_buffer.cc",
+ "gl_image_linux_dma_buffer.h",
+ ]
}
if (use_x11) {
sources += [
diff --git a/ui/gl/android/surface_texture_tracker.cc b/ui/gl/android/surface_texture_tracker.cc
deleted file mode 100644
index d0ff16a..0000000
--- a/ui/gl/android/surface_texture_tracker.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/gl/android/surface_texture_tracker.h"
-
-#include "base/logging.h"
-
-namespace gfx {
-namespace {
-SurfaceTextureTracker* g_instance = NULL;
-} // namespace
-
-// static
-SurfaceTextureTracker* SurfaceTextureTracker::GetInstance() {
- DCHECK(g_instance);
- return g_instance;
-}
-
-// static
-void SurfaceTextureTracker::InitInstance(SurfaceTextureTracker* tracker) {
- DCHECK(!g_instance);
- g_instance = tracker;
-}
-
-} // namespace gfx
diff --git a/ui/gl/android/surface_texture_tracker.h b/ui/gl/android/surface_texture_tracker.h
deleted file mode 100644
index a86f144..0000000
--- a/ui/gl/android/surface_texture_tracker.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_GL_ANDROID_SURFACE_TEXTURE_TRACKER_H_
-#define UI_GL_ANDROID_SURFACE_TEXTURE_TRACKER_H_
-
-#include "base/memory/ref_counted.h"
-#include "ui/gl/gl_export.h"
-
-namespace gfx {
-
-class SurfaceTexture;
-
-// This interface is used to take ownership of preallocated surface textures
-// with specific ids.
-class GL_EXPORT SurfaceTextureTracker {
- public:
- static SurfaceTextureTracker* GetInstance();
- static void InitInstance(SurfaceTextureTracker* tracker);
-
- virtual scoped_refptr<SurfaceTexture> AcquireSurfaceTexture(
- int primary_id,
- int secondary_id) = 0;
-
- protected:
- virtual ~SurfaceTextureTracker() {}
-};
-
-} // namespace gfx
-
-#endif // UI_GL_ANDROID_SURFACE_TEXTURE_TRACKER_H_
diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py
index 75f55c7..303c01e 100755
--- a/ui/gl/generate_bindings.py
+++ b/ui/gl/generate_bindings.py
@@ -216,7 +216,7 @@
'names': ['glDrawBuffer'],
'arguments': 'GLenum mode', },
{ 'return_type': 'void',
- 'names': ['glDrawBuffersARB', 'glDrawBuffersEXT'],
+ 'names': ['glDrawBuffersARB', 'glDrawBuffersEXT', 'glDrawBuffers'],
'arguments': 'GLsizei n, const GLenum* bufs', },
{ 'return_type': 'void',
'names': ['glDrawElements'],
@@ -1415,7 +1415,7 @@
# Write API declaration.
for func in functions:
- file.write(' virtual %s %sFn(%s) OVERRIDE;\n' %
+ file.write(' virtual %s %sFn(%s) override;\n' %
(func['return_type'], func['known_as'], func['arguments']))
file.write('\n')
diff --git a/ui/gl/gl.gyp b/ui/gl/gl.gyp
index 13f7daa..f3be5b2 100644
--- a/ui/gl/gl.gyp
+++ b/ui/gl/gl.gyp
@@ -49,8 +49,6 @@
'android/surface_texture.h',
'android/surface_texture_listener.cc',
'android/surface_texture_listener.h',
- 'android/surface_texture_tracker.cc',
- 'android/surface_texture_tracker.h',
'gl_bindings.h',
'gl_bindings_skia_in_process.cc',
'gl_bindings_skia_in_process.h',
@@ -199,6 +197,12 @@
'gl_implementation_osmesa.h',
],
}],
+ ['OS=="linux"', {
+ 'sources': [
+ 'gl_image_linux_dma_buffer.cc',
+ 'gl_image_linux_dma_buffer.h',
+ ],
+ }],
['use_x11 == 1', {
'sources': [
'gl_context_glx.cc',
diff --git a/ui/gl/gl_bindings.h b/ui/gl/gl_bindings.h
index 18dc6e6..22774f5 100644
--- a/ui/gl/gl_bindings.h
+++ b/ui/gl/gl_bindings.h
@@ -131,11 +131,6 @@
// GL_CHROMIUM_sync_query
#define GL_COMMANDS_COMPLETED_CHROMIUM 0x84F7
-// GL_CHROMIUM_image
-#define GL_IMAGE_ROWBYTES_CHROMIUM 0x78F0
-#define GL_IMAGE_MAP_CHROMIUM 0x78F1
-#define GL_IMAGE_SCANOUT_CHROMIUM 0x78F2
-
// GL_CHROMIUM_gpu_memory_buffer_image
#define GL_MAP_CHROMIUM 0x78F1
#define GL_SCANOUT_CHROMIUM 0x78F2
@@ -196,6 +191,9 @@
#define GL_STENCIL_EXT 0x1802
#endif
+// GL_EXT_sRGB
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
+
// GL_ARB_get_program_binary
#define PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
// GL_OES_get_program_binary
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h
index 323b373..8e5ecd8 100644
--- a/ui/gl/gl_context.h
+++ b/ui/gl/gl_context.h
@@ -188,7 +188,7 @@
protected:
virtual ~GLContextReal();
- virtual void SetCurrent(GLSurface* surface) OVERRIDE;
+ virtual void SetCurrent(GLSurface* surface) override;
private:
DISALLOW_COPY_AND_ASSIGN(GLContextReal);
diff --git a/ui/gl/gl_context_android.cc b/ui/gl/gl_context_android.cc
index 51377a3..2d91a65 100644
--- a/ui/gl/gl_context_android.cc
+++ b/ui/gl/gl_context_android.cc
@@ -27,14 +27,14 @@
// Implement GLContext.
virtual bool Initialize(GLSurface* compatible_surface,
- GpuPreference gpu_preference) OVERRIDE;
- virtual void Destroy() OVERRIDE {}
- virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
- virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE {}
- virtual bool IsCurrent(GLSurface* surface) OVERRIDE { return true; }
- virtual void* GetHandle() OVERRIDE { return NULL; }
- virtual void SetSwapInterval(int interval) OVERRIDE {}
- virtual std::string GetExtensions() OVERRIDE;
+ GpuPreference gpu_preference) override;
+ virtual void Destroy() override {}
+ virtual bool MakeCurrent(GLSurface* surface) override;
+ virtual void ReleaseCurrent(GLSurface* surface) override {}
+ virtual bool IsCurrent(GLSurface* surface) override { return true; }
+ virtual void* GetHandle() override { return NULL; }
+ virtual void SetSwapInterval(int interval) override {}
+ virtual std::string GetExtensions() override;
protected:
virtual ~GLNonOwnedContext() {}
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
index 999c921..10f854a 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -232,10 +232,8 @@
void GLContextCGL::SetSwapInterval(int interval) {
DCHECK(IsCurrent(NULL));
- LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored.";
}
-
bool GLContextCGL::GetTotalGpuMemory(size_t* bytes) {
DCHECK(bytes);
*bytes = 0;
diff --git a/ui/gl/gl_context_cgl.h b/ui/gl/gl_context_cgl.h
index a83eaaf..5bcb335 100644
--- a/ui/gl/gl_context_cgl.h
+++ b/ui/gl/gl_context_cgl.h
@@ -20,15 +20,15 @@
// Implement GLContext.
virtual bool Initialize(GLSurface* compatible_surface,
- GpuPreference gpu_preference) OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
- virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
- virtual bool IsCurrent(GLSurface* surface) OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual void SetSwapInterval(int interval) OVERRIDE;
- virtual bool GetTotalGpuMemory(size_t* bytes) OVERRIDE;
- virtual void SetSafeToForceGpuSwitch() OVERRIDE;
+ GpuPreference gpu_preference) override;
+ virtual void Destroy() override;
+ virtual bool MakeCurrent(GLSurface* surface) override;
+ virtual void ReleaseCurrent(GLSurface* surface) override;
+ virtual bool IsCurrent(GLSurface* surface) override;
+ virtual void* GetHandle() override;
+ virtual void SetSwapInterval(int interval) override;
+ virtual bool GetTotalGpuMemory(size_t* bytes) override;
+ virtual void SetSafeToForceGpuSwitch() override;
protected:
virtual ~GLContextCGL();
diff --git a/ui/gl/gl_context_egl.h b/ui/gl/gl_context_egl.h
index 9dd9a72..82d15a6 100644
--- a/ui/gl/gl_context_egl.h
+++ b/ui/gl/gl_context_egl.h
@@ -25,17 +25,17 @@
// Implement GLContext.
virtual bool Initialize(
- GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
- virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
- virtual bool IsCurrent(GLSurface* surface) OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual void SetSwapInterval(int interval) OVERRIDE;
- virtual std::string GetExtensions() OVERRIDE;
- virtual bool WasAllocatedUsingRobustnessExtension() OVERRIDE;
- virtual bool GetTotalGpuMemory(size_t* bytes) OVERRIDE;
- virtual void SetUnbindFboOnMakeCurrent() OVERRIDE;
+ GLSurface* compatible_surface, GpuPreference gpu_preference) override;
+ virtual void Destroy() override;
+ virtual bool MakeCurrent(GLSurface* surface) override;
+ virtual void ReleaseCurrent(GLSurface* surface) override;
+ virtual bool IsCurrent(GLSurface* surface) override;
+ virtual void* GetHandle() override;
+ virtual void SetSwapInterval(int interval) override;
+ virtual std::string GetExtensions() override;
+ virtual bool WasAllocatedUsingRobustnessExtension() override;
+ virtual bool GetTotalGpuMemory(size_t* bytes) override;
+ virtual void SetUnbindFboOnMakeCurrent() override;
protected:
virtual ~GLContextEGL();
diff --git a/ui/gl/gl_context_glx.h b/ui/gl/gl_context_glx.h
index 987a8d8..ca53403 100644
--- a/ui/gl/gl_context_glx.h
+++ b/ui/gl/gl_context_glx.h
@@ -25,16 +25,16 @@
// Implement GLContext.
virtual bool Initialize(
- GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
- virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
- virtual bool IsCurrent(GLSurface* surface) OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual void SetSwapInterval(int interval) OVERRIDE;
- virtual std::string GetExtensions() OVERRIDE;
- virtual bool GetTotalGpuMemory(size_t* bytes) OVERRIDE;
- virtual bool WasAllocatedUsingRobustnessExtension() OVERRIDE;
+ GLSurface* compatible_surface, GpuPreference gpu_preference) override;
+ virtual void Destroy() override;
+ virtual bool MakeCurrent(GLSurface* surface) override;
+ virtual void ReleaseCurrent(GLSurface* surface) override;
+ virtual bool IsCurrent(GLSurface* surface) override;
+ virtual void* GetHandle() override;
+ virtual void SetSwapInterval(int interval) override;
+ virtual std::string GetExtensions() override;
+ virtual bool GetTotalGpuMemory(size_t* bytes) override;
+ virtual bool WasAllocatedUsingRobustnessExtension() override;
protected:
virtual ~GLContextGLX();
diff --git a/ui/gl/gl_context_osmesa.h b/ui/gl/gl_context_osmesa.h
index f78b525..5cac4de 100644
--- a/ui/gl/gl_context_osmesa.h
+++ b/ui/gl/gl_context_osmesa.h
@@ -23,13 +23,13 @@
// Implement GLContext.
virtual bool Initialize(GLSurface* compatible_surface,
- GpuPreference gpu_preference) OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
- virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
- virtual bool IsCurrent(GLSurface* surface) OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual void SetSwapInterval(int interval) OVERRIDE;
+ GpuPreference gpu_preference) override;
+ virtual void Destroy() override;
+ virtual bool MakeCurrent(GLSurface* surface) override;
+ virtual void ReleaseCurrent(GLSurface* surface) override;
+ virtual bool IsCurrent(GLSurface* surface) override;
+ virtual void* GetHandle() override;
+ virtual void SetSwapInterval(int interval) override;
protected:
virtual ~GLContextOSMesa();
diff --git a/ui/gl/gl_context_stub.h b/ui/gl/gl_context_stub.h
index d57e02e..c95be1d 100644
--- a/ui/gl/gl_context_stub.h
+++ b/ui/gl/gl_context_stub.h
@@ -16,15 +16,15 @@
// Implement GLContext.
virtual bool Initialize(GLSurface* compatible_surface,
- GpuPreference gpu_preference) OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
- virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
- virtual bool IsCurrent(GLSurface* surface) OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual void SetSwapInterval(int interval) OVERRIDE;
- virtual std::string GetExtensions() OVERRIDE;
- virtual std::string GetGLRenderer() OVERRIDE;
+ GpuPreference gpu_preference) override;
+ virtual void Destroy() override;
+ virtual bool MakeCurrent(GLSurface* surface) override;
+ virtual void ReleaseCurrent(GLSurface* surface) override;
+ virtual bool IsCurrent(GLSurface* surface) override;
+ virtual void* GetHandle() override;
+ virtual void SetSwapInterval(int interval) override;
+ virtual std::string GetExtensions() override;
+ virtual std::string GetGLRenderer() override;
protected:
virtual ~GLContextStub();
diff --git a/ui/gl/gl_context_stub_with_extensions.h b/ui/gl/gl_context_stub_with_extensions.h
index e048990..e701e0d 100644
--- a/ui/gl/gl_context_stub_with_extensions.h
+++ b/ui/gl/gl_context_stub_with_extensions.h
@@ -15,13 +15,13 @@
class GL_EXPORT GLContextStubWithExtensions : public gfx::GLContextStub {
public:
GLContextStubWithExtensions() {}
- virtual std::string GetExtensions() OVERRIDE;
+ virtual std::string GetExtensions() override;
void AddExtensionsString(const char* extensions);
void SetGLVersionString(const char* version_str);
protected:
- virtual std::string GetGLVersion() OVERRIDE;
+ virtual std::string GetGLVersion() override;
virtual ~GLContextStubWithExtensions() {}
diff --git a/ui/gl/gl_fence_arb.h b/ui/gl/gl_fence_arb.h
index db29675..614bfcb 100644
--- a/ui/gl/gl_fence_arb.h
+++ b/ui/gl/gl_fence_arb.h
@@ -18,9 +18,9 @@
virtual ~GLFenceARB();
// GLFence implementation:
- virtual bool HasCompleted() OVERRIDE;
- virtual void ClientWait() OVERRIDE;
- virtual void ServerWait() OVERRIDE;
+ virtual bool HasCompleted() override;
+ virtual void ClientWait() override;
+ virtual void ServerWait() override;
private:
GLsync sync_;
diff --git a/ui/gl/gl_fence_egl.h b/ui/gl/gl_fence_egl.h
index 531b3dc..fce6291 100644
--- a/ui/gl/gl_fence_egl.h
+++ b/ui/gl/gl_fence_egl.h
@@ -18,9 +18,9 @@
virtual ~GLFenceEGL();
// GLFence implementation:
- virtual bool HasCompleted() OVERRIDE;
- virtual void ClientWait() OVERRIDE;
- virtual void ServerWait() OVERRIDE;
+ virtual bool HasCompleted() override;
+ virtual void ClientWait() override;
+ virtual void ServerWait() override;
private:
EGLSyncKHR sync_;
diff --git a/ui/gl/gl_fence_nv.h b/ui/gl/gl_fence_nv.h
index fee9eff..c89cc42 100644
--- a/ui/gl/gl_fence_nv.h
+++ b/ui/gl/gl_fence_nv.h
@@ -18,9 +18,9 @@
virtual ~GLFenceNV();
// GLFence implementation:
- virtual bool HasCompleted() OVERRIDE;
- virtual void ClientWait() OVERRIDE;
- virtual void ServerWait() OVERRIDE;
+ virtual bool HasCompleted() override;
+ virtual void ClientWait() override;
+ virtual void ServerWait() override;
private:
GLuint fence_;
diff --git a/ui/gl/gl_gl_api_implementation.h b/ui/gl/gl_gl_api_implementation.h
index 22faccd..39f9558 100644
--- a/ui/gl/gl_gl_api_implementation.h
+++ b/ui/gl/gl_gl_api_implementation.h
@@ -57,8 +57,8 @@
void Initialize(DriverGL* driver);
private:
- virtual void glFinishFn() OVERRIDE;
- virtual void glFlushFn() OVERRIDE;
+ virtual void glFinishFn() override;
+ virtual void glFlushFn() override;
};
// Inserts a TRACE for every GL call.
@@ -104,9 +104,9 @@
private:
// Overridden functions from GLApiBase
- virtual const GLubyte* glGetStringFn(GLenum name) OVERRIDE;
- virtual void glFinishFn() OVERRIDE;
- virtual void glFlushFn() OVERRIDE;
+ virtual const GLubyte* glGetStringFn(GLenum name) override;
+ virtual void glFinishFn() override;
+ virtual void glFlushFn() override;
// The real context we're running on.
GLContext* real_context_;
diff --git a/ui/gl/gl_image_egl.h b/ui/gl/gl_image_egl.h
index bade6eb..c1ec1fc 100644
--- a/ui/gl/gl_image_egl.h
+++ b/ui/gl/gl_image_egl.h
@@ -17,20 +17,20 @@
bool Initialize(EGLenum target, EGLClientBuffer buffer, const EGLint* attrs);
// Overridden from GLImage:
- virtual void Destroy(bool have_context) OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool BindTexImage(unsigned target) OVERRIDE;
- virtual void ReleaseTexImage(unsigned target) OVERRIDE {}
- virtual bool CopyTexImage(unsigned target) OVERRIDE;
- virtual void WillUseTexImage() OVERRIDE {}
- virtual void DidUseTexImage() OVERRIDE {}
- virtual void WillModifyTexImage() OVERRIDE {}
- virtual void DidModifyTexImage() OVERRIDE {}
+ virtual void Destroy(bool have_context) override;
+ virtual gfx::Size GetSize() override;
+ virtual bool BindTexImage(unsigned target) override;
+ virtual void ReleaseTexImage(unsigned target) override {}
+ virtual bool CopyTexImage(unsigned target) override;
+ virtual void WillUseTexImage() override {}
+ virtual void DidUseTexImage() override {}
+ virtual void WillModifyTexImage() override {}
+ virtual void DidModifyTexImage() override {}
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE;
+ const RectF& crop_rect) override;
protected:
virtual ~GLImageEGL();
diff --git a/ui/gl/gl_image_glx.cc b/ui/gl/gl_image_glx.cc
index 2152cfe..395636b 100644
--- a/ui/gl/gl_image_glx.cc
+++ b/ui/gl/gl_image_glx.cc
@@ -26,7 +26,7 @@
bool ValidFormat(unsigned internalformat) {
switch (internalformat) {
- case GL_BGRA8_EXT:
+ case GL_RGBA:
return true;
default:
return false;
@@ -35,7 +35,7 @@
int TextureFormat(unsigned internalformat) {
switch (internalformat) {
- case GL_BGRA8_EXT:
+ case GL_RGBA:
return GLX_TEXTURE_FORMAT_RGBA_EXT;
default:
NOTREACHED();
@@ -45,7 +45,7 @@
int BindToTextureFormat(unsigned internalformat) {
switch (internalformat) {
- case GL_BGRA8_EXT:
+ case GL_RGBA:
return GLX_BIND_TO_TEXTURE_RGBA_EXT;
default:
NOTREACHED();
@@ -55,7 +55,7 @@
unsigned PixmapDepth(unsigned internalformat) {
switch (internalformat) {
- case GL_BGRA8_EXT:
+ case GL_RGBA:
return 32u;
default:
NOTREACHED();
diff --git a/ui/gl/gl_image_glx.h b/ui/gl/gl_image_glx.h
index 82cee7d..57c55c5 100644
--- a/ui/gl/gl_image_glx.h
+++ b/ui/gl/gl_image_glx.h
@@ -19,20 +19,20 @@
bool Initialize(XID pixmap);
// Overridden from GLImage:
- virtual void Destroy(bool have_context) OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool BindTexImage(unsigned target) OVERRIDE;
- virtual void ReleaseTexImage(unsigned target) OVERRIDE;
- virtual bool CopyTexImage(unsigned target) OVERRIDE;
- virtual void WillUseTexImage() OVERRIDE {}
- virtual void DidUseTexImage() OVERRIDE {}
- virtual void WillModifyTexImage() OVERRIDE {}
- virtual void DidModifyTexImage() OVERRIDE {}
+ virtual void Destroy(bool have_context) override;
+ virtual gfx::Size GetSize() override;
+ virtual bool BindTexImage(unsigned target) override;
+ virtual void ReleaseTexImage(unsigned target) override;
+ virtual bool CopyTexImage(unsigned target) override;
+ virtual void WillUseTexImage() override {}
+ virtual void DidUseTexImage() override {}
+ virtual void WillModifyTexImage() override {}
+ virtual void DidModifyTexImage() override {}
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE;
+ const RectF& crop_rect) override;
protected:
virtual ~GLImageGLX();
diff --git a/ui/gl/gl_image_io_surface.h b/ui/gl/gl_image_io_surface.h
index 262582f..07f3a0c 100644
--- a/ui/gl/gl_image_io_surface.h
+++ b/ui/gl/gl_image_io_surface.h
@@ -20,20 +20,20 @@
bool Initialize(IOSurfaceRef io_surface);
// Overridden from GLImage:
- virtual void Destroy(bool have_context) OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool BindTexImage(unsigned target) OVERRIDE;
- virtual void ReleaseTexImage(unsigned target) OVERRIDE {}
- virtual bool CopyTexImage(unsigned target) OVERRIDE;
- virtual void WillUseTexImage() OVERRIDE {}
- virtual void DidUseTexImage() OVERRIDE {}
- virtual void WillModifyTexImage() OVERRIDE {}
- virtual void DidModifyTexImage() OVERRIDE {}
+ virtual void Destroy(bool have_context) override;
+ virtual gfx::Size GetSize() override;
+ virtual bool BindTexImage(unsigned target) override;
+ virtual void ReleaseTexImage(unsigned target) override {}
+ virtual bool CopyTexImage(unsigned target) override;
+ virtual void WillUseTexImage() override {}
+ virtual void DidUseTexImage() override {}
+ virtual void WillModifyTexImage() override {}
+ virtual void DidModifyTexImage() override {}
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE;
+ const RectF& crop_rect) override;
protected:
virtual ~GLImageIOSurface();
diff --git a/ui/gl/gl_image_linux_dma_buffer.cc b/ui/gl/gl_image_linux_dma_buffer.cc
new file mode 100644
index 0000000..1dec942
--- /dev/null
+++ b/ui/gl/gl_image_linux_dma_buffer.cc
@@ -0,0 +1,107 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/gl_image_linux_dma_buffer.h"
+
+#include <unistd.h>
+
+#define FOURCC(a, b, c, d) \
+ ((static_cast<uint32>(a)) | (static_cast<uint32>(b) << 8) | \
+ (static_cast<uint32>(c) << 16) | (static_cast<uint32>(d) << 24))
+
+#define DRM_FORMAT_ARGB8888 FOURCC('A', 'R', '2', '4')
+#define DRM_FORMAT_XRGB8888 FOURCC('X', 'R', '2', '4')
+
+namespace gfx {
+namespace {
+
+bool ValidFormat(unsigned internalformat, gfx::GpuMemoryBuffer::Format format) {
+ switch (internalformat) {
+ case GL_RGB:
+ switch (format) {
+ case gfx::GpuMemoryBuffer::RGBX_8888:
+ return true;
+ case gfx::GpuMemoryBuffer::RGBA_8888:
+ case gfx::GpuMemoryBuffer::BGRA_8888:
+ return false;
+ }
+ NOTREACHED();
+ return false;
+ case GL_RGBA:
+ switch (format) {
+ case gfx::GpuMemoryBuffer::BGRA_8888:
+ return true;
+ case gfx::GpuMemoryBuffer::RGBX_8888:
+ case gfx::GpuMemoryBuffer::RGBA_8888:
+ return false;
+ }
+ NOTREACHED();
+ return false;
+ default:
+ return false;
+ }
+}
+
+EGLint FourCC(gfx::GpuMemoryBuffer::Format format) {
+ switch (format) {
+ case gfx::GpuMemoryBuffer::BGRA_8888:
+ return DRM_FORMAT_ARGB8888;
+ case gfx::GpuMemoryBuffer::RGBX_8888:
+ return DRM_FORMAT_XRGB8888;
+ case gfx::GpuMemoryBuffer::RGBA_8888:
+ NOTREACHED();
+ return 0;
+ }
+
+ NOTREACHED();
+ return 0;
+}
+
+bool IsHandleValid(const base::FileDescriptor& handle) {
+ return handle.fd >= 0;
+}
+
+} // namespace
+
+GLImageLinuxDMABuffer::GLImageLinuxDMABuffer(const gfx::Size& size,
+ unsigned internalformat)
+ : GLImageEGL(size), internalformat_(internalformat) {
+}
+
+GLImageLinuxDMABuffer::~GLImageLinuxDMABuffer() {
+}
+
+bool GLImageLinuxDMABuffer::Initialize(const base::FileDescriptor& handle,
+ gfx::GpuMemoryBuffer::Format format,
+ int pitch) {
+ if (!ValidFormat(internalformat_, format)) {
+ LOG(ERROR) << "Invalid format: " << internalformat_;
+ return false;
+ }
+
+ if (!IsHandleValid(handle)) {
+ LOG(ERROR) << "Invalid file descriptor: " << handle.fd;
+ return false;
+ }
+
+ // Note: If eglCreateImageKHR is successful for a EGL_LINUX_DMA_BUF_EXT
+ // target, the EGL will take a reference to the dma_buf.
+ EGLint attrs[] = {EGL_WIDTH,
+ size_.width(),
+ EGL_HEIGHT,
+ size_.height(),
+ EGL_LINUX_DRM_FOURCC_EXT,
+ FourCC(format),
+ EGL_DMA_BUF_PLANE0_FD_EXT,
+ handle.fd,
+ EGL_DMA_BUF_PLANE0_OFFSET_EXT,
+ 0,
+ EGL_DMA_BUF_PLANE0_PITCH_EXT,
+ pitch,
+ EGL_NONE};
+ return GLImageEGL::Initialize(
+ EGL_LINUX_DMA_BUF_EXT, static_cast<EGLClientBuffer>(NULL), attrs);
+}
+
+} // namespace gfx
diff --git a/ui/gl/gl_image_linux_dma_buffer.h b/ui/gl/gl_image_linux_dma_buffer.h
new file mode 100644
index 0000000..3523915
--- /dev/null
+++ b/ui/gl/gl_image_linux_dma_buffer.h
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GL_GL_IMAGE_LINUX_DMA_BUFFER_H_
+#define UI_GL_GL_IMAGE_LINUX_DMA_BUFFER_H_
+
+#include "ui/gfx/gpu_memory_buffer.h"
+#include "ui/gl/gl_image_egl.h"
+
+namespace gfx {
+
+class GL_EXPORT GLImageLinuxDMABuffer : public GLImageEGL {
+ public:
+ GLImageLinuxDMABuffer(const gfx::Size& size, unsigned internalformat);
+
+ // Returns true on success and the file descriptor can be closed as the
+ // implementation will take a reference to the dma_buf.
+ bool Initialize(const base::FileDescriptor& handle,
+ gfx::GpuMemoryBuffer::Format format,
+ int pitch);
+
+ protected:
+ virtual ~GLImageLinuxDMABuffer();
+
+ private:
+ unsigned internalformat_;
+
+ DISALLOW_COPY_AND_ASSIGN(GLImageLinuxDMABuffer);
+};
+
+} // namespace gfx
+
+#endif // UI_GL_GL_IMAGE_LINUX_DMA_BUFFER_H_
diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc
index d79a753..a752940 100644
--- a/ui/gl/gl_image_memory.cc
+++ b/ui/gl/gl_image_memory.cc
@@ -17,60 +17,68 @@
namespace gfx {
namespace {
-bool ValidFormat(unsigned internalformat) {
+bool ValidInternalFormat(unsigned internalformat) {
switch (internalformat) {
- case GL_BGRA8_EXT:
- case GL_RGBA8_OES:
+ case GL_RGBA:
return true;
default:
return false;
}
}
-GLenum TextureFormat(unsigned internalformat) {
- switch (internalformat) {
- case GL_BGRA8_EXT:
- return GL_BGRA_EXT;
- case GL_RGBA8_OES:
+bool ValidFormat(gfx::GpuMemoryBuffer::Format format) {
+ switch (format) {
+ case gfx::GpuMemoryBuffer::RGBA_8888:
+ case gfx::GpuMemoryBuffer::BGRA_8888:
+ return true;
+ case gfx::GpuMemoryBuffer::RGBX_8888:
+ return false;
+ }
+
+ NOTREACHED();
+ return false;
+}
+
+GLenum TextureFormat(gfx::GpuMemoryBuffer::Format format) {
+ switch (format) {
+ case gfx::GpuMemoryBuffer::RGBA_8888:
return GL_RGBA;
- default:
+ case gfx::GpuMemoryBuffer::BGRA_8888:
+ return GL_BGRA_EXT;
+ case gfx::GpuMemoryBuffer::RGBX_8888:
NOTREACHED();
return 0;
}
+
+ NOTREACHED();
+ return 0;
}
-GLenum DataFormat(unsigned internalformat) {
- return TextureFormat(internalformat);
+GLenum DataFormat(gfx::GpuMemoryBuffer::Format format) {
+ return TextureFormat(format);
}
-GLenum DataType(unsigned internalformat) {
- switch (internalformat) {
- case GL_BGRA8_EXT:
- case GL_RGBA8_OES:
+GLenum DataType(gfx::GpuMemoryBuffer::Format format) {
+ switch (format) {
+ case gfx::GpuMemoryBuffer::RGBA_8888:
+ case gfx::GpuMemoryBuffer::BGRA_8888:
return GL_UNSIGNED_BYTE;
- default:
+ case gfx::GpuMemoryBuffer::RGBX_8888:
NOTREACHED();
return 0;
}
-}
-int BytesPerPixel(unsigned internalformat) {
- switch (internalformat) {
- case GL_BGRA8_EXT:
- case GL_RGBA8_OES:
- return 4;
- default:
- NOTREACHED();
- return 0;
- }
+ NOTREACHED();
+ return 0;
}
} // namespace
GLImageMemory::GLImageMemory(const gfx::Size& size, unsigned internalformat)
- : memory_(NULL),
- size_(size),
+ : size_(size),
internalformat_(internalformat),
+ memory_(NULL),
+ format_(gfx::GpuMemoryBuffer::RGBA_8888),
in_use_(false),
target_(0),
need_do_bind_tex_image_(false)
@@ -91,15 +99,37 @@
#endif
}
-bool GLImageMemory::Initialize(const unsigned char* memory) {
- if (!ValidFormat(internalformat_)) {
- DVLOG(0) << "Invalid format: " << internalformat_;
+// static
+size_t GLImageMemory::BytesPerPixel(gfx::GpuMemoryBuffer::Format format) {
+ switch (format) {
+ case gfx::GpuMemoryBuffer::RGBA_8888:
+ case gfx::GpuMemoryBuffer::BGRA_8888:
+ return 4;
+ case gfx::GpuMemoryBuffer::RGBX_8888:
+ NOTREACHED();
+ return 0;
+ }
+
+ NOTREACHED();
+ return 0;
+}
+
+bool GLImageMemory::Initialize(const unsigned char* memory,
+ gfx::GpuMemoryBuffer::Format format) {
+ if (!ValidInternalFormat(internalformat_)) {
+ LOG(ERROR) << "Invalid internalformat: " << internalformat_;
+ return false;
+ }
+
+ if (!ValidFormat(format)) {
+ LOG(ERROR) << "Invalid format: " << format;
return false;
}
DCHECK(memory);
DCHECK(!memory_);
memory_ = memory;
+ format_ = format;
return true;
}
@@ -151,12 +181,12 @@
DCHECK(memory_);
glTexImage2D(target,
0, // mip level
- TextureFormat(internalformat_),
+ TextureFormat(format_),
size_.width(),
size_.height(),
0, // border
- DataFormat(internalformat_),
- DataType(internalformat_),
+ DataFormat(format_),
+ DataType(format_),
memory_);
return true;
@@ -186,14 +216,6 @@
return false;
}
-bool GLImageMemory::HasValidFormat() const {
- return ValidFormat(internalformat_);
-}
-
-size_t GLImageMemory::Bytes() const {
- return size_.GetArea() * BytesPerPixel(internalformat_);
-}
-
void GLImageMemory::DoBindTexImage(unsigned target) {
TRACE_EVENT0("gpu", "GLImageMemory::DoBindTexImage");
@@ -216,12 +238,12 @@
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D,
0, // mip level
- TextureFormat(internalformat_),
+ TextureFormat(format_),
size_.width(),
size_.height(),
0, // border
- DataFormat(internalformat_),
- DataType(internalformat_),
+ DataFormat(format_),
+ DataType(format_),
memory_);
}
@@ -245,8 +267,8 @@
0, // y-offset
size_.width(),
size_.height(),
- DataFormat(internalformat_),
- DataType(internalformat_),
+ DataFormat(format_),
+ DataType(format_),
memory_);
}
@@ -259,12 +281,12 @@
DCHECK_NE(static_cast<GLenum>(GL_TEXTURE_EXTERNAL_OES), target);
glTexImage2D(target,
0, // mip level
- TextureFormat(internalformat_),
+ TextureFormat(format_),
size_.width(),
size_.height(),
0, // border
- DataFormat(internalformat_),
- DataType(internalformat_),
+ DataFormat(format_),
+ DataType(format_),
memory_);
}
diff --git a/ui/gl/gl_image_memory.h b/ui/gl/gl_image_memory.h
index 6dbec46..2d6b93e 100644
--- a/ui/gl/gl_image_memory.h
+++ b/ui/gl/gl_image_memory.h
@@ -13,42 +13,45 @@
#include <EGL/eglext.h>
#endif
+#include "ui/gfx/gpu_memory_buffer.h"
+
namespace gfx {
class GL_EXPORT GLImageMemory : public GLImage {
public:
GLImageMemory(const gfx::Size& size, unsigned internalformat);
- bool Initialize(const unsigned char* memory);
+ static size_t BytesPerPixel(gfx::GpuMemoryBuffer::Format format);
+
+ bool Initialize(const unsigned char* memory,
+ gfx::GpuMemoryBuffer::Format format);
// Overridden from GLImage:
- virtual void Destroy(bool have_context) OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool BindTexImage(unsigned target) OVERRIDE;
- virtual void ReleaseTexImage(unsigned target) OVERRIDE {}
- virtual bool CopyTexImage(unsigned target) OVERRIDE;
- virtual void WillUseTexImage() OVERRIDE;
- virtual void DidUseTexImage() OVERRIDE;
- virtual void WillModifyTexImage() OVERRIDE {}
- virtual void DidModifyTexImage() OVERRIDE {}
+ virtual void Destroy(bool have_context) override;
+ virtual gfx::Size GetSize() override;
+ virtual bool BindTexImage(unsigned target) override;
+ virtual void ReleaseTexImage(unsigned target) override {}
+ virtual bool CopyTexImage(unsigned target) override;
+ virtual void WillUseTexImage() override;
+ virtual void DidUseTexImage() override;
+ virtual void WillModifyTexImage() override {}
+ virtual void DidModifyTexImage() override {}
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE;
+ const RectF& crop_rect) override;
protected:
virtual ~GLImageMemory();
- bool HasValidFormat() const;
- size_t Bytes() const;
-
private:
void DoBindTexImage(unsigned target);
- const unsigned char* memory_;
const gfx::Size size_;
const unsigned internalformat_;
+ const unsigned char* memory_;
+ gfx::GpuMemoryBuffer::Format format_;
bool in_use_;
unsigned target_;
bool need_do_bind_tex_image_;
diff --git a/ui/gl/gl_image_ref_counted_memory.cc b/ui/gl/gl_image_ref_counted_memory.cc
index ed4e03f..653d70a 100644
--- a/ui/gl/gl_image_ref_counted_memory.cc
+++ b/ui/gl/gl_image_ref_counted_memory.cc
@@ -19,13 +19,13 @@
}
bool GLImageRefCountedMemory::Initialize(
- base::RefCountedMemory* ref_counted_memory) {
- if (!HasValidFormat())
+ base::RefCountedMemory* ref_counted_memory,
+ gfx::GpuMemoryBuffer::Format format) {
+ if (!GLImageMemory::Initialize(ref_counted_memory->front(), format))
return false;
DCHECK(!ref_counted_memory_.get());
ref_counted_memory_ = ref_counted_memory;
- GLImageMemory::Initialize(ref_counted_memory_->front());
return true;
}
diff --git a/ui/gl/gl_image_ref_counted_memory.h b/ui/gl/gl_image_ref_counted_memory.h
index f721f4b..bb7160e 100644
--- a/ui/gl/gl_image_ref_counted_memory.h
+++ b/ui/gl/gl_image_ref_counted_memory.h
@@ -18,10 +18,11 @@
public:
GLImageRefCountedMemory(const gfx::Size& size, unsigned internalformat);
- bool Initialize(base::RefCountedMemory* ref_counted_memory);
+ bool Initialize(base::RefCountedMemory* ref_counted_memory,
+ gfx::GpuMemoryBuffer::Format format);
// Overridden from GLImage:
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual void Destroy(bool have_context) override;
protected:
virtual ~GLImageRefCountedMemory();
diff --git a/ui/gl/gl_image_shared_memory.cc b/ui/gl/gl_image_shared_memory.cc
index 7c615f8..0bbf549 100644
--- a/ui/gl/gl_image_shared_memory.cc
+++ b/ui/gl/gl_image_shared_memory.cc
@@ -5,9 +5,28 @@
#include "ui/gl/gl_image_shared_memory.h"
#include "base/logging.h"
+#include "base/numerics/safe_math.h"
#include "base/process/process_handle.h"
namespace gfx {
+namespace {
+
+// Returns true if the size is valid and false otherwise.
+bool SizeInBytes(const gfx::Size& size,
+ gfx::GpuMemoryBuffer::Format format,
+ size_t* size_in_bytes) {
+ if (size.IsEmpty())
+ return false;
+ base::CheckedNumeric<size_t> s = GLImageMemory::BytesPerPixel(format);
+ s *= size.width();
+ s *= size.height();
+ if (!s.IsValid())
+ return false;
+ *size_in_bytes = s.ValueOrDie();
+ return true;
+}
+
+} // namespace
GLImageSharedMemory::GLImageSharedMemory(const gfx::Size& size,
unsigned internalformat)
@@ -18,8 +37,10 @@
DCHECK(!shared_memory_);
}
-bool GLImageSharedMemory::Initialize(const gfx::GpuMemoryBufferHandle& handle) {
- if (!HasValidFormat())
+bool GLImageSharedMemory::Initialize(const gfx::GpuMemoryBufferHandle& handle,
+ gfx::GpuMemoryBuffer::Format format) {
+ size_t size_in_bytes;
+ if (!SizeInBytes(GetSize(), format, &size_in_bytes))
return false;
if (!base::SharedMemory::IsHandleValid(handle.handle))
@@ -37,16 +58,18 @@
scoped_ptr<base::SharedMemory> duped_shared_memory(
new base::SharedMemory(duped_shared_memory_handle, true));
-
- if (!duped_shared_memory->Map(Bytes())) {
+ if (!duped_shared_memory->Map(size_in_bytes)) {
DVLOG(0) << "Failed to map shared memory.";
return false;
}
+ if (!GLImageMemory::Initialize(
+ static_cast<unsigned char*>(duped_shared_memory->memory()), format)) {
+ return false;
+ }
+
DCHECK(!shared_memory_);
shared_memory_ = duped_shared_memory.Pass();
- GLImageMemory::Initialize(
- static_cast<unsigned char*>(shared_memory_->memory()));
return true;
}
diff --git a/ui/gl/gl_image_shared_memory.h b/ui/gl/gl_image_shared_memory.h
index 447475f..429d3c8 100644
--- a/ui/gl/gl_image_shared_memory.h
+++ b/ui/gl/gl_image_shared_memory.h
@@ -15,10 +15,11 @@
public:
GLImageSharedMemory(const gfx::Size& size, unsigned internalformat);
- bool Initialize(const gfx::GpuMemoryBufferHandle& handle);
+ bool Initialize(const gfx::GpuMemoryBufferHandle& handle,
+ gfx::GpuMemoryBuffer::Format format);
// Overridden from GLImage:
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual void Destroy(bool have_context) override;
protected:
virtual ~GLImageSharedMemory();
diff --git a/ui/gl/gl_image_stub.h b/ui/gl/gl_image_stub.h
index c8ec8eb..626afea 100644
--- a/ui/gl/gl_image_stub.h
+++ b/ui/gl/gl_image_stub.h
@@ -15,20 +15,20 @@
GLImageStub();
// Overridden from GLImage:
- virtual void Destroy(bool have_context) OVERRIDE {}
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool BindTexImage(unsigned target) OVERRIDE;
- virtual void ReleaseTexImage(unsigned target) OVERRIDE {}
- virtual bool CopyTexImage(unsigned target) OVERRIDE;
- virtual void WillUseTexImage() OVERRIDE {}
- virtual void DidUseTexImage() OVERRIDE {}
- virtual void WillModifyTexImage() OVERRIDE {}
- virtual void DidModifyTexImage() OVERRIDE {}
+ virtual void Destroy(bool have_context) override {}
+ virtual gfx::Size GetSize() override;
+ virtual bool BindTexImage(unsigned target) override;
+ virtual void ReleaseTexImage(unsigned target) override {}
+ virtual bool CopyTexImage(unsigned target) override;
+ virtual void WillUseTexImage() override {}
+ virtual void DidUseTexImage() override {}
+ virtual void WillModifyTexImage() override {}
+ virtual void DidModifyTexImage() override {}
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE;
+ const RectF& crop_rect) override;
protected:
virtual ~GLImageStub();
diff --git a/ui/gl/gl_image_surface_texture.cc b/ui/gl/gl_image_surface_texture.cc
index 4fed45b..27c9f64 100644
--- a/ui/gl/gl_image_surface_texture.cc
+++ b/ui/gl/gl_image_surface_texture.cc
@@ -6,7 +6,6 @@
#include "base/debug/trace_event.h"
#include "ui/gl/android/surface_texture.h"
-#include "ui/gl/android/surface_texture_tracker.h"
namespace gfx {
@@ -19,14 +18,10 @@
DCHECK_EQ(0, texture_id_);
}
-bool GLImageSurfaceTexture::Initialize(
- const gfx::GpuMemoryBufferHandle& handle) {
+bool GLImageSurfaceTexture::Initialize(SurfaceTexture* surface_texture) {
DCHECK(!surface_texture_.get());
- surface_texture_ =
- SurfaceTextureTracker::GetInstance()->AcquireSurfaceTexture(
- handle.surface_texture_id.primary_id,
- handle.surface_texture_id.secondary_id);
- return !!surface_texture_.get();
+ surface_texture_ = surface_texture;
+ return true;
}
void GLImageSurfaceTexture::Destroy(bool have_context) {
diff --git a/ui/gl/gl_image_surface_texture.h b/ui/gl/gl_image_surface_texture.h
index b47eb30..eaf4363 100644
--- a/ui/gl/gl_image_surface_texture.h
+++ b/ui/gl/gl_image_surface_texture.h
@@ -6,35 +6,33 @@
#define UI_GL_GL_IMAGE_SURFACE_TEXTURE_H_
#include "base/memory/ref_counted.h"
-#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_image.h"
namespace gfx {
-
class SurfaceTexture;
class GL_EXPORT GLImageSurfaceTexture : public GLImage {
public:
explicit GLImageSurfaceTexture(const gfx::Size& size);
- bool Initialize(const gfx::GpuMemoryBufferHandle& handle);
+ bool Initialize(SurfaceTexture* surface_texture);
// Overridden from GLImage:
- virtual void Destroy(bool have_context) OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool BindTexImage(unsigned target) OVERRIDE;
- virtual void ReleaseTexImage(unsigned target) OVERRIDE {}
- virtual bool CopyTexImage(unsigned target) OVERRIDE;
- virtual void WillUseTexImage() OVERRIDE {}
- virtual void DidUseTexImage() OVERRIDE {}
- virtual void WillModifyTexImage() OVERRIDE {}
- virtual void DidModifyTexImage() OVERRIDE {}
+ virtual void Destroy(bool have_context) override;
+ virtual gfx::Size GetSize() override;
+ virtual bool BindTexImage(unsigned target) override;
+ virtual void ReleaseTexImage(unsigned target) override {}
+ virtual bool CopyTexImage(unsigned target) override;
+ virtual void WillUseTexImage() override {}
+ virtual void DidUseTexImage() override {}
+ virtual void WillModifyTexImage() override {}
+ virtual void DidModifyTexImage() override {}
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE;
+ const RectF& crop_rect) override;
protected:
virtual ~GLImageSurfaceTexture();
diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h
index 3851c1c..7c7a5ce 100644
--- a/ui/gl/gl_surface.h
+++ b/ui/gl/gl_surface.h
@@ -158,32 +158,32 @@
public:
explicit GLSurfaceAdapter(GLSurface* surface);
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool Resize(const gfx::Size& size) OVERRIDE;
- virtual bool Recreate() OVERRIDE;
- virtual bool DeferDraws() OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
- virtual bool SupportsPostSubBuffer() OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual unsigned int GetBackingFrameBufferObject() OVERRIDE;
- virtual bool OnMakeCurrent(GLContext* context) OVERRIDE;
- virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE;
- virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE;
- virtual void* GetShareHandle() OVERRIDE;
- virtual void* GetDisplay() OVERRIDE;
- virtual void* GetConfig() OVERRIDE;
- virtual unsigned GetFormat() OVERRIDE;
- virtual VSyncProvider* GetVSyncProvider() OVERRIDE;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool Resize(const gfx::Size& size) override;
+ virtual bool Recreate() override;
+ virtual bool DeferDraws() override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual bool PostSubBuffer(int x, int y, int width, int height) override;
+ virtual bool SupportsPostSubBuffer() override;
+ virtual gfx::Size GetSize() override;
+ virtual void* GetHandle() override;
+ virtual unsigned int GetBackingFrameBufferObject() override;
+ virtual bool OnMakeCurrent(GLContext* context) override;
+ virtual bool SetBackbufferAllocation(bool allocated) override;
+ virtual void SetFrontbufferAllocation(bool allocated) override;
+ virtual void* GetShareHandle() override;
+ virtual void* GetDisplay() override;
+ virtual void* GetConfig() override;
+ virtual unsigned GetFormat() override;
+ virtual VSyncProvider* GetVSyncProvider() override;
virtual bool ScheduleOverlayPlane(int z_order,
OverlayTransform transform,
GLImage* image,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE;
- virtual bool IsSurfaceless() const OVERRIDE;
+ const RectF& crop_rect) override;
+ virtual bool IsSurfaceless() const override;
GLSurface* surface() const { return surface_.get(); }
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 439401a..b8c29d7 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -79,7 +79,7 @@
protected:
virtual bool GetSyncValues(int64* system_time,
int64* media_stream_counter,
- int64* swap_buffer_counter) OVERRIDE {
+ int64* swap_buffer_counter) override {
uint64 u_system_time, u_media_stream_counter, u_swap_buffer_counter;
bool result = eglGetSyncValuesCHROMIUM(
g_display, surface_, &u_system_time,
@@ -92,7 +92,7 @@
return result;
}
- virtual bool GetMscRate(int32* numerator, int32* denominator) OVERRIDE {
+ virtual bool GetMscRate(int32* numerator, int32* denominator) override {
return false;
}
diff --git a/ui/gl/gl_surface_egl.h b/ui/gl/gl_surface_egl.h
index e682f4b..b0b3336 100644
--- a/ui/gl/gl_surface_egl.h
+++ b/ui/gl/gl_surface_egl.h
@@ -29,7 +29,7 @@
GLSurfaceEGL();
// Implement GLSurface.
- virtual EGLDisplay GetDisplay() OVERRIDE;
+ virtual EGLDisplay GetDisplay() override;
static bool InitializeOneOff();
static EGLDisplay GetHardwareDisplay();
@@ -60,18 +60,18 @@
explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window);
// Implement GLSurface.
- virtual EGLConfig GetConfig() OVERRIDE;
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool Resize(const gfx::Size& size) OVERRIDE;
- virtual bool Recreate() OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual EGLSurface GetHandle() OVERRIDE;
- virtual bool SupportsPostSubBuffer() OVERRIDE;
- virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
- virtual VSyncProvider* GetVSyncProvider() OVERRIDE;
+ virtual EGLConfig GetConfig() override;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool Resize(const gfx::Size& size) override;
+ virtual bool Recreate() override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual gfx::Size GetSize() override;
+ virtual EGLSurface GetHandle() override;
+ virtual bool SupportsPostSubBuffer() override;
+ virtual bool PostSubBuffer(int x, int y, int width, int height) override;
+ virtual VSyncProvider* GetVSyncProvider() override;
// Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider.
// Takes ownership of the VSyncProvider.
@@ -99,15 +99,15 @@
explicit PbufferGLSurfaceEGL(const gfx::Size& size);
// Implement GLSurface.
- virtual EGLConfig GetConfig() OVERRIDE;
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool Resize(const gfx::Size& size) OVERRIDE;
- virtual EGLSurface GetHandle() OVERRIDE;
- virtual void* GetShareHandle() OVERRIDE;
+ virtual EGLConfig GetConfig() override;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual gfx::Size GetSize() override;
+ virtual bool Resize(const gfx::Size& size) override;
+ virtual EGLSurface GetHandle() override;
+ virtual void* GetShareHandle() override;
protected:
virtual ~PbufferGLSurfaceEGL();
@@ -127,15 +127,15 @@
explicit SurfacelessEGL(const gfx::Size& size);
// Implement GLSurface.
- virtual EGLConfig GetConfig() OVERRIDE;
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool Resize(const gfx::Size& size) OVERRIDE;
- virtual EGLSurface GetHandle() OVERRIDE;
- virtual void* GetShareHandle() OVERRIDE;
+ virtual EGLConfig GetConfig() override;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual gfx::Size GetSize() override;
+ virtual bool Resize(const gfx::Size& size) override;
+ virtual EGLSurface GetHandle() override;
+ virtual void* GetShareHandle() override;
protected:
virtual ~SurfacelessEGL();
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index 10f0681..7189c5a 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -82,12 +82,12 @@
protected:
virtual bool GetSyncValues(int64* system_time,
int64* media_stream_counter,
- int64* swap_buffer_counter) OVERRIDE {
+ int64* swap_buffer_counter) override {
return glXGetSyncValuesOML(g_display, window_, system_time,
media_stream_counter, swap_buffer_counter);
}
- virtual bool GetMscRate(int32* numerator, int32* denominator) OVERRIDE {
+ virtual bool GetMscRate(int32* numerator, int32* denominator) override {
if (!g_glx_get_msc_rate_oml_supported)
return false;
@@ -269,7 +269,7 @@
}
virtual void GetVSyncParameters(
- const VSyncProvider::UpdateVSyncCallback& callback) OVERRIDE {
+ const VSyncProvider::UpdateVSyncCallback& callback) override {
if (kGetVSyncParametersMinPeriod > base::TimeDelta()) {
base::TimeTicks now = base::TimeTicks::Now();
base::TimeDelta delta = now - last_get_vsync_parameters_time_;
diff --git a/ui/gl/gl_surface_glx.h b/ui/gl/gl_surface_glx.h
index 37c835c..0627023 100644
--- a/ui/gl/gl_surface_glx.h
+++ b/ui/gl/gl_surface_glx.h
@@ -35,7 +35,7 @@
static bool IsTextureFromPixmapSupported();
static bool IsOMLSyncControlSupported();
- virtual void* GetDisplay() OVERRIDE;
+ virtual void* GetDisplay() override;
// Get the FB config that the surface was created with or NULL if it is not
// a GLX drawable.
@@ -55,17 +55,17 @@
explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window);
// Implement GLSurfaceGLX.
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool Resize(const gfx::Size& size) OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual bool SupportsPostSubBuffer() OVERRIDE;
- virtual void* GetConfig() OVERRIDE;
- virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
- virtual VSyncProvider* GetVSyncProvider() OVERRIDE;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool Resize(const gfx::Size& size) override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual gfx::Size GetSize() override;
+ virtual void* GetHandle() override;
+ virtual bool SupportsPostSubBuffer() override;
+ virtual void* GetConfig() override;
+ virtual bool PostSubBuffer(int x, int y, int width, int height) override;
+ virtual VSyncProvider* GetVSyncProvider() override;
protected:
virtual ~NativeViewGLSurfaceGLX();
@@ -75,8 +75,8 @@
gfx::AcceleratedWidget GetDrawableHandle() const;
// PlatformEventDispatcher implementation
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
// Window passed in at creation. Always valid.
gfx::AcceleratedWidget parent_window_;
@@ -98,13 +98,13 @@
explicit PbufferGLSurfaceGLX(const gfx::Size& size);
// Implement GLSurfaceGLX.
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual void* GetConfig() OVERRIDE;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual gfx::Size GetSize() override;
+ virtual void* GetHandle() override;
+ virtual void* GetConfig() override;
protected:
virtual ~PbufferGLSurfaceGLX();
diff --git a/ui/gl/gl_surface_mac.cc b/ui/gl/gl_surface_mac.cc
index 41f6798..dec5a9a 100644
--- a/ui/gl/gl_surface_mac.cc
+++ b/ui/gl/gl_surface_mac.cc
@@ -30,16 +30,16 @@
explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {}
// Implement GLSurface.
- virtual bool Initialize() OVERRIDE { return true; }
- virtual void Destroy() OVERRIDE {}
- virtual bool IsOffscreen() OVERRIDE { return true; }
- virtual bool SwapBuffers() OVERRIDE {
+ virtual bool Initialize() override { return true; }
+ virtual void Destroy() override {}
+ virtual bool IsOffscreen() override { return true; }
+ virtual bool SwapBuffers() override {
NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface.";
return false;
}
- virtual gfx::Size GetSize() OVERRIDE { return size_; }
- virtual void* GetHandle() OVERRIDE { return NULL; }
- virtual void* GetDisplay() OVERRIDE { return NULL; }
+ virtual gfx::Size GetSize() override { return size_; }
+ virtual void* GetHandle() override { return NULL; }
+ virtual void* GetDisplay() override { return NULL; }
protected:
virtual ~NoOpGLSurface() {}
diff --git a/ui/gl/gl_surface_osmesa.h b/ui/gl/gl_surface_osmesa.h
index 472d7b1..20fb17f 100644
--- a/ui/gl/gl_surface_osmesa.h
+++ b/ui/gl/gl_surface_osmesa.h
@@ -21,14 +21,14 @@
GLSurfaceOSMesa(OSMesaSurfaceFormat format, const gfx::Size& size);
// Implement GLSurface.
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool Resize(const gfx::Size& new_size) OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual unsigned GetFormat() OVERRIDE;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool Resize(const gfx::Size& new_size) override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual gfx::Size GetSize() override;
+ virtual void* GetHandle() override;
+ virtual unsigned GetFormat() override;
protected:
virtual ~GLSurfaceOSMesa();
@@ -48,8 +48,8 @@
public:
explicit GLSurfaceOSMesaHeadless();
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
protected:
virtual ~GLSurfaceOSMesaHeadless();
diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
index a47a759..4576195 100644
--- a/ui/gl/gl_surface_ozone.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -30,10 +30,10 @@
ozone_surface_(ozone_surface.Pass()),
widget_(widget) {}
- virtual bool Initialize() OVERRIDE {
+ virtual bool Initialize() override {
return Initialize(ozone_surface_->CreateVSyncProvider());
}
- virtual bool Resize(const gfx::Size& size) OVERRIDE {
+ virtual bool Resize(const gfx::Size& size) override {
if (!ozone_surface_->ResizeNativeWindow(size)) {
if (!ReinitializeNativeSurface() ||
!ozone_surface_->ResizeNativeWindow(size))
@@ -42,7 +42,7 @@
return NativeViewGLSurfaceEGL::Resize(size);
}
- virtual bool SwapBuffers() OVERRIDE {
+ virtual bool SwapBuffers() override {
if (!NativeViewGLSurfaceEGL::SwapBuffers())
return false;
@@ -52,7 +52,7 @@
OverlayTransform transform,
GLImage* image,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE {
+ const RectF& crop_rect) override {
return image->ScheduleOverlayPlane(
widget_, z_order, transform, bounds_rect, crop_rect);
}
@@ -107,7 +107,7 @@
ozone_surface_(ozone_surface.Pass()),
widget_(widget) {}
- virtual bool Initialize() OVERRIDE {
+ virtual bool Initialize() override {
if (!SurfacelessEGL::Initialize())
return false;
vsync_provider_ = ozone_surface_->CreateVSyncProvider();
@@ -115,13 +115,13 @@
return false;
return true;
}
- virtual bool Resize(const gfx::Size& size) OVERRIDE {
+ virtual bool Resize(const gfx::Size& size) override {
if (!ozone_surface_->ResizeNativeWindow(size))
return false;
return SurfacelessEGL::Resize(size);
}
- virtual bool SwapBuffers() OVERRIDE {
+ virtual bool SwapBuffers() override {
// TODO: this should be replaced by a fence when supported by the driver.
glFinish();
return ozone_surface_->OnSwapBuffers();
@@ -130,21 +130,21 @@
OverlayTransform transform,
GLImage* image,
const Rect& bounds_rect,
- const RectF& crop_rect) OVERRIDE {
+ const RectF& crop_rect) override {
return image->ScheduleOverlayPlane(
widget_, z_order, transform, bounds_rect, crop_rect);
}
- virtual bool IsOffscreen() OVERRIDE { return false; }
- virtual VSyncProvider* GetVSyncProvider() OVERRIDE {
+ virtual bool IsOffscreen() override { return false; }
+ virtual VSyncProvider* GetVSyncProvider() override {
return vsync_provider_.get();
}
- virtual bool SupportsPostSubBuffer() OVERRIDE { return true; }
- virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE {
+ virtual bool SupportsPostSubBuffer() override { return true; }
+ virtual bool PostSubBuffer(int x, int y, int width, int height) override {
// The actual sub buffer handling is handled at higher layers.
SwapBuffers();
return true;
}
- virtual bool IsSurfaceless() const OVERRIDE { return true; }
+ virtual bool IsSurfaceless() const override { return true; }
private:
virtual ~GLSurfaceOzoneSurfaceless() {
diff --git a/ui/gl/gl_surface_stub.h b/ui/gl/gl_surface_stub.h
index 14e24b0..8a80dfe 100644
--- a/ui/gl/gl_surface_stub.h
+++ b/ui/gl/gl_surface_stub.h
@@ -15,11 +15,11 @@
void SetSize(const gfx::Size& size) { size_ = size; }
// Implement GLSurface.
- virtual void Destroy() OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
+ virtual void Destroy() override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual gfx::Size GetSize() override;
+ virtual void* GetHandle() override;
protected:
virtual ~GLSurfaceStub();
diff --git a/ui/gl/gl_surface_wgl.cc b/ui/gl/gl_surface_wgl.cc
index 23391ea..690f4f4 100644
--- a/ui/gl/gl_surface_wgl.cc
+++ b/ui/gl/gl_surface_wgl.cc
@@ -176,7 +176,6 @@
NativeViewGLSurfaceWGL::NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window)
: window_(window),
- child_window_(NULL),
device_context_(NULL) {
DCHECK(window);
}
@@ -188,34 +187,16 @@
bool NativeViewGLSurfaceWGL::Initialize() {
DCHECK(!device_context_);
- RECT rect;
- if (!GetClientRect(window_, &rect)) {
- LOG(ERROR) << "GetClientRect failed.\n";
+ DWORD process_id;
+ GetWindowThreadProcessId(window_, &process_id);
+ if (process_id != GetCurrentProcessId()) {
+ LOG(ERROR) << "Can't use window created in " << process_id
+ << " with wgl in " << GetCurrentProcessId();
Destroy();
return false;
}
- // Create a child window. WGL has problems using a window handle owned by
- // another process.
- child_window_ = CreateWindow(
- reinterpret_cast<wchar_t*>(g_display->window_class()),
- L"",
- WS_CHILDWINDOW | WS_DISABLED | WS_VISIBLE,
- 0, 0,
- rect.right - rect.left,
- rect.bottom - rect.top,
- window_,
- NULL,
- NULL,
- NULL);
- if (!child_window_) {
- LOG(ERROR) << "CreateWindow failed.\n";
- Destroy();
- return false;
- }
-
- // The GL context will render to this window.
- device_context_ = GetDC(child_window_);
+ device_context_ = GetDC(window_);
if (!device_context_) {
LOG(ERROR) << "Unable to get device context for window.";
Destroy();
@@ -234,13 +215,9 @@
}
void NativeViewGLSurfaceWGL::Destroy() {
- if (child_window_ && device_context_)
- ReleaseDC(child_window_, device_context_);
+ if (window_ && device_context_)
+ ReleaseDC(window_, device_context_);
- if (child_window_)
- DestroyWindow(child_window_);
-
- child_window_ = NULL;
device_context_ = NULL;
}
@@ -253,26 +230,13 @@
"width", GetSize().width(),
"height", GetSize().height());
- // Resize the child window to match the parent before swapping. Do not repaint
- // it as it moves.
- RECT rect;
- if (!GetClientRect(window_, &rect))
- return false;
- if (!MoveWindow(child_window_,
- 0, 0,
- rect.right - rect.left,
- rect.bottom - rect.top,
- FALSE)) {
- return false;
- }
-
DCHECK(device_context_);
return ::SwapBuffers(device_context_) == TRUE;
}
gfx::Size NativeViewGLSurfaceWGL::GetSize() {
RECT rect;
- BOOL result = GetClientRect(child_window_, &rect);
+ BOOL result = GetClientRect(window_, &rect);
DCHECK(result);
return gfx::Size(rect.right - rect.left, rect.bottom - rect.top);
}
diff --git a/ui/gl/gl_surface_wgl.h b/ui/gl/gl_surface_wgl.h
index aa32047..18b7e84 100644
--- a/ui/gl/gl_surface_wgl.h
+++ b/ui/gl/gl_surface_wgl.h
@@ -42,7 +42,6 @@
private:
gfx::AcceleratedWidget window_;
- gfx::AcceleratedWidget child_window_;
HDC device_context_;
DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL);
diff --git a/ui/gl/gl_surface_win.cc b/ui/gl/gl_surface_win.cc
index df7613e..2219f32 100644
--- a/ui/gl/gl_surface_win.cc
+++ b/ui/gl/gl_surface_win.cc
@@ -45,12 +45,12 @@
virtual ~NativeViewGLSurfaceOSMesa();
// Implement subset of GLSurface.
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual bool SupportsPostSubBuffer() OVERRIDE;
- virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual bool SupportsPostSubBuffer() override;
+ virtual bool PostSubBuffer(int x, int y, int width, int height) override;
private:
gfx::AcceleratedWidget window_;
diff --git a/ui/gl/gl_surface_x11.cc b/ui/gl/gl_surface_x11.cc
index bc9f1e6..55a0f38 100644
--- a/ui/gl/gl_surface_x11.cc
+++ b/ui/gl/gl_surface_x11.cc
@@ -28,13 +28,13 @@
static bool InitializeOneOff();
// Implement a subset of GLSurface.
- virtual bool Initialize() OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool Resize(const gfx::Size& new_size) OVERRIDE;
- virtual bool IsOffscreen() OVERRIDE;
- virtual bool SwapBuffers() OVERRIDE;
- virtual bool SupportsPostSubBuffer() OVERRIDE;
- virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
+ virtual bool Initialize() override;
+ virtual void Destroy() override;
+ virtual bool Resize(const gfx::Size& new_size) override;
+ virtual bool IsOffscreen() override;
+ virtual bool SwapBuffers() override;
+ virtual bool SupportsPostSubBuffer() override;
+ virtual bool PostSubBuffer(int x, int y, int width, int height) override;
protected:
virtual ~NativeViewGLSurfaceOSMesa();
diff --git a/ui/gl/sync_control_vsync_provider.h b/ui/gl/sync_control_vsync_provider.h
index edee2b0..3360354 100644
--- a/ui/gl/sync_control_vsync_provider.h
+++ b/ui/gl/sync_control_vsync_provider.h
@@ -18,7 +18,7 @@
SyncControlVSyncProvider();
virtual ~SyncControlVSyncProvider();
- virtual void GetVSyncParameters(const UpdateVSyncCallback& callback) OVERRIDE;
+ virtual void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
protected:
virtual bool GetSyncValues(int64* system_time,
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index 8e9fd20..396ac49 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -62,7 +62,7 @@
private:
// wm::MaskedWindowTargeter:
virtual bool GetHitTestMask(aura::Window* window,
- gfx::Path* mask) const OVERRIDE {
+ gfx::Path* mask) const override {
if (proxy_ && !proxy_->HasKeyboardWindow())
return true;
gfx::Rect keyboard_bounds = proxy_ ? proxy_->GetKeyboardWindow()->bounds() :
@@ -88,34 +88,34 @@
private:
// Overridden from aura::WindowDelegate:
- virtual gfx::Size GetMinimumSize() const OVERRIDE { return gfx::Size(); }
- virtual gfx::Size GetMaximumSize() const OVERRIDE { return gfx::Size(); }
+ virtual gfx::Size GetMinimumSize() const override { return gfx::Size(); }
+ virtual gfx::Size GetMaximumSize() const override { return gfx::Size(); }
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
bounds_ = new_bounds;
}
- virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+ virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override {
return gfx::kNullCursor;
}
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
+ virtual int GetNonClientComponent(const gfx::Point& point) const override {
return HTNOWHERE;
}
virtual bool ShouldDescendIntoChildForEventHandling(
aura::Window* child,
- const gfx::Point& location) OVERRIDE {
+ const gfx::Point& location) override {
return true;
}
- virtual bool CanFocus() OVERRIDE { return false; }
- virtual void OnCaptureLost() OVERRIDE {}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {}
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {}
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE { delete this; }
- virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {}
- virtual bool HasHitTestMask() const OVERRIDE {
+ virtual bool CanFocus() override { return false; }
+ virtual void OnCaptureLost() override {}
+ virtual void OnPaint(gfx::Canvas* canvas) override {}
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
+ virtual void OnWindowDestroying(aura::Window* window) override {}
+ virtual void OnWindowDestroyed(aura::Window* window) override { delete this; }
+ virtual void OnWindowTargetVisibilityChanged(bool visible) override {}
+ virtual bool HasHitTestMask() const override {
return !proxy_ || proxy_->HasKeyboardWindow();
}
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {
+ virtual void GetHitTestMask(gfx::Path* mask) const override {
if (proxy_ && !proxy_->HasKeyboardWindow())
return;
gfx::Rect keyboard_bounds = proxy_ ? proxy_->GetKeyboardWindow()->bounds() :
@@ -171,11 +171,11 @@
private:
// Overridden from ui::LayerAnimationObserver:
- virtual void OnLayerAnimationEnded(ui::LayerAnimationSequence* seq) OVERRIDE;
+ virtual void OnLayerAnimationEnded(ui::LayerAnimationSequence* seq) override;
virtual void OnLayerAnimationAborted(
- ui::LayerAnimationSequence* seq) OVERRIDE;
+ ui::LayerAnimationSequence* seq) override;
virtual void OnLayerAnimationScheduled(
- ui::LayerAnimationSequence* seq) OVERRIDE {}
+ ui::LayerAnimationSequence* seq) override {}
ui::LayerAnimator* animator_;
base::Callback<void(void)> callback_;
@@ -209,8 +209,8 @@
public:
virtual void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
void AddObservedWindow(aura::Window* window);
void RemoveAllObservedWindows();
diff --git a/ui/keyboard/keyboard_controller.h b/ui/keyboard/keyboard_controller.h
index fbb1bdc..dc44cd6 100644
--- a/ui/keyboard/keyboard_controller.h
+++ b/ui/keyboard/keyboard_controller.h
@@ -116,20 +116,20 @@
// aura::WindowObserver overrides
virtual void OnWindowHierarchyChanged(
- const HierarchyChangeParams& params) OVERRIDE;
+ const HierarchyChangeParams& params) override;
// InputMethodObserver overrides
virtual void OnTextInputTypeChanged(
- const ui::TextInputClient* client) OVERRIDE {}
- virtual void OnFocus() OVERRIDE {}
- virtual void OnBlur() OVERRIDE {}
+ const ui::TextInputClient* client) override {}
+ virtual void OnFocus() override {}
+ virtual void OnBlur() override {}
virtual void OnCaretBoundsChanged(
- const ui::TextInputClient* client) OVERRIDE {}
+ const ui::TextInputClient* client) override {}
virtual void OnTextInputStateChanged(
- const ui::TextInputClient* client) OVERRIDE;
+ const ui::TextInputClient* client) override;
virtual void OnInputMethodDestroyed(
- const ui::InputMethod* input_method) OVERRIDE;
- virtual void OnShowImeIfNeeded() OVERRIDE;
+ const ui::InputMethod* input_method) override;
+ virtual void OnShowImeIfNeeded() override;
// Show virtual keyboard immediately with animation.
void ShowKeyboardInternal();
diff --git a/ui/keyboard/keyboard_controller_proxy.cc b/ui/keyboard/keyboard_controller_proxy.cc
index cd98f9a..37f655d 100644
--- a/ui/keyboard/keyboard_controller_proxy.cc
+++ b/ui/keyboard/keyboard_controller_proxy.cc
@@ -37,7 +37,7 @@
// Overridden from content::WebContentsDelegate:
virtual content::WebContents* OpenURLFromTab(
content::WebContents* source,
- const content::OpenURLParams& params) OVERRIDE {
+ const content::OpenURLParams& params) override {
source->GetController().LoadURL(
params.url, params.referrer, params.transition, params.extra_headers);
Observe(source);
@@ -45,12 +45,12 @@
}
virtual bool IsPopupOrPanel(
- const content::WebContents* source) const OVERRIDE {
+ const content::WebContents* source) const override {
return true;
}
virtual void MoveContents(content::WebContents* source,
- const gfx::Rect& pos) OVERRIDE {
+ const gfx::Rect& pos) override {
aura::Window* keyboard = proxy_->GetKeyboardWindow();
// keyboard window must have been added to keyboard container window at this
// point. Otherwise, wrong keyboard bounds is used and may cause problem as
@@ -70,12 +70,12 @@
// Overridden from content::WebContentsDelegate:
virtual void RequestMediaAccessPermission(content::WebContents* web_contents,
const content::MediaStreamRequest& request,
- const content::MediaResponseCallback& callback) OVERRIDE {
+ const content::MediaResponseCallback& callback) override {
proxy_->RequestAudioInput(web_contents, request, callback);
}
// Overridden from content::WebContentsObserver:
- virtual void WebContentsDestroyed() OVERRIDE {
+ virtual void WebContentsDestroyed() override {
delete this;
}
diff --git a/ui/keyboard/keyboard_controller_proxy.h b/ui/keyboard/keyboard_controller_proxy.h
index d7886e2..f893eea 100644
--- a/ui/keyboard/keyboard_controller_proxy.h
+++ b/ui/keyboard/keyboard_controller_proxy.h
@@ -115,8 +115,8 @@
// aura::WindowObserver overrides:
virtual void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
private:
friend class TestApi;
diff --git a/ui/keyboard/keyboard_controller_unittest.cc b/ui/keyboard/keyboard_controller_unittest.cc
index 51c4e0f..9c3ccb6 100644
--- a/ui/keyboard/keyboard_controller_unittest.cc
+++ b/ui/keyboard/keyboard_controller_unittest.cc
@@ -68,7 +68,7 @@
private:
// Overridden from ui::EventHandler:
- virtual void OnEvent(ui::Event* event) OVERRIDE {
+ virtual void OnEvent(ui::Event* event) override {
aura::Window* target = static_cast<aura::Window*>(event->target());
if (event->type() == ui::ET_MOUSE_PRESSED ||
event->type() == ui::ET_TOUCH_PRESSED) {
@@ -92,8 +92,8 @@
}
// Overridden from KeyboardControllerProxy:
- virtual bool HasKeyboardWindow() const OVERRIDE { return window_; }
- virtual aura::Window* GetKeyboardWindow() OVERRIDE {
+ virtual bool HasKeyboardWindow() const override { return window_; }
+ virtual aura::Window* GetKeyboardWindow() override {
if (!window_) {
window_.reset(new aura::Window(&delegate_));
window_->Init(aura::WINDOW_LAYER_NOT_DRAWN);
@@ -101,15 +101,15 @@
}
return window_.get();
}
- virtual content::BrowserContext* GetBrowserContext() OVERRIDE { return NULL; }
- virtual ui::InputMethod* GetInputMethod() OVERRIDE {
+ virtual content::BrowserContext* GetBrowserContext() override { return NULL; }
+ virtual ui::InputMethod* GetInputMethod() override {
return input_method_.get();
}
virtual void RequestAudioInput(content::WebContents* web_contents,
const content::MediaStreamRequest& request,
- const content::MediaResponseCallback& callback) OVERRIDE { return; }
- virtual void LoadSystemKeyboard() OVERRIDE {};
- virtual void ReloadKeyboardIfNeeded() OVERRIDE {};
+ const content::MediaResponseCallback& callback) override { return; }
+ virtual void LoadSystemKeyboard() override {};
+ virtual void ReloadKeyboardIfNeeded() override {};
private:
scoped_ptr<aura::Window> window_;
@@ -131,7 +131,7 @@
private:
// Overridden from ui::EventHandler:
- virtual void OnEvent(ui::Event* event) OVERRIDE {
+ virtual void OnEvent(ui::Event* event) override {
ui::EventHandler::OnEvent(event);
event_counts_[event->type()]++;
}
@@ -151,7 +151,7 @@
private:
virtual void OnWindowVisibilityChanged(aura::Window* window,
- bool visible) OVERRIDE {
+ bool visible) override {
if (!visible)
base::MessageLoop::current()->Quit();
}
@@ -168,7 +168,7 @@
KeyboardControllerTest() {}
virtual ~KeyboardControllerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// The ContextFactory must exist before any Compositors are created.
bool enable_pixel_output = false;
ui::ContextFactory* context_factory =
@@ -185,7 +185,7 @@
controller_.reset(new KeyboardController(proxy_));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
controller_.reset();
focus_controller_.reset();
if (::switches::IsTextInputFocusManagerEnabled())
@@ -499,7 +499,7 @@
KeyboardControllerAnimationTest() {}
virtual ~KeyboardControllerAnimationTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// We cannot short-circuit animations for this test.
ui::ScopedAnimationDurationScaleMode test_duration_mode(
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
@@ -512,14 +512,14 @@
controller()->AddObserver(this);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
controller()->RemoveObserver(this);
KeyboardControllerTest::TearDown();
}
protected:
// KeyboardControllerObserver overrides
- virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) OVERRIDE {
+ virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override {
notified_bounds_ = new_bounds;
}
diff --git a/ui/keyboard/keyboard_layout_manager.h b/ui/keyboard/keyboard_layout_manager.h
index bc13f16..b93665f 100644
--- a/ui/keyboard/keyboard_layout_manager.h
+++ b/ui/keyboard/keyboard_layout_manager.h
@@ -22,14 +22,14 @@
}
// Overridden from aura::LayoutManager
- virtual void OnWindowResized() OVERRIDE;
- virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE;
- virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE {}
- virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE {}
+ virtual void OnWindowResized() override;
+ virtual void OnWindowAddedToLayout(aura::Window* child) override;
+ virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override {}
+ virtual void OnWindowRemovedFromLayout(aura::Window* child) override {}
virtual void OnChildWindowVisibilityChanged(aura::Window* child,
- bool visible) OVERRIDE {}
+ bool visible) override {}
virtual void SetChildBounds(aura::Window* child,
- const gfx::Rect& requested_bounds) OVERRIDE;
+ const gfx::Rect& requested_bounds) override;
private:
KeyboardController* controller_;
diff --git a/ui/keyboard/test/run_all_unittests.cc b/ui/keyboard/test/run_all_unittests.cc
index 9ecd0c6..519f69f 100644
--- a/ui/keyboard/test/run_all_unittests.cc
+++ b/ui/keyboard/test/run_all_unittests.cc
@@ -20,7 +20,7 @@
KeyboardTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
protected:
- virtual void Initialize() OVERRIDE {
+ virtual void Initialize() override {
base::TestSuite::Initialize();
gfx::GLSurface::InitializeOneOffForTests();
ui::RegisterPathProvider();
@@ -30,7 +30,7 @@
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
}
- virtual void Shutdown() OVERRIDE {
+ virtual void Shutdown() override {
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
diff --git a/ui/keyboard/webui/vk_mojo_handler.h b/ui/keyboard/webui/vk_mojo_handler.h
index 7ee3c9d..a7985db 100644
--- a/ui/keyboard/webui/vk_mojo_handler.h
+++ b/ui/keyboard/webui/vk_mojo_handler.h
@@ -21,27 +21,27 @@
ui::InputMethod* GetInputMethod();
// mojo::InterfaceImpl<>:
- virtual void OnConnectionEstablished() OVERRIDE;
+ virtual void OnConnectionEstablished() override;
// KeyboardUIHandlerMojo:
virtual void SendKeyEvent(const mojo::String& event_type,
int32_t char_value,
int32_t key_code,
const mojo::String& key_name,
- int32_t modifiers) OVERRIDE;
- virtual void HideKeyboard() OVERRIDE;
+ int32_t modifiers) override;
+ virtual void HideKeyboard() override;
// ui::InputMethodObserver:
virtual void OnTextInputTypeChanged(
- const ui::TextInputClient* client) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual void OnCaretBoundsChanged(const ui::TextInputClient* client) OVERRIDE;
+ const ui::TextInputClient* client) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual void OnCaretBoundsChanged(const ui::TextInputClient* client) override;
virtual void OnTextInputStateChanged(
- const ui::TextInputClient* text_client) OVERRIDE;
+ const ui::TextInputClient* text_client) override;
virtual void OnInputMethodDestroyed(
- const ui::InputMethod* input_method) OVERRIDE;
- virtual void OnShowImeIfNeeded() OVERRIDE;
+ const ui::InputMethod* input_method) override;
+ virtual void OnShowImeIfNeeded() override;
DISALLOW_COPY_AND_ASSIGN(VKMojoHandler);
};
diff --git a/ui/keyboard/webui/vk_webui_controller.h b/ui/keyboard/webui/vk_webui_controller.h
index d701c63..97ee5a5 100644
--- a/ui/keyboard/webui/vk_webui_controller.h
+++ b/ui/keyboard/webui/vk_webui_controller.h
@@ -33,7 +33,7 @@
mojo::InterfaceRequest<KeyboardUIHandlerMojo> request);
// content::WebUIController:
- virtual void RenderViewCreated(content::RenderViewHost* host) OVERRIDE;
+ virtual void RenderViewCreated(content::RenderViewHost* host) override;
scoped_ptr<VKMojoHandler> ui_handler_;
base::WeakPtrFactory<VKWebUIController> weak_factory_;
@@ -47,14 +47,14 @@
// WebUIControllerFactory:
virtual content::WebUI::TypeID GetWebUIType(
content::BrowserContext* browser_context,
- const GURL& url) const OVERRIDE;
+ const GURL& url) const override;
virtual bool UseWebUIForURL(content::BrowserContext* browser_context,
- const GURL& url) const OVERRIDE;
+ const GURL& url) const override;
virtual bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
- const GURL& url) const OVERRIDE;
+ const GURL& url) const override;
virtual content::WebUIController* CreateWebUIControllerForURL(
content::WebUI* web_ui,
- const GURL& url) const OVERRIDE;
+ const GURL& url) const override;
static VKWebUIControllerFactory* GetInstance();
diff --git a/ui/login/display_manager.js b/ui/login/display_manager.js
index 8f8c60d..5561b9e 100644
--- a/ui/login/display_manager.js
+++ b/ui/login/display_manager.js
@@ -46,6 +46,7 @@
/** @const */ var ACCELERATOR_APP_LAUNCH_BAILOUT = 'app_launch_bailout';
/** @const */ var ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG =
'app_launch_network_config';
+/** @const */ var ACCELERATOR_EMBEDDED_SIGNIN = 'embedded_signin';
/* Signin UI state constants. Used to control header bar UI. */
/** @const */ var SIGNIN_UI_STATE = {
@@ -374,6 +375,9 @@
} else if (name == ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG) {
if (currentStepId == SCREEN_APP_LAUNCH_SPLASH)
chrome.send('networkConfigRequest');
+ } else if (name == ACCELERATOR_EMBEDDED_SIGNIN) {
+ if (currentStepId == SCREEN_GAIA_SIGNIN)
+ chrome.send('switchToEmbeddedSignin');
}
if (!this.forceKeyboardFlow_)
diff --git a/ui/login/screen_container.css b/ui/login/screen_container.css
index fdab175..54fc5ef 100644
--- a/ui/login/screen_container.css
+++ b/ui/login/screen_container.css
@@ -16,7 +16,7 @@
top: 0;
}
-.oobe-display #outer-container.down {
+.oobe-display #outer-container {
-webkit-perspective: 600px;
}
diff --git a/ui/message_center/cocoa/notification_controller_unittest.mm b/ui/message_center/cocoa/notification_controller_unittest.mm
index 4a77441..6ff7091 100644
--- a/ui/message_center/cocoa/notification_controller_unittest.mm
+++ b/ui/message_center/cocoa/notification_controller_unittest.mm
@@ -30,14 +30,14 @@
last_clicked_index_(-1) {}
virtual void RemoveNotification(const std::string& id,
- bool by_user) OVERRIDE {
+ bool by_user) override {
last_removed_id_ = id;
last_removed_by_user_ = by_user;
++remove_count_;
}
virtual void ClickOnNotificationButton(const std::string& id,
- int button_index) OVERRIDE {
+ int button_index) override {
last_clicked_id_ = id;
last_clicked_index_ = button_index;
}
diff --git a/ui/message_center/cocoa/popup_collection.mm b/ui/message_center/cocoa/popup_collection.mm
index adc4f62..7320dcb 100644
--- a/ui/message_center/cocoa/popup_collection.mm
+++ b/ui/message_center/cocoa/popup_collection.mm
@@ -62,17 +62,17 @@
}
virtual void OnNotificationAdded(
- const std::string& notification_id) OVERRIDE {
+ const std::string& notification_id) override {
[popup_collection_ layoutNewNotifications];
}
virtual void OnNotificationRemoved(const std::string& notification_id,
- bool user_id) OVERRIDE {
+ bool user_id) override {
[popup_collection_ removeNotification:notification_id];
}
virtual void OnNotificationUpdated(
- const std::string& notification_id) OVERRIDE {
+ const std::string& notification_id) override {
[popup_collection_ updateNotification:notification_id];
}
diff --git a/ui/message_center/cocoa/popup_collection_unittest.mm b/ui/message_center/cocoa/popup_collection_unittest.mm
index d85b158..d2990bc 100644
--- a/ui/message_center/cocoa/popup_collection_unittest.mm
+++ b/ui/message_center/cocoa/popup_collection_unittest.mm
@@ -35,7 +35,7 @@
}];
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
collection_.reset(); // Close all popups.
ui::CocoaTest::TearDown();
}
@@ -404,4 +404,50 @@
collection_.reset();
}
+// This test reproduces bug.
+// https://code.google.com/p/chromium/issues/detail?id=418053
+// It will timeout if problem exists.
+TEST_F(PopupCollectionTest, AnimationDidEndOutOfOrder) {
+ // Set animation duration to 100 ms.
+ [collection_ setAnimationDuration:0.1];
+
+ // Add three notifications.
+ AddThreeNotifications();
+
+ // Wait for animation end.
+ WaitForAnimationEnded();
+
+ // Add fourth notification.
+ scoped_ptr<message_center::Notification> notification;
+ notification.reset(new message_center::Notification(
+ message_center::NOTIFICATION_TYPE_SIMPLE,
+ "4",
+ ASCIIToUTF16("Fourth"),
+ ASCIIToUTF16("This is the Fourth notification to be displayed"),
+ gfx::Image(),
+ base::string16(),
+ DummyNotifierId(),
+ message_center::RichNotificationData(),
+ NULL));
+ center_->AddNotification(notification.Pass());
+
+ // Mark first notifications as shown,
+ // just as from TimerFinished callback.
+ // Mark it while fourth animation is in progress so old notification
+ // will be marked as pending updates.
+ center_->MarkSinglePopupAsShown("1", false);
+ center_->MarkSinglePopupAsShown("2", false);
+ center_->MarkSinglePopupAsShown("3", false);
+
+ WaitForAnimationEnded();
+ // Assert that isAnimating flag is false ater animation ends.
+ // If it will be true after all animaions ends,
+ // no new notification can be added and collection will be blocked.
+ EXPECT_FALSE([collection_ isAnimating]);
+
+ // Release the popup collection before the animation ends. No crash should
+ // be expected.
+ collection_.reset();
+}
+
} // namespace message_center
diff --git a/ui/message_center/cocoa/popup_controller.mm b/ui/message_center/cocoa/popup_controller.mm
index 0f22937..0ee5e89 100644
--- a/ui/message_center/cocoa/popup_controller.mm
+++ b/ui/message_center/cocoa/popup_controller.mm
@@ -192,6 +192,13 @@
[self close];
}
+- (void)animationDidStop:(NSAnimation*)animation {
+ // We can arrive here if animation was stopped in [self close] call.
+ boundsAnimation_.reset();
+
+ [popupCollection_ onPopupAnimationEnded:[self notificationID]];
+}
+
- (void)showWithAnimation:(NSRect)newBounds {
bounds_ = newBounds;
NSRect startBounds = newBounds;
diff --git a/ui/message_center/cocoa/settings_controller.h b/ui/message_center/cocoa/settings_controller.h
index 2efa944..83433b4 100644
--- a/ui/message_center/cocoa/settings_controller.h
+++ b/ui/message_center/cocoa/settings_controller.h
@@ -28,10 +28,10 @@
// Overridden from NotifierSettingsObserver:
virtual void UpdateIconImage(const NotifierId& notifier_id,
- const gfx::Image& icon) OVERRIDE;
- virtual void NotifierGroupChanged() OVERRIDE;
+ const gfx::Image& icon) override;
+ virtual void NotifierGroupChanged() override;
virtual void NotifierEnabledChanged(const NotifierId& notifier_id,
- bool enabled) OVERRIDE;
+ bool enabled) override;
private:
MCSettingsController* settings_controller_; // weak, owns this
diff --git a/ui/message_center/cocoa/status_item_view_unittest.mm b/ui/message_center/cocoa/status_item_view_unittest.mm
index f673a11..fb98a07 100644
--- a/ui/message_center/cocoa/status_item_view_unittest.mm
+++ b/ui/message_center/cocoa/status_item_view_unittest.mm
@@ -13,12 +13,12 @@
: view_([[MCStatusItemView alloc] init]) {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ui::CocoaTest::SetUp();
[[test_window() contentView] addSubview:view_];
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
[view_ removeItem];
ui::CocoaTest::TearDown();
}
diff --git a/ui/message_center/cocoa/tray_controller_unittest.mm b/ui/message_center/cocoa/tray_controller_unittest.mm
index 285e8b6..8a4c6f7 100644
--- a/ui/message_center/cocoa/tray_controller_unittest.mm
+++ b/ui/message_center/cocoa/tray_controller_unittest.mm
@@ -14,7 +14,7 @@
class TrayControllerTest : public ui::CocoaTest {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ui::CocoaTest::SetUp();
message_center::MessageCenter::Initialize();
tray_.reset(new message_center::MessageCenterTray(
@@ -23,7 +23,7 @@
[[MCTrayController alloc] initWithMessageCenterTray:tray_.get()]);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
controller_.reset();
tray_.reset();
message_center::MessageCenter::Shutdown();
diff --git a/ui/message_center/cocoa/tray_view_controller_unittest.mm b/ui/message_center/cocoa/tray_view_controller_unittest.mm
index 9496177..801f3f6 100644
--- a/ui/message_center/cocoa/tray_view_controller_unittest.mm
+++ b/ui/message_center/cocoa/tray_view_controller_unittest.mm
@@ -26,7 +26,7 @@
: center_(NULL) {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ui::CocoaTest::SetUp();
message_center::MessageCenter::Initialize();
center_ = message_center::MessageCenter::Get();
@@ -41,7 +41,7 @@
[tray_ view]; // Create the view.
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
tray_.reset();
message_center::MessageCenter::Shutdown();
ui::CocoaTest::TearDown();
diff --git a/ui/message_center/fake_message_center.h b/ui/message_center/fake_message_center.h
index 22273b8..073cff9 100644
--- a/ui/message_center/fake_message_center.h
+++ b/ui/message_center/fake_message_center.h
@@ -19,60 +19,60 @@
virtual ~FakeMessageCenter();
// Overridden from FakeMessageCenter.
- virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE;
- virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE;
- virtual void AddNotificationBlocker(NotificationBlocker* blocker) OVERRIDE;
- virtual void RemoveNotificationBlocker(NotificationBlocker* blocker) OVERRIDE;
- virtual size_t NotificationCount() const OVERRIDE;
- virtual size_t UnreadNotificationCount() const OVERRIDE;
- virtual bool HasPopupNotifications() const OVERRIDE;
- virtual bool IsQuietMode() const OVERRIDE;
- virtual bool HasClickedListener(const std::string& id) OVERRIDE;
+ virtual void AddObserver(MessageCenterObserver* observer) override;
+ virtual void RemoveObserver(MessageCenterObserver* observer) override;
+ virtual void AddNotificationBlocker(NotificationBlocker* blocker) override;
+ virtual void RemoveNotificationBlocker(NotificationBlocker* blocker) override;
+ virtual size_t NotificationCount() const override;
+ virtual size_t UnreadNotificationCount() const override;
+ virtual bool HasPopupNotifications() const override;
+ virtual bool IsQuietMode() const override;
+ virtual bool HasClickedListener(const std::string& id) override;
virtual message_center::Notification* FindVisibleNotificationById(
- const std::string& id) OVERRIDE;
+ const std::string& id) override;
virtual const NotificationList::Notifications& GetVisibleNotifications()
- OVERRIDE;
- virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE;
- virtual void AddNotification(scoped_ptr<Notification> notification) OVERRIDE;
+ override;
+ virtual NotificationList::PopupNotifications GetPopupNotifications() override;
+ virtual void AddNotification(scoped_ptr<Notification> notification) override;
virtual void UpdateNotification(const std::string& old_id,
scoped_ptr<Notification> new_notification)
- OVERRIDE;
+ override;
- virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE;
- virtual void RemoveAllNotifications(bool by_user) OVERRIDE;
- virtual void RemoveAllVisibleNotifications(bool by_user) OVERRIDE;
+ virtual void RemoveNotification(const std::string& id, bool by_user) override;
+ virtual void RemoveAllNotifications(bool by_user) override;
+ virtual void RemoveAllVisibleNotifications(bool by_user) override;
virtual void SetNotificationIcon(const std::string& notification_id,
- const gfx::Image& image) OVERRIDE;
+ const gfx::Image& image) override;
virtual void SetNotificationImage(const std::string& notification_id,
- const gfx::Image& image) OVERRIDE;
+ const gfx::Image& image) override;
virtual void SetNotificationButtonIcon(const std::string& notification_id,
int button_index,
- const gfx::Image& image) OVERRIDE;
+ const gfx::Image& image) override;
virtual void DisableNotificationsByNotifier(
- const NotifierId& notifier_id) OVERRIDE;
- virtual void ClickOnNotification(const std::string& id) OVERRIDE;
+ const NotifierId& notifier_id) override;
+ virtual void ClickOnNotification(const std::string& id) override;
virtual void ClickOnNotificationButton(const std::string& id,
- int button_index) OVERRIDE;
+ int button_index) override;
virtual void MarkSinglePopupAsShown(const std::string& id,
- bool mark_notification_as_read) OVERRIDE;
+ bool mark_notification_as_read) override;
virtual void DisplayedNotification(
const std::string& id,
- const DisplaySource source) OVERRIDE;
+ const DisplaySource source) override;
virtual void SetNotifierSettingsProvider(
- NotifierSettingsProvider* provider) OVERRIDE;
- virtual NotifierSettingsProvider* GetNotifierSettingsProvider() OVERRIDE;
- virtual void SetQuietMode(bool in_quiet_mode) OVERRIDE;
+ NotifierSettingsProvider* provider) override;
+ virtual NotifierSettingsProvider* GetNotifierSettingsProvider() override;
+ virtual void SetQuietMode(bool in_quiet_mode) override;
virtual void EnterQuietModeWithExpire(
- const base::TimeDelta& expires_in) OVERRIDE;
- virtual void SetVisibility(Visibility visible) OVERRIDE;
- virtual bool IsMessageCenterVisible() const OVERRIDE;
- virtual void RestartPopupTimers() OVERRIDE;
- virtual void PausePopupTimers() OVERRIDE;
+ const base::TimeDelta& expires_in) override;
+ virtual void SetVisibility(Visibility visible) override;
+ virtual bool IsMessageCenterVisible() const override;
+ virtual void RestartPopupTimers() override;
+ virtual void PausePopupTimers() override;
protected:
- virtual void DisableTimersForTest() OVERRIDE;
+ virtual void DisableTimersForTest() override;
private:
const NotificationList::Notifications empty_notifications_;
diff --git a/ui/message_center/fake_message_center_tray_delegate.h b/ui/message_center/fake_message_center_tray_delegate.h
index ff05c84..d03310b 100644
--- a/ui/message_center/fake_message_center_tray_delegate.h
+++ b/ui/message_center/fake_message_center_tray_delegate.h
@@ -27,15 +27,15 @@
}
// Overridden from MessageCenterTrayDelegate:
- virtual void OnMessageCenterTrayChanged() OVERRIDE;
- virtual bool ShowPopups() OVERRIDE;
- virtual void HidePopups() OVERRIDE;
- virtual bool ShowMessageCenter() OVERRIDE;
- virtual void HideMessageCenter() OVERRIDE;
- virtual bool ShowNotifierSettings() OVERRIDE;
- virtual bool IsContextMenuEnabled() const OVERRIDE;
- virtual MessageCenterTray* GetMessageCenterTray() OVERRIDE;
- virtual void DisplayFirstRunBalloon() OVERRIDE;
+ virtual void OnMessageCenterTrayChanged() override;
+ virtual bool ShowPopups() override;
+ virtual void HidePopups() override;
+ virtual bool ShowMessageCenter() override;
+ virtual void HideMessageCenter() override;
+ virtual bool ShowNotifierSettings() override;
+ virtual bool IsContextMenuEnabled() const override;
+ virtual MessageCenterTray* GetMessageCenterTray() override;
+ virtual void DisplayFirstRunBalloon() override;
private:
scoped_ptr<MessageCenterTray> tray_;
diff --git a/ui/message_center/fake_notifier_settings_provider.h b/ui/message_center/fake_notifier_settings_provider.h
index 08f4d34..ebefda1 100644
--- a/ui/message_center/fake_notifier_settings_provider.h
+++ b/ui/message_center/fake_notifier_settings_provider.h
@@ -19,25 +19,25 @@
const std::vector<Notifier*>& notifiers);
virtual ~FakeNotifierSettingsProvider();
- virtual size_t GetNotifierGroupCount() const OVERRIDE;
- virtual const NotifierGroup& GetNotifierGroupAt(size_t index) const OVERRIDE;
- virtual bool IsNotifierGroupActiveAt(size_t index) const OVERRIDE;
- virtual void SwitchToNotifierGroup(size_t index) OVERRIDE;
- virtual const NotifierGroup& GetActiveNotifierGroup() const OVERRIDE;
+ virtual size_t GetNotifierGroupCount() const override;
+ virtual const NotifierGroup& GetNotifierGroupAt(size_t index) const override;
+ virtual bool IsNotifierGroupActiveAt(size_t index) const override;
+ virtual void SwitchToNotifierGroup(size_t index) override;
+ virtual const NotifierGroup& GetActiveNotifierGroup() const override;
- virtual void GetNotifierList(std::vector<Notifier*>* notifiers) OVERRIDE;
+ virtual void GetNotifierList(std::vector<Notifier*>* notifiers) override;
virtual void SetNotifierEnabled(const Notifier& notifier,
- bool enabled) OVERRIDE;
+ bool enabled) override;
- virtual void OnNotifierSettingsClosing() OVERRIDE;
+ virtual void OnNotifierSettingsClosing() override;
virtual bool NotifierHasAdvancedSettings(const NotifierId& notifier_id) const
- OVERRIDE;
+ override;
virtual void OnNotifierAdvancedSettingsRequested(
const NotifierId& notifier_id,
- const std::string* notification_id) OVERRIDE;
- virtual void AddObserver(NotifierSettingsObserver* observer) OVERRIDE;
- virtual void RemoveObserver(NotifierSettingsObserver* observer) OVERRIDE;
+ const std::string* notification_id) override;
+ virtual void AddObserver(NotifierSettingsObserver* observer) override;
+ virtual void RemoveObserver(NotifierSettingsObserver* observer) override;
bool WasEnabled(const Notifier& notifier);
int closed_called_count();
diff --git a/ui/message_center/message_center_impl.h b/ui/message_center/message_center_impl.h
index f48f5dc..9948089 100644
--- a/ui/message_center/message_center_impl.h
+++ b/ui/message_center/message_center_impl.h
@@ -88,10 +88,10 @@
// MessageCenterObserver implementation.
virtual void OnNotificationDisplayed(
const std::string& id,
- const DisplaySource source) OVERRIDE;
- virtual void OnNotificationUpdated(const std::string& id) OVERRIDE;
+ const DisplaySource source) override;
+ virtual void OnNotificationUpdated(const std::string& id) override;
virtual void OnNotificationRemoved(const std::string& id, bool by_user)
- OVERRIDE;
+ override;
// Callback for each timer when its time is up.
virtual void TimerFinished(const std::string& id);
@@ -145,67 +145,67 @@
virtual ~MessageCenterImpl();
// MessageCenter overrides:
- virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE;
- virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE;
- virtual void AddNotificationBlocker(NotificationBlocker* blocker) OVERRIDE;
- virtual void RemoveNotificationBlocker(NotificationBlocker* blocker) OVERRIDE;
- virtual void SetVisibility(Visibility visible) OVERRIDE;
- virtual bool IsMessageCenterVisible() const OVERRIDE;
- virtual size_t NotificationCount() const OVERRIDE;
- virtual size_t UnreadNotificationCount() const OVERRIDE;
- virtual bool HasPopupNotifications() const OVERRIDE;
- virtual bool IsQuietMode() const OVERRIDE;
- virtual bool HasClickedListener(const std::string& id) OVERRIDE;
+ virtual void AddObserver(MessageCenterObserver* observer) override;
+ virtual void RemoveObserver(MessageCenterObserver* observer) override;
+ virtual void AddNotificationBlocker(NotificationBlocker* blocker) override;
+ virtual void RemoveNotificationBlocker(NotificationBlocker* blocker) override;
+ virtual void SetVisibility(Visibility visible) override;
+ virtual bool IsMessageCenterVisible() const override;
+ virtual size_t NotificationCount() const override;
+ virtual size_t UnreadNotificationCount() const override;
+ virtual bool HasPopupNotifications() const override;
+ virtual bool IsQuietMode() const override;
+ virtual bool HasClickedListener(const std::string& id) override;
virtual message_center::Notification* FindVisibleNotificationById(
- const std::string& id) OVERRIDE;
+ const std::string& id) override;
virtual const NotificationList::Notifications& GetVisibleNotifications()
- OVERRIDE;
- virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE;
- virtual void AddNotification(scoped_ptr<Notification> notification) OVERRIDE;
+ override;
+ virtual NotificationList::PopupNotifications GetPopupNotifications() override;
+ virtual void AddNotification(scoped_ptr<Notification> notification) override;
virtual void UpdateNotification(const std::string& old_id,
scoped_ptr<Notification> new_notification)
- OVERRIDE;
- virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE;
- virtual void RemoveAllNotifications(bool by_user) OVERRIDE;
- virtual void RemoveAllVisibleNotifications(bool by_user) OVERRIDE;
+ override;
+ virtual void RemoveNotification(const std::string& id, bool by_user) override;
+ virtual void RemoveAllNotifications(bool by_user) override;
+ virtual void RemoveAllVisibleNotifications(bool by_user) override;
virtual void SetNotificationIcon(const std::string& notification_id,
- const gfx::Image& image) OVERRIDE;
+ const gfx::Image& image) override;
virtual void SetNotificationImage(const std::string& notification_id,
- const gfx::Image& image) OVERRIDE;
+ const gfx::Image& image) override;
virtual void SetNotificationButtonIcon(const std::string& notification_id,
int button_index,
- const gfx::Image& image) OVERRIDE;
+ const gfx::Image& image) override;
virtual void DisableNotificationsByNotifier(
- const NotifierId& notifier_id) OVERRIDE;
- virtual void ClickOnNotification(const std::string& id) OVERRIDE;
+ const NotifierId& notifier_id) override;
+ virtual void ClickOnNotification(const std::string& id) override;
virtual void ClickOnNotificationButton(const std::string& id,
- int button_index) OVERRIDE;
+ int button_index) override;
virtual void MarkSinglePopupAsShown(const std::string& id,
- bool mark_notification_as_read) OVERRIDE;
+ bool mark_notification_as_read) override;
virtual void DisplayedNotification(
const std::string& id,
- const DisplaySource source) OVERRIDE;
+ const DisplaySource source) override;
virtual void SetNotifierSettingsProvider(
- NotifierSettingsProvider* provider) OVERRIDE;
- virtual NotifierSettingsProvider* GetNotifierSettingsProvider() OVERRIDE;
- virtual void SetQuietMode(bool in_quiet_mode) OVERRIDE;
+ NotifierSettingsProvider* provider) override;
+ virtual NotifierSettingsProvider* GetNotifierSettingsProvider() override;
+ virtual void SetQuietMode(bool in_quiet_mode) override;
virtual void EnterQuietModeWithExpire(
- const base::TimeDelta& expires_in) OVERRIDE;
- virtual void RestartPopupTimers() OVERRIDE;
- virtual void PausePopupTimers() OVERRIDE;
+ const base::TimeDelta& expires_in) override;
+ virtual void RestartPopupTimers() override;
+ virtual void PausePopupTimers() override;
// NotificationBlocker::Observer overrides:
- virtual void OnBlockingStateChanged(NotificationBlocker* blocker) OVERRIDE;
+ virtual void OnBlockingStateChanged(NotificationBlocker* blocker) override;
// message_center::NotifierSettingsObserver overrides:
virtual void UpdateIconImage(const NotifierId& notifier_id,
- const gfx::Image& icon) OVERRIDE;
- virtual void NotifierGroupChanged() OVERRIDE;
+ const gfx::Image& icon) override;
+ virtual void NotifierGroupChanged() override;
virtual void NotifierEnabledChanged(const NotifierId& notifier_id,
- bool enabled) OVERRIDE;
+ bool enabled) override;
protected:
- virtual void DisableTimersForTest() OVERRIDE;
+ virtual void DisableTimersForTest() override;
private:
struct NotificationCache {
diff --git a/ui/message_center/message_center_impl_unittest.cc b/ui/message_center/message_center_impl_unittest.cc
index 913c8a2..f0453e5 100644
--- a/ui/message_center/message_center_impl_unittest.cc
+++ b/ui/message_center/message_center_impl_unittest.cc
@@ -27,7 +27,7 @@
public:
MessageCenterImplTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
MessageCenter::Initialize();
message_center_ = MessageCenter::Get();
loop_.reset(new base::MessageLoop);
@@ -35,7 +35,7 @@
closure_ = run_loop_->QuitClosure();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
run_loop_.reset();
loop_.reset();
message_center_ = NULL;
@@ -118,7 +118,7 @@
// NotificationBlocker overrides:
virtual bool ShouldShowNotificationAsPopup(
- const message_center::NotifierId& notifier_id) const OVERRIDE {
+ const message_center::NotifierId& notifier_id) const override {
return notifications_enabled_;
}
@@ -138,7 +138,7 @@
// NotificationBlocker overrides:
virtual bool ShouldShowNotificationAsPopup(
- const NotifierId& notifier_id) const OVERRIDE {
+ const NotifierId& notifier_id) const override {
return (notifier_id == allowed_notifier_) ||
ToggledNotificationBlocker::ShouldShowNotificationAsPopup(notifier_id);
}
@@ -158,7 +158,7 @@
// NotificationBlocker overrides:
virtual bool ShouldShowNotification(
- const NotifierId& notifier_id) const OVERRIDE {
+ const NotifierId& notifier_id) const override {
return ShouldShowNotificationAsPopup(notifier_id);
}
@@ -202,7 +202,7 @@
quit_closure_(quit_closure) {}
virtual ~MockPopupTimersController() {}
- virtual void TimerFinished(const std::string& id) OVERRIDE {
+ virtual void TimerFinished(const std::string& id) override {
base::MessageLoop::current()->PostTask(FROM_HERE, quit_closure_);
timer_finished_ = true;
last_id_ = id;
diff --git a/ui/message_center/message_center_tray.cc b/ui/message_center/message_center_tray.cc
index 3425ce5..3037c69 100644
--- a/ui/message_center/message_center_tray.cc
+++ b/ui/message_center/message_center_tray.cc
@@ -32,12 +32,12 @@
virtual ~NotificationMenuModel();
// Overridden from ui::SimpleMenuModel::Delegate:
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdChecked(int command_id) const override;
+ virtual bool IsCommandIdEnabled(int command_id) const override;
virtual bool GetAcceleratorForCommandId(
int command_id,
- ui::Accelerator* accelerator) OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+ ui::Accelerator* accelerator) override;
+ virtual void ExecuteCommand(int command_id, int event_flags) override;
private:
MessageCenterTray* tray_;
diff --git a/ui/message_center/message_center_tray.h b/ui/message_center/message_center_tray.h
index 4539417..6e81409 100644
--- a/ui/message_center/message_center_tray.h
+++ b/ui/message_center/message_center_tray.h
@@ -74,21 +74,21 @@
message_center::MessageCenter* message_center() { return message_center_; }
// Overridden from MessageCenterObserver:
- virtual void OnNotificationAdded(const std::string& notification_id) OVERRIDE;
+ virtual void OnNotificationAdded(const std::string& notification_id) override;
virtual void OnNotificationRemoved(const std::string& notification_id,
- bool by_user) OVERRIDE;
+ bool by_user) override;
virtual void OnNotificationUpdated(
- const std::string& notification_id) OVERRIDE;
+ const std::string& notification_id) override;
virtual void OnNotificationClicked(
- const std::string& notification_id) OVERRIDE;
+ const std::string& notification_id) override;
virtual void OnNotificationButtonClicked(
const std::string& notification_id,
- int button_index) OVERRIDE;
+ int button_index) override;
virtual void OnNotificationDisplayed(
const std::string& notification_id,
- const DisplaySource source) OVERRIDE;
- virtual void OnQuietModeChanged(bool in_quiet_mode) OVERRIDE;
- virtual void OnBlockingStateChanged(NotificationBlocker* blocker) OVERRIDE;
+ const DisplaySource source) override;
+ virtual void OnQuietModeChanged(bool in_quiet_mode) override;
+ virtual void OnBlockingStateChanged(NotificationBlocker* blocker) override;
private:
void OnMessageCenterChanged();
diff --git a/ui/message_center/message_center_tray_unittest.cc b/ui/message_center/message_center_tray_unittest.cc
index 993e188..cf1fcee 100644
--- a/ui/message_center/message_center_tray_unittest.cc
+++ b/ui/message_center/message_center_tray_unittest.cc
@@ -23,23 +23,23 @@
show_message_center_success_(true),
enable_context_menu_(true) {}
virtual ~MockDelegate() {}
- virtual void OnMessageCenterTrayChanged() OVERRIDE {}
- virtual bool ShowPopups() OVERRIDE {
+ virtual void OnMessageCenterTrayChanged() override {}
+ virtual bool ShowPopups() override {
return show_message_center_success_;
}
- virtual void HidePopups() OVERRIDE {}
- virtual bool ShowMessageCenter() OVERRIDE {
+ virtual void HidePopups() override {}
+ virtual bool ShowMessageCenter() override {
return show_popups_success_;
}
- virtual void HideMessageCenter() OVERRIDE {}
- virtual bool ShowNotifierSettings() OVERRIDE {
+ virtual void HideMessageCenter() override {}
+ virtual bool ShowNotifierSettings() override {
return true;
}
- virtual bool IsContextMenuEnabled() const OVERRIDE {
+ virtual bool IsContextMenuEnabled() const override {
return enable_context_menu_;
}
- virtual MessageCenterTray* GetMessageCenterTray() OVERRIDE {
+ virtual MessageCenterTray* GetMessageCenterTray() override {
return NULL;
}
diff --git a/ui/message_center/notification_delegate.h b/ui/message_center/notification_delegate.h
index 9c6c8a1..2faf2d0 100644
--- a/ui/message_center/notification_delegate.h
+++ b/ui/message_center/notification_delegate.h
@@ -59,12 +59,12 @@
explicit HandleNotificationClickedDelegate(const base::Closure& closure);
// message_center::NotificationDelegate overrides:
- virtual void Display() OVERRIDE;
- virtual void Error() OVERRIDE;
- virtual void Close(bool by_user) OVERRIDE;
- virtual bool HasClickedListener() OVERRIDE;
- virtual void Click() OVERRIDE;
- virtual void ButtonClick(int button_index) OVERRIDE;
+ virtual void Display() override;
+ virtual void Error() override;
+ virtual void Close(bool by_user) override;
+ virtual bool HasClickedListener() override;
+ virtual void Click() override;
+ virtual void ButtonClick(int button_index) override;
protected:
virtual ~HandleNotificationClickedDelegate();
@@ -87,11 +87,11 @@
const ButtonClickCallback& button_callback);
// message_center::NotificationDelegate overrides:
- virtual void Display() OVERRIDE;
- virtual void Error() OVERRIDE;
- virtual void Close(bool by_user) OVERRIDE;
- virtual void Click() OVERRIDE;
- virtual void ButtonClick(int button_index) OVERRIDE;
+ virtual void Display() override;
+ virtual void Error() override;
+ virtual void Close(bool by_user) override;
+ virtual void Click() override;
+ virtual void ButtonClick(int button_index) override;
protected:
virtual ~HandleNotificationButtonClickDelegate();
diff --git a/ui/message_center/test/run_all_unittests.cc b/ui/message_center/test/run_all_unittests.cc
index f657e04..274b176 100644
--- a/ui/message_center/test/run_all_unittests.cc
+++ b/ui/message_center/test/run_all_unittests.cc
@@ -23,7 +23,7 @@
MessageCenterTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
protected:
- virtual void Initialize() OVERRIDE {
+ virtual void Initialize() override {
#if !defined(OS_MACOSX)
gfx::GLSurface::InitializeOneOffForTests();
#endif
@@ -35,7 +35,7 @@
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
}
- virtual void Shutdown() OVERRIDE {
+ virtual void Shutdown() override {
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
diff --git a/ui/message_center/views/bounded_label.cc b/ui/message_center/views/bounded_label.cc
index abbdcf3..f6b2fe2 100644
--- a/ui/message_center/views/bounded_label.cc
+++ b/ui/message_center/views/bounded_label.cc
@@ -44,12 +44,12 @@
std::vector<base::string16> GetWrappedText(int width, int lines);
// Overridden from views::Label.
- virtual void SetText(const base::string16& text) OVERRIDE;
+ virtual void SetText(const base::string16& text) override;
protected:
// Overridden from views::Label.
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
int GetTextFlags();
diff --git a/ui/message_center/views/bounded_label.h b/ui/message_center/views/bounded_label.h
index 9a9e6d4..d67d5c5 100644
--- a/ui/message_center/views/bounded_label.h
+++ b/ui/message_center/views/bounded_label.h
@@ -50,18 +50,18 @@
gfx::Size GetSizeForWidthAndLines(int width, int lines);
// views::View:
- virtual int GetBaseline() const OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
+ virtual int GetBaseline() const override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
virtual void Paint(gfx::Canvas* canvas,
- const views::CullSet& cull_set) OVERRIDE;
- virtual bool CanProcessEventsWithinSubtree() const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ const views::CullSet& cull_set) override;
+ virtual bool CanProcessEventsWithinSubtree() const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
protected:
// Overridden from views::View.
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
+ virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
private:
friend class test::BoundedLabelTest;
diff --git a/ui/message_center/views/desktop_popup_alignment_delegate.h b/ui/message_center/views/desktop_popup_alignment_delegate.h
index d00dbba..1e126d8 100644
--- a/ui/message_center/views/desktop_popup_alignment_delegate.h
+++ b/ui/message_center/views/desktop_popup_alignment_delegate.h
@@ -30,12 +30,12 @@
void StartObserving(gfx::Screen* screen);
// Overridden from PopupAlignmentDelegate:
- virtual int GetToastOriginX(const gfx::Rect& toast_bounds) const OVERRIDE;
- virtual int GetBaseLine() const OVERRIDE;
- virtual int GetWorkAreaBottom() const OVERRIDE;
- virtual bool IsTopDown() const OVERRIDE;
- virtual bool IsFromLeft() const OVERRIDE;
- virtual void RecomputeAlignment(const gfx::Display& display) OVERRIDE;
+ virtual int GetToastOriginX(const gfx::Rect& toast_bounds) const override;
+ virtual int GetBaseLine() const override;
+ virtual int GetWorkAreaBottom() const override;
+ virtual bool IsTopDown() const override;
+ virtual bool IsFromLeft() const override;
+ virtual void RecomputeAlignment(const gfx::Display& display) override;
private:
friend class test::MessagePopupCollectionTest;
@@ -48,10 +48,10 @@
};
// Overridden from gfx::DisplayObserver:
- virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE;
- virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE;
+ virtual void OnDisplayAdded(const gfx::Display& new_display) override;
+ virtual void OnDisplayRemoved(const gfx::Display& old_display) override;
virtual void OnDisplayMetricsChanged(const gfx::Display& display,
- uint32_t metrics) OVERRIDE;
+ uint32_t metrics) override;
int32_t alignment_;
int64_t display_id_;
diff --git a/ui/message_center/views/message_center_bubble.cc b/ui/message_center/views/message_center_bubble.cc
index 273d1ef..7f0d6e8 100644
--- a/ui/message_center/views/message_center_bubble.cc
+++ b/ui/message_center/views/message_center_bubble.cc
@@ -22,11 +22,11 @@
virtual ~ContentsView();
// Overridden from views::View:
- virtual int GetHeightForWidth(int width) const OVERRIDE;
+ virtual int GetHeightForWidth(int width) const override;
protected:
// Overridden from views::View:
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
+ virtual void ChildPreferredSizeChanged(View* child) override;
private:
base::WeakPtr<MessageCenterBubble> bubble_;
diff --git a/ui/message_center/views/message_center_bubble.h b/ui/message_center/views/message_center_bubble.h
index 1173a95..5febb18 100644
--- a/ui/message_center/views/message_center_bubble.h
+++ b/ui/message_center/views/message_center_bubble.h
@@ -29,16 +29,16 @@
void SetSettingsVisible();
// Overridden from views::WidgetObserver:
- virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
+ virtual void OnWidgetClosing(views::Widget* widget) override;
// Overridden from MessageBubbleBase:
virtual views::TrayBubbleView::InitParams GetInitParams(
- views::TrayBubbleView::AnchorAlignment anchor_alignment) OVERRIDE;
- virtual void InitializeContents(views::TrayBubbleView* bubble_view) OVERRIDE;
- virtual void OnBubbleViewDestroyed() OVERRIDE;
- virtual void UpdateBubbleView() OVERRIDE;
- virtual void OnMouseEnteredView() OVERRIDE;
- virtual void OnMouseExitedView() OVERRIDE;
+ views::TrayBubbleView::AnchorAlignment anchor_alignment) override;
+ virtual void InitializeContents(views::TrayBubbleView* bubble_view) override;
+ virtual void OnBubbleViewDestroyed() override;
+ virtual void UpdateBubbleView() override;
+ virtual void OnMouseEnteredView() override;
+ virtual void OnMouseExitedView() override;
size_t NumMessageViewsForTest() const;
diff --git a/ui/message_center/views/message_center_button_bar.cc b/ui/message_center/views/message_center_button_bar.cc
index eb5f11e..b56ab68 100644
--- a/ui/message_center/views/message_center_button_bar.cc
+++ b/ui/message_center/views/message_center_button_bar.cc
@@ -50,7 +50,7 @@
protected:
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
private:
gfx::Size size_;
diff --git a/ui/message_center/views/message_center_button_bar.h b/ui/message_center/views/message_center_button_bar.h
index bc87dbe..a02df8c 100644
--- a/ui/message_center/views/message_center_button_bar.h
+++ b/ui/message_center/views/message_center_button_bar.h
@@ -50,11 +50,11 @@
void ViewVisibilityChanged();
// Overridden from views::View:
- virtual void ChildVisibilityChanged(views::View* child) OVERRIDE;
+ virtual void ChildVisibilityChanged(views::View* child) override;
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
MessageCenterView* message_center_view() const {
return message_center_view_;
diff --git a/ui/message_center/views/message_center_view.cc b/ui/message_center/views/message_center_view.cc
index 5b3ee28..d726b61 100644
--- a/ui/message_center/views/message_center_view.cc
+++ b/ui/message_center/views/message_center_view.cc
@@ -62,9 +62,9 @@
virtual ~NoNotificationMessageView();
// Overridden from views::View.
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
+ virtual void Layout() override;
private:
views::Label* label_;
@@ -121,17 +121,17 @@
protected:
// Overridden from views::View.
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
virtual void PaintChildren(gfx::Canvas* canvas,
- const views::CullSet& cull_set) OVERRIDE;
- virtual void ReorderChildLayers(ui::Layer* parent_layer) OVERRIDE;
+ const views::CullSet& cull_set) override;
+ virtual void ReorderChildLayers(ui::Layer* parent_layer) override;
// Overridden from views::BoundsAnimatorObserver.
virtual void OnBoundsAnimatorProgressed(
- views::BoundsAnimator* animator) OVERRIDE;
- virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE;
+ views::BoundsAnimator* animator) override;
+ virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override;
private:
bool IsValidChild(const views::View* child) const;
diff --git a/ui/message_center/views/message_center_view.h b/ui/message_center/views/message_center_view.h
index 94dd139..6f72e91 100644
--- a/ui/message_center/views/message_center_view.h
+++ b/ui/message_center/views/message_center_view.h
@@ -68,33 +68,33 @@
protected:
// Overridden from views::View:
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
// Overridden from MessageCenterObserver:
- virtual void OnNotificationAdded(const std::string& id) OVERRIDE;
+ virtual void OnNotificationAdded(const std::string& id) override;
virtual void OnNotificationRemoved(const std::string& id,
- bool by_user) OVERRIDE;
- virtual void OnNotificationUpdated(const std::string& id) OVERRIDE;
+ bool by_user) override;
+ virtual void OnNotificationUpdated(const std::string& id) override;
// Overridden from MessageCenterController:
- virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE;
+ virtual void ClickOnNotification(const std::string& notification_id) override;
virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) OVERRIDE;
+ bool by_user) override;
virtual scoped_ptr<ui::MenuModel> CreateMenuModel(
const NotifierId& notifier_id,
- const base::string16& display_source) OVERRIDE;
- virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE;
+ const base::string16& display_source) override;
+ virtual bool HasClickedListener(const std::string& notification_id) override;
virtual void ClickOnNotificationButton(const std::string& notification_id,
- int button_index) OVERRIDE;
+ int button_index) override;
// Overridden from gfx::AnimationDelegate:
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationEnded(const gfx::Animation* animation) override;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
+ virtual void AnimationCanceled(const gfx::Animation* animation) override;
private:
friend class MessageCenterViewTest;
diff --git a/ui/message_center/views/message_center_view_unittest.cc b/ui/message_center/views/message_center_view_unittest.cc
index 3335ed8..6941927 100644
--- a/ui/message_center/views/message_center_view_unittest.cc
+++ b/ui/message_center/views/message_center_view_unittest.cc
@@ -40,9 +40,9 @@
Test* test);
virtual ~MockNotificationView();
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int w) const OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int w) const override;
+ virtual void Layout() override;
private:
Test* test_;
@@ -87,26 +87,26 @@
MessageCenterViewTest();
virtual ~MessageCenterViewTest();
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
MessageCenterView* GetMessageCenterView();
int GetNotificationCount();
int GetCallCount(CallType type);
// Overridden from MessageCenterController:
- virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE;
+ virtual void ClickOnNotification(const std::string& notification_id) override;
virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) OVERRIDE;
+ bool by_user) override;
virtual scoped_ptr<ui::MenuModel> CreateMenuModel(
const NotifierId& notifier_id,
- const base::string16& display_source) OVERRIDE;
- virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE;
+ const base::string16& display_source) override;
+ virtual bool HasClickedListener(const std::string& notification_id) override;
virtual void ClickOnNotificationButton(const std::string& notification_id,
- int button_index) OVERRIDE;
+ int button_index) override;
// Overridden from MockNotificationView::Test
- virtual void RegisterCall(CallType type) OVERRIDE;
+ virtual void RegisterCall(CallType type) override;
void LogBounds(int depth, views::View* view);
diff --git a/ui/message_center/views/message_popup_collection.h b/ui/message_center/views/message_popup_collection.h
index 8d6d644..f015319 100644
--- a/ui/message_center/views/message_popup_collection.h
+++ b/ui/message_center/views/message_popup_collection.h
@@ -62,15 +62,15 @@
virtual ~MessagePopupCollection();
// Overridden from MessageCenterController:
- virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE;
+ virtual void ClickOnNotification(const std::string& notification_id) override;
virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) OVERRIDE;
+ bool by_user) override;
virtual scoped_ptr<ui::MenuModel> CreateMenuModel(
const NotifierId& notifier_id,
- const base::string16& display_source) OVERRIDE;
- virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE;
+ const base::string16& display_source) override;
+ virtual bool HasClickedListener(const std::string& notification_id) override;
virtual void ClickOnNotificationButton(const std::string& notification_id,
- int button_index) OVERRIDE;
+ int button_index) override;
void MarkAllPopupsShown();
@@ -128,11 +128,11 @@
int GetBaseLine(ToastContentsView* last_toast) const;
// Overridden from MessageCenterObserver:
- virtual void OnNotificationAdded(const std::string& notification_id) OVERRIDE;
+ virtual void OnNotificationAdded(const std::string& notification_id) override;
virtual void OnNotificationRemoved(const std::string& notification_id,
- bool by_user) OVERRIDE;
+ bool by_user) override;
virtual void OnNotificationUpdated(
- const std::string& notification_id) OVERRIDE;
+ const std::string& notification_id) override;
ToastContentsView* FindToast(const std::string& notification_id) const;
diff --git a/ui/message_center/views/message_popup_collection_unittest.cc b/ui/message_center/views/message_popup_collection_unittest.cc
index 551e4dd..6aa0736 100644
--- a/ui/message_center/views/message_popup_collection_unittest.cc
+++ b/ui/message_center/views/message_popup_collection_unittest.cc
@@ -26,7 +26,7 @@
class MessagePopupCollectionTest : public views::ViewsTestBase {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
views::ViewsTestBase::SetUp();
MessageCenter::Initialize();
MessageCenter::Get()->DisableTimersForTest();
@@ -42,7 +42,7 @@
PrepareForWait();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
collection_.reset();
MessageCenter::Shutdown();
views::ViewsTestBase::TearDown();
diff --git a/ui/message_center/views/message_view.h b/ui/message_center/views/message_view.h
index 1bf8aee..0c0d3c5 100644
--- a/ui/message_center/views/message_view.h
+++ b/ui/message_center/views/message_view.h
@@ -74,21 +74,21 @@
}
// Overridden from views::View:
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnKeyReleased(const ui::KeyEvent& event) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual void Layout() override;
// Overridden from ui::EventHandler:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Overridden from ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; }
std::string notification_id() { return notification_id_; }
@@ -97,7 +97,7 @@
protected:
// Overridden from views::SlideOutView:
- virtual void OnSlideOut() OVERRIDE;
+ virtual void OnSlideOut() override;
views::ImageView* small_image() { return small_image_view_.get(); }
views::ImageButton* close_button() { return close_button_.get(); }
diff --git a/ui/message_center/views/message_view_context_menu_controller.h b/ui/message_center/views/message_view_context_menu_controller.h
index 5ee39de..7c41259 100644
--- a/ui/message_center/views/message_view_context_menu_controller.h
+++ b/ui/message_center/views/message_view_context_menu_controller.h
@@ -22,7 +22,7 @@
// Overridden from views::ContextMenuController:
virtual void ShowContextMenuForView(views::View* source,
const gfx::Point& point,
- ui::MenuSourceType source_type) OVERRIDE;
+ ui::MenuSourceType source_type) override;
MessageCenterController* controller_;
diff --git a/ui/message_center/views/notification_button.h b/ui/message_center/views/notification_button.h
index b5ac0f1..347964a 100644
--- a/ui/message_center/views/notification_button.h
+++ b/ui/message_center/views/notification_button.h
@@ -27,16 +27,16 @@
void SetTitle(const base::string16& title);
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
// Overridden from views::CustomButton:
- virtual void StateChanged() OVERRIDE;
+ virtual void StateChanged() override;
private:
views::ImageView* icon_;
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc
index 81cfcd1..208a386 100644
--- a/ui/message_center/views/notification_view.cc
+++ b/ui/message_center/views/notification_view.cc
@@ -115,7 +115,7 @@
virtual ~ItemView();
// Overridden from views::View:
- virtual void SetVisible(bool visible) OVERRIDE;
+ virtual void SetVisible(bool visible) override;
private:
DISALLOW_COPY_AND_ASSIGN(ItemView);
@@ -194,8 +194,8 @@
private:
// Overriden from View
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
DISALLOW_COPY_AND_ASSIGN(NotificationProgressBar);
};
diff --git a/ui/message_center/views/notification_view.h b/ui/message_center/views/notification_view.h
index 623f120..0cb6444 100644
--- a/ui/message_center/views/notification_view.h
+++ b/ui/message_center/views/notification_view.h
@@ -46,23 +46,23 @@
virtual ~NotificationView();
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
+ virtual void Layout() override;
+ virtual void OnFocus() override;
+ virtual void ScrollRectToVisible(const gfx::Rect& rect) override;
+ virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
// Overridden from MessageView:
virtual void UpdateWithNotification(
- const Notification& notification) OVERRIDE;
+ const Notification& notification) override;
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// Overridden from MessageViewController:
- virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE;
+ virtual void ClickOnNotification(const std::string& notification_id) override;
virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) OVERRIDE;
+ bool by_user) override;
void set_controller(MessageCenterController* controller) {
controller_ = controller;
@@ -82,7 +82,7 @@
// views::ViewTargeterDelegate:
virtual views::View* TargetForRect(views::View* root,
- const gfx::Rect& rect) OVERRIDE;
+ const gfx::Rect& rect) override;
void CreateOrUpdateViews(const Notification& notification);
void SetAccessibleName(const Notification& notification);
diff --git a/ui/message_center/views/notification_view_unittest.cc b/ui/message_center/views/notification_view_unittest.cc
index 6e85301..1937618 100644
--- a/ui/message_center/views/notification_view_unittest.cc
+++ b/ui/message_center/views/notification_view_unittest.cc
@@ -28,8 +28,8 @@
NotificationViewTest();
virtual ~NotificationViewTest();
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
views::Widget* widget() { return notification_view_->GetWidget(); }
NotificationView* notification_view() { return notification_view_.get(); }
@@ -37,15 +37,15 @@
RichNotificationData* data() { return data_.get(); }
// Overridden from MessageCenterController:
- virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE;
+ virtual void ClickOnNotification(const std::string& notification_id) override;
virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) OVERRIDE;
+ bool by_user) override;
virtual scoped_ptr<ui::MenuModel> CreateMenuModel(
const NotifierId& notifier_id,
- const base::string16& display_source) OVERRIDE;
- virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE;
+ const base::string16& display_source) override;
+ virtual bool HasClickedListener(const std::string& notification_id) override;
virtual void ClickOnNotificationButton(const std::string& notification_id,
- int button_index) OVERRIDE;
+ int button_index) override;
protected:
const gfx::Image CreateTestImage(int width, int height) {
diff --git a/ui/message_center/views/notifier_settings_view.cc b/ui/message_center/views/notifier_settings_view.cc
index cbe285b..4f24a8c 100644
--- a/ui/message_center/views/notifier_settings_view.cc
+++ b/ui/message_center/views/notifier_settings_view.cc
@@ -129,14 +129,14 @@
virtual ~EntryView();
// views::View:
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void OnFocus() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnKeyReleased(const ui::KeyEvent& event) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnBlur() override;
private:
scoped_ptr<views::Painter> focus_painter_;
@@ -210,12 +210,12 @@
virtual ~NotifierGroupMenuModel();
// ui::SimpleMenuModel::Delegate:
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdChecked(int command_id) const override;
+ virtual bool IsCommandIdEnabled(int command_id) const override;
virtual bool GetAcceleratorForCommandId(
int command_id,
- ui::Accelerator* accelerator) OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+ ui::Accelerator* accelerator) override;
+ virtual void ExecuteCommand(int command_id, int event_flags) override;
private:
NotifierSettingsProvider* notifier_settings_provider_;
diff --git a/ui/message_center/views/notifier_settings_view.h b/ui/message_center/views/notifier_settings_view.h
index 994fa50..ef60a06 100644
--- a/ui/message_center/views/notifier_settings_view.h
+++ b/ui/message_center/views/notifier_settings_view.h
@@ -41,10 +41,10 @@
// Overridden from NotifierSettingsDelegate:
virtual void UpdateIconImage(const NotifierId& notifier_id,
- const gfx::Image& icon) OVERRIDE;
- virtual void NotifierGroupChanged() OVERRIDE;
+ const gfx::Image& icon) override;
+ virtual void NotifierGroupChanged() override;
virtual void NotifierEnabledChanged(const NotifierId& notifier_id,
- bool enabled) OVERRIDE;
+ bool enabled) override;
void set_provider(NotifierSettingsProvider* new_provider) {
provider_ = new_provider;
@@ -72,8 +72,8 @@
private:
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* button,
- const ui::Event& event) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ const ui::Event& event) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
bool ShouldHaveLearnMoreButton() const;
// Helper function to reset the layout when the view has substantially
@@ -96,19 +96,19 @@
void UpdateContentsView(const std::vector<Notifier*>& notifiers);
// Overridden from views::View:
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
+ virtual void Layout() override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// Overridden from views::MenuButtonListener:
virtual void OnMenuButtonClicked(views::View* source,
- const gfx::Point& point) OVERRIDE;
+ const gfx::Point& point) override;
views::ImageButton* title_arrow_;
views::Label* title_label_;
diff --git a/ui/message_center/views/notifier_settings_view_unittest.cc b/ui/message_center/views/notifier_settings_view_unittest.cc
index 331bd95..df9ce16 100644
--- a/ui/message_center/views/notifier_settings_view_unittest.cc
+++ b/ui/message_center/views/notifier_settings_view_unittest.cc
@@ -31,13 +31,13 @@
virtual ~TestingNotifierSettingsProvider() {}
virtual bool NotifierHasAdvancedSettings(const NotifierId& notifier_id) const
- OVERRIDE {
+ override {
return notifier_id == settings_handler_id_;
}
virtual void OnNotifierAdvancedSettingsRequested(
const NotifierId& notifier_id,
- const std::string* notification_id) OVERRIDE {
+ const std::string* notification_id) override {
request_count_++;
last_notifier_id_settings_requested_.reset(new NotifierId(notifier_id));
}
@@ -60,8 +60,8 @@
NotifierSettingsViewTest();
virtual ~NotifierSettingsViewTest();
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
NotifierSettingsView* GetView() const;
TestingNotifierSettingsProvider* settings_provider() const {
diff --git a/ui/message_center/views/padded_button.h b/ui/message_center/views/padded_button.h
index c420621..ccb2590 100644
--- a/ui/message_center/views/padded_button.h
+++ b/ui/message_center/views/padded_button.h
@@ -24,9 +24,9 @@
virtual ~PaddedButton();
// Overridden from views::ImageButton:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnFocus() override;
// The SetPadding() method also sets the button's image alignment (positive
// values yield left/top alignments, negative values yield right/bottom ones,
diff --git a/ui/message_center/views/proportional_image_view.h b/ui/message_center/views/proportional_image_view.h
index 7c1be92..f92b4d8 100644
--- a/ui/message_center/views/proportional_image_view.h
+++ b/ui/message_center/views/proportional_image_view.h
@@ -17,9 +17,9 @@
virtual ~ProportionalImageView();
// Overridden from views::View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
gfx::Size GetImageDrawingSize();
diff --git a/ui/message_center/views/toast_contents_view.h b/ui/message_center/views/toast_contents_view.h
index 1b39d81..4ebcd17 100644
--- a/ui/message_center/views/toast_contents_view.h
+++ b/ui/message_center/views/toast_contents_view.h
@@ -71,34 +71,34 @@
const std::string& id() { return id_; }
// Overridden from views::View:
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
private:
// Overridden from MessageCenterController:
- virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE;
+ virtual void ClickOnNotification(const std::string& notification_id) override;
virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) OVERRIDE;
+ bool by_user) override;
virtual scoped_ptr<ui::MenuModel> CreateMenuModel(
const NotifierId& notifier_id,
- const base::string16& display_source) OVERRIDE;
- virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE;
+ const base::string16& display_source) override;
+ virtual bool HasClickedListener(const std::string& notification_id) override;
virtual void ClickOnNotificationButton(const std::string& notification_id,
- int button_index) OVERRIDE;
+ int button_index) override;
// Overridden from gfx::AnimationDelegate:
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
+ virtual void AnimationEnded(const gfx::Animation* animation) override;
+ virtual void AnimationCanceled(const gfx::Animation* animation) override;
// Overridden from views::WidgetDelegate:
- virtual views::View* GetContentsView() OVERRIDE;
- virtual void WindowClosing() OVERRIDE;
- virtual void OnDisplayChanged() OVERRIDE;
- virtual void OnWorkAreaChanged() OVERRIDE;
+ virtual views::View* GetContentsView() override;
+ virtual void WindowClosing() override;
+ virtual void OnDisplayChanged() override;
+ virtual void OnWorkAreaChanged() override;
// Initialization and update.
void CreateWidget(gfx::NativeView parent);
diff --git a/ui/metro_viewer/OWNERS b/ui/metro_viewer/OWNERS
index 5ecb406..9b1c245 100644
--- a/ui/metro_viewer/OWNERS
+++ b/ui/metro_viewer/OWNERS
@@ -6,6 +6,7 @@
per-file *_messages*.h=jln@chromium.org
per-file *_messages*.h=jschuh@chromium.org
per-file *_messages*.h=kenrb@chromium.org
+per-file *_messages*.h=mkwst@chromium.org
per-file *_messages*.h=nasko@chromium.org
per-file *_messages*.h=tsepez@chromium.org
per-file *_messages*.h=wfh@chromium.org
diff --git a/ui/native_theme/fallback_theme.h b/ui/native_theme/fallback_theme.h
index 65eb3bd..4f695b0 100644
--- a/ui/native_theme/fallback_theme.h
+++ b/ui/native_theme/fallback_theme.h
@@ -18,7 +18,7 @@
protected:
// Overridden from NativeThemeBase:
- virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE;
+ virtual SkColor GetSystemColor(ColorId color_id) const override;
private:
DISALLOW_COPY_AND_ASSIGN(FallbackTheme);
diff --git a/ui/native_theme/native_theme_android.h b/ui/native_theme/native_theme_android.h
index e1d2f78..378a233 100644
--- a/ui/native_theme/native_theme_android.h
+++ b/ui/native_theme/native_theme_android.h
@@ -14,7 +14,7 @@
public:
static NativeThemeAndroid* instance();
- virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE;
+ virtual SkColor GetSystemColor(ColorId color_id) const override;
private:
NativeThemeAndroid();
diff --git a/ui/native_theme/native_theme_aura.h b/ui/native_theme/native_theme_aura.h
index 82a6ec9..2bcfbed 100644
--- a/ui/native_theme/native_theme_aura.h
+++ b/ui/native_theme/native_theme_aura.h
@@ -28,36 +28,36 @@
virtual void PaintMenuPopupBackground(
SkCanvas* canvas,
const gfx::Size& size,
- const MenuBackgroundExtraParams& menu_background) const OVERRIDE;
+ const MenuBackgroundExtraParams& menu_background) const override;
virtual void PaintMenuItemBackground(
SkCanvas* canvas,
State state,
const gfx::Rect& rect,
- const MenuListExtraParams& menu_list) const OVERRIDE;
+ const MenuListExtraParams& menu_list) const override;
virtual void PaintArrowButton(SkCanvas* gc,
const gfx::Rect& rect,
Part direction,
- State state) const OVERRIDE;
+ State state) const override;
virtual void PaintScrollbarTrack(
SkCanvas* sk_canvas,
Part part,
State state,
const ScrollbarTrackExtraParams& extra_params,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
virtual void PaintScrollbarThumb(SkCanvas* sk_canvas,
Part part,
State state,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
virtual void PaintScrollbarCorner(SkCanvas* canvas,
State state,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
virtual void PaintScrollbarThumbStateTransition(SkCanvas* canvas,
State startState,
State endState,
double progress,
const gfx::Rect& rect) const
- OVERRIDE;
+ override;
// Returns the NineImagePainter used to paint the specified state, creating if
// necessary. If no image is provided for the specified state the normal state
diff --git a/ui/native_theme/native_theme_aurawin.h b/ui/native_theme/native_theme_aurawin.h
index 0b3a29e..7c7e57d 100644
--- a/ui/native_theme/native_theme_aurawin.h
+++ b/ui/native_theme/native_theme_aurawin.h
@@ -23,12 +23,12 @@
// Overridden from NativeThemeBase:
virtual gfx::Size GetPartSize(Part part,
State state,
- const ExtraParams& extra) const OVERRIDE;
+ const ExtraParams& extra) const override;
virtual void Paint(SkCanvas* canvas,
Part part,
State state,
const gfx::Rect& rect,
- const ExtraParams& extra) const OVERRIDE;
+ const ExtraParams& extra) const override;
DISALLOW_COPY_AND_ASSIGN(NativeThemeAuraWin);
};
diff --git a/ui/native_theme/native_theme_base.h b/ui/native_theme/native_theme_base.h
index 454c4b6..b928c81 100644
--- a/ui/native_theme/native_theme_base.h
+++ b/ui/native_theme/native_theme_base.h
@@ -26,19 +26,19 @@
// NativeTheme implementation:
virtual gfx::Size GetPartSize(Part part,
State state,
- const ExtraParams& extra) const OVERRIDE;
+ const ExtraParams& extra) const override;
virtual void Paint(SkCanvas* canvas,
Part part,
State state,
const gfx::Rect& rect,
- const ExtraParams& extra) const OVERRIDE;
+ const ExtraParams& extra) const override;
virtual void PaintStateTransition(SkCanvas* canvas,
Part part,
State startState,
State endState,
double progress,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
protected:
NativeThemeBase();
diff --git a/ui/native_theme/native_theme_mac.h b/ui/native_theme/native_theme_mac.h
index ecdd38e..433e16d 100644
--- a/ui/native_theme/native_theme_mac.h
+++ b/ui/native_theme/native_theme_mac.h
@@ -17,7 +17,7 @@
static NativeThemeMac* instance();
// Overridden from NativeTheme:
- virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE;
+ virtual SkColor GetSystemColor(ColorId color_id) const override;
// Overridden from NativeThemeBase:
virtual void PaintScrollbarTrack(
@@ -25,23 +25,23 @@
Part part,
State state,
const ScrollbarTrackExtraParams& extra_params,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
virtual void PaintScrollbarThumb(SkCanvas* sk_canvas,
Part part,
State state,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
virtual void PaintScrollbarCorner(SkCanvas* canvas,
State state,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
virtual void PaintMenuPopupBackground(
SkCanvas* canvas,
const gfx::Size& size,
- const MenuBackgroundExtraParams& menu_background) const OVERRIDE;
+ const MenuBackgroundExtraParams& menu_background) const override;
virtual void PaintMenuItemBackground(
SkCanvas* canvas,
State state,
const gfx::Rect& rect,
- const MenuListExtraParams& menu_list) const OVERRIDE;
+ const MenuListExtraParams& menu_list) const override;
private:
NativeThemeMac();
diff --git a/ui/native_theme/native_theme_win.h b/ui/native_theme/native_theme_win.h
index 408818f..9430298 100644
--- a/ui/native_theme/native_theme_win.h
+++ b/ui/native_theme/native_theme_win.h
@@ -106,20 +106,20 @@
// NativeTheme implementation:
virtual gfx::Size GetPartSize(Part part,
State state,
- const ExtraParams& extra) const OVERRIDE;
+ const ExtraParams& extra) const override;
virtual void Paint(SkCanvas* canvas,
Part part,
State state,
const gfx::Rect& rect,
- const ExtraParams& extra) const OVERRIDE;
- virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE;
+ const ExtraParams& extra) const override;
+ virtual SkColor GetSystemColor(ColorId color_id) const override;
private:
NativeThemeWin();
~NativeThemeWin();
// gfx::SysColorChangeListener implementation:
- virtual void OnSysColorChange() OVERRIDE;
+ virtual void OnSysColorChange() override;
// Update the locally cached set of system colors.
void UpdateSystemColors();
diff --git a/ui/ozone/common/display_snapshot_proxy.h b/ui/ozone/common/display_snapshot_proxy.h
index c0d29c5..175af51 100644
--- a/ui/ozone/common/display_snapshot_proxy.h
+++ b/ui/ozone/common/display_snapshot_proxy.h
@@ -17,7 +17,7 @@
virtual ~DisplaySnapshotProxy();
// DisplaySnapshot override:
- virtual std::string ToString() const OVERRIDE;
+ virtual std::string ToString() const override;
private:
std::string string_representation_;
diff --git a/ui/ozone/common/native_display_delegate_ozone.h b/ui/ozone/common/native_display_delegate_ozone.h
index 5507f9a..e600ce5 100644
--- a/ui/ozone/common/native_display_delegate_ozone.h
+++ b/ui/ozone/common/native_display_delegate_ozone.h
@@ -16,31 +16,31 @@
virtual ~NativeDisplayDelegateOzone();
// NativeDisplayDelegate overrides:
- virtual void Initialize() OVERRIDE;
- virtual void GrabServer() OVERRIDE;
- virtual void UngrabServer() OVERRIDE;
- virtual void SyncWithServer() OVERRIDE;
- virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE;
- virtual void ForceDPMSOn() OVERRIDE;
- virtual std::vector<ui::DisplaySnapshot*> GetDisplays() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void GrabServer() override;
+ virtual void UngrabServer() override;
+ virtual void SyncWithServer() override;
+ virtual void SetBackgroundColor(uint32_t color_argb) override;
+ virtual void ForceDPMSOn() override;
+ virtual std::vector<ui::DisplaySnapshot*> GetDisplays() override;
virtual void AddMode(const ui::DisplaySnapshot& output,
- const ui::DisplayMode* mode) OVERRIDE;
+ const ui::DisplayMode* mode) override;
virtual bool Configure(const ui::DisplaySnapshot& output,
const ui::DisplayMode* mode,
- const gfx::Point& origin) OVERRIDE;
- virtual void CreateFrameBuffer(const gfx::Size& size) OVERRIDE;
+ const gfx::Point& origin) override;
+ virtual void CreateFrameBuffer(const gfx::Size& size) override;
virtual bool GetHDCPState(const ui::DisplaySnapshot& output,
- ui::HDCPState* state) OVERRIDE;
+ ui::HDCPState* state) override;
virtual bool SetHDCPState(const ui::DisplaySnapshot& output,
- ui::HDCPState state) OVERRIDE;
+ ui::HDCPState state) override;
virtual std::vector<ui::ColorCalibrationProfile>
GetAvailableColorCalibrationProfiles(
- const ui::DisplaySnapshot& output) OVERRIDE;
+ const ui::DisplaySnapshot& output) override;
virtual bool SetColorCalibrationProfile(
const ui::DisplaySnapshot& output,
- ui::ColorCalibrationProfile new_profile) OVERRIDE;
- virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE;
- virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE;
+ ui::ColorCalibrationProfile new_profile) override;
+ virtual void AddObserver(NativeDisplayObserver* observer) override;
+ virtual void RemoveObserver(NativeDisplayObserver* observer) override;
private:
DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateOzone);
diff --git a/ui/ozone/demo/ozone_demo.cc b/ui/ozone/demo/ozone_demo.cc
index 42a6267..717b451 100644
--- a/ui/ozone/demo/ozone_demo.cc
+++ b/ui/ozone/demo/ozone_demo.cc
@@ -66,22 +66,22 @@
}
// PlatformWindowDelegate:
- virtual void OnBoundsChanged(const gfx::Rect& new_bounds) OVERRIDE {}
- virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE {}
- virtual void DispatchEvent(ui::Event* event) OVERRIDE {}
- virtual void OnCloseRequest() OVERRIDE {
+ virtual void OnBoundsChanged(const gfx::Rect& new_bounds) override {}
+ virtual void OnDamageRect(const gfx::Rect& damaged_region) override {}
+ virtual void DispatchEvent(ui::Event* event) override {}
+ virtual void OnCloseRequest() override {
Quit();
}
- virtual void OnClosed() OVERRIDE {}
+ virtual void OnClosed() override {}
virtual void OnWindowStateChanged(
- ui::PlatformWindowState new_state) OVERRIDE {}
- virtual void OnLostCapture() OVERRIDE {}
+ ui::PlatformWindowState new_state) override {}
+ virtual void OnLostCapture() override {}
virtual void OnAcceleratedWidgetAvailable(
- gfx::AcceleratedWidget widget) OVERRIDE {
+ gfx::AcceleratedWidget widget) override {
DCHECK_NE(widget, gfx::kNullAcceleratedWidget);
widget_ = widget;
}
- virtual void OnActivationChanged(bool active) OVERRIDE {}
+ virtual void OnActivationChanged(bool active) override {}
private:
bool InitializeGLSurface() {
diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
index 6953185..c9bee4c 100644
--- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
+++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
@@ -28,7 +28,7 @@
int z_order,
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
- const gfx::RectF& crop_rect) OVERRIDE {
+ const gfx::RectF& crop_rect) override {
return SurfaceFactoryOzone::GetInstance()->ScheduleOverlayPlane(
widget, z_order, transform, pixmap_, bounds_rect, crop_rect);
}
@@ -41,16 +41,20 @@
scoped_refptr<NativePixmap> pixmap_;
};
-SurfaceFactoryOzone::BufferFormat GetOzoneFormatFor(unsigned internal_format) {
- switch (internal_format) {
- case GL_RGBA8_OES:
+SurfaceFactoryOzone::BufferFormat GetOzoneFormatFor(
+ gfx::GpuMemoryBuffer::Format format) {
+ switch (format) {
+ case gfx::GpuMemoryBuffer::RGBA_8888:
return SurfaceFactoryOzone::RGBA_8888;
- case GL_RGB8_OES:
+ case gfx::GpuMemoryBuffer::RGBX_8888:
return SurfaceFactoryOzone::RGBX_8888;
- default:
+ case gfx::GpuMemoryBuffer::BGRA_8888:
NOTREACHED();
return SurfaceFactoryOzone::RGBA_8888;
}
+
+ NOTREACHED();
+ return SurfaceFactoryOzone::RGBA_8888;
}
std::pair<uint32_t, uint32_t> GetIndex(const gfx::GpuMemoryBufferId& id) {
@@ -69,15 +73,14 @@
bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
const gfx::GpuMemoryBufferId& id,
const gfx::Size& size,
- unsigned internalformat,
- unsigned usage) {
+ gfx::GpuMemoryBuffer::Format format,
+ gfx::GpuMemoryBuffer::Usage usage) {
scoped_refptr<NativePixmap> pixmap =
SurfaceFactoryOzone::GetInstance()->CreateNativePixmap(
- size, GetOzoneFormatFor(internalformat));
+ size, GetOzoneFormatFor(format));
if (!pixmap.get()) {
LOG(ERROR) << "Failed to create pixmap " << size.width() << "x"
- << size.height() << " format " << internalformat << ", usage "
- << usage;
+ << size.height() << " format " << format << ", usage " << usage;
return false;
}
native_pixmap_map_[GetIndex(id)] = pixmap;
diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h
index 79584fc..b35487f 100644
--- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h
+++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h
@@ -30,8 +30,8 @@
// Creates a GPU memory buffer identified by |id|.
bool CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id,
const gfx::Size& size,
- unsigned internalformat,
- unsigned usage);
+ gfx::GpuMemoryBuffer::Format format,
+ gfx::GpuMemoryBuffer::Usage usage);
// Destroys GPU memory buffer identified by |id|.
void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id);
diff --git a/ui/ozone/platform/caca/caca_window.h b/ui/ozone/platform/caca/caca_window.h
index 444f3d5..5310a93 100644
--- a/ui/ozone/platform/caca/caca_window.h
+++ b/ui/ozone/platform/caca/caca_window.h
@@ -47,23 +47,23 @@
caca_display_t* display() const { return display_.get(); }
// PlatformWindow:
- virtual gfx::Rect GetBounds() OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void ToggleFullscreen() OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetCursor(PlatformCursor cursor) OVERRIDE;
- virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
+ virtual gfx::Rect GetBounds() override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual void Close() override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void ToggleFullscreen() override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual void Restore() override;
+ virtual void SetCursor(PlatformCursor cursor) override;
+ virtual void MoveCursorTo(const gfx::Point& location) override;
// PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override;
private:
// Event polling.
diff --git a/ui/ozone/platform/caca/caca_window_manager.cc b/ui/ozone/platform/caca/caca_window_manager.cc
index 9dbbc6b..247ba28 100644
--- a/ui/ozone/platform/caca/caca_window_manager.cc
+++ b/ui/ozone/platform/caca/caca_window_manager.cc
@@ -26,10 +26,10 @@
bool Initialize();
// ui::SurfaceOzoneCanvas overrides:
- virtual skia::RefPtr<SkCanvas> GetCanvas() OVERRIDE;
- virtual void ResizeCanvas(const gfx::Size& viewport_size) OVERRIDE;
- virtual void PresentCanvas(const gfx::Rect& damage) OVERRIDE;
- virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE;
+ virtual skia::RefPtr<SkCanvas> GetCanvas() override;
+ virtual void ResizeCanvas(const gfx::Size& viewport_size) override;
+ virtual void PresentCanvas(const gfx::Rect& damage) override;
+ virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
private:
CacaWindow* window_; // Not owned.
diff --git a/ui/ozone/platform/caca/caca_window_manager.h b/ui/ozone/platform/caca/caca_window_manager.h
index e01cf55..de1d5ae 100644
--- a/ui/ozone/platform/caca/caca_window_manager.h
+++ b/ui/ozone/platform/caca/caca_window_manager.h
@@ -31,9 +31,9 @@
// ui::SurfaceFactoryOzone overrides:
virtual bool LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
- SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE;
+ SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
virtual scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
- gfx::AcceleratedWidget widget) OVERRIDE;
+ gfx::AcceleratedWidget widget) override;
private:
IDMap<CacaWindow> windows_;
diff --git a/ui/ozone/platform/caca/ozone_platform_caca.cc b/ui/ozone/platform/caca/ozone_platform_caca.cc
index d892a63..a34f014 100644
--- a/ui/ozone/platform/caca/ozone_platform_caca.cc
+++ b/ui/ozone/platform/caca/ozone_platform_caca.cc
@@ -21,21 +21,21 @@
virtual ~OzonePlatformCaca() {}
// OzonePlatform:
- virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
+ virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
return window_manager_.get();
}
- virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ virtual CursorFactoryOzone* GetCursorFactoryOzone() override {
return cursor_factory_ozone_.get();
}
- virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE {
+ virtual GpuPlatformSupport* GetGpuPlatformSupport() override {
return NULL; // no GPU support
}
- virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
+ virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
return NULL; // no GPU support
}
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
- const gfx::Rect& bounds) OVERRIDE {
+ const gfx::Rect& bounds) override {
scoped_ptr<CacaWindow> caca_window(new CacaWindow(
delegate, window_manager_.get(), event_source_.get(), bounds));
if (!caca_window->Initialize())
@@ -43,17 +43,17 @@
return caca_window.PassAs<PlatformWindow>();
}
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
- OVERRIDE {
+ override {
return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
}
- virtual void InitializeUI() OVERRIDE {
+ virtual void InitializeUI() override {
window_manager_.reset(new CacaWindowManager);
event_source_.reset(new CacaEventSource());
cursor_factory_ozone_.reset(new CursorFactoryOzone());
}
- virtual void InitializeGPU() OVERRIDE {}
+ virtual void InitializeGPU() override {}
private:
scoped_ptr<CacaWindowManager> window_manager_;
diff --git a/ui/ozone/platform/dri/display_snapshot_dri.cc b/ui/ozone/platform/dri/display_snapshot_dri.cc
index fa7b6f9..0d0c559 100644
--- a/ui/ozone/platform/dri/display_snapshot_dri.cc
+++ b/ui/ozone/platform/dri/display_snapshot_dri.cc
@@ -43,11 +43,16 @@
bool IsAspectPreserving(DriWrapper* drm, drmModeConnector* connector) {
ScopedDrmPropertyPtr property(drm->GetProperty(connector, "scaling mode"));
- if (property) {
- for (int j = 0; j < property->count_enums; ++j) {
- if (property->enums[j].value ==
- connector->prop_values[property->prop_id] &&
- strcmp(property->enums[j].name, "Full aspect") == 0)
+ if (!property)
+ return false;
+
+ for (int props_i = 0; props_i < connector->count_props; ++props_i) {
+ if (connector->props[props_i] != property->prop_id)
+ continue;
+
+ for (int enums_i = 0; enums_i < property->count_enums; ++enums_i) {
+ if (property->enums[enums_i].value == connector->prop_values[props_i] &&
+ strcmp(property->enums[enums_i].name, "Full aspect") == 0)
return true;
}
}
diff --git a/ui/ozone/platform/dri/display_snapshot_dri.h b/ui/ozone/platform/dri/display_snapshot_dri.h
index a509be4..5c13188 100644
--- a/ui/ozone/platform/dri/display_snapshot_dri.h
+++ b/ui/ozone/platform/dri/display_snapshot_dri.h
@@ -27,7 +27,7 @@
drmModePropertyRes* dpms_property() const { return dpms_property_.get(); }
// DisplaySnapshot overrides:
- virtual std::string ToString() const OVERRIDE;
+ virtual std::string ToString() const override;
private:
uint32_t connector_;
diff --git a/ui/ozone/platform/dri/dri_buffer.h b/ui/ozone/platform/dri/dri_buffer.h
index 9b645ae..773860f 100644
--- a/ui/ozone/platform/dri/dri_buffer.h
+++ b/ui/ozone/platform/dri/dri_buffer.h
@@ -28,9 +28,9 @@
SkCanvas* GetCanvas() const;
// ScanoutBuffer:
- virtual uint32_t GetFramebufferId() const OVERRIDE;
- virtual uint32_t GetHandle() const OVERRIDE;
- virtual gfx::Size GetSize() const OVERRIDE;
+ virtual uint32_t GetFramebufferId() const override;
+ virtual uint32_t GetHandle() const override;
+ virtual gfx::Size GetSize() const override;
protected:
virtual ~DriBuffer();
@@ -59,7 +59,7 @@
virtual ~DriBufferGenerator();
// ScanoutBufferGenerator:
- virtual scoped_refptr<ScanoutBuffer> Create(const gfx::Size& size) OVERRIDE;
+ virtual scoped_refptr<ScanoutBuffer> Create(const gfx::Size& size) override;
private:
DriWrapper* dri_; // Not owned.
diff --git a/ui/ozone/platform/dri/dri_cursor.h b/ui/ozone/platform/dri/dri_cursor.h
index 949584c..f13abef 100644
--- a/ui/ozone/platform/dri/dri_cursor.h
+++ b/ui/ozone/platform/dri/dri_cursor.h
@@ -35,10 +35,10 @@
// CursorDelegateEvdev:
virtual void MoveCursorTo(gfx::AcceleratedWidget widget,
- const gfx::PointF& location) OVERRIDE;
- virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE;
- virtual bool IsCursorVisible() OVERRIDE;
- virtual gfx::PointF location() OVERRIDE;
+ const gfx::PointF& location) override;
+ virtual void MoveCursor(const gfx::Vector2dF& delta) override;
+ virtual bool IsCursorVisible() override;
+ virtual gfx::PointF location() override;
private:
// The location of the bitmap (the cursor location is the hotspot location).
diff --git a/ui/ozone/platform/dri/dri_gpu_platform_support.h b/ui/ozone/platform/dri/dri_gpu_platform_support.h
index 65a8ee5..259edb7 100644
--- a/ui/ozone/platform/dri/dri_gpu_platform_support.h
+++ b/ui/ozone/platform/dri/dri_gpu_platform_support.h
@@ -40,10 +40,10 @@
void AddHandler(scoped_ptr<GpuPlatformSupport> handler);
// GpuPlatformSupport:
- virtual void OnChannelEstablished(IPC::Sender* sender) OVERRIDE;
+ virtual void OnChannelEstablished(IPC::Sender* sender) override;
// IPC::Listener:
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) override;
private:
void OnCreateWindowDelegate(gfx::AcceleratedWidget widget);
diff --git a/ui/ozone/platform/dri/dri_gpu_platform_support_host.h b/ui/ozone/platform/dri/dri_gpu_platform_support_host.h
index 0315b54..61d35f0 100644
--- a/ui/ozone/platform/dri/dri_gpu_platform_support_host.h
+++ b/ui/ozone/platform/dri/dri_gpu_platform_support_host.h
@@ -39,22 +39,22 @@
void RemoveChannelObserver(ChannelObserver* observer);
// GpuPlatformSupportHost:
- virtual void OnChannelEstablished(int host_id, IPC::Sender* sender) OVERRIDE;
- virtual void OnChannelDestroyed(int host_id) OVERRIDE;
+ virtual void OnChannelEstablished(int host_id, IPC::Sender* sender) override;
+ virtual void OnChannelDestroyed(int host_id) override;
// IPC::Listener:
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) override;
// IPC::Sender:
- virtual bool Send(IPC::Message* message) OVERRIDE;
+ virtual bool Send(IPC::Message* message) override;
// HardwareCursorDelegate:
virtual void SetHardwareCursor(gfx::AcceleratedWidget widget,
const std::vector<SkBitmap>& bitmaps,
const gfx::Point& location,
- int frame_delay_ms) OVERRIDE;
+ int frame_delay_ms) override;
virtual void MoveHardwareCursor(gfx::AcceleratedWidget widget,
- const gfx::Point& location) OVERRIDE;
+ const gfx::Point& location) override;
private:
int host_id_;
diff --git a/ui/ozone/platform/dri/dri_surface.h b/ui/ozone/platform/dri/dri_surface.h
index 740a310..d3b7807 100644
--- a/ui/ozone/platform/dri/dri_surface.h
+++ b/ui/ozone/platform/dri/dri_surface.h
@@ -27,10 +27,10 @@
virtual ~DriSurface();
// SurfaceOzoneCanvas:
- virtual skia::RefPtr<SkCanvas> GetCanvas() OVERRIDE;
- virtual void ResizeCanvas(const gfx::Size& viewport_size) OVERRIDE;
- virtual void PresentCanvas(const gfx::Rect& damage) OVERRIDE;
- virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE;
+ virtual skia::RefPtr<SkCanvas> GetCanvas() override;
+ virtual void ResizeCanvas(const gfx::Size& viewport_size) override;
+ virtual void PresentCanvas(const gfx::Rect& damage) override;
+ virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
private:
void UpdateNativeSurface(const gfx::Rect& damage);
diff --git a/ui/ozone/platform/dri/dri_surface_factory.h b/ui/ozone/platform/dri/dri_surface_factory.h
index c51847e..d05ad5f 100644
--- a/ui/ozone/platform/dri/dri_surface_factory.h
+++ b/ui/ozone/platform/dri/dri_surface_factory.h
@@ -50,18 +50,18 @@
// SurfaceFactoryOzone:
virtual scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
- gfx::AcceleratedWidget widget) OVERRIDE;
+ gfx::AcceleratedWidget widget) override;
virtual bool LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
- SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE;
+ SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
// HardwareCursorDelegate:
virtual void SetHardwareCursor(gfx::AcceleratedWidget widget,
const std::vector<SkBitmap>& bitmaps,
const gfx::Point& location,
- int frame_delay_ms) OVERRIDE;
+ int frame_delay_ms) override;
virtual void MoveHardwareCursor(gfx::AcceleratedWidget window,
- const gfx::Point& location) OVERRIDE;
+ const gfx::Point& location) override;
protected:
// Draw the last set cursor & update the cursor plane.
diff --git a/ui/ozone/platform/dri/dri_surface_factory_unittest.cc b/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
index 1fbaf31..6a124c6 100644
--- a/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
+++ b/ui/ozone/platform/dri/dri_surface_factory_unittest.cc
@@ -40,7 +40,7 @@
// Normally we'd use DRM to figure out the controller configuration. But we
// can't use DRM in unit tests, so we just create a fake configuration.
- virtual void ForceInitializationOfPrimaryDisplay() OVERRIDE {
+ virtual void ForceInitializationOfPrimaryDisplay() override {
ConfigureDisplayController(
kDefaultCrtc, kDefaultConnector, gfx::Point(), kDefaultMode);
}
@@ -57,8 +57,8 @@
public:
DriSurfaceFactoryTest() {}
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
protected:
scoped_ptr<base::MessageLoop> message_loop_;
scoped_ptr<ui::MockDriWrapper> dri_;
diff --git a/ui/ozone/platform/dri/dri_surface_unittest.cc b/ui/ozone/platform/dri/dri_surface_unittest.cc
index 427911e..108e600 100644
--- a/ui/ozone/platform/dri/dri_surface_unittest.cc
+++ b/ui/ozone/platform/dri/dri_surface_unittest.cc
@@ -37,13 +37,13 @@
virtual ~MockDriWindowDelegate() {}
// DriWindowDelegate:
- virtual void Initialize() OVERRIDE {}
- virtual void Shutdown() OVERRIDE {}
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE { return 1; }
- virtual ui::HardwareDisplayController* GetController() OVERRIDE {
+ virtual void Initialize() override {}
+ virtual void Shutdown() override {}
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override { return 1; }
+ virtual ui::HardwareDisplayController* GetController() override {
return controller_.get();
}
- virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE {}
+ virtual void OnBoundsChanged(const gfx::Rect& bounds) override {}
private:
scoped_ptr<ui::HardwareDisplayController> controller_;
@@ -57,8 +57,8 @@
public:
DriSurfaceTest() {}
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
protected:
scoped_ptr<base::MessageLoop> message_loop_;
diff --git a/ui/ozone/platform/dri/dri_vsync_provider.h b/ui/ozone/platform/dri/dri_vsync_provider.h
index c90aa80..05668f2 100644
--- a/ui/ozone/platform/dri/dri_vsync_provider.h
+++ b/ui/ozone/platform/dri/dri_vsync_provider.h
@@ -16,7 +16,7 @@
DriVSyncProvider(DriWindowDelegate* window_delegate);
virtual ~DriVSyncProvider();
- virtual void GetVSyncParameters(const UpdateVSyncCallback& callback) OVERRIDE;
+ virtual void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
private:
DriWindowDelegate* window_delegate_; // Not owned.
diff --git a/ui/ozone/platform/dri/dri_window.h b/ui/ozone/platform/dri/dri_window.h
index 825c6a0..9197ce0 100644
--- a/ui/ozone/platform/dri/dri_window.h
+++ b/ui/ozone/platform/dri/dri_window.h
@@ -33,27 +33,27 @@
void Initialize();
// PlatformWindow:
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Rect GetBounds() OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void ToggleFullscreen() OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetCursor(PlatformCursor cursor) OVERRIDE;
- virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual void Close() override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Rect GetBounds() override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void ToggleFullscreen() override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual void Restore() override;
+ virtual void SetCursor(PlatformCursor cursor) override;
+ virtual void MoveCursorTo(const gfx::Point& location) override;
// PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override;
// ChannelObserver:
- virtual void OnChannelEstablished() OVERRIDE;
- virtual void OnChannelDestroyed() OVERRIDE;
+ virtual void OnChannelEstablished() override;
+ virtual void OnChannelDestroyed() override;
private:
PlatformWindowDelegate* delegate_; // Not owned.
diff --git a/ui/ozone/platform/dri/dri_window_delegate_impl.h b/ui/ozone/platform/dri/dri_window_delegate_impl.h
index 336b05d..0345beb 100644
--- a/ui/ozone/platform/dri/dri_window_delegate_impl.h
+++ b/ui/ozone/platform/dri/dri_window_delegate_impl.h
@@ -25,11 +25,11 @@
virtual ~DriWindowDelegateImpl();
// DriWindowDelegate:
- virtual void Initialize() OVERRIDE;
- virtual void Shutdown() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual HardwareDisplayController* GetController() OVERRIDE;
- virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE;
+ virtual void Initialize() override;
+ virtual void Shutdown() override;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override;
+ virtual HardwareDisplayController* GetController() override;
+ virtual void OnBoundsChanged(const gfx::Rect& bounds) override;
private:
gfx::AcceleratedWidget widget_;
diff --git a/ui/ozone/platform/dri/gbm_buffer.h b/ui/ozone/platform/dri/gbm_buffer.h
index b455db3..3451510 100644
--- a/ui/ozone/platform/dri/gbm_buffer.h
+++ b/ui/ozone/platform/dri/gbm_buffer.h
@@ -40,8 +40,8 @@
GbmPixmap(scoped_refptr<GbmBuffer> buffer);
// NativePixmap:
- virtual void* GetEGLClientBuffer() OVERRIDE;
- virtual int GetDmaBufFd() OVERRIDE;
+ virtual void* GetEGLClientBuffer() override;
+ virtual int GetDmaBufFd() override;
scoped_refptr<GbmBuffer> buffer() { return buffer_; }
diff --git a/ui/ozone/platform/dri/gbm_buffer_base.h b/ui/ozone/platform/dri/gbm_buffer_base.h
index b536694..58ce159 100644
--- a/ui/ozone/platform/dri/gbm_buffer_base.h
+++ b/ui/ozone/platform/dri/gbm_buffer_base.h
@@ -22,9 +22,9 @@
gbm_bo* bo() const { return bo_; }
// ScanoutBuffer:
- virtual uint32_t GetFramebufferId() const OVERRIDE;
- virtual uint32_t GetHandle() const OVERRIDE;
- virtual gfx::Size GetSize() const OVERRIDE;
+ virtual uint32_t GetFramebufferId() const override;
+ virtual uint32_t GetHandle() const override;
+ virtual gfx::Size GetSize() const override;
protected:
GbmBufferBase(DriWrapper* dri, gbm_bo* bo, bool scanout);
diff --git a/ui/ozone/platform/dri/gbm_surface.h b/ui/ozone/platform/dri/gbm_surface.h
index be52c9c..ed54b31 100644
--- a/ui/ozone/platform/dri/gbm_surface.h
+++ b/ui/ozone/platform/dri/gbm_surface.h
@@ -34,9 +34,9 @@
bool Initialize();
// GbmSurfaceless:
- virtual intptr_t GetNativeWindow() OVERRIDE;
- virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) OVERRIDE;
- virtual bool OnSwapBuffers() OVERRIDE;
+ virtual intptr_t GetNativeWindow() override;
+ virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) override;
+ virtual bool OnSwapBuffers() override;
private:
gbm_device* gbm_device_;
diff --git a/ui/ozone/platform/dri/gbm_surface_factory.cc b/ui/ozone/platform/dri/gbm_surface_factory.cc
index a31fcee..59f6a4c 100644
--- a/ui/ozone/platform/dri/gbm_surface_factory.cc
+++ b/ui/ozone/platform/dri/gbm_surface_factory.cc
@@ -29,7 +29,7 @@
virtual ~SingleOverlay() {}
virtual void CheckOverlaySupport(
- OverlaySurfaceCandidateList* candidates) OVERRIDE {
+ OverlaySurfaceCandidateList* candidates) override {
if (candidates->size() == 2) {
OverlayCandidatesOzone::OverlaySurfaceCandidate* first =
&(*candidates)[0];
diff --git a/ui/ozone/platform/dri/gbm_surface_factory.h b/ui/ozone/platform/dri/gbm_surface_factory.h
index 2118db2..786f77d 100644
--- a/ui/ozone/platform/dri/gbm_surface_factory.h
+++ b/ui/ozone/platform/dri/gbm_surface_factory.h
@@ -25,28 +25,28 @@
DriWindowDelegateManager* window_manager);
// DriSurfaceFactory:
- virtual intptr_t GetNativeDisplay() OVERRIDE;
+ virtual intptr_t GetNativeDisplay() override;
virtual const int32_t* GetEGLSurfaceProperties(
- const int32_t* desired_list) OVERRIDE;
+ const int32_t* desired_list) override;
virtual bool LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
- SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE;
+ SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
virtual scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget(
- gfx::AcceleratedWidget w) OVERRIDE;
+ gfx::AcceleratedWidget w) override;
virtual scoped_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget(
- gfx::AcceleratedWidget widget) OVERRIDE;
+ gfx::AcceleratedWidget widget) override;
virtual scoped_refptr<ui::NativePixmap> CreateNativePixmap(
gfx::Size size,
- BufferFormat format) OVERRIDE;
+ BufferFormat format) override;
virtual OverlayCandidatesOzone* GetOverlayCandidates(
- gfx::AcceleratedWidget w) OVERRIDE;
+ gfx::AcceleratedWidget w) override;
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int plane_z_order,
gfx::OverlayTransform plane_transform,
scoped_refptr<NativePixmap> buffer,
const gfx::Rect& display_bounds,
- const gfx::RectF& crop_rect) OVERRIDE;
- virtual bool CanShowPrimaryPlaneAsOverlay() OVERRIDE;
+ const gfx::RectF& crop_rect) override;
+ virtual bool CanShowPrimaryPlaneAsOverlay() override;
private:
DriWindowDelegate* GetOrCreateWindowDelegate(gfx::AcceleratedWidget widget);
diff --git a/ui/ozone/platform/dri/gbm_surfaceless.h b/ui/ozone/platform/dri/gbm_surfaceless.h
index 4e3b92b..d30b7a4 100644
--- a/ui/ozone/platform/dri/gbm_surfaceless.h
+++ b/ui/ozone/platform/dri/gbm_surfaceless.h
@@ -25,10 +25,10 @@
virtual ~GbmSurfaceless();
// SurfaceOzoneEGL:
- virtual intptr_t GetNativeWindow() OVERRIDE;
- virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) OVERRIDE;
- virtual bool OnSwapBuffers() OVERRIDE;
- virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE;
+ virtual intptr_t GetNativeWindow() override;
+ virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) override;
+ virtual bool OnSwapBuffers() override;
+ virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
protected:
DriWindowDelegate* window_delegate_;
diff --git a/ui/ozone/platform/dri/hardware_display_controller.cc b/ui/ozone/platform/dri/hardware_display_controller.cc
index 716ec38..ee4e4a9 100644
--- a/ui/ozone/platform/dri/hardware_display_controller.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller.cc
@@ -119,7 +119,10 @@
bool has_pending_page_flips = false;
// Wait for the page-flips to complete.
for (size_t i = 0; i < crtc_controllers_.size(); ++i) {
- if (crtc_controllers_[i]->page_flip_pending()) {
+ // In mirror mode the page flip callbacks can happen in different order than
+ // scheduled, so we need to make sure that the event for the current CRTC is
+ // processed before moving to the next CRTC.
+ while (crtc_controllers_[i]->page_flip_pending()) {
has_pending_page_flips = true;
crtc_controllers_[i]->drm()->HandleEvent(drm_event);
}
diff --git a/ui/ozone/platform/dri/hardware_display_controller_unittest.cc b/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
index bde4d5a..ded4cfe 100644
--- a/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
@@ -30,9 +30,9 @@
MockScanoutBuffer(const gfx::Size& size) : size_(size) {}
// ScanoutBuffer:
- virtual uint32_t GetFramebufferId() const OVERRIDE {return 0; }
- virtual uint32_t GetHandle() const OVERRIDE { return 0; }
- virtual gfx::Size GetSize() const OVERRIDE { return size_; }
+ virtual uint32_t GetFramebufferId() const override {return 0; }
+ virtual uint32_t GetHandle() const override { return 0; }
+ virtual gfx::Size GetSize() const override { return size_; }
private:
virtual ~MockScanoutBuffer() {}
@@ -49,8 +49,8 @@
HardwareDisplayControllerTest() {}
virtual ~HardwareDisplayControllerTest() {}
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
protected:
scoped_ptr<ui::HardwareDisplayController> controller_;
scoped_ptr<ui::MockDriWrapper> drm_;
@@ -182,4 +182,38 @@
controller_->QueueOverlayPlane(plane2);
EXPECT_TRUE(controller_->SchedulePageFlip());
EXPECT_EQ(2, drm_->get_page_flip_call_count());
+
+ controller_->WaitForPageFlipEvent();
+ EXPECT_EQ(2, drm_->get_handle_events_count());
+}
+
+TEST_F(HardwareDisplayControllerTest,
+ PageflipMirroredControllersWithInvertedCrtcOrder) {
+ scoped_ptr<ui::CrtcController> crtc1(
+ new ui::CrtcController(drm_.get(), kPrimaryCrtc, kPrimaryConnector));
+ scoped_ptr<ui::CrtcController> crtc2(
+ new ui::CrtcController(drm_.get(), kSecondaryCrtc, kSecondaryConnector));
+
+ // Make sure that if the order is reversed everything is still fine.
+ std::queue<ui::CrtcController*> crtc_queue;
+ crtc_queue.push(crtc2.get());
+ crtc_queue.push(crtc1.get());
+
+ controller_.reset(new ui::HardwareDisplayController(crtc1.Pass()));
+ controller_->AddCrtc(crtc2.Pass());
+
+ ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
+ new MockScanoutBuffer(kDefaultModeSize)));
+ EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode));
+ EXPECT_EQ(2, drm_->get_set_crtc_call_count());
+
+ ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>(
+ new MockScanoutBuffer(kDefaultModeSize)));
+ controller_->QueueOverlayPlane(plane2);
+ EXPECT_TRUE(controller_->SchedulePageFlip());
+ EXPECT_EQ(2, drm_->get_page_flip_call_count());
+
+ drm_->set_controllers(crtc_queue);
+ controller_->WaitForPageFlipEvent();
+ EXPECT_EQ(2, drm_->get_handle_events_count());
}
diff --git a/ui/ozone/platform/dri/native_display_delegate_dri.h b/ui/ozone/platform/dri/native_display_delegate_dri.h
index 70abb7b..fc20054 100644
--- a/ui/ozone/platform/dri/native_display_delegate_dri.h
+++ b/ui/ozone/platform/dri/native_display_delegate_dri.h
@@ -33,34 +33,34 @@
float refresh_rate);
// NativeDisplayDelegate overrides:
- virtual void Initialize() OVERRIDE;
- virtual void GrabServer() OVERRIDE;
- virtual void UngrabServer() OVERRIDE;
- virtual void SyncWithServer() OVERRIDE;
- virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE;
- virtual void ForceDPMSOn() OVERRIDE;
- virtual std::vector<DisplaySnapshot*> GetDisplays() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void GrabServer() override;
+ virtual void UngrabServer() override;
+ virtual void SyncWithServer() override;
+ virtual void SetBackgroundColor(uint32_t color_argb) override;
+ virtual void ForceDPMSOn() override;
+ virtual std::vector<DisplaySnapshot*> GetDisplays() override;
virtual void AddMode(const DisplaySnapshot& output,
- const DisplayMode* mode) OVERRIDE;
+ const DisplayMode* mode) override;
virtual bool Configure(const DisplaySnapshot& output,
const DisplayMode* mode,
- const gfx::Point& origin) OVERRIDE;
- virtual void CreateFrameBuffer(const gfx::Size& size) OVERRIDE;
+ const gfx::Point& origin) override;
+ virtual void CreateFrameBuffer(const gfx::Size& size) override;
virtual bool GetHDCPState(const DisplaySnapshot& output,
- HDCPState* state) OVERRIDE;
+ HDCPState* state) override;
virtual bool SetHDCPState(const DisplaySnapshot& output,
- HDCPState state) OVERRIDE;
+ HDCPState state) override;
virtual std::vector<ui::ColorCalibrationProfile>
GetAvailableColorCalibrationProfiles(
- const ui::DisplaySnapshot& output) OVERRIDE;
+ const ui::DisplaySnapshot& output) override;
virtual bool SetColorCalibrationProfile(
const ui::DisplaySnapshot& output,
- ui::ColorCalibrationProfile new_profile) OVERRIDE;
- virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE;
- virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE;
+ ui::ColorCalibrationProfile new_profile) override;
+ virtual void AddObserver(NativeDisplayObserver* observer) override;
+ virtual void RemoveObserver(NativeDisplayObserver* observer) override;
// DeviceEventObserver overrides:
- virtual void OnDeviceEvent(const DeviceEvent& event) OVERRIDE;
+ virtual void OnDeviceEvent(const DeviceEvent& event) override;
private:
// Notify ScreenManager of all the displays that were present before the
diff --git a/ui/ozone/platform/dri/native_display_delegate_proxy.h b/ui/ozone/platform/dri/native_display_delegate_proxy.h
index 098c514..2dcf0e1 100644
--- a/ui/ozone/platform/dri/native_display_delegate_proxy.h
+++ b/ui/ozone/platform/dri/native_display_delegate_proxy.h
@@ -28,41 +28,41 @@
virtual ~NativeDisplayDelegateProxy();
// NativeDisplayDelegate overrides:
- virtual void Initialize() OVERRIDE;
- virtual void GrabServer() OVERRIDE;
- virtual void UngrabServer() OVERRIDE;
- virtual void SyncWithServer() OVERRIDE;
- virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE;
- virtual void ForceDPMSOn() OVERRIDE;
- virtual std::vector<DisplaySnapshot*> GetDisplays() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void GrabServer() override;
+ virtual void UngrabServer() override;
+ virtual void SyncWithServer() override;
+ virtual void SetBackgroundColor(uint32_t color_argb) override;
+ virtual void ForceDPMSOn() override;
+ virtual std::vector<DisplaySnapshot*> GetDisplays() override;
virtual void AddMode(const DisplaySnapshot& output,
- const DisplayMode* mode) OVERRIDE;
+ const DisplayMode* mode) override;
virtual bool Configure(const DisplaySnapshot& output,
const DisplayMode* mode,
- const gfx::Point& origin) OVERRIDE;
- virtual void CreateFrameBuffer(const gfx::Size& size) OVERRIDE;
+ const gfx::Point& origin) override;
+ virtual void CreateFrameBuffer(const gfx::Size& size) override;
virtual bool GetHDCPState(const DisplaySnapshot& output,
- HDCPState* state) OVERRIDE;
+ HDCPState* state) override;
virtual bool SetHDCPState(const DisplaySnapshot& output,
- HDCPState state) OVERRIDE;
+ HDCPState state) override;
virtual std::vector<ColorCalibrationProfile>
GetAvailableColorCalibrationProfiles(
- const DisplaySnapshot& output) OVERRIDE;
+ const DisplaySnapshot& output) override;
virtual bool SetColorCalibrationProfile(
const DisplaySnapshot& output,
- ColorCalibrationProfile new_profile) OVERRIDE;
- virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE;
- virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE;
+ ColorCalibrationProfile new_profile) override;
+ virtual void AddObserver(NativeDisplayObserver* observer) override;
+ virtual void RemoveObserver(NativeDisplayObserver* observer) override;
// DeviceEventObserver overrides:
- virtual void OnDeviceEvent(const DeviceEvent& event) OVERRIDE;
+ virtual void OnDeviceEvent(const DeviceEvent& event) override;
// GpuPlatformSupportHost:
- virtual void OnChannelEstablished(int host_id, IPC::Sender* sender) OVERRIDE;
- virtual void OnChannelDestroyed(int host_id) OVERRIDE;
+ virtual void OnChannelEstablished(int host_id, IPC::Sender* sender) override;
+ virtual void OnChannelDestroyed(int host_id) override;
// IPC::Listener overrides:
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) override;
private:
void OnUpdateNativeDisplays(
diff --git a/ui/ozone/platform/dri/ozone_platform_dri.cc b/ui/ozone/platform/dri/ozone_platform_dri.cc
index f4f0914..88d6207 100644
--- a/ui/ozone/platform/dri/ozone_platform_dri.cc
+++ b/ui/ozone/platform/dri/ozone_platform_dri.cc
@@ -50,21 +50,21 @@
virtual ~OzonePlatformDri() {}
// OzonePlatform:
- virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
+ virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
return surface_factory_ozone_.get();
}
- virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ virtual CursorFactoryOzone* GetCursorFactoryOzone() override {
return cursor_factory_ozone_.get();
}
- virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE {
+ virtual GpuPlatformSupport* GetGpuPlatformSupport() override {
return gpu_platform_support_.get();
}
- virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
+ virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
return gpu_platform_support_host_.get();
}
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
- const gfx::Rect& bounds) OVERRIDE {
+ const gfx::Rect& bounds) override {
scoped_ptr<DriWindow> platform_window(
new DriWindow(delegate,
bounds,
@@ -75,11 +75,11 @@
return platform_window.PassAs<PlatformWindow>();
}
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
- OVERRIDE {
+ override {
return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri(
dri_.get(), screen_manager_.get(), device_manager_.get()));
}
- virtual void InitializeUI() OVERRIDE {
+ virtual void InitializeUI() override {
dri_->Initialize();
surface_factory_ozone_.reset(new DriSurfaceFactory(
dri_.get(), screen_manager_.get(), &window_delegate_manager_));
@@ -101,7 +101,7 @@
LOG(FATAL) << "Failed to initialize dummy channel.";
}
- virtual void InitializeGPU() OVERRIDE {}
+ virtual void InitializeGPU() override {}
private:
scoped_ptr<VirtualTerminalManager> vt_manager_;
diff --git a/ui/ozone/platform/dri/ozone_platform_gbm.cc b/ui/ozone/platform/dri/ozone_platform_gbm.cc
index e8f0bef..737689c 100644
--- a/ui/ozone/platform/dri/ozone_platform_gbm.cc
+++ b/ui/ozone/platform/dri/ozone_platform_gbm.cc
@@ -57,7 +57,7 @@
gbm_device* device() const { return device_; }
- virtual scoped_refptr<ScanoutBuffer> Create(const gfx::Size& size) OVERRIDE {
+ virtual scoped_refptr<ScanoutBuffer> Create(const gfx::Size& size) override {
return GbmBuffer::CreateBuffer(
dri_, device_, SurfaceFactoryOzone::RGBA_8888, size, true);
}
@@ -82,21 +82,21 @@
virtual ~OzonePlatformGbm() {}
// OzonePlatform:
- virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
+ virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
return surface_factory_ozone_.get();
}
- virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ virtual CursorFactoryOzone* GetCursorFactoryOzone() override {
return cursor_factory_ozone_.get();
}
- virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE {
+ virtual GpuPlatformSupport* GetGpuPlatformSupport() override {
return gpu_platform_support_.get();
}
- virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
+ virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
return gpu_platform_support_host_.get();
}
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
- const gfx::Rect& bounds) OVERRIDE {
+ const gfx::Rect& bounds) override {
scoped_ptr<DriWindow> platform_window(
new DriWindow(delegate,
bounds,
@@ -107,11 +107,11 @@
return platform_window.PassAs<PlatformWindow>();
}
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
- OVERRIDE {
+ override {
return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateProxy(
gpu_platform_support_host_.get(), device_manager_.get()));
}
- virtual void InitializeUI() OVERRIDE {
+ virtual void InitializeUI() override {
vt_manager_.reset(new VirtualTerminalManager());
// Needed since the browser process creates the accelerated widgets and that
// happens through SFO.
@@ -125,7 +125,7 @@
device_manager_.get()));
}
- virtual void InitializeGPU() OVERRIDE {
+ virtual void InitializeGPU() override {
dri_.reset(new DriWrapper(kDefaultGraphicsCardPath));
dri_->Initialize();
buffer_generator_.reset(new GbmBufferGenerator(dri_.get()));
diff --git a/ui/ozone/platform/dri/screen_manager_unittest.cc b/ui/ozone/platform/dri/screen_manager_unittest.cc
index 843553f..1ee0006 100644
--- a/ui/ozone/platform/dri/screen_manager_unittest.cc
+++ b/ui/ozone/platform/dri/screen_manager_unittest.cc
@@ -25,7 +25,7 @@
ui::ScanoutBufferGenerator* buffer_generator)
: ScreenManager(dri, buffer_generator), dri_(dri) {}
- virtual void ForceInitializationOfPrimaryDisplay() OVERRIDE {}
+ virtual void ForceInitializationOfPrimaryDisplay() override {}
private:
ui::DriWrapper* dri_;
@@ -50,13 +50,13 @@
kDefaultMode.hdisplay, 0, kDefaultMode.hdisplay, kDefaultMode.vdisplay);
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
dri_.reset(new ui::MockDriWrapper(3));
buffer_generator_.reset(new ui::DriBufferGenerator(dri_.get()));
screen_manager_.reset(new MockScreenManager(
dri_.get(), buffer_generator_.get()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
screen_manager_.reset();
dri_.reset();
}
diff --git a/ui/ozone/platform/dri/test/mock_dri_wrapper.cc b/ui/ozone/platform/dri/test/mock_dri_wrapper.cc
index b3f0100..fefddf7 100644
--- a/ui/ozone/platform/dri/test/mock_dri_wrapper.cc
+++ b/ui/ozone/platform/dri/test/mock_dri_wrapper.cc
@@ -30,6 +30,7 @@
remove_framebuffer_call_count_(0),
page_flip_call_count_(0),
overlay_flip_call_count_(0),
+ handle_events_count_(0),
set_crtc_expectation_(true),
add_framebuffer_expectation_(true),
page_flip_expectation_(true),
@@ -132,6 +133,7 @@
CHECK(!controllers_.empty());
controllers_.front()->OnPageFlipEvent(0, 0, 0);
controllers_.pop();
+ handle_events_count_++;
}
bool MockDriWrapper::CreateDumbBuffer(const SkImageInfo& info,
diff --git a/ui/ozone/platform/dri/test/mock_dri_wrapper.h b/ui/ozone/platform/dri/test/mock_dri_wrapper.h
index 3d4517b..a9b68b7 100644
--- a/ui/ozone/platform/dri/test/mock_dri_wrapper.h
+++ b/ui/ozone/platform/dri/test/mock_dri_wrapper.h
@@ -33,6 +33,7 @@
}
int get_page_flip_call_count() const { return page_flip_call_count_; }
int get_overlay_flip_call_count() const { return overlay_flip_call_count_; }
+ int get_handle_events_count() const { return handle_events_count_; }
void fail_init() { fd_ = -1; }
void set_set_crtc_expectation(bool state) { set_crtc_expectation_ = state; }
void set_page_flip_expectation(bool state) { page_flip_expectation_ = state; }
@@ -49,51 +50,56 @@
return buffers_;
}
+ // Overwrite the list of controllers used when serving the PageFlip requests.
+ void set_controllers(const std::queue<CrtcController*>& controllers) {
+ controllers_ = controllers;
+ }
+
// DriWrapper:
- virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id) OVERRIDE;
+ virtual ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id) override;
virtual bool SetCrtc(uint32_t crtc_id,
uint32_t framebuffer,
std::vector<uint32_t> connectors,
- drmModeModeInfo* mode) OVERRIDE;
+ drmModeModeInfo* mode) override;
virtual bool SetCrtc(drmModeCrtc* crtc,
- std::vector<uint32_t> connectors) OVERRIDE;
- virtual ScopedDrmConnectorPtr GetConnector(uint32_t connector_id) OVERRIDE;
+ std::vector<uint32_t> connectors) override;
+ virtual ScopedDrmConnectorPtr GetConnector(uint32_t connector_id) override;
virtual bool AddFramebuffer(uint32_t width,
uint32_t height,
uint8_t depth,
uint8_t bpp,
uint32_t stride,
uint32_t handle,
- uint32_t* framebuffer) OVERRIDE;
- virtual bool RemoveFramebuffer(uint32_t framebuffer) OVERRIDE;
+ uint32_t* framebuffer) override;
+ virtual bool RemoveFramebuffer(uint32_t framebuffer) override;
virtual bool PageFlip(uint32_t crtc_id,
uint32_t framebuffer,
- void* data) OVERRIDE;
+ void* data) override;
virtual bool PageFlipOverlay(uint32_t crtc_id,
uint32_t framebuffer,
const gfx::Rect& location,
const gfx::RectF& source,
- int overlay_plane) OVERRIDE;
+ int overlay_plane) override;
virtual ScopedDrmPropertyPtr GetProperty(drmModeConnector* connector,
- const char* name) OVERRIDE;
+ const char* name) override;
virtual bool SetProperty(uint32_t connector_id,
uint32_t property_id,
- uint64_t value) OVERRIDE;
+ uint64_t value) override;
virtual ScopedDrmPropertyBlobPtr GetPropertyBlob(drmModeConnector* connector,
- const char* name) OVERRIDE;
+ const char* name) override;
virtual bool SetCursor(uint32_t crtc_id,
uint32_t handle,
- const gfx::Size& size) OVERRIDE;
- virtual bool MoveCursor(uint32_t crtc_id, const gfx::Point& point) OVERRIDE;
- virtual void HandleEvent(drmEventContext& event) OVERRIDE;
+ const gfx::Size& size) override;
+ virtual bool MoveCursor(uint32_t crtc_id, const gfx::Point& point) override;
+ virtual void HandleEvent(drmEventContext& event) override;
virtual bool CreateDumbBuffer(const SkImageInfo& info,
uint32_t* handle,
uint32_t* stride,
- void** pixels) OVERRIDE;
+ void** pixels) override;
virtual void DestroyDumbBuffer(const SkImageInfo& info,
uint32_t handle,
uint32_t stride,
- void* pixels) OVERRIDE;
+ void* pixels) override;
private:
int get_crtc_call_count_;
@@ -103,6 +109,7 @@
int remove_framebuffer_call_count_;
int page_flip_call_count_;
int overlay_flip_call_count_;
+ int handle_events_count_;
bool set_crtc_expectation_;
bool add_framebuffer_expectation_;
diff --git a/ui/ozone/platform/egltest/ozone_platform_egltest.cc b/ui/ozone/platform/egltest/ozone_platform_egltest.cc
index 46ee4ef..c192c9f 100644
--- a/ui/ozone/platform/egltest/ozone_platform_egltest.cc
+++ b/ui/ozone/platform/egltest/ozone_platform_egltest.cc
@@ -54,23 +54,23 @@
virtual ~EgltestWindow();
// PlatformWindow:
- virtual gfx::Rect GetBounds() OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void ToggleFullscreen() OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetCursor(PlatformCursor cursor) OVERRIDE;
- virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
+ virtual gfx::Rect GetBounds() override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual void Close() override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void ToggleFullscreen() override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual void Restore() override;
+ virtual void SetCursor(PlatformCursor cursor) override;
+ virtual void MoveCursorTo(const gfx::Point& location) override;
// PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override;
private:
PlatformWindowDelegate* delegate_;
@@ -174,15 +174,15 @@
DCHECK(ret);
}
- virtual intptr_t GetNativeWindow() OVERRIDE { return native_window_; }
+ virtual intptr_t GetNativeWindow() override { return native_window_; }
- virtual bool OnSwapBuffers() OVERRIDE { return true; }
+ virtual bool OnSwapBuffers() override { return true; }
- virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) OVERRIDE {
+ virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) override {
return true;
}
- virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE {
+ virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override {
return scoped_ptr<gfx::VSyncProvider>();
}
@@ -203,14 +203,14 @@
virtual ~SurfaceFactoryEgltest() {}
// SurfaceFactoryOzone:
- virtual intptr_t GetNativeDisplay() OVERRIDE;
+ virtual intptr_t GetNativeDisplay() override;
virtual scoped_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget(
- gfx::AcceleratedWidget widget) OVERRIDE;
+ gfx::AcceleratedWidget widget) override;
virtual const int32* GetEGLSurfaceProperties(
- const int32* desired_list) OVERRIDE;
+ const int32* desired_list) override;
virtual bool LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
- SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE;
+ SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
private:
LibeglplatformShimLoader* eglplatform_shim_;
@@ -317,21 +317,21 @@
}
// OzonePlatform:
- virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
+ virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
return surface_factory_ozone_.get();
}
- virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ virtual CursorFactoryOzone* GetCursorFactoryOzone() override {
return cursor_factory_ozone_.get();
}
- virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE {
+ virtual GpuPlatformSupport* GetGpuPlatformSupport() override {
return gpu_platform_support_.get();
}
- virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
+ virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
return gpu_platform_support_host_.get();
}
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
- const gfx::Rect& bounds) OVERRIDE {
+ const gfx::Rect& bounds) override {
return make_scoped_ptr<PlatformWindow>(
new EgltestWindow(delegate,
&eglplatform_shim_,
@@ -339,11 +339,11 @@
bounds));
}
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
- OVERRIDE {
+ override {
return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
}
- virtual void InitializeUI() OVERRIDE {
+ virtual void InitializeUI() override {
device_manager_ = CreateDeviceManager();
if (!surface_factory_ozone_)
surface_factory_ozone_.reset(
@@ -354,7 +354,7 @@
gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
}
- virtual void InitializeGPU() OVERRIDE {
+ virtual void InitializeGPU() override {
if (!surface_factory_ozone_)
surface_factory_ozone_.reset(
new SurfaceFactoryEgltest(&eglplatform_shim_));
diff --git a/ui/ozone/platform/test/ozone_platform_test.cc b/ui/ozone/platform/test/ozone_platform_test.cc
index 1057291..d657129 100644
--- a/ui/ozone/platform/test/ozone_platform_test.cc
+++ b/ui/ozone/platform/test/ozone_platform_test.cc
@@ -30,30 +30,30 @@
virtual ~OzonePlatformTest() {}
// OzonePlatform:
- virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
+ virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
return window_manager_.get();
}
- virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ virtual CursorFactoryOzone* GetCursorFactoryOzone() override {
return cursor_factory_ozone_.get();
}
- virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE {
+ virtual GpuPlatformSupport* GetGpuPlatformSupport() override {
return gpu_platform_support_.get();
}
- virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
+ virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
return gpu_platform_support_host_.get();
}
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
- const gfx::Rect& bounds) OVERRIDE {
+ const gfx::Rect& bounds) override {
return make_scoped_ptr<PlatformWindow>(
new TestWindow(delegate, window_manager_.get(), bounds));
}
virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
- OVERRIDE {
+ override {
return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
}
- virtual void InitializeUI() OVERRIDE {
+ virtual void InitializeUI() override {
window_manager_.reset(new TestWindowManager(file_path_));
window_manager_->Initialize();
// This unbreaks tests that create their own.
@@ -64,7 +64,7 @@
gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
}
- virtual void InitializeGPU() OVERRIDE {
+ virtual void InitializeGPU() override {
gpu_platform_support_.reset(CreateStubGpuPlatformSupport());
}
diff --git a/ui/ozone/platform/test/test_window.h b/ui/ozone/platform/test/test_window.h
index 13a23a6..37e4ec4 100644
--- a/ui/ozone/platform/test/test_window.h
+++ b/ui/ozone/platform/test/test_window.h
@@ -26,19 +26,19 @@
base::FilePath path();
// PlatformWindow:
- virtual gfx::Rect GetBounds() OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void ToggleFullscreen() OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetCursor(PlatformCursor cursor) OVERRIDE;
- virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
+ virtual gfx::Rect GetBounds() override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual void Close() override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void ToggleFullscreen() override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual void Restore() override;
+ virtual void SetCursor(PlatformCursor cursor) override;
+ virtual void MoveCursorTo(const gfx::Point& location) override;
private:
PlatformWindowDelegate* delegate_;
diff --git a/ui/ozone/platform/test/test_window_manager.cc b/ui/ozone/platform/test/test_window_manager.cc
index 6eb1aef..7ffbad8 100644
--- a/ui/ozone/platform/test/test_window_manager.cc
+++ b/ui/ozone/platform/test/test_window_manager.cc
@@ -35,14 +35,14 @@
virtual ~FileSurface() {}
// SurfaceOzoneCanvas overrides:
- virtual void ResizeCanvas(const gfx::Size& viewport_size) OVERRIDE {
+ virtual void ResizeCanvas(const gfx::Size& viewport_size) override {
surface_ = skia::AdoptRef(SkSurface::NewRaster(SkImageInfo::MakeN32Premul(
viewport_size.width(), viewport_size.height())));
}
- virtual skia::RefPtr<SkCanvas> GetCanvas() OVERRIDE {
+ virtual skia::RefPtr<SkCanvas> GetCanvas() override {
return skia::SharePtr(surface_->getCanvas());
}
- virtual void PresentCanvas(const gfx::Rect& damage) OVERRIDE {
+ virtual void PresentCanvas(const gfx::Rect& damage) override {
if (location_.empty())
return;
SkBitmap bitmap;
@@ -55,7 +55,7 @@
FROM_HERE, base::Bind(&WriteDataToFile, location_, bitmap), true);
}
}
- virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE {
+ virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override {
return scoped_ptr<gfx::VSyncProvider>();
}
diff --git a/ui/ozone/platform/test/test_window_manager.h b/ui/ozone/platform/test/test_window_manager.h
index 8efbb69..0241e8b 100644
--- a/ui/ozone/platform/test/test_window_manager.h
+++ b/ui/ozone/platform/test/test_window_manager.h
@@ -33,10 +33,10 @@
// SurfaceFactoryOzone:
virtual scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
- gfx::AcceleratedWidget w) OVERRIDE;
+ gfx::AcceleratedWidget w) override;
virtual bool LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
- SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE;
+ SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
private:
base::FilePath location_;
diff --git a/ui/ozone/public/gpu_platform_support.cc b/ui/ozone/public/gpu_platform_support.cc
index 2ac2004..f9f1589 100644
--- a/ui/ozone/public/gpu_platform_support.cc
+++ b/ui/ozone/public/gpu_platform_support.cc
@@ -15,8 +15,8 @@
class StubGpuPlatformSupport : public GpuPlatformSupport {
public:
// GpuPlatformSupport:
- virtual void OnChannelEstablished(IPC::Sender* sender) OVERRIDE {}
- virtual bool OnMessageReceived(const IPC::Message&) OVERRIDE { return false; }
+ virtual void OnChannelEstablished(IPC::Sender* sender) override {}
+ virtual bool OnMessageReceived(const IPC::Message&) override { return false; }
};
} // namespace
diff --git a/ui/ozone/public/gpu_platform_support_host.cc b/ui/ozone/public/gpu_platform_support_host.cc
index 1a75efd..a611f50 100644
--- a/ui/ozone/public/gpu_platform_support_host.cc
+++ b/ui/ozone/public/gpu_platform_support_host.cc
@@ -16,10 +16,10 @@
class StubGpuPlatformSupportHost : public GpuPlatformSupportHost {
public:
// GpuPlatformSupportHost:
- virtual void OnChannelEstablished(int host_id, IPC::Sender* sender) OVERRIDE {
+ virtual void OnChannelEstablished(int host_id, IPC::Sender* sender) override {
}
- virtual void OnChannelDestroyed(int host_id) OVERRIDE {}
- virtual bool OnMessageReceived(const IPC::Message&) OVERRIDE { return false; }
+ virtual void OnChannelDestroyed(int host_id) override {}
+ virtual bool OnMessageReceived(const IPC::Message&) override { return false; }
};
} // namespace
diff --git a/ui/ozone/public/ui_thread_gpu.cc b/ui/ozone/public/ui_thread_gpu.cc
index 68b260e..9601759 100644
--- a/ui/ozone/public/ui_thread_gpu.cc
+++ b/ui/ozone/public/ui_thread_gpu.cc
@@ -20,7 +20,7 @@
virtual ~UiThreadGpuForwardingSender() {}
// IPC::Sender:
- virtual bool Send(IPC::Message* msg) OVERRIDE {
+ virtual bool Send(IPC::Message* msg) override {
listener_->OnMessageReceived(*msg);
delete msg;
return true;
diff --git a/ui/ozone/run_all_unittests.cc b/ui/ozone/run_all_unittests.cc
index 3227099..6192740 100644
--- a/ui/ozone/run_all_unittests.cc
+++ b/ui/ozone/run_all_unittests.cc
@@ -15,8 +15,8 @@
protected:
// base::TestSuite:
- virtual void Initialize() OVERRIDE;
- virtual void Shutdown() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void Shutdown() override;
private:
DISALLOW_COPY_AND_ASSIGN(OzoneTestSuite);
diff --git a/ui/platform_window/win/win_window.h b/ui/platform_window/win/win_window.h
index 18fada5..65ffb5a 100644
--- a/ui/platform_window/win/win_window.h
+++ b/ui/platform_window/win/win_window.h
@@ -22,19 +22,19 @@
void Destroy();
// PlatformWindow:
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Rect GetBounds() OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void ToggleFullscreen() OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetCursor(PlatformCursor cursor) OVERRIDE;
- virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual void Close() override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Rect GetBounds() override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void ToggleFullscreen() override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual void Restore() override;
+ virtual void SetCursor(PlatformCursor cursor) override;
+ virtual void MoveCursorTo(const gfx::Point& location) override;
CR_BEGIN_MSG_MAP_EX(WinWindow)
CR_MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange)
diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc
index 07baea6..e3a421c 100644
--- a/ui/platform_window/x11/x11_window.cc
+++ b/ui/platform_window/x11/x11_window.cc
@@ -56,6 +56,7 @@
}
void X11Window::Destroy() {
+ delegate_->OnClosed();
if (xwindow_ == None)
return;
diff --git a/ui/platform_window/x11/x11_window.h b/ui/platform_window/x11/x11_window.h
index 29fd63c..6e1184c 100644
--- a/ui/platform_window/x11/x11_window.h
+++ b/ui/platform_window/x11/x11_window.h
@@ -29,23 +29,23 @@
void ProcessXInput2Event(XEvent* xevent);
// PlatformWindow:
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Rect GetBounds() OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void ToggleFullscreen() OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetCursor(PlatformCursor cursor) OVERRIDE;
- virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual void Close() override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Rect GetBounds() override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void ToggleFullscreen() override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual void Restore() override;
+ virtual void SetCursor(PlatformCursor cursor) override;
+ virtual void MoveCursorTo(const gfx::Point& location) override;
// PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) override;
PlatformWindowDelegate* delegate_;
diff --git a/ui/shell_dialogs/select_file_dialog_android.h b/ui/shell_dialogs/select_file_dialog_android.h
index a9d0d54..90abdbb 100644
--- a/ui/shell_dialogs/select_file_dialog_android.h
+++ b/ui/shell_dialogs/select_file_dialog_android.h
@@ -31,8 +31,8 @@
void OnFileNotSelected(JNIEnv* env, jobject java_object);
// From SelectFileDialog
- virtual bool IsRunning(gfx::NativeWindow) const OVERRIDE;
- virtual void ListenerDestroyed() OVERRIDE;
+ virtual bool IsRunning(gfx::NativeWindow) const override;
+ virtual void ListenerDestroyed() override;
// Called when it is time to display the file picker.
// params is expected to be a vector<string16> with accept_types first and
@@ -45,7 +45,7 @@
int file_type_index,
const std::string& default_extension,
gfx::NativeWindow owning_window,
- void* params) OVERRIDE;
+ void* params) override;
static bool RegisterSelectFileDialog(JNIEnv* env);
@@ -55,7 +55,7 @@
private:
SelectFileDialogImpl(Listener* listener, SelectFilePolicy* policy);
- virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE;
+ virtual bool HasMultipleFileTypeChoicesImpl() override;
base::android::ScopedJavaGlobalRef<jobject> java_object_;
diff --git a/ui/shell_dialogs/select_file_dialog_mac.mm b/ui/shell_dialogs/select_file_dialog_mac.mm
index 3844b06..a0d75e5 100644
--- a/ui/shell_dialogs/select_file_dialog_mac.mm
+++ b/ui/shell_dialogs/select_file_dialog_mac.mm
@@ -64,8 +64,8 @@
ui::SelectFilePolicy* policy);
// BaseShellDialog implementation.
- virtual bool IsRunning(gfx::NativeWindow parent_window) const OVERRIDE;
- virtual void ListenerDestroyed() OVERRIDE;
+ virtual bool IsRunning(gfx::NativeWindow parent_window) const override;
+ virtual void ListenerDestroyed() override;
// Callback from ObjC bridge.
void FileWasSelected(NSSavePanel* dialog,
@@ -75,8 +75,6 @@
const std::vector<base::FilePath>& files,
int index);
- bool ShouldEnableFilename(NSSavePanel* dialog, NSString* filename);
-
protected:
// SelectFileDialog implementation.
// |params| is user data we pass back via the Listener interface.
@@ -88,7 +86,7 @@
int file_type_index,
const base::FilePath::StringType& default_extension,
gfx::NativeWindow owning_window,
- void* params) OVERRIDE;
+ void* params) override;
private:
virtual ~SelectFileDialogImpl();
@@ -97,7 +95,7 @@
NSView* GetAccessoryView(const FileTypeInfo* file_types,
int file_type_index);
- virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE;
+ virtual bool HasMultipleFileTypeChoicesImpl() override;
// The bridge for results from Cocoa to return to us.
base::scoped_nsobject<SelectFileDialogBridge> bridge_;
@@ -159,16 +157,6 @@
}
}
-bool SelectFileDialogImpl::ShouldEnableFilename(NSSavePanel* dialog,
- NSString* filename) {
- // If this is a single/multiple open file dialog, disable selecting packages.
- if (type_map_[dialog] != SELECT_OPEN_FILE &&
- type_map_[dialog] != SELECT_OPEN_MULTI_FILE)
- return true;
-
- return ![[NSWorkspace sharedWorkspace] isFilePackageAtPath:filename];
-}
-
void SelectFileDialogImpl::SelectFileImpl(
Type type,
const base::string16& title,
@@ -427,9 +415,7 @@
}
- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url {
- if (![url isFileURL])
- return NO;
- return selectFileDialogImpl_->ShouldEnableFilename(sender, [url path]);
+ return [url isFileURL];
}
@end
diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/select_file_dialog_win.cc
index 94949e5..6e1a8ab 100644
--- a/ui/shell_dialogs/select_file_dialog_win.cc
+++ b/ui/shell_dialogs/select_file_dialog_win.cc
@@ -168,8 +168,8 @@
const base::Callback<bool(OPENFILENAME*)>& get_save_file_name_impl);
// BaseShellDialog implementation:
- virtual bool IsRunning(gfx::NativeWindow owning_window) const OVERRIDE;
- virtual void ListenerDestroyed() OVERRIDE;
+ virtual bool IsRunning(gfx::NativeWindow owning_window) const override;
+ virtual void ListenerDestroyed() override;
protected:
// SelectFileDialog implementation:
@@ -181,7 +181,7 @@
int file_type_index,
const base::FilePath::StringType& default_extension,
gfx::NativeWindow owning_window,
- void* params) OVERRIDE;
+ void* params) override;
private:
virtual ~SelectFileDialogImpl();
@@ -289,7 +289,7 @@
LPARAM parameter,
LPARAM data);
- virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE;
+ virtual bool HasMultipleFileTypeChoicesImpl() override;
// Returns the filter to be used while displaying the open/save file dialog.
// This is computed from the extensions for the file types being opened.
diff --git a/ui/snapshot/snapshot_aura_unittest.cc b/ui/snapshot/snapshot_aura_unittest.cc
index 5fe05a8..b5a2a66 100644
--- a/ui/snapshot/snapshot_aura_unittest.cc
+++ b/ui/snapshot/snapshot_aura_unittest.cc
@@ -43,7 +43,7 @@
virtual ~TestPaintingWindowDelegate() {
}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
for (int y = 0; y < window_size_.height(); ++y) {
for (int x = 0; x < window_size_.width(); ++x)
canvas->FillRect(gfx::Rect(x, y, 1, 1), GetExpectedColorForPoint(x, y));
@@ -84,7 +84,7 @@
SnapshotAuraTest() {}
virtual ~SnapshotAuraTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
testing::Test::SetUp();
// The ContextFactory must exist before any Compositors are created.
@@ -99,7 +99,7 @@
new ::wm::DefaultActivationClient(helper_->root_window());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
test_window_.reset();
delegate_.reset();
helper_->RunAllPendingInMessageLoop();
diff --git a/ui/v2/src/view.cc b/ui/v2/src/view.cc
index 4185465..d973630 100644
--- a/ui/v2/src/view.cc
+++ b/ui/v2/src/view.cc
@@ -125,13 +125,13 @@
private:
// Overridden from ui::LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override {
// TODO(beng): paint processor.
}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {
// TODO(beng): ???
}
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
+ virtual base::Closure PrepareForLayerBoundsChange() override {
return base::Bind(&ViewLayerOwner::OnLayerBoundsChanged,
base::Unretained(this));
}
diff --git a/ui/v2/src/view_unittest.cc b/ui/v2/src/view_unittest.cc
index c0253ed..b2971fa 100644
--- a/ui/v2/src/view_unittest.cc
+++ b/ui/v2/src/view_unittest.cc
@@ -138,7 +138,7 @@
private:
// Overridden from ViewObserver:
- virtual void OnViewTreeChange(const TreeChangeParams& params) OVERRIDE {
+ virtual void OnViewTreeChange(const TreeChangeParams& params) override {
received_params_.push_back(params);
}
@@ -394,7 +394,7 @@
// Overridden from ViewObserver:
virtual void OnViewVisibilityChange(
View* view,
- ViewObserver::DispositionChangePhase phase) OVERRIDE {
+ ViewObserver::DispositionChangePhase phase) override {
DCHECK_EQ(view_, view);
log_entries_.push_back(std::make_pair(phase, view->visible()));
}
@@ -436,7 +436,7 @@
private:
virtual void OnViewBoundsChanged(View* view,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
DCHECK_EQ(view_, view);
bounds_changes_.push_back(std::make_pair(old_bounds, new_bounds));
}
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index 93abc4d..1b1b6bf 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -104,8 +104,6 @@
}
}
-if (false) {
-
static_library("test_support") {
testonly = true
sources = gypi_values.views_test_support_sources
@@ -115,6 +113,7 @@
]
deps = [
"//base",
+ "//ipc:test_support",
"//skia",
"//testing/gtest",
"//ui/aura",
@@ -263,5 +262,3 @@
]
}
}
-
-} # if (false)
diff --git a/ui/views/accessibility/ax_view_obj_wrapper.h b/ui/views/accessibility/ax_view_obj_wrapper.h
index 6838d07..7a768b7 100644
--- a/ui/views/accessibility/ax_view_obj_wrapper.h
+++ b/ui/views/accessibility/ax_view_obj_wrapper.h
@@ -17,15 +17,15 @@
virtual ~AXViewObjWrapper();
// AXAuraObjWrapper overrides.
- virtual AXAuraObjWrapper* GetParent() OVERRIDE;
+ virtual AXAuraObjWrapper* GetParent() override;
virtual void GetChildren(
- std::vector<AXAuraObjWrapper*>* out_children) OVERRIDE;
- virtual void Serialize(ui::AXNodeData* out_node_data) OVERRIDE;
- virtual int32 GetID() OVERRIDE;
- virtual void DoDefault() OVERRIDE;
- virtual void Focus() OVERRIDE;
- virtual void MakeVisible() OVERRIDE;
- virtual void SetSelection(int32 start, int32 end) OVERRIDE;
+ std::vector<AXAuraObjWrapper*>* out_children) override;
+ virtual void Serialize(ui::AXNodeData* out_node_data) override;
+ virtual int32 GetID() override;
+ virtual void DoDefault() override;
+ virtual void Focus() override;
+ virtual void MakeVisible() override;
+ virtual void SetSelection(int32 start, int32 end) override;
private:
View* view_;
diff --git a/ui/views/accessibility/ax_widget_obj_wrapper.h b/ui/views/accessibility/ax_widget_obj_wrapper.h
index 61ff1e9..52c03ca 100644
--- a/ui/views/accessibility/ax_widget_obj_wrapper.h
+++ b/ui/views/accessibility/ax_widget_obj_wrapper.h
@@ -21,17 +21,17 @@
virtual ~AXWidgetObjWrapper();
// AXAuraObjWrapper overrides.
- virtual AXAuraObjWrapper* GetParent() OVERRIDE;
+ virtual AXAuraObjWrapper* GetParent() override;
virtual void GetChildren(
- std::vector<AXAuraObjWrapper*>* out_children) OVERRIDE;
- virtual void Serialize(ui::AXNodeData* out_node_data) OVERRIDE;
- virtual int32 GetID() OVERRIDE;
+ std::vector<AXAuraObjWrapper*>* out_children) override;
+ virtual void Serialize(ui::AXNodeData* out_node_data) override;
+ virtual int32 GetID() override;
// WidgetObserver overrides.
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE;
+ virtual void OnWidgetDestroying(Widget* widget) override;
// WidgetRemovalsObserver overrides.
- virtual void OnWillRemoveView(Widget* widget, View* view) OVERRIDE;
+ virtual void OnWillRemoveView(Widget* widget, View* view) override;
private:
Widget* widget_;
diff --git a/ui/views/accessibility/ax_window_obj_wrapper.h b/ui/views/accessibility/ax_window_obj_wrapper.h
index b3cd235..14bf2a8 100644
--- a/ui/views/accessibility/ax_window_obj_wrapper.h
+++ b/ui/views/accessibility/ax_window_obj_wrapper.h
@@ -22,14 +22,14 @@
virtual ~AXWindowObjWrapper();
// AXAuraObjWrapper overrides.
- virtual AXAuraObjWrapper* GetParent() OVERRIDE;
+ virtual AXAuraObjWrapper* GetParent() override;
virtual void GetChildren(
- std::vector<AXAuraObjWrapper*>* out_children) OVERRIDE;
- virtual void Serialize(ui::AXNodeData* out_node_data) OVERRIDE;
- virtual int32 GetID() OVERRIDE;
+ std::vector<AXAuraObjWrapper*>* out_children) override;
+ virtual void Serialize(ui::AXNodeData* out_node_data) override;
+ virtual int32 GetID() override;
// WindowObserver overrides.
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
+ virtual void OnWindowDestroying(aura::Window* window) override;
private:
aura::Window* window_;
diff --git a/ui/views/accessibility/native_view_accessibility.h b/ui/views/accessibility/native_view_accessibility.h
index 3f36f57..a85dc0c 100644
--- a/ui/views/accessibility/native_view_accessibility.h
+++ b/ui/views/accessibility/native_view_accessibility.h
@@ -32,12 +32,12 @@
static void UnregisterWebView(View* web_view);
// ui::AXPlatformNodeDelegate
- virtual ui::AXNodeData* GetData() OVERRIDE;
- virtual int GetChildCount() OVERRIDE;
- virtual gfx::NativeViewAccessible ChildAtIndex(int index) OVERRIDE;
- virtual gfx::NativeViewAccessible GetParent() OVERRIDE;
- virtual gfx::Vector2d GetGlobalCoordinateOffset() OVERRIDE;
- virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) OVERRIDE;
+ virtual ui::AXNodeData* GetData() override;
+ virtual int GetChildCount() override;
+ virtual gfx::NativeViewAccessible ChildAtIndex(int index) override;
+ virtual gfx::NativeViewAccessible GetParent() override;
+ virtual gfx::Vector2d GetGlobalCoordinateOffset() override;
+ virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) override;
protected:
NativeViewAccessibility();
diff --git a/ui/views/accessibility/native_view_accessibility_unittest.cc b/ui/views/accessibility/native_view_accessibility_unittest.cc
index cf5f5de..c376bbf 100644
--- a/ui/views/accessibility/native_view_accessibility_unittest.cc
+++ b/ui/views/accessibility/native_view_accessibility_unittest.cc
@@ -28,7 +28,7 @@
NativeViewAccessibilityTest() {}
virtual ~NativeViewAccessibilityTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
button_.reset(new TestButton());
button_->SetSize(gfx::Size(20, 20));
@@ -39,7 +39,7 @@
label_accessibility_ = NativeViewAccessibility::Create(label_.get());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
button_accessibility_->Destroy();
button_accessibility_ = NULL;
label_accessibility_->Destroy();
diff --git a/ui/views/accessibility/native_view_accessibility_win.h b/ui/views/accessibility/native_view_accessibility_win.h
index b9a77f5..2f629ca 100644
--- a/ui/views/accessibility/native_view_accessibility_win.h
+++ b/ui/views/accessibility/native_view_accessibility_win.h
@@ -62,9 +62,9 @@
// NativeViewAccessibility.
virtual void NotifyAccessibilityEvent(
- ui::AXEvent event_type) OVERRIDE;
- virtual gfx::NativeViewAccessible GetNativeObject() OVERRIDE;
- virtual void Destroy() OVERRIDE;
+ ui::AXEvent event_type) override;
+ virtual gfx::NativeViewAccessible GetNativeObject() override;
+ virtual void Destroy() override;
// Supported IAccessible methods.
diff --git a/ui/views/accessible_pane_view.cc b/ui/views/accessible_pane_view.cc
index 84fccdc..c89dc46 100644
--- a/ui/views/accessible_pane_view.cc
+++ b/ui/views/accessible_pane_view.cc
@@ -24,14 +24,14 @@
accessible_pane_view_(pane_view) {}
protected:
- virtual View* GetParent(View* v) OVERRIDE {
+ virtual View* GetParent(View* v) override {
return accessible_pane_view_->ContainsForFocusSearch(root(), v) ?
accessible_pane_view_->GetParentForFocusSearch(v) : NULL;
}
// Returns true if |v| is contained within the hierarchy rooted at |root|.
// Subclasses can override this if they need custom focus search behavior.
- virtual bool Contains(View* root, const View* v) OVERRIDE {
+ virtual bool Contains(View* root, const View* v) override {
return accessible_pane_view_->ContainsForFocusSearch(root, v);
}
diff --git a/ui/views/accessible_pane_view.h b/ui/views/accessible_pane_view.h
index 11ea448..345e928 100644
--- a/ui/views/accessible_pane_view.h
+++ b/ui/views/accessible_pane_view.h
@@ -40,23 +40,23 @@
virtual bool SetPaneFocusAndFocusDefault();
// Overridden from View:
- virtual FocusTraversable* GetPaneFocusTraversable() OVERRIDE;
+ virtual FocusTraversable* GetPaneFocusTraversable() override;
virtual bool AcceleratorPressed(const ui::Accelerator& accelerator)
- OVERRIDE;
- virtual void SetVisible(bool flag) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void RequestFocus() OVERRIDE;
+ override;
+ virtual void SetVisible(bool flag) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void RequestFocus() override;
// Overridden from FocusChangeListener:
virtual void OnWillChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
virtual void OnDidChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
// Overridden from FocusTraversable:
- virtual FocusSearch* GetFocusSearch() OVERRIDE;
- virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE;
- virtual View* GetFocusTraversableParentView() OVERRIDE;
+ virtual FocusSearch* GetFocusSearch() override;
+ virtual FocusTraversable* GetFocusTraversableParent() override;
+ virtual View* GetFocusTraversableParentView() override;
// For testing only.
const ui::Accelerator& home_key() const { return home_key_; }
diff --git a/ui/views/accessible_pane_view_unittest.cc b/ui/views/accessible_pane_view_unittest.cc
index 4468f2f..126fc91 100644
--- a/ui/views/accessible_pane_view_unittest.cc
+++ b/ui/views/accessible_pane_view_unittest.cc
@@ -24,7 +24,7 @@
virtual ~TestBarView();
virtual void ButtonPressed(Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
LabelButton* child_button() const { return child_button_.get(); }
LabelButton* second_child_button() const {
return second_child_button_.get();
@@ -32,7 +32,7 @@
LabelButton* third_child_button() const { return third_child_button_.get(); }
LabelButton* not_child_button() const { return not_child_button_.get(); }
- virtual View* GetDefaultFocusableChild() OVERRIDE;
+ virtual View* GetDefaultFocusableChild() override;
private:
void Init();
diff --git a/ui/views/animation/bounds_animator.h b/ui/views/animation/bounds_animator.h
index 1a88cdf..0abc37a 100644
--- a/ui/views/animation/bounds_animator.h
+++ b/ui/views/animation/bounds_animator.h
@@ -144,15 +144,15 @@
AnimationEndType type);
// gfx::AnimationDelegate overrides.
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
+ virtual void AnimationEnded(const gfx::Animation* animation) override;
+ virtual void AnimationCanceled(const gfx::Animation* animation) override;
// gfx::AnimationContainerObserver overrides.
virtual void AnimationContainerProgressed(
- gfx::AnimationContainer* container) OVERRIDE;
+ gfx::AnimationContainer* container) override;
virtual void AnimationContainerEmpty(
- gfx::AnimationContainer* container) OVERRIDE;
+ gfx::AnimationContainer* container) override;
// Parent of all views being animated.
View* parent_;
diff --git a/ui/views/animation/bounds_animator_unittest.cc b/ui/views/animation/bounds_animator_unittest.cc
index 6294d8a..b8f62a2 100644
--- a/ui/views/animation/bounds_animator_unittest.cc
+++ b/ui/views/animation/bounds_animator_unittest.cc
@@ -22,7 +22,7 @@
}
protected:
- virtual SlideAnimation* CreateAnimation() OVERRIDE {
+ virtual SlideAnimation* CreateAnimation() override {
SlideAnimation* animation = BoundsAnimator::CreateAnimation();
animation->SetSlideDuration(10);
return animation;
@@ -53,7 +53,7 @@
}
// Overridden from gfx::AnimationDelegate:
- virtual void AnimationCanceled(const Animation* animation) OVERRIDE {
+ virtual void AnimationCanceled(const Animation* animation) override {
canceled_ = true;
}
@@ -72,7 +72,7 @@
public:
TestView() {}
- virtual void SchedulePaintInRect(const gfx::Rect& r) OVERRIDE {
+ virtual void SchedulePaintInRect(const gfx::Rect& r) override {
if (dirty_rect_.IsEmpty())
dirty_rect_ = r;
else
diff --git a/ui/views/animation/scroll_animator.h b/ui/views/animation/scroll_animator.h
index 525a998..b941cdb 100644
--- a/ui/views/animation/scroll_animator.h
+++ b/ui/views/animation/scroll_animator.h
@@ -41,9 +41,9 @@
private:
// Implementation of gfx::AnimationDelegate.
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationEnded(const gfx::Animation* animation) override;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
+ virtual void AnimationCanceled(const gfx::Animation* animation) override;
ScrollDelegate* delegate_;
diff --git a/ui/views/background.cc b/ui/views/background.cc
index bb2ddd0..d2d64bb 100644
--- a/ui/views/background.cc
+++ b/ui/views/background.cc
@@ -22,7 +22,7 @@
SetNativeControlColor(color);
}
- virtual void Paint(gfx::Canvas* canvas, View* view) const OVERRIDE {
+ virtual void Paint(gfx::Canvas* canvas, View* view) const override {
// Fill the background. Note that we don't constrain to the bounds as
// canvas is already clipped for us.
canvas->DrawColor(get_color());
@@ -45,7 +45,7 @@
}
- virtual void Paint(gfx::Canvas* canvas, View* view) const OVERRIDE {
+ virtual void Paint(gfx::Canvas* canvas, View* view) const override {
Painter::PaintPainterAt(canvas, painter_, view->GetLocalBounds());
}
diff --git a/ui/views/border.cc b/ui/views/border.cc
index 0ff3406..dac2daa 100644
--- a/ui/views/border.cc
+++ b/ui/views/border.cc
@@ -20,9 +20,9 @@
SidedSolidBorder(int top, int left, int bottom, int right, SkColor color);
// Overridden from Border:
- virtual void Paint(const View& view, gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual void Paint(const View& view, gfx::Canvas* canvas) override;
+ virtual gfx::Insets GetInsets() const override;
+ virtual gfx::Size GetMinimumSize() const override;
private:
const SkColor color_;
@@ -78,13 +78,13 @@
: insets_(top, left, bottom, right) {}
// Overridden from Border:
- virtual void Paint(const View& view, gfx::Canvas* canvas) OVERRIDE {}
+ virtual void Paint(const View& view, gfx::Canvas* canvas) override {}
- virtual gfx::Insets GetInsets() const OVERRIDE {
+ virtual gfx::Insets GetInsets() const override {
return insets_;
}
- virtual gfx::Size GetMinimumSize() const OVERRIDE {
+ virtual gfx::Size GetMinimumSize() const override {
return gfx::Size();
}
@@ -105,15 +105,15 @@
virtual ~BorderPainter() {}
// Overridden from Border:
- virtual void Paint(const View& view, gfx::Canvas* canvas) OVERRIDE {
+ virtual void Paint(const View& view, gfx::Canvas* canvas) override {
Painter::PaintPainterAt(canvas, painter_.get(), view.GetLocalBounds());
}
- virtual gfx::Insets GetInsets() const OVERRIDE {
+ virtual gfx::Insets GetInsets() const override {
return insets_;
}
- virtual gfx::Size GetMinimumSize() const OVERRIDE {
+ virtual gfx::Size GetMinimumSize() const override {
return painter_->GetMinimumSize();
}
diff --git a/ui/views/bubble/bubble_border.h b/ui/views/bubble/bubble_border.h
index 8ce546a..8fc149b 100644
--- a/ui/views/bubble/bubble_border.h
+++ b/ui/views/bubble/bubble_border.h
@@ -196,9 +196,9 @@
int GetArrowOffset(const gfx::Size& border_size) const;
// Overridden from Border:
- virtual void Paint(const View& view, gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual void Paint(const View& view, gfx::Canvas* canvas) override;
+ virtual gfx::Insets GetInsets() const override;
+ virtual gfx::Size GetMinimumSize() const override;
private:
FRIEND_TEST_ALL_PREFIXES(BubbleBorderTest, GetSizeForContentsSizeTest);
@@ -233,7 +233,7 @@
explicit BubbleBackground(BubbleBorder* border) : border_(border) {}
// Overridden from Background:
- virtual void Paint(gfx::Canvas* canvas, View* view) const OVERRIDE;
+ virtual void Paint(gfx::Canvas* canvas, View* view) const override;
private:
BubbleBorder* border_;
diff --git a/ui/views/bubble/bubble_delegate.h b/ui/views/bubble/bubble_delegate.h
index 739ec92..5f21313 100644
--- a/ui/views/bubble/bubble_delegate.h
+++ b/ui/views/bubble/bubble_delegate.h
@@ -33,21 +33,21 @@
static Widget* CreateBubble(BubbleDelegateView* bubble_delegate);
// WidgetDelegateView overrides:
- virtual BubbleDelegateView* AsBubbleDelegate() OVERRIDE;
- virtual bool ShouldShowCloseButton() const OVERRIDE;
- virtual View* GetContentsView() OVERRIDE;
- virtual NonClientFrameView* CreateNonClientFrameView(Widget* widget) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual BubbleDelegateView* AsBubbleDelegate() override;
+ virtual bool ShouldShowCloseButton() const override;
+ virtual View* GetContentsView() override;
+ virtual NonClientFrameView* CreateNonClientFrameView(Widget* widget) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
// WidgetObserver overrides:
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE;
+ virtual void OnWidgetDestroying(Widget* widget) override;
virtual void OnWidgetVisibilityChanging(Widget* widget, bool visible)
- OVERRIDE;
+ override;
virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible)
- OVERRIDE;
- virtual void OnWidgetActivationChanged(Widget* widget, bool active) OVERRIDE;
+ override;
+ virtual void OnWidgetActivationChanged(Widget* widget, bool active) override;
virtual void OnWidgetBoundsChanged(Widget* widget,
- const gfx::Rect& new_bounds) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
bool close_on_esc() const { return close_on_esc_; }
void set_close_on_esc(bool close_on_esc) { close_on_esc_ = close_on_esc; }
@@ -119,8 +119,8 @@
virtual const gfx::FontList& GetTitleFontList() const;
// View overrides:
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
+ virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
// Perform view initialization on the contents for bubble sizing.
virtual void Init();
diff --git a/ui/views/bubble/bubble_delegate_unittest.cc b/ui/views/bubble/bubble_delegate_unittest.cc
index a0cd57b..c3ba170 100644
--- a/ui/views/bubble/bubble_delegate_unittest.cc
+++ b/ui/views/bubble/bubble_delegate_unittest.cc
@@ -33,8 +33,8 @@
}
// BubbleDelegateView overrides:
- virtual View* GetInitiallyFocusedView() OVERRIDE { return view_; }
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual View* GetInitiallyFocusedView() override { return view_; }
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(200, 200);
}
diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h
index f14ca1e..1d3add7 100644
--- a/ui/views/bubble/bubble_frame_view.h
+++ b/ui/views/bubble/bubble_frame_view.h
@@ -40,33 +40,33 @@
static LabelButton* CreateCloseButton(ButtonListener* listener);
// NonClientFrameView overrides:
- virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
+ virtual gfx::Rect GetBoundsForClientView() const override;
virtual gfx::Rect GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds) const OVERRIDE;
- virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
+ const gfx::Rect& client_bounds) const override;
+ virtual int NonClientHitTest(const gfx::Point& point) override;
virtual void GetWindowMask(const gfx::Size& size,
- gfx::Path* window_mask) OVERRIDE;
- virtual void ResetWindowControls() OVERRIDE;
- virtual void UpdateWindowIcon() OVERRIDE;
- virtual void UpdateWindowTitle() OVERRIDE;
- virtual void SizeConstraintsChanged() OVERRIDE;
+ gfx::Path* window_mask) override;
+ virtual void ResetWindowControls() override;
+ virtual void UpdateWindowIcon() override;
+ virtual void UpdateWindowTitle() override;
+ virtual void SizeConstraintsChanged() override;
// Set the FontList to be used for the title of the bubble.
// Caller must arrange to update the layout to have the call take effect.
void SetTitleFontList(const gfx::FontList& font_list);
// View overrides:
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
- virtual void OnThemeChanged() OVERRIDE;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
+ virtual gfx::Insets GetInsets() const override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual void Layout() override;
+ virtual const char* GetClassName() const override;
+ virtual void ChildPreferredSizeChanged(View* child) override;
+ virtual void OnThemeChanged() override;
+ virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
// Overridden from ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// Use bubble_border() and SetBubbleBorder(), not border() and SetBorder().
BubbleBorder* bubble_border() const { return bubble_border_; }
diff --git a/ui/views/bubble/bubble_frame_view_unittest.cc b/ui/views/bubble/bubble_frame_view_unittest.cc
index 1bd9e34..545ca38 100644
--- a/ui/views/bubble/bubble_frame_view_unittest.cc
+++ b/ui/views/bubble/bubble_frame_view_unittest.cc
@@ -29,7 +29,7 @@
virtual ~TestBubbleFrameView() {}
// BubbleFrameView overrides:
- virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) OVERRIDE {
+ virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) override {
return available_bounds_;
}
diff --git a/ui/views/bubble/bubble_window_targeter.h b/ui/views/bubble/bubble_window_targeter.h
index 45b1d5c..b37eaa0 100644
--- a/ui/views/bubble/bubble_window_targeter.h
+++ b/ui/views/bubble/bubble_window_targeter.h
@@ -23,7 +23,7 @@
private:
// wm::MaskedWindowTargeter:
virtual bool GetHitTestMask(aura::Window* window,
- gfx::Path* mask) const OVERRIDE;
+ gfx::Path* mask) const override;
views::BubbleDelegateView* bubble_;
diff --git a/ui/views/bubble/bubble_window_targeter_unittest.cc b/ui/views/bubble/bubble_window_targeter_unittest.cc
index 479f6e9..4ff0e0a 100644
--- a/ui/views/bubble/bubble_window_targeter_unittest.cc
+++ b/ui/views/bubble/bubble_window_targeter_unittest.cc
@@ -26,7 +26,7 @@
private:
// BubbleDelegateView:
virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params,
- Widget* widget) const OVERRIDE {
+ Widget* widget) const override {
params->ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
}
@@ -42,7 +42,7 @@
}
virtual ~BubbleWindowTargeterTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
CreateAnchorWidget();
CreateBubbleWidget();
@@ -51,7 +51,7 @@
bubble_widget()->Show();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
bubble_delegate_ = NULL;
bubble_widget_.reset();
anchor_.reset();
diff --git a/ui/views/bubble/tray_bubble_view.cc b/ui/views/bubble/tray_bubble_view.cc
index d1cf48e..53cb526 100644
--- a/ui/views/bubble/tray_bubble_view.cc
+++ b/ui/views/bubble/tray_bubble_view.cc
@@ -56,7 +56,7 @@
virtual ~MouseMoveDetectorHost();
virtual bool Contains(const gfx::Point& screen_point,
- MouseEventType type) OVERRIDE;
+ MouseEventType type) override;
private:
DISALLOW_COPY_AND_ASSIGN(MouseMoveDetectorHost);
};
@@ -94,7 +94,7 @@
// Overridden from BubbleBorder.
// Sets the bubble on top of the anchor when it has no arrow.
virtual gfx::Rect GetBounds(const gfx::Rect& position_relative_to,
- const gfx::Size& contents_size) const OVERRIDE {
+ const gfx::Size& contents_size) const override {
if (has_arrow(arrow())) {
gfx::Rect rect =
BubbleBorder::GetBounds(position_relative_to, contents_size);
@@ -182,11 +182,11 @@
ui::Layer* layer() { return &layer_; }
// Overridden from LayerDelegate.
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override;
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE;
+ const gfx::Rect& damage_rect_in_dip) override {}
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
+ virtual base::Closure PrepareForLayerBoundsChange() override;
private:
ui::Layer layer_;
@@ -234,7 +234,7 @@
virtual ~BottomAlignedBoxLayout() {}
private:
- virtual void Layout(View* host) OVERRIDE {
+ virtual void Layout(View* host) override {
if (host->height() >= host->GetPreferredSize().height() ||
!bubble_view_->is_gesture_dragging()) {
BoxLayout::Layout(host);
diff --git a/ui/views/bubble/tray_bubble_view.h b/ui/views/bubble/tray_bubble_view.h
index 54f6cc8..8ffd58d 100644
--- a/ui/views/bubble/tray_bubble_view.h
+++ b/ui/views/bubble/tray_bubble_view.h
@@ -147,25 +147,25 @@
bool is_gesture_dragging() const { return is_gesture_dragging_; }
// Overridden from views::WidgetDelegate.
- virtual bool CanActivate() const OVERRIDE;
+ virtual bool CanActivate() const override;
virtual views::NonClientFrameView* CreateNonClientFrameView(
- views::Widget* widget) OVERRIDE;
- virtual bool WidgetHasHitTestMask() const OVERRIDE;
- virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE;
+ views::Widget* widget) override;
+ virtual bool WidgetHasHitTestMask() const override;
+ virtual void GetWidgetHitTestMask(gfx::Path* mask) const override;
// Overridden from views::BubbleDelegateView.
- virtual gfx::Rect GetAnchorRect() const OVERRIDE;
+ virtual gfx::Rect GetAnchorRect() const override;
// Overridden from views::View.
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
// Overridden from MouseWatcherListener
- virtual void MouseMovedOutOfHost() OVERRIDE;
+ virtual void MouseMovedOutOfHost() override;
protected:
TrayBubbleView(gfx::NativeView parent_window,
@@ -174,12 +174,12 @@
const InitParams& init_params);
// Overridden from views::BubbleDelegateView.
- virtual void Init() OVERRIDE;
+ virtual void Init() override;
// Overridden from views::View.
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
+ virtual void ChildPreferredSizeChanged(View* child) override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
private:
InitParams params_;
diff --git a/ui/views/cocoa/OWNERS b/ui/views/cocoa/OWNERS
new file mode 100644
index 0000000..13c6f49
--- /dev/null
+++ b/ui/views/cocoa/OWNERS
@@ -0,0 +1 @@
+tapted@chromium.org
diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
index 64cf81d..05eeabf 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -52,16 +52,35 @@
// Called internally by the NSWindowDelegate when the window is closing.
void OnWindowWillClose();
+ // Called by the NSWindowDelegate when a fullscreen operation begins. If
+ // |target_fullscreen_state| is true, the target state is fullscreen.
+ // Otherwise, a transition has begun to come out of fullscreen.
+ void OnFullscreenTransitionStart(bool target_fullscreen_state);
+
+ // Called when a fullscreen transition completes. If target_fullscreen_state()
+ // does not match |actual_fullscreen_state|, a new transition will begin.
+ void OnFullscreenTransitionComplete(bool actual_fullscreen_state);
+
+ // Transition the window into or out of fullscreen. This will immediately
+ // invert the value of target_fullscreen_state().
+ void ToggleDesiredFullscreenState();
+
// See widget.h for documentation.
InputMethod* CreateInputMethod();
ui::InputMethod* GetHostInputMethod();
+ // The restored bounds will be derived from the current NSWindow frame unless
+ // fullscreen or transitioning between fullscreen states.
+ gfx::Rect GetRestoredBounds() const;
+
NativeWidgetMac* native_widget_mac() { return native_widget_mac_; }
BridgedContentView* ns_view() { return bridged_view_; }
NSWindow* ns_window() { return window_; }
+ bool target_fullscreen_state() const { return target_fullscreen_state_; }
+
// Overridden from internal::InputMethodDelegate:
- virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE;
+ virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) override;
private:
// Closes all child windows. BridgedNativeWidget children will be destroyed.
@@ -74,11 +93,24 @@
scoped_ptr<ui::InputMethod> input_method_;
FocusManager* focus_manager_; // Weak. Owned by our Widget.
+ // Tracks the bounds when the window last started entering fullscreen. Used to
+ // provide an answer for GetRestoredBounds(), but not ever sent to Cocoa (it
+ // has its own copy, but doesn't provide access to it).
+ gfx::Rect bounds_before_fullscreen_;
+
+ // Whether this window wants to be fullscreen. If a fullscreen animation is in
+ // progress then it might not be actually fullscreen.
+ bool target_fullscreen_state_;
+
+ // Whether this window is in a fullscreen transition, and the fullscreen state
+ // can not currently be changed.
+ bool in_fullscreen_transition_;
+
// Overridden from FocusChangeListener:
virtual void OnWillChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
virtual void OnDidChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
};
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm
index 2a959da..560f533 100644
--- a/ui/views/cocoa/bridged_native_widget.mm
+++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -5,9 +5,12 @@
#import "ui/views/cocoa/bridged_native_widget.h"
#include "base/logging.h"
+#include "base/mac/mac_util.h"
+#import "base/mac/sdk_forward_declarations.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ime/input_method_factory.h"
#include "ui/base/ui_base_switches_util.h"
+#import "ui/gfx/mac/coordinate_conversion.h"
#import "ui/views/cocoa/bridged_content_view.h"
#import "ui/views/cocoa/views_nswindow_delegate.h"
#include "ui/views/widget/native_widget_mac.h"
@@ -19,7 +22,10 @@
namespace views {
BridgedNativeWidget::BridgedNativeWidget(NativeWidgetMac* parent)
- : native_widget_mac_(parent), focus_manager_(NULL) {
+ : native_widget_mac_(parent),
+ focus_manager_(NULL),
+ target_fullscreen_state_(false),
+ in_fullscreen_transition_(false) {
DCHECK(parent);
window_delegate_.reset(
[[ViewsNSWindowDelegate alloc] initWithBridgedNativeWidget:this]);
@@ -44,6 +50,11 @@
window_.swap(window);
[window_ setDelegate:window_delegate_];
+ // Validate the window's initial state, otherwise the bridge's initial
+ // tracking state will be incorrect.
+ DCHECK(![window_ isVisible]);
+ DCHECK_EQ(0u, [window_ styleMask] & NSFullScreenWindowMask);
+
if (params.parent) {
// Use NSWindow to manage child windows. This won't automatically close them
// but it will maintain relative positioning of the window layer and origin.
@@ -89,6 +100,61 @@
native_widget_mac_->OnWindowWillClose();
}
+void BridgedNativeWidget::OnFullscreenTransitionStart(
+ bool target_fullscreen_state) {
+ DCHECK_NE(target_fullscreen_state, target_fullscreen_state_);
+ target_fullscreen_state_ = target_fullscreen_state;
+ in_fullscreen_transition_ = true;
+
+ // If going into fullscreen, store an answer for GetRestoredBounds().
+ if (target_fullscreen_state)
+ bounds_before_fullscreen_ = gfx::ScreenRectFromNSRect([window_ frame]);
+}
+
+void BridgedNativeWidget::OnFullscreenTransitionComplete(
+ bool actual_fullscreen_state) {
+ in_fullscreen_transition_ = false;
+ if (target_fullscreen_state_ == actual_fullscreen_state)
+ return;
+
+ // First update to reflect reality so that OnTargetFullscreenStateChanged()
+ // expects the change.
+ target_fullscreen_state_ = actual_fullscreen_state;
+ ToggleDesiredFullscreenState();
+
+ // Usually ToggleDesiredFullscreenState() sets |in_fullscreen_transition_| via
+ // OnFullscreenTransitionStart(). When it does not, it means Cocoa ignored the
+ // toggleFullScreen: request. This can occur when the fullscreen transition
+ // fails and Cocoa is *about* to send windowDidFailToEnterFullScreen:.
+ // Annoyingly, for this case, Cocoa first sends windowDidExitFullScreen:.
+ if (in_fullscreen_transition_)
+ DCHECK_NE(target_fullscreen_state_, actual_fullscreen_state);
+}
+
+void BridgedNativeWidget::ToggleDesiredFullscreenState() {
+ if (base::mac::IsOSSnowLeopard()) {
+ NOTIMPLEMENTED();
+ return; // TODO(tapted): Implement this for Snow Leopard.
+ }
+
+ // If there is currently an animation into or out of fullscreen, then AppKit
+ // emits the string "not in fullscreen state" to stdio and does nothing. For
+ // this case, schedule a transition back into the desired state when the
+ // animation completes.
+ if (in_fullscreen_transition_) {
+ target_fullscreen_state_ = !target_fullscreen_state_;
+ return;
+ }
+
+ // Since fullscreen requests are ignored if the collection behavior does not
+ // allow it, save the collection behavior and restore it after.
+ NSWindowCollectionBehavior behavior = [window_ collectionBehavior];
+ [window_ setCollectionBehavior:behavior |
+ NSWindowCollectionBehaviorFullScreenPrimary];
+ [window_ toggleFullScreen:nil];
+ [window_ setCollectionBehavior:behavior];
+}
+
InputMethod* BridgedNativeWidget::CreateInputMethod() {
if (switches::IsTextInputFocusManagerEnabled())
return new NullInputMethod();
@@ -105,6 +171,13 @@
return input_method_.get();
}
+gfx::Rect BridgedNativeWidget::GetRestoredBounds() const {
+ if (target_fullscreen_state_ || in_fullscreen_transition_)
+ return bounds_before_fullscreen_;
+
+ return gfx::ScreenRectFromNSRect([window_ frame]);
+}
+
////////////////////////////////////////////////////////////////////////////////
// BridgedNativeWidget, internal::InputMethodDelegate:
diff --git a/ui/views/cocoa/bridged_native_widget_unittest.mm b/ui/views/cocoa/bridged_native_widget_unittest.mm
index 14a7f9c..bd72331 100644
--- a/ui/views/cocoa/bridged_native_widget_unittest.mm
+++ b/ui/views/cocoa/bridged_native_widget_unittest.mm
@@ -6,7 +6,11 @@
#import <Cocoa/Cocoa.h>
+#import "base/mac/foundation_util.h"
+#import "base/mac/sdk_forward_declarations.h"
#include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#import "testing/gtest_mac.h"
@@ -37,6 +41,112 @@
} // namespace
+@interface NativeWidgetMacNotificationWaiter : NSObject {
+ @private
+ scoped_ptr<base::RunLoop> runLoop_;
+ base::scoped_nsobject<NSWindow> window_;
+ int enterCount_;
+ int exitCount_;
+ int targetEnterCount_;
+ int targetExitCount_;
+}
+
+@property(readonly, nonatomic) int enterCount;
+@property(readonly, nonatomic) int exitCount;
+
+// Initialize for the given window and start tracking notifications.
+- (id)initWithWindow:(NSWindow*)window;
+
+// Keep spinning a run loop until the enter and exit counts match.
+- (void)waitForEnterCount:(int)enterCount exitCount:(int)exitCount;
+
+// private:
+// Exit the RunLoop if there is one and the counts being tracked match.
+- (void)maybeQuitForChangedArg:(int*)changedArg;
+
+- (void)onEnter:(NSNotification*)notification;
+- (void)onExit:(NSNotification*)notification;
+
+@end
+
+@implementation NativeWidgetMacNotificationWaiter
+
+@synthesize enterCount = enterCount_;
+@synthesize exitCount = exitCount_;
+
+- (id)initWithWindow:(NSWindow*)window {
+ if ((self = [super init])) {
+ window_.reset([window retain]);
+ NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
+ [defaultCenter addObserver:self
+ selector:@selector(onEnter:)
+ name:NSWindowDidEnterFullScreenNotification
+ object:window];
+ [defaultCenter addObserver:self
+ selector:@selector(onExit:)
+ name:NSWindowDidExitFullScreenNotification
+ object:window];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ DCHECK(!runLoop_);
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [super dealloc];
+}
+
+- (void)waitForEnterCount:(int)enterCount exitCount:(int)exitCount {
+ if (enterCount_ >= enterCount && exitCount_ >= exitCount)
+ return;
+
+ targetEnterCount_ = enterCount;
+ targetExitCount_ = exitCount;
+ runLoop_.reset(new base::RunLoop);
+ runLoop_->Run();
+ runLoop_.reset();
+}
+
+- (void)maybeQuitForChangedArg:(int*)changedArg {
+ ++*changedArg;
+ if (!runLoop_)
+ return;
+
+ if (enterCount_ >= targetEnterCount_ && exitCount_ >= targetExitCount_)
+ runLoop_->Quit();
+}
+
+- (void)onEnter:(NSNotification*)notification {
+ [self maybeQuitForChangedArg:&enterCount_];
+}
+
+- (void)onExit:(NSNotification*)notification {
+ [self maybeQuitForChangedArg:&exitCount_];
+}
+
+@end
+
+// Class to override -[NSWindow toggleFullScreen:] to a no-op. This simulates
+// NSWindow's behavior when attempting to toggle fullscreen state again, when
+// the last attempt failed but Cocoa has not yet sent
+// windowDidFailToEnterFullScreen:.
+@interface BridgedNativeWidgetTestFullScreenWindow : NSWindow {
+ @private
+ int ignoredToggleFullScreenCount_;
+}
+@property(readonly, nonatomic) int ignoredToggleFullScreenCount;
+@end
+
+@implementation BridgedNativeWidgetTestFullScreenWindow
+
+@synthesize ignoredToggleFullScreenCount = ignoredToggleFullScreenCount_;
+
+- (void)toggleFullScreen:(id)sender {
+ ++ignoredToggleFullScreenCount_;
+}
+
+@end
+
namespace views {
namespace test {
@@ -51,7 +161,7 @@
}
// internal::NativeWidgetPrivate:
- virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE {
+ virtual void InitNativeWidget(const Widget::InitParams& params) override {
ownership_ = params.ownership;
// Usually the bridge gets initialized here. It is skipped to run extra
@@ -59,7 +169,7 @@
delegate()->OnNativeWidgetCreated(true);
}
- virtual void ReorderNativeViews() OVERRIDE {
+ virtual void ReorderNativeViews() override {
// Called via Widget::Init to set the content view. No-op in these tests.
}
@@ -80,7 +190,7 @@
}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ui::CocoaTest::SetUp();
Widget::InitParams params;
@@ -109,8 +219,8 @@
std::string GetText();
// testing::Test:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
protected:
// TODO(tapted): Make this a EventCountView from widget_unittest.cc.
@@ -148,6 +258,9 @@
view_.reset(new views::View);
base::scoped_nsobject<NSWindow> window([test_window() retain]);
+ // BridgedNativeWidget expects to be initialized with a hidden (deferred)
+ // window.
+ [window orderOut:nil];
EXPECT_FALSE([window delegate]);
bridge()->Init(window, Widget::InitParams());
@@ -156,6 +269,8 @@
bridge()->SetRootView(view_.get());
ns_view_ = bridge()->ns_view();
+ // Pretend it has been shown via NativeWidgetMac::Show().
+ [window orderFront:nil];
[test_window() makePretendKeyWindowAndSetFirstResponder:bridge()->ns_view()];
}
@@ -246,7 +361,7 @@
[[NSWindow alloc] initWithContentRect:NSMakeRect(50, 50, 400, 300)
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
- defer:NO]);
+ defer:YES]);
[child_window setReleasedWhenClosed:NO]; // Owned by scoped_nsobject.
EXPECT_FALSE([child_window parentWindow]);
@@ -415,5 +530,163 @@
EXPECT_EQ_RANGE(NSMakeRange(0, 0), [ns_view_ selectedRange]);
}
+// Tests for correct fullscreen tracking, regardless of whether it is initiated
+// by the Widget code or elsewhere (e.g. by the user).
+TEST_F(BridgedNativeWidgetTest, FullscreenSynchronousState) {
+ EXPECT_FALSE(widget_->IsFullscreen());
+ // Allow user-initiated fullscreen changes on the Window.
+ [test_window()
+ setCollectionBehavior:[test_window() collectionBehavior] |
+ NSWindowCollectionBehaviorFullScreenPrimary];
+
+ base::scoped_nsobject<NativeWidgetMacNotificationWaiter> waiter(
+ [[NativeWidgetMacNotificationWaiter alloc] initWithWindow:test_window()]);
+ const gfx::Rect restored_bounds = widget_->GetRestoredBounds();
+
+ // Simulate a user-initiated fullscreen. Note trying to to this again before
+ // spinning a runloop will cause Cocoa to emit text to stdio and ignore it.
+ [test_window() toggleFullScreen:nil];
+ EXPECT_TRUE(widget_->IsFullscreen());
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+
+ // Note there's now an animation running. While that's happening, toggling the
+ // state should work as expected, but do "nothing".
+ widget_->SetFullscreen(false);
+ EXPECT_FALSE(widget_->IsFullscreen());
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+ widget_->SetFullscreen(false); // Same request - should no-op.
+ EXPECT_FALSE(widget_->IsFullscreen());
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+
+ widget_->SetFullscreen(true);
+ EXPECT_TRUE(widget_->IsFullscreen());
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+
+ // Always finish out of fullscreen. Otherwise there are 4 NSWindow objects
+ // that Cocoa creates which don't close themselves and will be seen by the Mac
+ // test harness on teardown. Note that the test harness will be waiting until
+ // all animations complete, since these temporary animation windows will not
+ // be removed from the window list until they do.
+ widget_->SetFullscreen(false);
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+
+ // Now we must wait for the notifications. Since, if the widget is torn down,
+ // the NSWindowDelegate is removed, and the pending request to take out of
+ // fullscreen is lost. Since a message loop has not yet spun up in this test
+ // we can reliably say there will be one enter and one exit, despite all the
+ // toggling above.
+ base::MessageLoopForUI message_loop;
+ [waiter waitForEnterCount:1 exitCount:1];
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+}
+
+// Test fullscreen without overlapping calls and without changing collection
+// behavior on the test window.
+TEST_F(BridgedNativeWidgetTest, FullscreenEnterAndExit) {
+ base::MessageLoopForUI message_loop;
+ base::scoped_nsobject<NativeWidgetMacNotificationWaiter> waiter(
+ [[NativeWidgetMacNotificationWaiter alloc] initWithWindow:test_window()]);
+
+ EXPECT_FALSE(widget_->IsFullscreen());
+ const gfx::Rect restored_bounds = widget_->GetRestoredBounds();
+ EXPECT_FALSE(restored_bounds.IsEmpty());
+
+ // Ensure this works without having to change collection behavior as for the
+ // test above.
+ widget_->SetFullscreen(true);
+ EXPECT_TRUE(widget_->IsFullscreen());
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+
+ // Should be zero until the runloop spins.
+ EXPECT_EQ(0, [waiter enterCount]);
+ [waiter waitForEnterCount:1 exitCount:0];
+
+ // Verify it hasn't exceeded.
+ EXPECT_EQ(1, [waiter enterCount]);
+ EXPECT_EQ(0, [waiter exitCount]);
+ EXPECT_TRUE(widget_->IsFullscreen());
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+
+ widget_->SetFullscreen(false);
+ EXPECT_FALSE(widget_->IsFullscreen());
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+
+ [waiter waitForEnterCount:1 exitCount:1];
+ EXPECT_EQ(1, [waiter enterCount]);
+ EXPECT_EQ(1, [waiter exitCount]);
+ EXPECT_EQ(restored_bounds, widget_->GetRestoredBounds());
+}
+
+typedef BridgedNativeWidgetTestBase BridgedNativeWidgetSimulateFullscreenTest;
+
+// Simulate the notifications that AppKit would send out if a fullscreen
+// operation begins, and then fails and must abort. This notification sequence
+// was determined by posting delayed tasks to toggle fullscreen state and then
+// mashing Ctrl+Left/Right to keep OSX in a transition between Spaces to cause
+// the fullscreen transition to fail.
+TEST_F(BridgedNativeWidgetSimulateFullscreenTest, FailToEnterAndExit) {
+ base::scoped_nsobject<NSWindow> owned_window(
+ [[BridgedNativeWidgetTestFullScreenWindow alloc]
+ initWithContentRect:NSMakeRect(50, 50, 400, 300)
+ styleMask:NSBorderlessWindowMask
+ backing:NSBackingStoreBuffered
+ defer:YES]);
+ [owned_window setReleasedWhenClosed:NO]; // Owned by scoped_nsobject.
+ bridge()->Init(owned_window, Widget::InitParams()); // Transfers ownership.
+
+ BridgedNativeWidgetTestFullScreenWindow* window =
+ base::mac::ObjCCastStrict<BridgedNativeWidgetTestFullScreenWindow>(
+ widget_->GetNativeWindow());
+ widget_->Show();
+
+ NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
+
+ EXPECT_FALSE(bridge()->target_fullscreen_state());
+
+ // Simulate an initial toggleFullScreen: (user- or Widget-initiated).
+ [center postNotificationName:NSWindowWillEnterFullScreenNotification
+ object:window];
+
+ // On a failure, Cocoa starts by sending an unexpected *exit* fullscreen, and
+ // BridgedNativeWidget will think it's just a delayed transition and try to go
+ // back into fullscreen but get ignored by Cocoa.
+ EXPECT_EQ(0, [window ignoredToggleFullScreenCount]);
+ EXPECT_TRUE(bridge()->target_fullscreen_state());
+ [center postNotificationName:NSWindowDidExitFullScreenNotification
+ object:window];
+ EXPECT_EQ(1, [window ignoredToggleFullScreenCount]);
+ EXPECT_FALSE(bridge()->target_fullscreen_state());
+
+ // Cocoa follows up with a failure notification.
+ [center postNotificationName:NSWindowDidFailToEnterFullScreenNotification
+ object:window];
+ EXPECT_FALSE(bridge()->target_fullscreen_state());
+
+ // Now perform a successful fullscreen operation.
+ [center postNotificationName:NSWindowWillEnterFullScreenNotification
+ object:window];
+ EXPECT_TRUE(bridge()->target_fullscreen_state());
+ [center postNotificationName:NSWindowDidEnterFullScreenNotification
+ object:window];
+ EXPECT_TRUE(bridge()->target_fullscreen_state());
+
+ // And try to get out.
+ [center postNotificationName:NSWindowWillExitFullScreenNotification
+ object:window];
+ EXPECT_FALSE(bridge()->target_fullscreen_state());
+
+ // On a failure, Cocoa sends a failure notification, but then just dumps the
+ // Window out of fullscreen anyway (in that order).
+ [center postNotificationName:NSWindowDidFailToExitFullScreenNotification
+ object:window];
+ EXPECT_FALSE(bridge()->target_fullscreen_state());
+ [center postNotificationName:NSWindowDidExitFullScreenNotification
+ object:window];
+ EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change.
+ EXPECT_FALSE(bridge()->target_fullscreen_state());
+
+ widget_->CloseNow();
+}
+
} // namespace test
} // namespace views
diff --git a/ui/views/cocoa/views_nswindow_delegate.mm b/ui/views/cocoa/views_nswindow_delegate.mm
index da577d6..50f0021 100644
--- a/ui/views/cocoa/views_nswindow_delegate.mm
+++ b/ui/views/cocoa/views_nswindow_delegate.mm
@@ -6,6 +6,7 @@
#include "base/logging.h"
#import "ui/views/cocoa/bridged_native_widget.h"
+#include "ui/views/widget/native_widget_mac.h"
@implementation ViewsNSWindowDelegate
@@ -23,9 +24,50 @@
// NSWindowDelegate implementation.
+- (void)windowDidFailToEnterFullScreen:(NSWindow*)window {
+ // Cocoa should already have sent an (unexpected) windowDidExitFullScreen:
+ // notification, and the attempt to get back into fullscreen should fail.
+ // Nothing to do except verify |parent_| is no longer trying to fullscreen.
+ DCHECK(!parent_->target_fullscreen_state());
+}
+
+- (void)windowDidFailToExitFullScreen:(NSWindow*)window {
+ // Unlike entering fullscreen, windowDidFailToExitFullScreen: is sent *before*
+ // windowDidExitFullScreen:. Also, failing to exit fullscreen just dumps the
+ // window out of fullscreen without an animation; still sending the expected,
+ // windowDidExitFullScreen: notification. So, again, nothing to do here.
+ DCHECK(!parent_->target_fullscreen_state());
+}
+
+- (void)windowDidBecomeKey:(NSNotification*)notification {
+ parent_->native_widget_mac()->GetWidget()->OnNativeWidgetActivationChanged(
+ true);
+}
+
+- (void)windowDidResignKey:(NSNotification*)notification {
+ parent_->native_widget_mac()->GetWidget()->OnNativeWidgetActivationChanged(
+ false);
+}
+
- (void)windowWillClose:(NSNotification*)notification {
DCHECK([parent_->ns_window() isEqual:[notification object]]);
parent_->OnWindowWillClose();
}
+- (void)windowWillEnterFullScreen:(NSNotification*)notification {
+ parent_->OnFullscreenTransitionStart(true);
+}
+
+- (void)windowDidEnterFullScreen:(NSNotification*)notification {
+ parent_->OnFullscreenTransitionComplete(true);
+}
+
+- (void)windowWillExitFullScreen:(NSNotification*)notification {
+ parent_->OnFullscreenTransitionStart(false);
+}
+
+- (void)windowDidExitFullScreen:(NSNotification*)notification {
+ parent_->OnFullscreenTransitionComplete(false);
+}
+
@end
diff --git a/ui/views/color_chooser/color_chooser_view.cc b/ui/views/color_chooser/color_chooser_view.cc
index 8efdb2a..680fd30 100644
--- a/ui/views/color_chooser/color_chooser_view.cc
+++ b/ui/views/color_chooser/color_chooser_view.cc
@@ -66,17 +66,17 @@
virtual void ProcessEventAtLocation(const gfx::Point& location) = 0;
// views::View overrides:
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE {
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override {
ProcessEventAtLocation(event.location());
return true;
}
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE {
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override {
ProcessEventAtLocation(event.location());
return true;
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
if (event->type() == ui::ET_GESTURE_TAP ||
event->type() == ui::ET_GESTURE_TAP_DOWN ||
event->IsScrollGestureEvent()) {
@@ -123,11 +123,11 @@
private:
// LocatedEventHandlerView overrides:
- virtual void ProcessEventAtLocation(const gfx::Point& point) OVERRIDE;
+ virtual void ProcessEventAtLocation(const gfx::Point& point) override;
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
ColorChooserView* chooser_view_;
int level_;
@@ -235,11 +235,11 @@
private:
// LocatedEventHandlerView overrides:
- virtual void ProcessEventAtLocation(const gfx::Point& point) OVERRIDE;
+ virtual void ProcessEventAtLocation(const gfx::Point& point) override;
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
ColorChooserView* chooser_view_;
SkScalar hue_;
diff --git a/ui/views/color_chooser/color_chooser_view.h b/ui/views/color_chooser/color_chooser_view.h
index c4481d3..532e823 100644
--- a/ui/views/color_chooser/color_chooser_view.h
+++ b/ui/views/color_chooser/color_chooser_view.h
@@ -48,17 +48,17 @@
class SelectedColorPatchView;
// WidgetDelegate overrides:
- virtual bool CanMinimize() const OVERRIDE;
- virtual View* GetInitiallyFocusedView() OVERRIDE;
- virtual ui::ModalType GetModalType() const OVERRIDE;
- virtual void WindowClosing() OVERRIDE;
- virtual View* GetContentsView() OVERRIDE;
+ virtual bool CanMinimize() const override;
+ virtual View* GetInitiallyFocusedView() override;
+ virtual ui::ModalType GetModalType() const override;
+ virtual void WindowClosing() override;
+ virtual View* GetContentsView() override;
// TextfieldController overrides:
virtual void ContentsChanged(Textfield* sender,
- const base::string16& new_contents) OVERRIDE;
+ const base::string16& new_contents) override;
virtual bool HandleKeyEvent(Textfield* sender,
- const ui::KeyEvent& key_event) OVERRIDE;
+ const ui::KeyEvent& key_event) override;
// The current color in HSV coordinate.
SkScalar hsv_[3];
diff --git a/ui/views/controls/button/blue_button.h b/ui/views/controls/button/blue_button.h
index 8c83c00..cad8245 100644
--- a/ui/views/controls/button/blue_button.h
+++ b/ui/views/controls/button/blue_button.h
@@ -20,9 +20,9 @@
private:
// Overridden from LabelButton:
- virtual void ResetColorsFromNativeTheme() OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual scoped_ptr<LabelButtonBorder> CreateDefaultBorder() const OVERRIDE;
+ virtual void ResetColorsFromNativeTheme() override;
+ virtual const char* GetClassName() const override;
+ virtual scoped_ptr<LabelButtonBorder> CreateDefaultBorder() const override;
DISALLOW_COPY_AND_ASSIGN(BlueButton);
};
diff --git a/ui/views/controls/button/button.h b/ui/views/controls/button/button.h
index 37d639d..6347a43 100644
--- a/ui/views/controls/button/button.h
+++ b/ui/views/controls/button/button.h
@@ -57,8 +57,8 @@
// Overridden from View:
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ base::string16* tooltip) const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
protected:
// Construct the Button with a Listener. The listener can be NULL. This can be
diff --git a/ui/views/controls/button/checkbox.h b/ui/views/controls/button/checkbox.h
index 7bfd5bc..8f473fa 100644
--- a/ui/views/controls/button/checkbox.h
+++ b/ui/views/controls/button/checkbox.h
@@ -32,12 +32,12 @@
protected:
// Overridden from LabelButton:
- virtual void Layout() OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual const gfx::ImageSkia& GetImage(ButtonState for_state) OVERRIDE;
+ virtual void Layout() override;
+ virtual const char* GetClassName() const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual const gfx::ImageSkia& GetImage(ButtonState for_state) override;
// Set the image shown for each button state depending on whether it is
// [checked] or [focused].
@@ -48,11 +48,11 @@
private:
// Overridden from Button:
- virtual void NotifyClick(const ui::Event& event) OVERRIDE;
+ virtual void NotifyClick(const ui::Event& event) override;
- virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual ui::NativeTheme::Part GetThemePart() const override;
virtual void GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ ui::NativeTheme::ExtraParams* params) const override;
// True if the checkbox is checked.
bool checked_;
diff --git a/ui/views/controls/button/custom_button.h b/ui/views/controls/button/custom_button.h
index 6c9a162..5b29358 100644
--- a/ui/views/controls/button/custom_button.h
+++ b/ui/views/controls/button/custom_button.h
@@ -67,27 +67,27 @@
bool IsHotTracked() const;
// Overridden from View:
- virtual void OnEnabledChanged() OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+ virtual void OnEnabledChanged() override;
+ virtual const char* GetClassName() const override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual void OnMouseMoved(const ui::MouseEvent& event) override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnKeyReleased(const ui::KeyEvent& event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
virtual void ShowContextMenu(const gfx::Point& p,
- ui::MenuSourceType source_type) OVERRIDE;
- virtual void OnDragDone() OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE;
+ ui::MenuSourceType source_type) override;
+ virtual void OnDragDone() override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void VisibilityChanged(View* starting_from, bool is_visible) override;
// Overridden from gfx::AnimationDelegate:
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
// Takes ownership of the delegate.
void set_state_changed_delegate(CustomButtonStateChangedDelegate* delegate) {
@@ -115,8 +115,8 @@
// Overridden from View:
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
+ virtual void OnBlur() override;
// The button state (defined in implementation)
ButtonState state_;
diff --git a/ui/views/controls/button/image_button.h b/ui/views/controls/button/image_button.h
index fbdf429..dc861c4 100644
--- a/ui/views/controls/button/image_button.h
+++ b/ui/views/controls/button/image_button.h
@@ -69,14 +69,14 @@
}
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
protected:
// Overridden from View:
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
// Returns the image to paint. This is invoked from paint and returns a value
// from images.
@@ -141,14 +141,14 @@
void SetToggledTooltipText(const base::string16& tooltip);
// Overridden from ImageButton:
- virtual const gfx::ImageSkia& GetImage(ButtonState state) const OVERRIDE;
+ virtual const gfx::ImageSkia& GetImage(ButtonState state) const override;
virtual void SetImage(ButtonState state,
- const gfx::ImageSkia* image) OVERRIDE;
+ const gfx::ImageSkia* image) override;
// Overridden from View:
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ base::string16* tooltip) const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
private:
// The parent class's images_ member is used for the current images,
diff --git a/ui/views/controls/button/label_button.h b/ui/views/controls/button/label_button.h
index b614fe2..fbedf8b 100644
--- a/ui/views/controls/button/label_button.h
+++ b/ui/views/controls/button/label_button.h
@@ -86,11 +86,11 @@
Painter* focus_painter() { return focus_painter_.get(); }
// View:
- virtual void SetBorder(scoped_ptr<Border> border) OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int w) const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual void SetBorder(scoped_ptr<Border> border) override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int w) const override;
+ virtual void Layout() override;
+ virtual const char* GetClassName() const override;
protected:
ImageView* image() const { return image_; }
@@ -101,10 +101,10 @@
virtual gfx::Rect GetChildAreaBounds();
// View:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
// Fill |params| with information about the button.
virtual void GetExtraParams(ui::NativeTheme::ExtraParams* params) const;
@@ -124,7 +124,7 @@
void UpdateThemedBorder();
// NativeThemeDelegate:
- virtual gfx::Rect GetThemePaintRect() const OVERRIDE;
+ virtual gfx::Rect GetThemePaintRect() const override;
private:
FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Init);
@@ -134,20 +134,20 @@
FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, FontList);
// CustomButton:
- virtual void StateChanged() OVERRIDE;
+ virtual void StateChanged() override;
// View:
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
+ virtual void ChildPreferredSizeChanged(View* child) override;
// NativeThemeDelegate:
- virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual ui::NativeTheme::Part GetThemePart() const override;
virtual ui::NativeTheme::State GetThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
- virtual const gfx::Animation* GetThemeAnimation() const OVERRIDE;
+ ui::NativeTheme::ExtraParams* params) const override;
+ virtual const gfx::Animation* GetThemeAnimation() const override;
virtual ui::NativeTheme::State GetBackgroundThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ ui::NativeTheme::ExtraParams* params) const override;
virtual ui::NativeTheme::State GetForegroundThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ ui::NativeTheme::ExtraParams* params) const override;
// Resets |cached_preferred_size_| and marks |cached_preferred_size_valid_|
// as false.
diff --git a/ui/views/controls/button/label_button_border.h b/ui/views/controls/button/label_button_border.h
index a737ba7..936c898 100644
--- a/ui/views/controls/button/label_button_border.h
+++ b/ui/views/controls/button/label_button_border.h
@@ -24,9 +24,9 @@
Button::ButtonStyle style() const { return style_; }
// Overridden from Border:
- virtual void Paint(const View& view, gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual void Paint(const View& view, gfx::Canvas* canvas) override;
+ virtual gfx::Insets GetInsets() const override;
+ virtual gfx::Size GetMinimumSize() const override;
void set_insets(const gfx::Insets& insets) { insets_ = insets; }
diff --git a/ui/views/controls/button/menu_button.h b/ui/views/controls/button/menu_button.h
index 1eedc0f..a1baf05 100644
--- a/ui/views/controls/button/menu_button.h
+++ b/ui/views/controls/button/menu_button.h
@@ -65,25 +65,25 @@
virtual bool Activate();
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual void OnMouseMoved(const ui::MouseEvent& event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnKeyReleased(const ui::KeyEvent& event) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
protected:
// Paint the menu marker image.
void PaintMenuMarker(gfx::Canvas* canvas);
// Overridden from LabelButton:
- virtual gfx::Rect GetChildAreaBounds() OVERRIDE;
+ virtual gfx::Rect GetChildAreaBounds() override;
// Offset of the associated menu position.
gfx::Point menu_offset_;
diff --git a/ui/views/controls/button/menu_button_unittest.cc b/ui/views/controls/button/menu_button_unittest.cc
index 9cff544..3b153ad 100644
--- a/ui/views/controls/button/menu_button_unittest.cc
+++ b/ui/views/controls/button/menu_button_unittest.cc
@@ -19,7 +19,7 @@
MenuButtonTest() : widget_(NULL), button_(NULL) {}
virtual ~MenuButtonTest() {}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (widget_ && !widget_->IsClosed())
widget_->Close();
@@ -85,7 +85,7 @@
last_event_type_(ui::ET_UNKNOWN) {}
virtual ~TestButtonListener() {}
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE {
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override {
last_sender_ = sender;
CustomButton* custom_button = CustomButton::AsCustomButton(sender);
DCHECK(custom_button);
@@ -111,7 +111,7 @@
virtual ~TestMenuButtonListener() {}
virtual void OnMenuButtonClicked(View* source,
- const gfx::Point& /*point*/) OVERRIDE {
+ const gfx::Point& /*point*/) override {
last_source_ = source;
CustomButton* custom_button = CustomButton::AsCustomButton(source);
DCHECK(custom_button);
diff --git a/ui/views/controls/button/radio_button.h b/ui/views/controls/button/radio_button.h
index edbb2c6..b24e0be 100644
--- a/ui/views/controls/button/radio_button.h
+++ b/ui/views/controls/button/radio_button.h
@@ -21,20 +21,20 @@
virtual ~RadioButton();
// Overridden from View:
- virtual const char* GetClassName() const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual View* GetSelectedViewForGroup(int group) OVERRIDE;
- virtual bool IsGroupFocusTraversable() const OVERRIDE;
- virtual void OnFocus() OVERRIDE;
+ virtual const char* GetClassName() const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual View* GetSelectedViewForGroup(int group) override;
+ virtual bool IsGroupFocusTraversable() const override;
+ virtual void OnFocus() override;
// Overridden from Button:
- virtual void NotifyClick(const ui::Event& event) OVERRIDE;
+ virtual void NotifyClick(const ui::Event& event) override;
// Overridden from LabelButton:
- virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual ui::NativeTheme::Part GetThemePart() const override;
// Overridden from Checkbox:
- virtual void SetChecked(bool checked) OVERRIDE;
+ virtual void SetChecked(bool checked) override;
private:
DISALLOW_COPY_AND_ASSIGN(RadioButton);
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
index 81b3ae5..62b8ec3 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -94,7 +94,7 @@
}
virtual ~TransparentButton() {}
- virtual bool OnMousePressed(const ui::MouseEvent& mouse_event) OVERRIDE {
+ virtual bool OnMousePressed(const ui::MouseEvent& mouse_event) override {
parent()->RequestFocus();
return true;
}
diff --git a/ui/views/controls/combobox/combobox.h b/ui/views/controls/combobox/combobox.h
index 24011de..aabb476 100644
--- a/ui/views/controls/combobox/combobox.h
+++ b/ui/views/controls/combobox/combobox.h
@@ -93,36 +93,36 @@
bool invalid() const { return invalid_; }
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& e) OVERRIDE;
- virtual bool OnKeyReleased(const ui::KeyEvent& e) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual ui::TextInputClient* GetTextInputClient() OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override;
+ virtual bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& e) override;
+ virtual bool OnKeyReleased(const ui::KeyEvent& e) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual ui::TextInputClient* GetTextInputClient() override;
+ virtual void Layout() override;
// Overridden from MenuDelegate:
- virtual bool IsItemChecked(int id) const OVERRIDE;
- virtual bool IsCommandEnabled(int id) const OVERRIDE;
- virtual void ExecuteCommand(int id) OVERRIDE;
+ virtual bool IsItemChecked(int id) const override;
+ virtual bool IsCommandEnabled(int id) const override;
+ virtual void ExecuteCommand(int id) override;
virtual bool GetAccelerator(int id,
- ui::Accelerator* accelerator) const OVERRIDE;
+ ui::Accelerator* accelerator) const override;
// Overridden from PrefixDelegate:
- virtual int GetRowCount() OVERRIDE;
- virtual int GetSelectedRow() OVERRIDE;
- virtual void SetSelectedRow(int row) OVERRIDE;
- virtual base::string16 GetTextForRow(int row) OVERRIDE;
+ virtual int GetRowCount() override;
+ virtual int GetSelectedRow() override;
+ virtual void SetSelectedRow(int row) override;
+ virtual base::string16 GetTextForRow(int row) override;
// Overriden from ComboboxModelObserver:
- virtual void OnComboboxModelChanged(ui::ComboboxModel* model) OVERRIDE;
+ virtual void OnComboboxModelChanged(ui::ComboboxModel* model) override;
// Overriden from ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
private:
FRIEND_TEST_ALL_PREFIXES(ComboboxTest, Click);
diff --git a/ui/views/controls/combobox/combobox_unittest.cc b/ui/views/controls/combobox/combobox_unittest.cc
index 5621525..8a2043f 100644
--- a/ui/views/controls/combobox/combobox_unittest.cc
+++ b/ui/views/controls/combobox/combobox_unittest.cc
@@ -40,7 +40,7 @@
const gfx::Rect& bounds,
MenuAnchorPosition anchor,
ui::MenuSourceType source_type,
- int32 types) OVERRIDE {
+ int32 types) override {
executed_ = true;
return MenuRunner::NORMAL_EXIT;
}
@@ -60,13 +60,13 @@
key_handled_(false),
key_received_(false) {}
- virtual bool OnKeyPressed(const ui::KeyEvent& e) OVERRIDE {
+ virtual bool OnKeyPressed(const ui::KeyEvent& e) override {
key_received_ = true;
key_handled_ = Combobox::OnKeyPressed(e);
return key_handled_;
}
- virtual bool OnKeyReleased(const ui::KeyEvent& e) OVERRIDE {
+ virtual bool OnKeyReleased(const ui::KeyEvent& e) override {
key_received_ = true;
key_handled_ = Combobox::OnKeyReleased(e);
return key_handled_;
@@ -95,21 +95,21 @@
static const int kItemCount = 10;
// ui::ComboboxModel:
- virtual int GetItemCount() const OVERRIDE {
+ virtual int GetItemCount() const override {
return kItemCount;
}
- virtual base::string16 GetItemAt(int index) OVERRIDE {
+ virtual base::string16 GetItemAt(int index) override {
if (IsItemSeparatorAt(index)) {
NOTREACHED();
return ASCIIToUTF16("SEPARATOR");
}
return ASCIIToUTF16(index % 2 == 0 ? "PEANUT BUTTER" : "JELLY");
}
- virtual bool IsItemSeparatorAt(int index) OVERRIDE {
+ virtual bool IsItemSeparatorAt(int index) override {
return separators_.find(index) != separators_.end();
}
- virtual int GetDefaultIndex() const OVERRIDE {
+ virtual int GetDefaultIndex() const override {
// Return the first index that is not a separator.
for (int index = 0; index < kItemCount; ++index) {
if (separators_.find(index) == separators_.end())
@@ -137,13 +137,13 @@
virtual ~VectorComboboxModel() {}
// ui::ComboboxModel:
- virtual int GetItemCount() const OVERRIDE {
+ virtual int GetItemCount() const override {
return (int)values_->size();
}
- virtual base::string16 GetItemAt(int index) OVERRIDE {
+ virtual base::string16 GetItemAt(int index) override {
return ASCIIToUTF16(values_->at(index));
}
- virtual bool IsItemSeparatorAt(int index) OVERRIDE {
+ virtual bool IsItemSeparatorAt(int index) override {
return false;
}
@@ -157,7 +157,7 @@
virtual ~EvilListener() {};
// ComboboxListener:
- virtual void OnPerformAction(Combobox* combobox) OVERRIDE {
+ virtual void OnPerformAction(Combobox* combobox) override {
delete combobox;
deleted_ = true;
}
@@ -175,7 +175,7 @@
TestComboboxListener() : perform_action_index_(-1), actions_performed_(0) {}
virtual ~TestComboboxListener() {}
- virtual void OnPerformAction(views::Combobox* combobox) OVERRIDE {
+ virtual void OnPerformAction(views::Combobox* combobox) override {
perform_action_index_ = combobox->selected_index();
actions_performed_++;
}
@@ -206,7 +206,7 @@
public:
ComboboxTest() : widget_(NULL), combobox_(NULL) {}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (widget_)
widget_->Close();
ViewsTestBase::TearDown();
diff --git a/ui/views/controls/focusable_border.h b/ui/views/controls/focusable_border.h
index b8f9aa7..9afa6ea 100644
--- a/ui/views/controls/focusable_border.h
+++ b/ui/views/controls/focusable_border.h
@@ -32,9 +32,9 @@
void UseDefaultColor();
// Overridden from Border:
- virtual void Paint(const View& view, gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual void Paint(const View& view, gfx::Canvas* canvas) override;
+ virtual gfx::Insets GetInsets() const override;
+ virtual gfx::Size GetMinimumSize() const override;
private:
gfx::Insets insets_;
diff --git a/ui/views/controls/glow_hover_controller.h b/ui/views/controls/glow_hover_controller.h
index 2ac423e..59d27a7 100644
--- a/ui/views/controls/glow_hover_controller.h
+++ b/ui/views/controls/glow_hover_controller.h
@@ -65,8 +65,8 @@
void Draw(gfx::Canvas* canvas, const gfx::ImageSkia& mask_image) const;
// gfx::AnimationDelegate overrides:
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationEnded(const gfx::Animation* animation) override;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
private:
// View we're drawing to.
diff --git a/ui/views/controls/image_view.h b/ui/views/controls/image_view.h
index a05b106..00b8209 100644
--- a/ui/views/controls/image_view.h
+++ b/ui/views/controls/image_view.h
@@ -80,14 +80,14 @@
void SetFocusPainter(scoped_ptr<Painter> focus_painter);
// Overriden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
- virtual bool CanProcessEventsWithinSubtree() const OVERRIDE;
+ base::string16* tooltip) const override;
+ virtual bool CanProcessEventsWithinSubtree() const override;
private:
void OnPaintImage(gfx::Canvas* canvas);
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h
index 755ca14..727b6db 100644
--- a/ui/views/controls/label.h
+++ b/ui/views/controls/label.h
@@ -120,17 +120,17 @@
const base::string16& GetLayoutTextForTesting() const;
// View:
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual int GetBaseline() const OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual int GetHeightForWidth(int w) const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) OVERRIDE;
- virtual bool CanProcessEventsWithinSubtree() const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual gfx::Insets GetInsets() const override;
+ virtual int GetBaseline() const override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual int GetHeightForWidth(int w) const override;
+ virtual const char* GetClassName() const override;
+ virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) override;
+ virtual bool CanProcessEventsWithinSubtree() const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
+ base::string16* tooltip) const override;
protected:
// Called by Paint to paint the text.
@@ -144,9 +144,9 @@
SkColor disabled_color() const { return actual_disabled_color_; }
// View:
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
private:
// These tests call CalculateDrawStringParams in order to verify the
diff --git a/ui/views/controls/link.h b/ui/views/controls/link.h
index 4d5cf6b..951de2d 100644
--- a/ui/views/controls/link.h
+++ b/ui/views/controls/link.h
@@ -34,24 +34,24 @@
void set_listener(LinkListener* listener) { listener_ = listener; }
// Label:
- virtual const char* GetClassName() const OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
- virtual bool CanProcessEventsWithinSubtree() const OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual const char* GetClassName() const override;
+ virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
+ virtual bool CanProcessEventsWithinSubtree() const override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
virtual bool SkipDefaultKeyEventProcessing(
- const ui::KeyEvent& event) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void OnEnabledChanged() OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual void SetFontList(const gfx::FontList& font_list) OVERRIDE;
- virtual void SetText(const base::string16& text) OVERRIDE;
- virtual void SetEnabledColor(SkColor color) OVERRIDE;
+ const ui::KeyEvent& event) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void OnEnabledChanged() override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual void SetFontList(const gfx::FontList& font_list) override;
+ virtual void SetText(const base::string16& text) override;
+ virtual void SetEnabledColor(SkColor color) override;
void SetPressedColor(SkColor color);
void SetUnderline(bool underline);
diff --git a/ui/views/controls/menu/display_change_listener_aura.cc b/ui/views/controls/menu/display_change_listener_aura.cc
index e6df560..7bab443 100644
--- a/ui/views/controls/menu/display_change_listener_aura.cc
+++ b/ui/views/controls/menu/display_change_listener_aura.cc
@@ -22,8 +22,8 @@
// aura::WindowObserver overrides:
virtual void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual void OnWindowDestroying(aura::Window* window) override;
private:
MenuRunner* menu_runner_;
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
index a020144..6da540d 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -164,7 +164,7 @@
void UpdateSubmenuSelection(SubmenuView* source);
// WidgetObserver overrides:
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE;
+ virtual void OnWidgetDestroying(Widget* widget) override;
// Only used for testing.
bool IsCancelAllTimerRunningForTest();
diff --git a/ui/views/controls/menu/menu_controller_unittest.cc b/ui/views/controls/menu/menu_controller_unittest.cc
index 334c431..ba4dd13 100644
--- a/ui/views/controls/menu/menu_controller_unittest.cc
+++ b/ui/views/controls/menu/menu_controller_unittest.cc
@@ -61,7 +61,7 @@
virtual ~TestNullTargeter() {}
virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root,
- ui::Event* event) OVERRIDE {
+ ui::Event* event) override {
return NULL;
}
@@ -82,7 +82,7 @@
virtual void PrepareNestedLoopClosures(
base::MessagePumpDispatcher* dispatcher,
base::Closure* run_closure,
- base::Closure* quit_closure) OVERRIDE {
+ base::Closure* quit_closure) override {
scoped_ptr<base::RunLoop> run_loop(new base::RunLoop());
*quit_closure = run_loop->QuitClosure();
*run_closure = base::Bind(&TestDispatcherClient::RunNestedDispatcher,
diff --git a/ui/views/controls/menu/menu_event_dispatcher_linux.h b/ui/views/controls/menu/menu_event_dispatcher_linux.h
index bdc76fd..a516d2e 100644
--- a/ui/views/controls/menu/menu_event_dispatcher_linux.h
+++ b/ui/views/controls/menu/menu_event_dispatcher_linux.h
@@ -20,8 +20,8 @@
private:
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
MenuController* menu_controller_;
diff --git a/ui/views/controls/menu/menu_host.h b/ui/views/controls/menu/menu_host.h
index a169661..31ad7de 100644
--- a/ui/views/controls/menu/menu_host.h
+++ b/ui/views/controls/menu/menu_host.h
@@ -56,12 +56,12 @@
private:
// Overridden from Widget:
- virtual internal::RootView* CreateRootView() OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual void OnNativeWidgetDestroyed() OVERRIDE;
- virtual void OnOwnerClosing() OVERRIDE;
- virtual void OnDragWillStart() OVERRIDE;
- virtual void OnDragComplete() OVERRIDE;
+ virtual internal::RootView* CreateRootView() override;
+ virtual void OnMouseCaptureLost() override;
+ virtual void OnNativeWidgetDestroyed() override;
+ virtual void OnOwnerClosing() override;
+ virtual void OnDragWillStart() override;
+ virtual void OnDragComplete() override;
// The view we contain.
SubmenuView* submenu_;
diff --git a/ui/views/controls/menu/menu_host_root_view.h b/ui/views/controls/menu/menu_host_root_view.h
index 4031dec..f08c813 100644
--- a/ui/views/controls/menu/menu_host_root_view.h
+++ b/ui/views/controls/menu/menu_host_root_view.h
@@ -25,15 +25,15 @@
void ClearSubmenu() { submenu_ = NULL; }
// Overridden from View:
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseMoved(const ui::MouseEvent& event) override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
private:
// ui::EventProcessor:
- virtual void OnEventProcessingFinished(ui::Event* event) OVERRIDE;
+ virtual void OnEventProcessingFinished(ui::Event* event) override;
// Returns the MenuController for this MenuHostRootView.
MenuController* GetMenuController();
diff --git a/ui/views/controls/menu/menu_image_util.cc b/ui/views/controls/menu/menu_image_util.cc
index c85afd7..84f33bd 100644
--- a/ui/views/controls/menu/menu_image_util.cc
+++ b/ui/views/controls/menu/menu_image_util.cc
@@ -42,7 +42,7 @@
}
virtual ~RadioButtonImageSource() {}
- virtual void Draw(gfx::Canvas* canvas) OVERRIDE {
+ virtual void Draw(gfx::Canvas* canvas) override {
canvas->Translate(gfx::Vector2d(1, 1));
SkPoint gradient_points[3];
@@ -105,7 +105,7 @@
image_id_(image_id) {}
virtual ~SubmenuArrowImageSource() {}
- virtual void Draw(gfx::Canvas* canvas) OVERRIDE {
+ virtual void Draw(gfx::Canvas* canvas) override {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
const gfx::ImageSkia* r = rb.GetImageNamed(image_id_).ToImageSkia();
canvas->Scale(-1, 1);
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index a47557f..6b11d3a 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -49,7 +49,7 @@
}
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE {
+ base::string16* tooltip) const override {
// Empty menu items shouldn't have a tooltip.
return false;
}
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
index 97cf215..cc4150e 100644
--- a/ui/views/controls/menu/menu_item_view.h
+++ b/ui/views/controls/menu/menu_item_view.h
@@ -118,8 +118,8 @@
// Overridden from View:
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ base::string16* tooltip) const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
// Returns the preferred height of menu items. This is only valid when the
// menu is about to be shown.
@@ -260,15 +260,15 @@
int GetCommand() const { return command_; }
// Paints the menu item.
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// Returns the preferred size of this item.
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
// Gets the preferred height for the given |width|. This is only different
// from GetPreferredSize().width() if the item has a child view with flexible
// dimensions.
- virtual int GetHeightForWidth(int width) const OVERRIDE;
+ virtual int GetHeightForWidth(int width) const override;
// Return the preferred dimensions of the item in pixel.
const MenuItemDimensions& GetDimensions() const;
@@ -305,7 +305,7 @@
void ChildrenChanged();
// Sizes any child views.
- virtual void Layout() OVERRIDE;
+ virtual void Layout() override;
// Returns true if the menu has mnemonics. This only useful on the root menu
// item.
@@ -330,9 +330,9 @@
// MenuRunner owns MenuItemView and should be the only one deleting it.
virtual ~MenuItemView();
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
+ virtual void ChildPreferredSizeChanged(View* child) override;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual const char* GetClassName() const override;
// Returns the preferred size (and padding) of any children.
virtual gfx::Size GetChildPreferredSize() const;
diff --git a/ui/views/controls/menu/menu_item_view_unittest.cc b/ui/views/controls/menu/menu_item_view_unittest.cc
index 23bf4e4..961d90c 100644
--- a/ui/views/controls/menu/menu_item_view_unittest.cc
+++ b/ui/views/controls/menu/menu_item_view_unittest.cc
@@ -19,10 +19,10 @@
virtual ~SquareView() {}
private:
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(1, 1);
}
- virtual int GetHeightForWidth(int width) const OVERRIDE {
+ virtual int GetHeightForWidth(int width) const override {
return width;
}
};
diff --git a/ui/views/controls/menu/menu_message_loop_aura.cc b/ui/views/controls/menu/menu_message_loop_aura.cc
index 0d7e99a..a2b7651 100644
--- a/ui/views/controls/menu/menu_message_loop_aura.cc
+++ b/ui/views/controls/menu/menu_message_loop_aura.cc
@@ -61,16 +61,16 @@
// aura::client::ActivationChangeObserver:
virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE {
+ aura::Window* lost_active) override {
if (!controller_->drag_in_progress())
controller_->CancelAll();
}
// aura::WindowObserver:
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE { Cleanup(); }
+ virtual void OnWindowDestroying(aura::Window* window) override { Cleanup(); }
// ui::EventHandler:
- virtual void OnCancelMode(ui::CancelModeEvent* event) OVERRIDE {
+ virtual void OnCancelMode(ui::CancelModeEvent* event) override {
controller_->CancelAll();
}
diff --git a/ui/views/controls/menu/menu_message_loop_aura.h b/ui/views/controls/menu/menu_message_loop_aura.h
index 49e8a39..1e58059 100644
--- a/ui/views/controls/menu/menu_message_loop_aura.h
+++ b/ui/views/controls/menu/menu_message_loop_aura.h
@@ -28,13 +28,13 @@
// Overridden from MenuMessageLoop:
virtual void Run(MenuController* controller,
Widget* owner,
- bool nested_menu) OVERRIDE;
- virtual bool ShouldQuitNow() const OVERRIDE;
- virtual void QuitNow() OVERRIDE;
+ bool nested_menu) override;
+ virtual bool ShouldQuitNow() const override;
+ virtual void QuitNow() override;
virtual void RepostEventToWindow(const ui::LocatedEvent& event,
gfx::NativeWindow window,
- const gfx::Point& screen_loc) OVERRIDE;
- virtual void ClearOwner() OVERRIDE;
+ const gfx::Point& screen_loc) override;
+ virtual void ClearOwner() override;
private:
// Owner of child windows.
diff --git a/ui/views/controls/menu/menu_message_loop_mac.h b/ui/views/controls/menu/menu_message_loop_mac.h
index b77d263..5508e7d 100644
--- a/ui/views/controls/menu/menu_message_loop_mac.h
+++ b/ui/views/controls/menu/menu_message_loop_mac.h
@@ -18,13 +18,13 @@
// Overridden from MenuMessageLoop:
virtual void Run(MenuController* controller,
Widget* owner,
- bool nested_menu) OVERRIDE;
- virtual bool ShouldQuitNow() const OVERRIDE;
- virtual void QuitNow() OVERRIDE;
+ bool nested_menu) override;
+ virtual bool ShouldQuitNow() const override;
+ virtual void QuitNow() override;
virtual void RepostEventToWindow(const ui::LocatedEvent& event,
gfx::NativeWindow window,
- const gfx::Point& screen_loc) OVERRIDE;
- virtual void ClearOwner() OVERRIDE;
+ const gfx::Point& screen_loc) override;
+ virtual void ClearOwner() override;
private:
DISALLOW_COPY_AND_ASSIGN(MenuMessageLoopMac);
diff --git a/ui/views/controls/menu/menu_message_pump_dispatcher_win.h b/ui/views/controls/menu/menu_message_pump_dispatcher_win.h
index 31f1b36..9f84171 100644
--- a/ui/views/controls/menu/menu_message_pump_dispatcher_win.h
+++ b/ui/views/controls/menu/menu_message_pump_dispatcher_win.h
@@ -23,7 +23,7 @@
private:
// base::MessagePumpDispatcher:
- virtual uint32_t Dispatch(const base::NativeEvent& event) OVERRIDE;
+ virtual uint32_t Dispatch(const base::NativeEvent& event) override;
MenuController* menu_controller_;
diff --git a/ui/views/controls/menu/menu_model_adapter.h b/ui/views/controls/menu/menu_model_adapter.h
index 353d010..54ce037 100644
--- a/ui/views/controls/menu/menu_model_adapter.h
+++ b/ui/views/controls/menu/menu_model_adapter.h
@@ -62,20 +62,20 @@
int index);
// views::MenuDelegate implementation.
- virtual void ExecuteCommand(int id) OVERRIDE;
- virtual void ExecuteCommand(int id, int mouse_event_flags) OVERRIDE;
+ virtual void ExecuteCommand(int id) override;
+ virtual void ExecuteCommand(int id, int mouse_event_flags) override;
virtual bool IsTriggerableEvent(MenuItemView* source,
- const ui::Event& e) OVERRIDE;
+ const ui::Event& e) override;
virtual bool GetAccelerator(int id,
- ui::Accelerator* accelerator) const OVERRIDE;
- virtual base::string16 GetLabel(int id) const OVERRIDE;
- virtual const gfx::FontList* GetLabelFontList(int id) const OVERRIDE;
- virtual bool IsCommandEnabled(int id) const OVERRIDE;
- virtual bool IsCommandVisible(int id) const OVERRIDE;
- virtual bool IsItemChecked(int id) const OVERRIDE;
- virtual void SelectionChanged(MenuItemView* menu) OVERRIDE;
- virtual void WillShowMenu(MenuItemView* menu) OVERRIDE;
- virtual void WillHideMenu(MenuItemView* menu) OVERRIDE;
+ ui::Accelerator* accelerator) const override;
+ virtual base::string16 GetLabel(int id) const override;
+ virtual const gfx::FontList* GetLabelFontList(int id) const override;
+ virtual bool IsCommandEnabled(int id) const override;
+ virtual bool IsCommandVisible(int id) const override;
+ virtual bool IsItemChecked(int id) const override;
+ virtual void SelectionChanged(MenuItemView* menu) override;
+ virtual void WillShowMenu(MenuItemView* menu) override;
+ virtual void WillHideMenu(MenuItemView* menu) override;
private:
// Implementation of BuildMenu().
diff --git a/ui/views/controls/menu/menu_model_adapter_unittest.cc b/ui/views/controls/menu/menu_model_adapter_unittest.cc
index b3c4735..b98fba0 100644
--- a/ui/views/controls/menu/menu_model_adapter_unittest.cc
+++ b/ui/views/controls/menu/menu_model_adapter_unittest.cc
@@ -30,95 +30,95 @@
// ui::MenuModel implementation:
- virtual bool HasIcons() const OVERRIDE {
+ virtual bool HasIcons() const override {
return false;
}
- virtual int GetItemCount() const OVERRIDE {
+ virtual int GetItemCount() const override {
return static_cast<int>(items_.size());
}
- virtual ItemType GetTypeAt(int index) const OVERRIDE {
+ virtual ItemType GetTypeAt(int index) const override {
return items_[index].type;
}
virtual ui::MenuSeparatorType GetSeparatorTypeAt(
- int index) const OVERRIDE {
+ int index) const override {
return ui::NORMAL_SEPARATOR;
}
- virtual int GetCommandIdAt(int index) const OVERRIDE {
+ virtual int GetCommandIdAt(int index) const override {
return index + command_id_base_;
}
- virtual base::string16 GetLabelAt(int index) const OVERRIDE {
+ virtual base::string16 GetLabelAt(int index) const override {
return items_[index].label;
}
- virtual bool IsItemDynamicAt(int index) const OVERRIDE {
+ virtual bool IsItemDynamicAt(int index) const override {
return false;
}
- virtual const gfx::FontList* GetLabelFontListAt(int index) const OVERRIDE {
+ virtual const gfx::FontList* GetLabelFontListAt(int index) const override {
return NULL;
}
virtual bool GetAcceleratorAt(int index,
- ui::Accelerator* accelerator) const OVERRIDE {
+ ui::Accelerator* accelerator) const override {
return false;
}
- virtual bool IsItemCheckedAt(int index) const OVERRIDE {
+ virtual bool IsItemCheckedAt(int index) const override {
return false;
}
- virtual int GetGroupIdAt(int index) const OVERRIDE {
+ virtual int GetGroupIdAt(int index) const override {
return 0;
}
- virtual bool GetIconAt(int index, gfx::Image* icon) OVERRIDE {
+ virtual bool GetIconAt(int index, gfx::Image* icon) override {
return false;
}
virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(
- int index) const OVERRIDE {
+ int index) const override {
return NULL;
}
- virtual bool IsEnabledAt(int index) const OVERRIDE {
+ virtual bool IsEnabledAt(int index) const override {
return true;
}
- virtual bool IsVisibleAt(int index) const OVERRIDE {
+ virtual bool IsVisibleAt(int index) const override {
return true;
}
- virtual MenuModel* GetSubmenuModelAt(int index) const OVERRIDE {
+ virtual MenuModel* GetSubmenuModelAt(int index) const override {
return items_[index].submenu;
}
- virtual void HighlightChangedTo(int index) OVERRIDE {
+ virtual void HighlightChangedTo(int index) override {
}
- virtual void ActivatedAt(int index) OVERRIDE {
+ virtual void ActivatedAt(int index) override {
set_last_activation(index);
}
- virtual void ActivatedAt(int index, int event_flags) OVERRIDE {
+ virtual void ActivatedAt(int index, int event_flags) override {
ActivatedAt(index);
}
- virtual void MenuWillShow() OVERRIDE {
+ virtual void MenuWillShow() override {
}
- virtual void MenuClosed() OVERRIDE {
+ virtual void MenuClosed() override {
}
virtual void SetMenuModelDelegate(
- ui::MenuModelDelegate* delegate) OVERRIDE {
+ ui::MenuModelDelegate* delegate) override {
}
- virtual ui::MenuModelDelegate* GetMenuModelDelegate() const OVERRIDE {
+ virtual ui::MenuModelDelegate* GetMenuModelDelegate() const override {
return NULL;
}
diff --git a/ui/views/controls/menu/menu_runner_cocoa_unittest.mm b/ui/views/controls/menu/menu_runner_cocoa_unittest.mm
index b43c6e8..bfd5723 100644
--- a/ui/views/controls/menu/menu_runner_cocoa_unittest.mm
+++ b/ui/views/controls/menu/menu_runner_cocoa_unittest.mm
@@ -17,7 +17,7 @@
MenuRunnerCocoaTest() : runner_(NULL) {}
virtual ~MenuRunnerCocoaTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
menu_.reset(new ui::SimpleMenuModel(NULL));
@@ -27,7 +27,7 @@
EXPECT_FALSE(runner_->IsRunning());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (runner_) {
runner_->Release();
runner_ = NULL;
diff --git a/ui/views/controls/menu/menu_runner_impl.h b/ui/views/controls/menu/menu_runner_impl.h
index 9df132a..910f4b7 100644
--- a/ui/views/controls/menu/menu_runner_impl.h
+++ b/ui/views/controls/menu/menu_runner_impl.h
@@ -27,19 +27,19 @@
public:
explicit MenuRunnerImpl(MenuItemView* menu);
- virtual bool IsRunning() const OVERRIDE;
- virtual void Release() OVERRIDE;
+ virtual bool IsRunning() const override;
+ virtual void Release() override;
virtual MenuRunner::RunResult RunMenuAt(Widget* parent,
MenuButton* button,
const gfx::Rect& bounds,
MenuAnchorPosition anchor,
- int32 run_types) OVERRIDE;
- virtual void Cancel() OVERRIDE;
- virtual base::TimeDelta GetClosingEventTime() const OVERRIDE;
+ int32 run_types) override;
+ virtual void Cancel() override;
+ virtual base::TimeDelta GetClosingEventTime() const override;
// MenuControllerDelegate:
- virtual void DropMenuClosed(NotifyType type, MenuItemView* menu) OVERRIDE;
- virtual void SiblingMenuCreated(MenuItemView* menu) OVERRIDE;
+ virtual void DropMenuClosed(NotifyType type, MenuItemView* menu) override;
+ virtual void SiblingMenuCreated(MenuItemView* menu) override;
private:
virtual ~MenuRunnerImpl();
diff --git a/ui/views/controls/menu/menu_runner_impl_adapter.h b/ui/views/controls/menu/menu_runner_impl_adapter.h
index 3708de2..eba68c4 100644
--- a/ui/views/controls/menu/menu_runner_impl_adapter.h
+++ b/ui/views/controls/menu/menu_runner_impl_adapter.h
@@ -18,15 +18,15 @@
explicit MenuRunnerImplAdapter(ui::MenuModel* menu_model);
// MenuRunnerImplInterface:
- virtual bool IsRunning() const OVERRIDE;
- virtual void Release() OVERRIDE;
+ virtual bool IsRunning() const override;
+ virtual void Release() override;
virtual MenuRunner::RunResult RunMenuAt(Widget* parent,
MenuButton* button,
const gfx::Rect& bounds,
MenuAnchorPosition anchor,
- int32 types) OVERRIDE;
- virtual void Cancel() OVERRIDE;
- virtual base::TimeDelta GetClosingEventTime() const OVERRIDE;
+ int32 types) override;
+ virtual void Cancel() override;
+ virtual base::TimeDelta GetClosingEventTime() const override;
private:
virtual ~MenuRunnerImplAdapter();
diff --git a/ui/views/controls/menu/menu_runner_impl_cocoa.h b/ui/views/controls/menu/menu_runner_impl_cocoa.h
index a24c081..831d322 100644
--- a/ui/views/controls/menu/menu_runner_impl_cocoa.h
+++ b/ui/views/controls/menu/menu_runner_impl_cocoa.h
@@ -20,15 +20,15 @@
public:
explicit MenuRunnerImplCocoa(ui::MenuModel* menu);
- virtual bool IsRunning() const OVERRIDE;
- virtual void Release() OVERRIDE;
+ virtual bool IsRunning() const override;
+ virtual void Release() override;
virtual MenuRunner::RunResult RunMenuAt(Widget* parent,
MenuButton* button,
const gfx::Rect& bounds,
MenuAnchorPosition anchor,
- int32 run_types) OVERRIDE;
- virtual void Cancel() OVERRIDE;
- virtual base::TimeDelta GetClosingEventTime() const OVERRIDE;
+ int32 run_types) override;
+ virtual void Cancel() override;
+ virtual base::TimeDelta GetClosingEventTime() const override;
private:
virtual ~MenuRunnerImplCocoa();
diff --git a/ui/views/controls/menu/menu_scroll_view_container.cc b/ui/views/controls/menu/menu_scroll_view_container.cc
index 451bd15..2d3db74 100644
--- a/ui/views/controls/menu/menu_scroll_view_container.cc
+++ b/ui/views/controls/menu/menu_scroll_view_container.cc
@@ -40,37 +40,37 @@
pref_height_(MenuItemView::pref_menu_height()) {
}
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(
host_->GetMenuItem()->GetMenuConfig().scroll_arrow_height * 2 - 1,
pref_height_);
}
- virtual bool CanDrop(const OSExchangeData& data) OVERRIDE {
+ virtual bool CanDrop(const OSExchangeData& data) override {
DCHECK(host_->GetMenuItem()->GetMenuController());
return true; // Always return true so that drop events are targeted to us.
}
- virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE {
+ virtual void OnDragEntered(const ui::DropTargetEvent& event) override {
DCHECK(host_->GetMenuItem()->GetMenuController());
host_->GetMenuItem()->GetMenuController()->OnDragEnteredScrollButton(
host_, is_up_);
}
- virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE {
+ virtual int OnDragUpdated(const ui::DropTargetEvent& event) override {
return ui::DragDropTypes::DRAG_NONE;
}
- virtual void OnDragExited() OVERRIDE {
+ virtual void OnDragExited() override {
DCHECK(host_->GetMenuItem()->GetMenuController());
host_->GetMenuItem()->GetMenuController()->OnDragExitedScrollButton(host_);
}
- virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE {
+ virtual int OnPerformDrop(const ui::DropTargetEvent& event) override {
return ui::DragDropTypes::DRAG_NONE;
}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
const MenuConfig& config = host_->GetMenuItem()->GetMenuConfig();
// The background.
@@ -139,7 +139,7 @@
AddChildView(child);
}
- virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE {
+ virtual void ScrollRectToVisible(const gfx::Rect& rect) override {
// NOTE: this assumes we only want to scroll in the y direction.
// If the rect is already visible, do not scroll.
diff --git a/ui/views/controls/menu/menu_scroll_view_container.h b/ui/views/controls/menu/menu_scroll_view_container.h
index dc7c1ac..fb0c2ff 100644
--- a/ui/views/controls/menu/menu_scroll_view_container.h
+++ b/ui/views/controls/menu/menu_scroll_view_container.h
@@ -31,14 +31,14 @@
void SetBubbleArrowOffset(int offset);
// View overrides.
- virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual void OnPaintBackground(gfx::Canvas* canvas) override;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
protected:
// View override.
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
private:
// Create the default border.
diff --git a/ui/views/controls/menu/menu_separator.h b/ui/views/controls/menu/menu_separator.h
index 93bf3d4..feb629a 100644
--- a/ui/views/controls/menu/menu_separator.h
+++ b/ui/views/controls/menu/menu_separator.h
@@ -20,8 +20,8 @@
parent_menu_item_(parent) {}
// View overrides.
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual gfx::Size GetPreferredSize() const override;
private:
// Gets the bounds where the separator should be painted.
diff --git a/ui/views/controls/menu/native_menu_win.h b/ui/views/controls/menu/native_menu_win.h
index ce3a072..39dc37e 100644
--- a/ui/views/controls/menu/native_menu_win.h
+++ b/ui/views/controls/menu/native_menu_win.h
@@ -33,15 +33,15 @@
virtual ~NativeMenuWin();
// Overridden from MenuWrapper:
- virtual void RunMenuAt(const gfx::Point& point, int alignment) OVERRIDE;
- virtual void CancelMenu() OVERRIDE;
- virtual void Rebuild(MenuInsertionDelegateWin* delegate) OVERRIDE;
- virtual void UpdateStates() OVERRIDE;
- virtual HMENU GetNativeMenu() const OVERRIDE;
- virtual MenuAction GetMenuAction() const OVERRIDE;
- virtual void AddMenuListener(MenuListener* listener) OVERRIDE;
- virtual void RemoveMenuListener(MenuListener* listener) OVERRIDE;
- virtual void SetMinimumWidth(int width) OVERRIDE;
+ virtual void RunMenuAt(const gfx::Point& point, int alignment) override;
+ virtual void CancelMenu() override;
+ virtual void Rebuild(MenuInsertionDelegateWin* delegate) override;
+ virtual void UpdateStates() override;
+ virtual HMENU GetNativeMenu() const override;
+ virtual MenuAction GetMenuAction() const override;
+ virtual void AddMenuListener(MenuListener* listener) override;
+ virtual void RemoveMenuListener(MenuListener* listener) override;
+ virtual void SetMinimumWidth(int width) override;
private:
// IMPORTANT: Note about indices.
diff --git a/ui/views/controls/menu/submenu_view.h b/ui/views/controls/menu/submenu_view.h
index 1b7d362..c475988 100644
--- a/ui/views/controls/menu/submenu_view.h
+++ b/ui/views/controls/menu/submenu_view.h
@@ -54,40 +54,40 @@
// Positions and sizes the child views. This tiles the views vertically,
// giving each child the available width.
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
// Override from View.
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual ui::TextInputClient* GetTextInputClient() OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual ui::TextInputClient* GetTextInputClient() override;
// Painting.
virtual void PaintChildren(gfx::Canvas* canvas,
- const views::CullSet& cull_view) OVERRIDE;
+ const views::CullSet& cull_view) override;
// Drag and drop methods. These are forwarded to the MenuController.
virtual bool GetDropFormats(
int* formats,
- std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE;
- virtual bool AreDropTypesRequired() OVERRIDE;
- virtual bool CanDrop(const OSExchangeData& data) OVERRIDE;
- virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE;
- virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE;
- virtual void OnDragExited() OVERRIDE;
- virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
+ std::set<OSExchangeData::CustomFormat>* custom_formats) override;
+ virtual bool AreDropTypesRequired() override;
+ virtual bool CanDrop(const OSExchangeData& data) override;
+ virtual void OnDragEntered(const ui::DropTargetEvent& event) override;
+ virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
+ virtual void OnDragExited() override;
+ virtual int OnPerformDrop(const ui::DropTargetEvent& event) override;
// Scrolls on menu item boundaries.
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) OVERRIDE;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) override;
// Overridden from ui::EventHandler.
// Scrolls on menu item boundaries.
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Overridden from PrefixDelegate.
- virtual int GetRowCount() OVERRIDE;
- virtual int GetSelectedRow() OVERRIDE;
- virtual void SetSelectedRow(int row) OVERRIDE;
- virtual base::string16 GetTextForRow(int row) OVERRIDE;
+ virtual int GetRowCount() override;
+ virtual int GetSelectedRow() override;
+ virtual void SetSelectedRow(int row) override;
+ virtual base::string16 GetTextForRow(int row) override;
// Returns true if the menu is showing.
bool IsShowing();
@@ -118,7 +118,7 @@
void ReleaseCapture();
// Overriden from View to prevent tab from doing anything.
- virtual bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) OVERRIDE;
+ virtual bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) override;
// Returns the parent menu item we're showing children for.
MenuItemView* GetMenuItem() const;
@@ -158,13 +158,13 @@
protected:
// Overridden from View:
- virtual const char* GetClassName() const OVERRIDE;
+ virtual const char* GetClassName() const override;
// View method. Overridden to schedule a paint. We do this so that when
// scrolling occurs, everything is repainted correctly.
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
+ virtual void ChildPreferredSizeChanged(View* child) override;
private:
// Paints the drop indicator. This is only invoked if item is non-NULL and
@@ -181,7 +181,7 @@
MenuDelegate::DropPosition position);
// Implementation of ScrollDelegate
- virtual bool OnScroll(float dx, float dy) OVERRIDE;
+ virtual bool OnScroll(float dx, float dy) override;
// Parent menu item.
MenuItemView* parent_menu_item_;
diff --git a/ui/views/controls/message_box_view.h b/ui/views/controls/message_box_view.h
index b56b3d1..9123995 100644
--- a/ui/views/controls/message_box_view.h
+++ b/ui/views/controls/message_box_view.h
@@ -74,14 +74,14 @@
void SetLink(const base::string16& text, LinkListener* listener);
// View:
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
protected:
// View:
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
// Handles Ctrl-C and writes the message in the system clipboard.
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
private:
// Sets up the layout manager and initializes the message labels and prompt
diff --git a/ui/views/controls/native/native_view_host.h b/ui/views/controls/native/native_view_host.h
index 6c1890b..db8d7bb 100644
--- a/ui/views/controls/native/native_view_host.h
+++ b/ui/views/controls/native/native_view_host.h
@@ -79,20 +79,20 @@
void NativeViewDestroyed();
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void VisibilityChanged(View* starting_from, bool is_visible) override;
+ virtual void OnFocus() override;
+ virtual gfx::NativeViewAccessible GetNativeViewAccessible() override;
+ virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
protected:
- virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const OVERRIDE;
- virtual void OnVisibleBoundsChanged() OVERRIDE;
+ virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const override;
+ virtual void OnVisibleBoundsChanged() override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
+ virtual const char* GetClassName() const override;
private:
friend class test::NativeViewHostTestBase;
diff --git a/ui/views/controls/native/native_view_host_aura.cc b/ui/views/controls/native/native_view_host_aura.cc
index 3b36b98..75c281f 100644
--- a/ui/views/controls/native/native_view_host_aura.cc
+++ b/ui/views/controls/native/native_view_host_aura.cc
@@ -26,20 +26,20 @@
native_view_ = native_view;
}
- virtual gfx::Size GetMinimumSize() const OVERRIDE { return gfx::Size(); }
- virtual gfx::Size GetMaximumSize() const OVERRIDE { return gfx::Size(); }
+ virtual gfx::Size GetMinimumSize() const override { return gfx::Size(); }
+ virtual gfx::Size GetMaximumSize() const override { return gfx::Size(); }
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {}
- virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+ const gfx::Rect& new_bounds) override {}
+ virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override {
return gfx::kNullCursor;
}
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
+ virtual int GetNonClientComponent(const gfx::Point& point) const override {
return HTCLIENT;
}
virtual bool ShouldDescendIntoChildForEventHandling(
aura::Window* child,
- const gfx::Point& location) OVERRIDE { return true; }
- virtual bool CanFocus() OVERRIDE {
+ const gfx::Point& location) override { return true; }
+ virtual bool CanFocus() override {
// Ask the hosted native view's delegate because directly calling
// aura::Window::CanFocus() will call back into this when checking whether
// parents can focus.
@@ -47,14 +47,14 @@
? native_view_->delegate()->CanFocus()
: true;
}
- virtual void OnCaptureLost() OVERRIDE {}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {}
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {}
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {}
- virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {}
- virtual bool HasHitTestMask() const OVERRIDE { return false; }
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {}
+ virtual void OnCaptureLost() override {}
+ virtual void OnPaint(gfx::Canvas* canvas) override {}
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
+ virtual void OnWindowDestroying(aura::Window* window) override {}
+ virtual void OnWindowDestroyed(aura::Window* window) override {}
+ virtual void OnWindowTargetVisibilityChanged(bool visible) override {}
+ virtual bool HasHitTestMask() const override { return false; }
+ virtual void GetHitTestMask(gfx::Path* mask) const override {}
private:
aura::Window* native_view_;
diff --git a/ui/views/controls/native/native_view_host_aura.h b/ui/views/controls/native/native_view_host_aura.h
index 05c03d5..149bb41 100644
--- a/ui/views/controls/native/native_view_host_aura.h
+++ b/ui/views/controls/native/native_view_host_aura.h
@@ -24,18 +24,18 @@
virtual ~NativeViewHostAura();
// Overridden from NativeViewHostWrapper:
- virtual void AttachNativeView() OVERRIDE;
- virtual void NativeViewDetaching(bool destroyed) OVERRIDE;
- virtual void AddedToWidget() OVERRIDE;
- virtual void RemovedFromWidget() OVERRIDE;
- virtual void InstallClip(int x, int y, int w, int h) OVERRIDE;
- virtual bool HasInstalledClip() OVERRIDE;
- virtual void UninstallClip() OVERRIDE;
- virtual void ShowWidget(int x, int y, int w, int h) OVERRIDE;
- virtual void HideWidget() OVERRIDE;
- virtual void SetFocus() OVERRIDE;
- virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
- virtual gfx::NativeCursor GetCursor(int x, int y) OVERRIDE;
+ virtual void AttachNativeView() override;
+ virtual void NativeViewDetaching(bool destroyed) override;
+ virtual void AddedToWidget() override;
+ virtual void RemovedFromWidget() override;
+ virtual void InstallClip(int x, int y, int w, int h) override;
+ virtual bool HasInstalledClip() override;
+ virtual void UninstallClip() override;
+ virtual void ShowWidget(int x, int y, int w, int h) override;
+ virtual void HideWidget() override;
+ virtual void SetFocus() override;
+ virtual gfx::NativeViewAccessible GetNativeViewAccessible() override;
+ virtual gfx::NativeCursor GetCursor(int x, int y) override;
private:
friend class NativeViewHostAuraTest;
@@ -43,8 +43,8 @@
class ClippingWindowDelegate;
// Overridden from aura::WindowObserver:
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ virtual void OnWindowDestroying(aura::Window* window) override;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
// Reparents the native view with the clipping window existing between it and
// its old parent, so that the fast resize path works.
diff --git a/ui/views/controls/native/native_view_host_aura_unittest.cc b/ui/views/controls/native/native_view_host_aura_unittest.cc
index 27ce142..1a40ab7 100644
--- a/ui/views/controls/native/native_view_host_aura_unittest.cc
+++ b/ui/views/controls/native/native_view_host_aura_unittest.cc
@@ -45,7 +45,7 @@
// aura::WindowObserver overrides
virtual void OnWindowVisibilityChanged(aura::Window* window,
- bool visible) OVERRIDE {
+ bool visible) override {
EventDetails event;
event.type = visible ? EVENT_SHOWN : EVENT_HIDDEN;
event.window = window;
@@ -59,7 +59,7 @@
virtual void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
EventDetails event;
event.type = EVENT_BOUNDS_CHANGED;
event.window = window;
diff --git a/ui/views/controls/native/native_view_host_mac.h b/ui/views/controls/native/native_view_host_mac.h
index c15ce44..6880170 100644
--- a/ui/views/controls/native/native_view_host_mac.h
+++ b/ui/views/controls/native/native_view_host_mac.h
@@ -20,18 +20,18 @@
virtual ~NativeViewHostMac();
// Overridden from NativeViewHostWrapper:
- virtual void AttachNativeView() OVERRIDE;
- virtual void NativeViewDetaching(bool destroyed) OVERRIDE;
- virtual void AddedToWidget() OVERRIDE;
- virtual void RemovedFromWidget() OVERRIDE;
- virtual void InstallClip(int x, int y, int w, int h) OVERRIDE;
- virtual bool HasInstalledClip() OVERRIDE;
- virtual void UninstallClip() OVERRIDE;
- virtual void ShowWidget(int x, int y, int w, int h) OVERRIDE;
- virtual void HideWidget() OVERRIDE;
- virtual void SetFocus() OVERRIDE;
- virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
- virtual gfx::NativeCursor GetCursor(int x, int y) OVERRIDE;
+ virtual void AttachNativeView() override;
+ virtual void NativeViewDetaching(bool destroyed) override;
+ virtual void AddedToWidget() override;
+ virtual void RemovedFromWidget() override;
+ virtual void InstallClip(int x, int y, int w, int h) override;
+ virtual bool HasInstalledClip() override;
+ virtual void UninstallClip() override;
+ virtual void ShowWidget(int x, int y, int w, int h) override;
+ virtual void HideWidget() override;
+ virtual void SetFocus() override;
+ virtual gfx::NativeViewAccessible GetNativeViewAccessible() override;
+ virtual gfx::NativeCursor GetCursor(int x, int y) override;
private:
// Our associated NativeViewHost. Owns this.
diff --git a/ui/views/controls/native/native_view_host_unittest.cc b/ui/views/controls/native/native_view_host_unittest.cc
index 4fa9a75..d5fb543 100644
--- a/ui/views/controls/native/native_view_host_unittest.cc
+++ b/ui/views/controls/native/native_view_host_unittest.cc
@@ -18,7 +18,7 @@
NativeViewHostTest() {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
CreateTopLevel();
}
@@ -43,7 +43,7 @@
int notification_count() const { return notification_count_; }
// Overriden from View:
- virtual void NativeViewHierarchyChanged() OVERRIDE {
+ virtual void NativeViewHierarchyChanged() override {
++notification_count_;
View::NativeViewHierarchyChanged();
}
@@ -74,7 +74,7 @@
// Overriden from NativeViewHost:
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE {
+ const ViewHierarchyChangedDetails& details) override {
gfx::NativeView parent_before = native_view() ?
GetNativeParent(native_view()) : NULL;
NativeViewHost::ViewHierarchyChanged(details);
diff --git a/ui/views/controls/prefix_selector.h b/ui/views/controls/prefix_selector.h
index 255046f..615f239 100644
--- a/ui/views/controls/prefix_selector.h
+++ b/ui/views/controls/prefix_selector.h
@@ -26,37 +26,37 @@
// ui::TextInputClient:
virtual void SetCompositionText(
- const ui::CompositionText& composition) OVERRIDE;
- virtual void ConfirmCompositionText() OVERRIDE;
- virtual void ClearCompositionText() OVERRIDE;
- virtual void InsertText(const base::string16& text) OVERRIDE;
- virtual void InsertChar(base::char16 ch, int flags) OVERRIDE;
- virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE;
- virtual ui::TextInputType GetTextInputType() const OVERRIDE;
- virtual ui::TextInputMode GetTextInputMode() const OVERRIDE;
- virtual bool CanComposeInline() const OVERRIDE;
- virtual gfx::Rect GetCaretBounds() const OVERRIDE;
+ const ui::CompositionText& composition) override;
+ virtual void ConfirmCompositionText() override;
+ virtual void ClearCompositionText() override;
+ virtual void InsertText(const base::string16& text) override;
+ virtual void InsertChar(base::char16 ch, int flags) override;
+ virtual gfx::NativeWindow GetAttachedWindow() const override;
+ virtual ui::TextInputType GetTextInputType() const override;
+ virtual ui::TextInputMode GetTextInputMode() const override;
+ virtual bool CanComposeInline() const override;
+ virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,
- gfx::Rect* rect) const OVERRIDE;
- virtual bool HasCompositionText() const OVERRIDE;
- virtual bool GetTextRange(gfx::Range* range) const OVERRIDE;
- virtual bool GetCompositionTextRange(gfx::Range* range) const OVERRIDE;
- virtual bool GetSelectionRange(gfx::Range* range) const OVERRIDE;
- virtual bool SetSelectionRange(const gfx::Range& range) OVERRIDE;
- virtual bool DeleteRange(const gfx::Range& range) OVERRIDE;
+ gfx::Rect* rect) const override;
+ virtual bool HasCompositionText() const override;
+ virtual bool GetTextRange(gfx::Range* range) const override;
+ virtual bool GetCompositionTextRange(gfx::Range* range) const override;
+ virtual bool GetSelectionRange(gfx::Range* range) const override;
+ virtual bool SetSelectionRange(const gfx::Range& range) override;
+ virtual bool DeleteRange(const gfx::Range& range) override;
virtual bool GetTextFromRange(const gfx::Range& range,
- base::string16* text) const OVERRIDE;
- virtual void OnInputMethodChanged() OVERRIDE;
+ base::string16* text) const override;
+ virtual void OnInputMethodChanged() override;
virtual bool ChangeTextDirectionAndLayoutAlignment(
- base::i18n::TextDirection direction) OVERRIDE;
- virtual void ExtendSelectionAndDelete(size_t before, size_t after) OVERRIDE;
- virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE;
- virtual void OnCandidateWindowShown() OVERRIDE;
- virtual void OnCandidateWindowUpdated() OVERRIDE;
- virtual void OnCandidateWindowHidden() OVERRIDE;
+ base::i18n::TextDirection direction) override;
+ virtual void ExtendSelectionAndDelete(size_t before, size_t after) override;
+ virtual void EnsureCaretInRect(const gfx::Rect& rect) override;
+ virtual void OnCandidateWindowShown() override;
+ virtual void OnCandidateWindowUpdated() override;
+ virtual void OnCandidateWindowHidden() override;
- virtual bool IsEditingCommandEnabled(int command_id) OVERRIDE;
- virtual void ExecuteEditingCommand(int command_id) OVERRIDE;
+ virtual bool IsEditingCommandEnabled(int command_id) override;
+ virtual void ExecuteEditingCommand(int command_id) override;
private:
// Invoked when text is typed. Tries to change the selection appropriately.
diff --git a/ui/views/controls/prefix_selector_unittest.cc b/ui/views/controls/prefix_selector_unittest.cc
index 031c007..ce04180 100644
--- a/ui/views/controls/prefix_selector_unittest.cc
+++ b/ui/views/controls/prefix_selector_unittest.cc
@@ -26,19 +26,19 @@
virtual ~TestPrefixDelegate() {}
- virtual int GetRowCount() OVERRIDE {
+ virtual int GetRowCount() override {
return static_cast<int>(rows_.size());
}
- virtual int GetSelectedRow() OVERRIDE {
+ virtual int GetSelectedRow() override {
return selected_row_;
}
- virtual void SetSelectedRow(int row) OVERRIDE {
+ virtual void SetSelectedRow(int row) override {
selected_row_ = row;
}
- virtual base::string16 GetTextForRow(int row) OVERRIDE {
+ virtual base::string16 GetTextForRow(int row) override {
return rows_[row];
}
diff --git a/ui/views/controls/progress_bar.h b/ui/views/controls/progress_bar.h
index b6d3851..e844d2f 100644
--- a/ui/views/controls/progress_bar.h
+++ b/ui/views/controls/progress_bar.h
@@ -39,16 +39,16 @@
// Overridden from View:
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ base::string16* tooltip) const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
private:
static const char kViewClassName[];
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// Inclusive range used when displaying values.
double min_display_value_;
diff --git a/ui/views/controls/resize_area.h b/ui/views/controls/resize_area.h
index 12ec310..661c2b6 100644
--- a/ui/views/controls/resize_area.h
+++ b/ui/views/controls/resize_area.h
@@ -26,13 +26,13 @@
virtual ~ResizeArea();
// Overridden from views::View:
- virtual const char* GetClassName() const OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual const char* GetClassName() const override;
+ virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
private:
// Report the amount the user resized by to the delegate, accounting for
diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
index d12c73b..8a05f92 100644
--- a/ui/views/controls/scroll_view.cc
+++ b/ui/views/controls/scroll_view.cc
@@ -24,7 +24,7 @@
ScrollViewWithBorder() {}
// View overrides;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE {
+ virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
SetBorder(Border::CreateSolidBorder(
1,
theme->GetSystemColor(ui::NativeTheme::kColorId_UnfocusedBorderColor)));
@@ -38,7 +38,7 @@
public:
ScrollCornerView() {}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
ui::NativeTheme::ExtraParams ignored;
GetNativeTheme()->Paint(canvas->sk_canvas(),
ui::NativeTheme::kScrollbarCorner,
@@ -96,11 +96,11 @@
Viewport() {}
virtual ~Viewport() {}
- virtual const char* GetClassName() const OVERRIDE {
+ virtual const char* GetClassName() const override {
return "ScrollView::Viewport";
}
- virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE {
+ virtual void ScrollRectToVisible(const gfx::Rect& rect) override {
if (!has_children() || !parent())
return;
@@ -111,7 +111,7 @@
scroll_rect);
}
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE {
+ virtual void ChildPreferredSizeChanged(View* child) override {
if (parent())
parent()->Layout();
}
diff --git a/ui/views/controls/scroll_view.h b/ui/views/controls/scroll_view.h
index f6e8564..4dfcdfc 100644
--- a/ui/views/controls/scroll_view.h
+++ b/ui/views/controls/scroll_view.h
@@ -75,21 +75,21 @@
void SetVerticalScrollBar(ScrollBar* vert_sb);
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual int GetHeightForWidth(int width) const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) OVERRIDE;
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual int GetHeightForWidth(int width) const override;
+ virtual void Layout() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) override;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
+ virtual const char* GetClassName() const override;
// ScrollBarController overrides:
- virtual void ScrollToPosition(ScrollBar* source, int position) OVERRIDE;
+ virtual void ScrollToPosition(ScrollBar* source, int position) override;
virtual int GetScrollIncrement(ScrollBar* source,
bool is_page,
- bool is_positive) OVERRIDE;
+ bool is_positive) override;
private:
FRIEND_TEST_ALL_PREFIXES(ScrollViewTest, CornerViewVisibility);
@@ -211,7 +211,7 @@
protected:
// Calculates the bounds of the row from the top margin and row height.
- virtual RowInfo GetRowInfo(int y) OVERRIDE;
+ virtual RowInfo GetRowInfo(int y) override;
private:
int top_margin_;
diff --git a/ui/views/controls/scroll_view_unittest.cc b/ui/views/controls/scroll_view_unittest.cc
index a2cba6f..9baa4d3 100644
--- a/ui/views/controls/scroll_view_unittest.cc
+++ b/ui/views/controls/scroll_view_unittest.cc
@@ -26,11 +26,11 @@
PreferredSizeChanged();
}
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return preferred_size_;
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
gfx::Size pref = GetPreferredSize();
int width = pref.width();
int height = pref.height();
diff --git a/ui/views/controls/scrollbar/base_scroll_bar.h b/ui/views/controls/scrollbar/base_scroll_bar.h
index 068ad4d..b68e22a 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar.h
+++ b/ui/views/controls/scrollbar/base_scroll_bar.h
@@ -64,42 +64,42 @@
CustomButton::ButtonState new_state);
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE = 0;
- virtual void Layout() OVERRIDE = 0;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override = 0;
+ virtual void Layout() override = 0;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
// ui::EventHandler overrides:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// ScrollBar overrides:
virtual void Update(int viewport_size,
int content_size,
- int contents_scroll_offset) OVERRIDE;
- virtual int GetLayoutSize() const OVERRIDE = 0;
- virtual int GetPosition() const OVERRIDE;
+ int contents_scroll_offset) override;
+ virtual int GetLayoutSize() const override = 0;
+ virtual int GetPosition() const override;
// ScrollDelegate overrides:
- virtual bool OnScroll(float dx, float dy) OVERRIDE;
+ virtual bool OnScroll(float dx, float dy) override;
// ContextMenuController overrides:
virtual void ShowContextMenuForView(View* source,
const gfx::Point& point,
- ui::MenuSourceType source_type) OVERRIDE;
+ ui::MenuSourceType source_type) override;
// Menu::Delegate overrides:
- virtual base::string16 GetLabel(int id) const OVERRIDE;
- virtual bool IsCommandEnabled(int id) const OVERRIDE;
- virtual void ExecuteCommand(int id) OVERRIDE;
+ virtual base::string16 GetLabel(int id) const override;
+ virtual bool IsCommandEnabled(int id) const override;
+ virtual void ExecuteCommand(int id) override;
protected:
// View overrides:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE = 0;
+ virtual void OnPaint(gfx::Canvas* canvas) override = 0;
BaseScrollBarThumb* GetThumb() const;
CustomButton::ButtonState GetThumbTrackState() const;
diff --git a/ui/views/controls/scrollbar/base_scroll_bar_button.h b/ui/views/controls/scrollbar/base_scroll_bar_button.h
index b154d1e..b264e6d 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar_button.h
+++ b/ui/views/controls/scrollbar/base_scroll_bar_button.h
@@ -30,9 +30,9 @@
virtual ~BaseScrollBarButton();
protected:
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
private:
void RepeaterNotifyClick();
diff --git a/ui/views/controls/scrollbar/base_scroll_bar_thumb.h b/ui/views/controls/scrollbar/base_scroll_bar_thumb.h
index c755441..5e9dbc6 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar_thumb.h
+++ b/ui/views/controls/scrollbar/base_scroll_bar_thumb.h
@@ -44,17 +44,17 @@
int GetPosition() const;
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE = 0;
+ virtual gfx::Size GetPreferredSize() const override = 0;
protected:
// View overrides:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE = 0;
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override = 0;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
CustomButton::ButtonState GetState() const;
// Update our state and schedule a repaint when the mouse moves over us.
diff --git a/ui/views/controls/scrollbar/kennedy_scroll_bar.cc b/ui/views/controls/scrollbar/kennedy_scroll_bar.cc
index b3d1e6a..13a7823 100644
--- a/ui/views/controls/scrollbar/kennedy_scroll_bar.cc
+++ b/ui/views/controls/scrollbar/kennedy_scroll_bar.cc
@@ -28,8 +28,8 @@
protected:
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
DISALLOW_COPY_AND_ASSIGN(KennedyScrollBarThumb);
diff --git a/ui/views/controls/scrollbar/kennedy_scroll_bar.h b/ui/views/controls/scrollbar/kennedy_scroll_bar.h
index ace3fae..bd67a05 100644
--- a/ui/views/controls/scrollbar/kennedy_scroll_bar.h
+++ b/ui/views/controls/scrollbar/kennedy_scroll_bar.h
@@ -19,15 +19,15 @@
protected:
// BaseScrollBar overrides:
- virtual gfx::Rect GetTrackBounds() const OVERRIDE;
+ virtual gfx::Rect GetTrackBounds() const override;
// ScrollBar overrides:
- virtual int GetLayoutSize() const OVERRIDE;
+ virtual int GetLayoutSize() const override;
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
DISALLOW_COPY_AND_ASSIGN(KennedyScrollBar);
diff --git a/ui/views/controls/scrollbar/native_scroll_bar.h b/ui/views/controls/scrollbar/native_scroll_bar.h
index 058784d..8536111 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar.h
+++ b/ui/views/controls/scrollbar/native_scroll_bar.h
@@ -40,25 +40,25 @@
FRIEND_TEST_ALL_PREFIXES(NativeScrollBarTest, Scrolling);
// Overridden from View.
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
+ virtual const char* GetClassName() const override;
// Overrideen from View for keyboard UI purpose.
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) OVERRIDE;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) override;
// Overridden from ui::EventHandler.
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Overridden from ScrollBar.
virtual void Update(int viewport_size,
int content_size,
- int current_pos) OVERRIDE;
- virtual int GetPosition() const OVERRIDE;
- virtual int GetLayoutSize() const OVERRIDE;
+ int current_pos) override;
+ virtual int GetPosition() const override;
+ virtual int GetLayoutSize() const override;
// init border
NativeScrollBarWrapper* native_wrapper_;
diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.cc b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
index b4f83cc..4ffa8df 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar_views.cc
+++ b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
@@ -32,13 +32,13 @@
ScrollBarButton(ButtonListener* listener, Type type);
virtual ~ScrollBarButton();
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override {
return "ScrollBarButton";
}
protected:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
ui::NativeTheme::ExtraParams GetNativeThemeParams() const;
@@ -54,13 +54,13 @@
explicit ScrollBarThumb(BaseScrollBar* scroll_bar);
virtual ~ScrollBarThumb();
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override {
return "ScrollBarThumb";
}
protected:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
ui::NativeTheme::ExtraParams GetNativeThemeParams() const;
diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.h b/ui/views/controls/scrollbar/native_scroll_bar_views.h
index 38dbe0b..9dd6b6d 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar_views.h
+++ b/ui/views/controls/scrollbar/native_scroll_bar_views.h
@@ -34,32 +34,32 @@
private:
// View overrides:
- virtual void Layout() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual void Layout() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override;
// ScrollBar overrides:
- virtual int GetLayoutSize() const OVERRIDE;
+ virtual int GetLayoutSize() const override;
// BaseScrollBar overrides:
- virtual void ScrollToPosition(int position) OVERRIDE;
- virtual int GetScrollIncrement(bool is_page, bool is_positive) OVERRIDE;
+ virtual void ScrollToPosition(int position) override;
+ virtual int GetScrollIncrement(bool is_page, bool is_positive) override;
// BaseButton::ButtonListener overrides:
virtual void ButtonPressed(Button* sender,
- const ui::Event& event) OVERRIDE;
+ const ui::Event& event) override;
// NativeScrollBarWrapper overrides:
- virtual int GetPosition() const OVERRIDE;
- virtual View* GetView() OVERRIDE;
+ virtual int GetPosition() const override;
+ virtual View* GetView() override;
virtual void Update(int viewport_size,
int content_size,
- int current_pos) OVERRIDE;
+ int current_pos) override;
// Returns the area for the track. This is the area of the scrollbar minus
// the size of the arrow buttons.
- virtual gfx::Rect GetTrackBounds() const OVERRIDE;
+ virtual gfx::Rect GetTrackBounds() const override;
// The NativeScrollBar we are bound to.
NativeScrollBar* native_scroll_bar_;
diff --git a/ui/views/controls/scrollbar/overlay_scroll_bar.cc b/ui/views/controls/scrollbar/overlay_scroll_bar.cc
index 1396bd1..ad54fd7 100644
--- a/ui/views/controls/scrollbar/overlay_scroll_bar.cc
+++ b/ui/views/controls/scrollbar/overlay_scroll_bar.cc
@@ -30,11 +30,11 @@
protected:
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// gfx::AnimationDelegate overrides:
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
private:
double animation_opacity_;
diff --git a/ui/views/controls/scrollbar/overlay_scroll_bar.h b/ui/views/controls/scrollbar/overlay_scroll_bar.h
index 428a277..20cb755 100644
--- a/ui/views/controls/scrollbar/overlay_scroll_bar.h
+++ b/ui/views/controls/scrollbar/overlay_scroll_bar.h
@@ -18,19 +18,19 @@
protected:
// BaseScrollBar overrides:
- virtual gfx::Rect GetTrackBounds() const OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual gfx::Rect GetTrackBounds() const override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// ScrollBar overrides:
- virtual int GetLayoutSize() const OVERRIDE;
- virtual int GetContentOverlapSize() const OVERRIDE;
- virtual void OnMouseEnteredScrollView(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExitedScrollView(const ui::MouseEvent& event) OVERRIDE;
+ virtual int GetLayoutSize() const override;
+ virtual int GetContentOverlapSize() const override;
+ virtual void OnMouseEnteredScrollView(const ui::MouseEvent& event) override;
+ virtual void OnMouseExitedScrollView(const ui::MouseEvent& event) override;
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
gfx::SlideAnimation animation_;
diff --git a/ui/views/controls/scrollbar/scroll_bar.h b/ui/views/controls/scrollbar/scroll_bar.h
index c8a31c4..2a711d6 100644
--- a/ui/views/controls/scrollbar/scroll_bar.h
+++ b/ui/views/controls/scrollbar/scroll_bar.h
@@ -60,7 +60,7 @@
virtual ~ScrollBar();
// Overridden from View:
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
// Returns whether this scrollbar is horizontal.
bool IsHorizontal() const;
diff --git a/ui/views/controls/scrollbar/scrollbar_unittest.cc b/ui/views/controls/scrollbar/scrollbar_unittest.cc
index c3c96df..295ac2c 100644
--- a/ui/views/controls/scrollbar/scrollbar_unittest.cc
+++ b/ui/views/controls/scrollbar/scrollbar_unittest.cc
@@ -17,14 +17,14 @@
virtual ~TestScrollBarController() {}
virtual void ScrollToPosition(views::ScrollBar* source,
- int position) OVERRIDE {
+ int position) override {
last_source = source;
last_position = position;
}
virtual int GetScrollIncrement(views::ScrollBar* source,
bool is_page,
- bool is_positive) OVERRIDE {
+ bool is_positive) override {
last_source = source;
last_is_page = is_page;
last_is_positive = is_positive;
diff --git a/ui/views/controls/separator.h b/ui/views/controls/separator.h
index 6f45f8c..7c964b7 100644
--- a/ui/views/controls/separator.h
+++ b/ui/views/controls/separator.h
@@ -28,11 +28,11 @@
virtual ~Separator();
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
virtual void Paint(gfx::Canvas* canvas,
- const views::CullSet& cull_set) OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ const views::CullSet& cull_set) override;
+ virtual const char* GetClassName() const override;
private:
const Orientation orientation_;
diff --git a/ui/views/controls/single_split_view.h b/ui/views/controls/single_split_view.h
index c03c834..4581e40 100644
--- a/ui/views/controls/single_split_view.h
+++ b/ui/views/controls/single_split_view.h
@@ -31,17 +31,17 @@
Orientation orientation,
SingleSplitViewListener* listener);
- virtual void Layout() OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual void Layout() override;
+ virtual const char* GetClassName() const override;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
// SingleSplitView's preferred size is the sum of the preferred widths
// and the max of the heights.
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
// Overriden to return a resize cursor when over the divider.
- virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
+ virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
Orientation orientation() const {
return is_horizontal_ ? HORIZONTAL_SPLIT : VERTICAL_SPLIT;
@@ -81,10 +81,10 @@
protected:
// View overrides.
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
private:
// This test calls OnMouse* functions.
diff --git a/ui/views/controls/single_split_view_unittest.cc b/ui/views/controls/single_split_view_unittest.cc
index cfea48e..ca48b9a 100644
--- a/ui/views/controls/single_split_view_unittest.cc
+++ b/ui/views/controls/single_split_view_unittest.cc
@@ -45,7 +45,7 @@
public:
SingleSplitViewListenerImpl() : count_(0) {}
- virtual bool SplitHandleMoved(views::SingleSplitView* sender) OVERRIDE {
+ virtual bool SplitHandleMoved(views::SingleSplitView* sender) override {
++count_;
return false;
}
@@ -64,7 +64,7 @@
private:
gfx::Size min_size_;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
};
gfx::Size MinimumSizedView::GetMinimumSize() const {
diff --git a/ui/views/controls/slide_out_view.h b/ui/views/controls/slide_out_view.h
index 04a8f8a..46b4135 100644
--- a/ui/views/controls/slide_out_view.h
+++ b/ui/views/controls/slide_out_view.h
@@ -23,7 +23,7 @@
virtual void OnSlideOut() = 0;
// Overridden from views::View.
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
private:
enum SlideDirection {
@@ -38,7 +38,7 @@
void SlideOutAndClose(SlideDirection direction);
// Overridden from ImplicitAnimationObserver.
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ virtual void OnImplicitAnimationsCompleted() override;
float gesture_scroll_amount_;
diff --git a/ui/views/controls/slider.h b/ui/views/controls/slider.h
index 33a760b..e6a521a 100644
--- a/ui/views/controls/slider.h
+++ b/ui/views/controls/slider.h
@@ -94,21 +94,21 @@
void OnSliderDragEnded();
// views::View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
// ui::EventHandler overrides:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// gfx::AnimationDelegate overrides:
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationProgressed(const gfx::Animation* animation) override;
void set_listener(SliderListener* listener) {
listener_ = listener;
diff --git a/ui/views/controls/slider_unittest.cc b/ui/views/controls/slider_unittest.cc
index efa4112..23be9e9 100644
--- a/ui/views/controls/slider_unittest.cc
+++ b/ui/views/controls/slider_unittest.cc
@@ -56,9 +56,9 @@
virtual void SliderValueChanged(views::Slider* sender,
float value,
float old_value,
- views::SliderChangeReason reason) OVERRIDE;
- virtual void SliderDragStarted(views::Slider* sender) OVERRIDE;
- virtual void SliderDragEnded(views::Slider* sender) OVERRIDE;
+ views::SliderChangeReason reason) override;
+ virtual void SliderDragStarted(views::Slider* sender) override;
+ virtual void SliderDragEnded(views::Slider* sender) override;
private:
// The epoch of the last event.
@@ -143,8 +143,8 @@
virtual void ClickAt(int x, int y);
// testing::Test:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
ui::test::EventGenerator* event_generator() {
return event_generator_.get();
diff --git a/ui/views/controls/styled_label.h b/ui/views/controls/styled_label.h
index ce1004c..8382b8e 100644
--- a/ui/views/controls/styled_label.h
+++ b/ui/views/controls/styled_label.h
@@ -91,13 +91,13 @@
}
// View implementation:
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual int GetHeightForWidth(int w) const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void PreferredSizeChanged() OVERRIDE;
+ virtual gfx::Insets GetInsets() const override;
+ virtual int GetHeightForWidth(int w) const override;
+ virtual void Layout() override;
+ virtual void PreferredSizeChanged() override;
// LinkListener implementation:
- virtual void LinkClicked(Link* source, int event_flags) OVERRIDE;
+ virtual void LinkClicked(Link* source, int event_flags) override;
private:
struct StyleRange {
diff --git a/ui/views/controls/styled_label_unittest.cc b/ui/views/controls/styled_label_unittest.cc
index 624c146..144e03f 100644
--- a/ui/views/controls/styled_label_unittest.cc
+++ b/ui/views/controls/styled_label_unittest.cc
@@ -28,7 +28,7 @@
// StyledLabelListener implementation.
virtual void StyledLabelLinkClicked(const gfx::Range& range,
- int event_flags) OVERRIDE {}
+ int event_flags) override {}
protected:
StyledLabel* styled() { return styled_.get(); }
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc
index 3d181e0..aa4b307 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -43,12 +43,12 @@
void SetSelected(bool selected);
// Overridden from View:
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
private:
enum TabState {
@@ -76,9 +76,9 @@
virtual ~TabStrip();
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
TabbedPane* tabbed_pane_;
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.h b/ui/views/controls/tabbed_pane/tabbed_pane.h
index 83c7fef..c404808 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.h
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.h
@@ -54,8 +54,8 @@
void SelectTab(Tab* tab);
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override;
private:
friend class TabStrip;
@@ -64,12 +64,12 @@
Tab* GetTabAt(int index);
// Overridden from View:
- virtual void Layout() OVERRIDE;
+ virtual void Layout() override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
+ virtual void OnFocus() override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
// A listener notified when tab selection changes. Weak, not owned.
TabbedPaneListener* listener_;
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc b/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
index f81c2a8..8a4acd4 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
@@ -22,7 +22,7 @@
: size_(size) {}
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return size_;
}
diff --git a/ui/views/controls/table/table_header.h b/ui/views/controls/table/table_header.h
index a595de9..55c0949 100644
--- a/ui/views/controls/table/table_header.h
+++ b/ui/views/controls/table/table_header.h
@@ -28,15 +28,15 @@
const gfx::FontList& font_list() const { return font_list_; }
// views::View overrides.
- virtual void Layout() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void Layout() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
private:
// Used to track the column being resized.
diff --git a/ui/views/controls/table/table_view.h b/ui/views/controls/table/table_view.h
index 9626806..c1a9162 100644
--- a/ui/views/controls/table/table_view.h
+++ b/ui/views/controls/table/table_view.h
@@ -165,28 +165,28 @@
int row_height() const { return row_height_; }
// View overrides:
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
+ base::string16* tooltip) const override;
virtual bool GetTooltipTextOrigin(const gfx::Point& p,
- gfx::Point* loc) const OVERRIDE;
+ gfx::Point* loc) const override;
// ui::TableModelObserver overrides:
- virtual void OnModelChanged() OVERRIDE;
- virtual void OnItemsChanged(int start, int length) OVERRIDE;
- virtual void OnItemsAdded(int start, int length) OVERRIDE;
- virtual void OnItemsRemoved(int start, int length) OVERRIDE;
+ virtual void OnModelChanged() override;
+ virtual void OnItemsChanged(int start, int length) override;
+ virtual void OnItemsAdded(int start, int length) override;
+ virtual void OnItemsRemoved(int start, int length) override;
protected:
// View overrides:
- virtual gfx::Point GetKeyboardContextMenuLocation() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual gfx::Point GetKeyboardContextMenuLocation() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
private:
friend class TableViewTestHelper;
diff --git a/ui/views/controls/table/table_view_unittest.cc b/ui/views/controls/table/table_view_unittest.cc
index 6ce06c8..535c650 100644
--- a/ui/views/controls/table/table_view_unittest.cc
+++ b/ui/views/controls/table/table_view_unittest.cc
@@ -66,10 +66,10 @@
void ChangeRow(int row, int c1_value, int c2_value);
// ui::TableModel:
- virtual int RowCount() OVERRIDE;
- virtual base::string16 GetText(int row, int column_id) OVERRIDE;
- virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE;
- virtual int CompareValues(int row1, int row2, int column_id) OVERRIDE;
+ virtual int RowCount() override;
+ virtual base::string16 GetText(int row, int column_id) override;
+ virtual void SetObserver(ui::TableModelObserver* observer) override;
+ virtual int CompareValues(int row1, int row2, int column_id) override;
private:
ui::TableModelObserver* observer_;
@@ -157,7 +157,7 @@
}
// View overrides:
- virtual bool HasFocus() const OVERRIDE {
+ virtual bool HasFocus() const override {
// Overriden so key processing works.
return true;
}
@@ -172,7 +172,7 @@
public:
TableViewTest() : table_(NULL) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
model_.reset(new TestTableModel2);
std::vector<ui::TableColumn> columns(2);
columns[0].title = base::ASCIIToUTF16("Title Column 0");
@@ -410,7 +410,7 @@
}
// TableGrouper overrides:
- virtual void GetGroupRange(int model_index, GroupRange* range) OVERRIDE {
+ virtual void GetGroupRange(int model_index, GroupRange* range) override {
int offset = 0;
size_t range_index = 0;
for (; range_index < ranges_.size() && offset < model_index; ++range_index)
@@ -514,7 +514,7 @@
}
// TableViewObserver overrides:
- virtual void OnSelectionChanged() OVERRIDE {
+ virtual void OnSelectionChanged() override {
selection_changed_count_++;
}
diff --git a/ui/views/controls/table/test_table_model.h b/ui/views/controls/table/test_table_model.h
index 8338aae..a06db77 100644
--- a/ui/views/controls/table/test_table_model.h
+++ b/ui/views/controls/table/test_table_model.h
@@ -14,10 +14,10 @@
virtual ~TestTableModel();
// ui::TableModel overrides:
- virtual int RowCount() OVERRIDE;
- virtual base::string16 GetText(int row, int column_id) OVERRIDE;
- virtual gfx::ImageSkia GetIcon(int row) OVERRIDE;
- virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE;
+ virtual int RowCount() override;
+ virtual base::string16 GetText(int row, int column_id) override;
+ virtual gfx::ImageSkia GetIcon(int row) override;
+ virtual void SetObserver(ui::TableModelObserver* observer) override;
private:
int row_count_;
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index d577d90..53f0ee6 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -205,110 +205,110 @@
bool HasTextBeingDragged();
// View overrides:
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual int GetBaseline() const OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual ui::TextInputClient* GetTextInputClient() OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE;
+ virtual gfx::Insets GetInsets() const override;
+ virtual int GetBaseline() const override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual const char* GetClassName() const override;
+ virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual ui::TextInputClient* GetTextInputClient() override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
+ virtual void AboutToRequestFocusFromTabTraversal(bool reverse) override;
virtual bool SkipDefaultKeyEventProcessing(
- const ui::KeyEvent& event) OVERRIDE;
+ const ui::KeyEvent& event) override;
virtual bool GetDropFormats(
int* formats,
- std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE;
- virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE;
- virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE;
- virtual void OnDragExited() OVERRIDE;
- virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
- virtual void OnDragDone() OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
- virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const OVERRIDE;
- virtual void OnVisibleBoundsChanged() OVERRIDE;
- virtual void OnEnabledChanged() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
- virtual gfx::Point GetKeyboardContextMenuLocation() OVERRIDE;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
+ std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override;
+ virtual bool CanDrop(const ui::OSExchangeData& data) override;
+ virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
+ virtual void OnDragExited() override;
+ virtual int OnPerformDrop(const ui::DropTargetEvent& event) override;
+ virtual void OnDragDone() override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
+ virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const override;
+ virtual void OnVisibleBoundsChanged() override;
+ virtual void OnEnabledChanged() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
+ virtual gfx::Point GetKeyboardContextMenuLocation() override;
+ virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
// TextfieldModel::Delegate overrides:
- virtual void OnCompositionTextConfirmedOrCleared() OVERRIDE;
+ virtual void OnCompositionTextConfirmedOrCleared() override;
// ContextMenuController overrides:
virtual void ShowContextMenuForView(View* source,
const gfx::Point& point,
- ui::MenuSourceType source_type) OVERRIDE;
+ ui::MenuSourceType source_type) override;
// DragController overrides:
virtual void WriteDragDataForView(View* sender,
const gfx::Point& press_pt,
- ui::OSExchangeData* data) OVERRIDE;
+ ui::OSExchangeData* data) override;
virtual int GetDragOperationsForView(View* sender,
- const gfx::Point& p) OVERRIDE;
+ const gfx::Point& p) override;
virtual bool CanStartDragForView(View* sender,
const gfx::Point& press_pt,
- const gfx::Point& p) OVERRIDE;
+ const gfx::Point& p) override;
// ui::TouchEditable overrides:
virtual void SelectRect(const gfx::Point& start,
- const gfx::Point& end) OVERRIDE;
- virtual void MoveCaretTo(const gfx::Point& point) OVERRIDE;
- virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) OVERRIDE;
- virtual gfx::Rect GetBounds() OVERRIDE;
- virtual gfx::NativeView GetNativeView() const OVERRIDE;
- virtual void ConvertPointToScreen(gfx::Point* point) OVERRIDE;
- virtual void ConvertPointFromScreen(gfx::Point* point) OVERRIDE;
- virtual bool DrawsHandles() OVERRIDE;
- virtual void OpenContextMenu(const gfx::Point& anchor) OVERRIDE;
- virtual void DestroyTouchSelection() OVERRIDE;
+ const gfx::Point& end) override;
+ virtual void MoveCaretTo(const gfx::Point& point) override;
+ virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) override;
+ virtual gfx::Rect GetBounds() override;
+ virtual gfx::NativeView GetNativeView() const override;
+ virtual void ConvertPointToScreen(gfx::Point* point) override;
+ virtual void ConvertPointFromScreen(gfx::Point* point) override;
+ virtual bool DrawsHandles() override;
+ virtual void OpenContextMenu(const gfx::Point& anchor) override;
+ virtual void DestroyTouchSelection() override;
// ui::SimpleMenuModel::Delegate overrides:
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdChecked(int command_id) const override;
+ virtual bool IsCommandIdEnabled(int command_id) const override;
virtual bool GetAcceleratorForCommandId(
int command_id,
- ui::Accelerator* accelerator) OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+ ui::Accelerator* accelerator) override;
+ virtual void ExecuteCommand(int command_id, int event_flags) override;
// ui::TextInputClient overrides:
virtual void SetCompositionText(
- const ui::CompositionText& composition) OVERRIDE;
- virtual void ConfirmCompositionText() OVERRIDE;
- virtual void ClearCompositionText() OVERRIDE;
- virtual void InsertText(const base::string16& text) OVERRIDE;
- virtual void InsertChar(base::char16 ch, int flags) OVERRIDE;
- virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE;
- virtual ui::TextInputType GetTextInputType() const OVERRIDE;
- virtual ui::TextInputMode GetTextInputMode() const OVERRIDE;
- virtual bool CanComposeInline() const OVERRIDE;
- virtual gfx::Rect GetCaretBounds() const OVERRIDE;
+ const ui::CompositionText& composition) override;
+ virtual void ConfirmCompositionText() override;
+ virtual void ClearCompositionText() override;
+ virtual void InsertText(const base::string16& text) override;
+ virtual void InsertChar(base::char16 ch, int flags) override;
+ virtual gfx::NativeWindow GetAttachedWindow() const override;
+ virtual ui::TextInputType GetTextInputType() const override;
+ virtual ui::TextInputMode GetTextInputMode() const override;
+ virtual bool CanComposeInline() const override;
+ virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,
- gfx::Rect* rect) const OVERRIDE;
- virtual bool HasCompositionText() const OVERRIDE;
- virtual bool GetTextRange(gfx::Range* range) const OVERRIDE;
- virtual bool GetCompositionTextRange(gfx::Range* range) const OVERRIDE;
- virtual bool GetSelectionRange(gfx::Range* range) const OVERRIDE;
- virtual bool SetSelectionRange(const gfx::Range& range) OVERRIDE;
- virtual bool DeleteRange(const gfx::Range& range) OVERRIDE;
+ gfx::Rect* rect) const override;
+ virtual bool HasCompositionText() const override;
+ virtual bool GetTextRange(gfx::Range* range) const override;
+ virtual bool GetCompositionTextRange(gfx::Range* range) const override;
+ virtual bool GetSelectionRange(gfx::Range* range) const override;
+ virtual bool SetSelectionRange(const gfx::Range& range) override;
+ virtual bool DeleteRange(const gfx::Range& range) override;
virtual bool GetTextFromRange(const gfx::Range& range,
- base::string16* text) const OVERRIDE;
- virtual void OnInputMethodChanged() OVERRIDE;
+ base::string16* text) const override;
+ virtual void OnInputMethodChanged() override;
virtual bool ChangeTextDirectionAndLayoutAlignment(
- base::i18n::TextDirection direction) OVERRIDE;
- virtual void ExtendSelectionAndDelete(size_t before, size_t after) OVERRIDE;
- virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE;
- virtual void OnCandidateWindowShown() OVERRIDE;
- virtual void OnCandidateWindowUpdated() OVERRIDE;
- virtual void OnCandidateWindowHidden() OVERRIDE;
- virtual bool IsEditingCommandEnabled(int command_id) OVERRIDE;
- virtual void ExecuteEditingCommand(int command_id) OVERRIDE;
+ base::i18n::TextDirection direction) override;
+ virtual void ExtendSelectionAndDelete(size_t before, size_t after) override;
+ virtual void EnsureCaretInRect(const gfx::Rect& rect) override;
+ virtual void OnCandidateWindowShown() override;
+ virtual void OnCandidateWindowUpdated() override;
+ virtual void OnCandidateWindowHidden() override;
+ virtual bool IsEditingCommandEnabled(int command_id) override;
+ virtual void ExecuteEditingCommand(int command_id) override;
protected:
// Returns the TextfieldModel's text/cursor/selection rendering model.
diff --git a/ui/views/controls/textfield/textfield_model.cc b/ui/views/controls/textfield/textfield_model.cc
index 1e5bab5..fba7e11 100644
--- a/ui/views/controls/textfield/textfield_model.cc
+++ b/ui/views/controls/textfield/textfield_model.cc
@@ -160,7 +160,7 @@
}
// Edit implementation.
- virtual bool DoMerge(const Edit* edit) OVERRIDE {
+ virtual bool DoMerge(const Edit* edit) override {
if (edit->type() != INSERT_EDIT || new_text_end() != edit->new_text_start_)
return false;
// If continuous edit, merge it.
@@ -193,7 +193,7 @@
}
// Edit implementation.
- virtual bool DoMerge(const Edit* edit) OVERRIDE {
+ virtual bool DoMerge(const Edit* edit) override {
if (edit->type() == DELETE_EDIT ||
new_text_end() != edit->old_text_start_ ||
edit->old_text_start_ != edit->new_text_start_)
@@ -223,7 +223,7 @@
}
// Edit implementation.
- virtual bool DoMerge(const Edit* edit) OVERRIDE {
+ virtual bool DoMerge(const Edit* edit) override {
if (edit->type() != DELETE_EDIT)
return false;
diff --git a/ui/views/controls/textfield/textfield_model_unittest.cc b/ui/views/controls/textfield/textfield_model_unittest.cc
index 0239516..e5b1dfd 100644
--- a/ui/views/controls/textfield/textfield_model_unittest.cc
+++ b/ui/views/controls/textfield/textfield_model_unittest.cc
@@ -50,7 +50,7 @@
composition_text_confirmed_or_cleared_(false) {
}
- virtual void OnCompositionTextConfirmedOrCleared() OVERRIDE {
+ virtual void OnCompositionTextConfirmedOrCleared() override {
composition_text_confirmed_or_cleared_ = true;
}
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index 56f4c5d..560bb41 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -64,7 +64,7 @@
key_received_(false),
weak_ptr_factory_(this) {}
- virtual bool OnKeyPressed(const ui::KeyEvent& e) OVERRIDE {
+ virtual bool OnKeyPressed(const ui::KeyEvent& e) override {
key_received_ = true;
// Since OnKeyPressed() might destroy |this|, get a weak pointer and
@@ -80,7 +80,7 @@
return key_handled_;
}
- virtual bool OnKeyReleased(const ui::KeyEvent& e) OVERRIDE {
+ virtual bool OnKeyReleased(const ui::KeyEvent& e) override {
key_received_ = true;
key_handled_ = views::Textfield::OnKeyReleased(e);
return key_handled_;
@@ -123,7 +123,7 @@
// views::TextfieldController:
virtual bool HandleKeyEvent(views::Textfield* sender,
- const ui::KeyEvent& key_event) OVERRIDE {
+ const ui::KeyEvent& key_event) override {
target_.reset();
return false;
}
@@ -177,22 +177,22 @@
// TextfieldController:
virtual void ContentsChanged(Textfield* sender,
- const base::string16& new_contents) OVERRIDE {
+ const base::string16& new_contents) override {
// Paste calls TextfieldController::ContentsChanged() explicitly even if the
// paste action did not change the content. So |new_contents| may match
// |last_contents_|. For more info, see http://crbug.com/79002
last_contents_ = new_contents;
}
- virtual void OnBeforeUserAction(Textfield* sender) OVERRIDE {
+ virtual void OnBeforeUserAction(Textfield* sender) override {
++on_before_user_action_;
}
- virtual void OnAfterUserAction(Textfield* sender) OVERRIDE {
+ virtual void OnAfterUserAction(Textfield* sender) override {
++on_after_user_action_;
}
- virtual void OnAfterCutOrCopy(ui::ClipboardType clipboard_type) OVERRIDE {
+ virtual void OnAfterCutOrCopy(ui::ClipboardType clipboard_type) override {
copied_to_clipboard_ = clipboard_type;
}
@@ -632,7 +632,7 @@
virtual bool MatchEvent(
const ui::Event& event,
- std::vector<ui::TextEditCommandAuraLinux>* commands) OVERRIDE {
+ std::vector<ui::TextEditCommandAuraLinux>* commands) override {
return false;
}
diff --git a/ui/views/controls/throbber.h b/ui/views/controls/throbber.h
index 08188c3..493cffe 100644
--- a/ui/views/controls/throbber.h
+++ b/ui/views/controls/throbber.h
@@ -37,8 +37,8 @@
void SetFrames(const gfx::ImageSkia* frames);
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
protected:
// Specifies whether the throbber is currently animating or not
@@ -67,8 +67,8 @@
SmoothedThrobber(int frame_delay_ms, gfx::ImageSkia* frames);
virtual ~SmoothedThrobber();
- virtual void Start() OVERRIDE;
- virtual void Stop() OVERRIDE;
+ virtual void Start() override;
+ virtual void Stop() override;
void set_start_delay_ms(int value) { start_delay_ms_ = value; }
void set_stop_delay_ms(int value) { stop_delay_ms_ = value; }
@@ -108,7 +108,7 @@
void SetChecked(bool checked);
// Overridden from Throbber:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
private:
static const int kFrameTimeMs = 30;
diff --git a/ui/views/controls/tree/tree_view.h b/ui/views/controls/tree/tree_view.h
index 3cae3b5..dcecc9f 100644
--- a/ui/views/controls/tree/tree_view.h
+++ b/ui/views/controls/tree/tree_view.h
@@ -120,54 +120,54 @@
views::Textfield* editor() { return editor_; }
// View overrides:
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual ui::TextInputClient* GetTextInputClient() OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual ui::TextInputClient* GetTextInputClient() override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
virtual void ShowContextMenu(const gfx::Point& p,
- ui::MenuSourceType source_type) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ ui::MenuSourceType source_type) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual const char* GetClassName() const override;
// TreeModelObserver overrides:
virtual void TreeNodesAdded(ui::TreeModel* model,
ui::TreeModelNode* parent,
int start,
- int count) OVERRIDE;
+ int count) override;
virtual void TreeNodesRemoved(ui::TreeModel* model,
ui::TreeModelNode* parent,
int start,
- int count) OVERRIDE;
+ int count) override;
virtual void TreeNodeChanged(ui::TreeModel* model,
- ui::TreeModelNode* model_node) OVERRIDE;
+ ui::TreeModelNode* model_node) override;
// TextfieldController overrides:
virtual void ContentsChanged(Textfield* sender,
- const base::string16& new_contents) OVERRIDE;
+ const base::string16& new_contents) override;
virtual bool HandleKeyEvent(Textfield* sender,
- const ui::KeyEvent& key_event) OVERRIDE;
+ const ui::KeyEvent& key_event) override;
// FocusChangeListener overrides:
virtual void OnWillChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
virtual void OnDidChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
// PrefixDelegate overrides:
- virtual int GetRowCount() OVERRIDE;
- virtual int GetSelectedRow() OVERRIDE;
- virtual void SetSelectedRow(int row) OVERRIDE;
- virtual base::string16 GetTextForRow(int row) OVERRIDE;
+ virtual int GetRowCount() override;
+ virtual int GetSelectedRow() override;
+ virtual void SetSelectedRow(int row) override;
+ virtual base::string16 GetTextForRow(int row) override;
protected:
// View overrides:
- virtual gfx::Point GetKeyboardContextMenuLocation() OVERRIDE;
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual gfx::Point GetKeyboardContextMenuLocation() override;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
private:
friend class TreeViewTest;
diff --git a/ui/views/controls/webview/BUILD.gn b/ui/views/controls/webview/BUILD.gn
index 93bd360..6671139 100644
--- a/ui/views/controls/webview/BUILD.gn
+++ b/ui/views/controls/webview/BUILD.gn
@@ -57,7 +57,6 @@
"//ipc:test_support",
"//skia",
"//testing/gtest",
- "//ui/aura",
"//ui/base",
"//ui/events",
"//ui/gfx",
diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h
index 2e69ad3..40d7616 100644
--- a/ui/views/controls/webview/web_dialog_view.h
+++ b/ui/views/controls/webview/web_dialog_view.h
@@ -52,69 +52,69 @@
content::WebContents* web_contents();
// Overridden from views::ClientView:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMinimumSize() const override;
virtual bool AcceleratorPressed(const ui::Accelerator& accelerator)
- OVERRIDE;
+ override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
- virtual bool CanClose() OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
+ virtual bool CanClose() override;
// Overridden from views::WidgetDelegate:
- virtual bool CanResize() const OVERRIDE;
- virtual ui::ModalType GetModalType() const OVERRIDE;
- virtual base::string16 GetWindowTitle() const OVERRIDE;
- virtual std::string GetWindowName() const OVERRIDE;
- virtual void WindowClosing() OVERRIDE;
- virtual views::View* GetContentsView() OVERRIDE;
- virtual ClientView* CreateClientView(views::Widget* widget) OVERRIDE;
- virtual views::View* GetInitiallyFocusedView() OVERRIDE;
- virtual bool ShouldShowWindowTitle() const OVERRIDE;
- virtual views::Widget* GetWidget() OVERRIDE;
- virtual const views::Widget* GetWidget() const OVERRIDE;
+ virtual bool CanResize() const override;
+ virtual ui::ModalType GetModalType() const override;
+ virtual base::string16 GetWindowTitle() const override;
+ virtual std::string GetWindowName() const override;
+ virtual void WindowClosing() override;
+ virtual views::View* GetContentsView() override;
+ virtual ClientView* CreateClientView(views::Widget* widget) override;
+ virtual views::View* GetInitiallyFocusedView() override;
+ virtual bool ShouldShowWindowTitle() const override;
+ virtual views::Widget* GetWidget() override;
+ virtual const views::Widget* GetWidget() const override;
// Overridden from ui::WebDialogDelegate:
- virtual ui::ModalType GetDialogModalType() const OVERRIDE;
- virtual base::string16 GetDialogTitle() const OVERRIDE;
- virtual GURL GetDialogContentURL() const OVERRIDE;
+ virtual ui::ModalType GetDialogModalType() const override;
+ virtual base::string16 GetDialogTitle() const override;
+ virtual GURL GetDialogContentURL() const override;
virtual void GetWebUIMessageHandlers(
- std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
- virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
- virtual void GetMinimumDialogSize(gfx::Size* size) const OVERRIDE;
- virtual std::string GetDialogArgs() const OVERRIDE;
+ std::vector<content::WebUIMessageHandler*>* handlers) const override;
+ virtual void GetDialogSize(gfx::Size* size) const override;
+ virtual void GetMinimumDialogSize(gfx::Size* size) const override;
+ virtual std::string GetDialogArgs() const override;
virtual void OnDialogShown(
content::WebUI* webui,
- content::RenderViewHost* render_view_host) OVERRIDE;
- virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
+ content::RenderViewHost* render_view_host) override;
+ virtual void OnDialogClosed(const std::string& json_retval) override;
virtual void OnDialogCloseFromWebUI(
- const std::string& json_retval) OVERRIDE;
+ const std::string& json_retval) override;
virtual void OnCloseContents(content::WebContents* source,
- bool* out_close_dialog) OVERRIDE;
- virtual bool ShouldShowDialogTitle() const OVERRIDE;
+ bool* out_close_dialog) override;
+ virtual bool ShouldShowDialogTitle() const override;
virtual bool HandleContextMenu(
- const content::ContextMenuParams& params) OVERRIDE;
+ const content::ContextMenuParams& params) override;
// Overridden from content::WebContentsDelegate:
virtual void MoveContents(content::WebContents* source,
- const gfx::Rect& pos) OVERRIDE;
+ const gfx::Rect& pos) override;
virtual void HandleKeyboardEvent(
content::WebContents* source,
- const content::NativeWebKeyboardEvent& event) OVERRIDE;
- virtual void CloseContents(content::WebContents* source) OVERRIDE;
+ const content::NativeWebKeyboardEvent& event) override;
+ virtual void CloseContents(content::WebContents* source) override;
virtual content::WebContents* OpenURLFromTab(
content::WebContents* source,
- const content::OpenURLParams& params) OVERRIDE;
+ const content::OpenURLParams& params) override;
virtual void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
bool user_gesture,
- bool* was_blocked) OVERRIDE;
+ bool* was_blocked) override;
virtual void LoadingStateChanged(content::WebContents* source,
- bool to_different_document) OVERRIDE;
+ bool to_different_document) override;
virtual void BeforeUnloadFired(content::WebContents* tab,
bool proceed,
- bool* proceed_to_fire_unload) OVERRIDE;
+ bool* proceed_to_fire_unload) override;
private:
FRIEND_TEST_ALL_PREFIXES(WebDialogBrowserTest, WebContentRendered);
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
index 7e31097..f17c534 100644
--- a/ui/views/controls/webview/webview.cc
+++ b/ui/views/controls/webview/webview.cc
@@ -13,7 +13,6 @@
#include "ipc/ipc_message.h"
#include "ui/accessibility/ax_enums.h"
#include "ui/accessibility/ax_view_state.h"
-#include "ui/aura/window.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/events/event.h"
#include "ui/views/accessibility/native_view_accessibility.h"
@@ -303,14 +302,8 @@
if (holder_->native_view() == view_to_attach)
return;
- // The WCV needs to be parented before making it visible.
holder_->Attach(view_to_attach);
- // Fullscreen widgets are not parented by a WebContentsView. Their visibility
- // is controlled by content i.e. (RenderWidgetHost)
- if (!is_embedding_fullscreen_widget_)
- view_to_attach->Show();
-
// The view will not be focused automatically when it is attached, so we need
// to pass on focus to it if the FocusManager thinks the view is focused. Note
// that not every Widget has a focus manager.
@@ -328,11 +321,6 @@
void WebView::DetachWebContents() {
if (web_contents()) {
- // Fullscreen widgets are not parented by a WebContentsView. Their
- // visibility is controlled by content i.e. (RenderWidgetHost).
- if (!is_embedding_fullscreen_widget_)
- web_contents()->GetNativeView()->Hide();
-
holder_->Detach();
#if defined(OS_WIN)
if (!is_embedding_fullscreen_widget_)
diff --git a/ui/views/controls/webview/webview.gyp b/ui/views/controls/webview/webview.gyp
index afd1ae2..af284b7 100644
--- a/ui/views/controls/webview/webview.gyp
+++ b/ui/views/controls/webview/webview.gyp
@@ -12,7 +12,6 @@
'target_name': 'webview',
'type': '<(component)',
'dependencies': [
- '../../../aura/aura.gyp:aura',
'../../../../base/base.gyp:base',
'../../../../base/base.gyp:base_i18n',
'../../../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
diff --git a/ui/views/controls/webview/webview.h b/ui/views/controls/webview/webview.h
index 850b2ba..32d423a 100644
--- a/ui/views/controls/webview/webview.h
+++ b/ui/views/controls/webview/webview.h
@@ -89,8 +89,8 @@
void SetPreferredSize(const gfx::Size& preferred_size);
// Overridden from View:
- virtual const char* GetClassName() const OVERRIDE;
- virtual ui::TextInputClient* GetTextInputClient() OVERRIDE;
+ virtual const char* GetClassName() const override;
+ virtual ui::TextInputClient* GetTextInputClient() override;
protected:
// Swaps the owned WebContents |wc_owner_| with |new_web_contents|. Returns
@@ -99,38 +99,38 @@
scoped_ptr<content::WebContents> new_web_contents);
// Overridden from View:
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
virtual bool SkipDefaultKeyEventProcessing(
- const ui::KeyEvent& event) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ const ui::KeyEvent& event) override;
+ virtual void OnFocus() override;
+ virtual void AboutToRequestFocusFromTabTraversal(bool reverse) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual gfx::NativeViewAccessible GetNativeViewAccessible() override;
+ virtual gfx::Size GetPreferredSize() const override;
// Overridden from content::WebContentsDelegate:
- virtual void WebContentsFocused(content::WebContents* web_contents) OVERRIDE;
- virtual bool EmbedsFullscreenWidget() const OVERRIDE;
+ virtual void WebContentsFocused(content::WebContents* web_contents) override;
+ virtual bool EmbedsFullscreenWidget() const override;
// Overridden from content::WebContentsObserver:
virtual void RenderViewDeleted(
- content::RenderViewHost* render_view_host) OVERRIDE;
- virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
+ content::RenderViewHost* render_view_host) override;
+ virtual void RenderProcessGone(base::TerminationStatus status) override;
virtual void RenderViewHostChanged(
content::RenderViewHost* old_host,
- content::RenderViewHost* new_host) OVERRIDE;
- virtual void DidShowFullscreenWidget(int routing_id) OVERRIDE;
- virtual void DidDestroyFullscreenWidget(int routing_id) OVERRIDE;
- virtual void DidToggleFullscreenModeForTab(bool entered_fullscreen) OVERRIDE;
- virtual void DidAttachInterstitialPage() OVERRIDE;
- virtual void DidDetachInterstitialPage() OVERRIDE;
+ content::RenderViewHost* new_host) override;
+ virtual void DidShowFullscreenWidget(int routing_id) override;
+ virtual void DidDestroyFullscreenWidget(int routing_id) override;
+ virtual void DidToggleFullscreenModeForTab(bool entered_fullscreen) override;
+ virtual void DidAttachInterstitialPage() override;
+ virtual void DidDetachInterstitialPage() override;
// Workaround for MSVC++ linker bug/feature that requires
// instantiation of the inline IPC::Listener methods in all translation units.
- virtual void OnChannelConnected(int32 peer_id) OVERRIDE {}
- virtual void OnChannelError() OVERRIDE {}
- virtual void OnBadMessageReceived(const IPC::Message& message) OVERRIDE {}
+ virtual void OnChannelConnected(int32 peer_id) override {}
+ virtual void OnChannelError() override {}
+ virtual void OnBadMessageReceived(const IPC::Message& message) override {}
private:
void AttachWebContents();
diff --git a/ui/views/controls/webview/webview_interactive_uitest.cc b/ui/views/controls/webview/webview_interactive_uitest.cc
index f1179b8..1ccfc33 100644
--- a/ui/views/controls/webview/webview_interactive_uitest.cc
+++ b/ui/views/controls/webview/webview_interactive_uitest.cc
@@ -22,7 +22,7 @@
WebViewInteractiveUiTest()
: ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
gfx::GLSurface::InitializeOneOffForTests();
WidgetTest::SetUp();
}
diff --git a/ui/views/controls/webview/webview_unittest.cc b/ui/views/controls/webview/webview_unittest.cc
index a6a250d..93cb915 100644
--- a/ui/views/controls/webview/webview_unittest.cc
+++ b/ui/views/controls/webview/webview_unittest.cc
@@ -26,7 +26,7 @@
// Overriden from TestViewsDelegate.
virtual content::WebContents* CreateWebContents(
content::BrowserContext* browser_context,
- content::SiteInstance* site_instance) OVERRIDE {
+ content::SiteInstance* site_instance) override {
return content::WebContentsTester::CreateTestWebContents(browser_context,
site_instance);
}
@@ -46,7 +46,7 @@
virtual ~WebViewUnitTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// The ViewsDelegate is deleted when the ViewsTestBase class is torn down.
WidgetTest::set_views_delegate(new WebViewTestViewsDelegate);
browser_context_.reset(new content::TestBrowserContext);
@@ -56,7 +56,7 @@
SetBrowserClientForTesting(&test_browser_client_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
browser_context_.reset(NULL);
// Flush the message loop to execute pending relase tasks as this would
// upset ASAN and Valgrind.
@@ -95,20 +95,20 @@
content::WebContentsObserver::Observe(NULL);
}
- virtual void WebContentsDestroyed() OVERRIDE {
+ virtual void WebContentsDestroyed() override {
DCHECK(web_contents_);
content::WebContentsObserver::Observe(NULL);
web_contents_ = NULL;
}
- virtual void WasShown() OVERRIDE {
+ virtual void WasShown() override {
valid_root_while_shown_ =
web_contents()->GetNativeView()->GetRootWindow() != NULL;
was_shown_ = true;
++shown_count_;
}
- virtual void WasHidden() OVERRIDE {
+ virtual void WasHidden() override {
was_shown_ = false;
++hidden_count_;
}
@@ -136,10 +136,14 @@
// WebContents visible and hidden respectively.
TEST_F(WebViewUnitTest, TestWebViewAttachDetachWebContents) {
// Create a top level widget and a webview as its content.
- views::Widget* widget = CreateTopLevelFramelessPlatformWidget();
+ views::Widget* parent = CreateTopLevelFramelessPlatformWidget();
+ parent->SetBounds(gfx::Rect(0, 10, 100, 100));
+
+ views::Widget* widget = CreateChildNativeWidgetWithParent(parent);
widget->SetBounds(gfx::Rect(0, 10, 100, 100));
views::WebView* webview = new views::WebView(browser_context());
widget->SetContentsView(webview);
+ parent->Show();
widget->Show();
// Case 1: Create a new WebContents and set it in the webview via
@@ -179,7 +183,48 @@
EXPECT_EQ(observer2.shown_count(), 1);
EXPECT_EQ(observer2.hidden_count(), 0);
+ // Case 3: Test that attaching to a hidden webview does not show the web
+ // contents.
+ webview->SetVisible(false);
+ EXPECT_EQ(1, observer2.hidden_count()); // Now hidden.
+
+ EXPECT_EQ(1, observer1.shown_count());
+ webview->SetWebContents(web_contents1.get());
+ EXPECT_EQ(1, observer1.shown_count());
+
+ // Nothing else should change.
+ EXPECT_EQ(1, observer1.hidden_count());
+ EXPECT_EQ(1, observer2.shown_count());
+ EXPECT_EQ(1, observer2.hidden_count());
+
+ // Case 4: Test that making the webview visible when a window has an invisible
+ // parent does not make the web contents visible.
+ parent->Hide();
+ webview->SetVisible(true);
+ // TODO(tapted): The following line is wrong, the shown_count() should still
+ // be 1, until the parent window is made visible on the line after.
+ EXPECT_EQ(2, observer1.shown_count());
+ parent->Show();
+ EXPECT_EQ(2, observer1.shown_count());
+ parent->Hide();
+ EXPECT_EQ(2, observer1.hidden_count());
+
+ // Case 5: Test that moving from a hidden parent to a visible parent makes the
+ // web contents visible.
+ views::Widget* parent2 = CreateTopLevelFramelessPlatformWidget();
+ parent2->SetBounds(gfx::Rect(0, 10, 100, 100));
+ parent2->Show();
+
+ EXPECT_EQ(2, observer1.shown_count());
+ // Note: that reparenting the windows directly, after the windows have been
+ // created, e.g., views::Widget::ReparentNativeView(widget, parent2), is not a
+ // supported use case. Instead, move the WebView over.
+ parent2->SetContentsView(webview);
+ EXPECT_EQ(3, observer1.shown_count());
+
widget->Close();
+ parent->Close();
+ parent2->Close();
RunPendingMessages();
}
diff --git a/ui/views/corewm/capture_controller_unittest.cc b/ui/views/corewm/capture_controller_unittest.cc
index 9a536ae..da2ca72 100644
--- a/ui/views/corewm/capture_controller_unittest.cc
+++ b/ui/views/corewm/capture_controller_unittest.cc
@@ -30,7 +30,7 @@
public:
CaptureControllerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AuraTestBase::SetUp();
capture_controller_.reset(new wm::ScopedCaptureClient(root_window()));
@@ -50,7 +50,7 @@
#endif
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
RunAllPendingInMessageLoop();
#if !defined(OS_CHROMEOS)
diff --git a/ui/views/corewm/desktop_capture_controller_unittest.cc b/ui/views/corewm/desktop_capture_controller_unittest.cc
index 3baf0f4..85c9c79 100644
--- a/ui/views/corewm/desktop_capture_controller_unittest.cc
+++ b/ui/views/corewm/desktop_capture_controller_unittest.cc
@@ -32,7 +32,7 @@
DesktopCaptureControllerTest() {}
virtual ~DesktopCaptureControllerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
gfx::GLSurface::InitializeOneOffForTests();
ui::RegisterPathProvider();
base::FilePath ui_test_pak_path;
@@ -50,7 +50,7 @@
DesktopViewInputTest()
: received_gesture_event_(false) {}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
received_gesture_event_ = true;
return View::OnGestureEvent(event);
}
diff --git a/ui/views/corewm/tooltip_aura.h b/ui/views/corewm/tooltip_aura.h
index 9e8c5fa..24976b9 100644
--- a/ui/views/corewm/tooltip_aura.h
+++ b/ui/views/corewm/tooltip_aura.h
@@ -51,13 +51,13 @@
// Tooltip:
virtual void SetText(aura::Window* window,
const base::string16& tooltip_text,
- const gfx::Point& location) OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual bool IsVisible() OVERRIDE;
+ const gfx::Point& location) override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual bool IsVisible() override;
// WidgetObserver:
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE;
+ virtual void OnWidgetDestroying(Widget* widget) override;
const gfx::ScreenType screen_type_;
diff --git a/ui/views/corewm/tooltip_controller.h b/ui/views/corewm/tooltip_controller.h
index e045334..8242725 100644
--- a/ui/views/corewm/tooltip_controller.h
+++ b/ui/views/corewm/tooltip_controller.h
@@ -38,19 +38,19 @@
virtual ~TooltipController();
// Overridden from aura::client::TooltipClient.
- virtual void UpdateTooltip(aura::Window* target) OVERRIDE;
+ virtual void UpdateTooltip(aura::Window* target) override;
virtual void SetTooltipShownTimeout(aura::Window* target,
- int timeout_in_ms) OVERRIDE;
- virtual void SetTooltipsEnabled(bool enable) OVERRIDE;
+ int timeout_in_ms) override;
+ virtual void SetTooltipsEnabled(bool enable) override;
// Overridden from ui::EventHandler.
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
- virtual void OnCancelMode(ui::CancelModeEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnTouchEvent(ui::TouchEvent* event) override;
+ virtual void OnCancelMode(ui::CancelModeEvent* event) override;
// Overridden from aura::WindowObserver.
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
const gfx::Point& mouse_location() const { return curr_mouse_loc_; }
diff --git a/ui/views/corewm/tooltip_controller_test_helper.h b/ui/views/corewm/tooltip_controller_test_helper.h
index 4451ff3..310a00c 100644
--- a/ui/views/corewm/tooltip_controller_test_helper.h
+++ b/ui/views/corewm/tooltip_controller_test_helper.h
@@ -57,7 +57,7 @@
// Overridden from views::View
virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
+ base::string16* tooltip) const override;
private:
base::string16 tooltip_text_;
diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc
index 43f5c80..e083439 100644
--- a/ui/views/corewm/tooltip_controller_unittest.cc
+++ b/ui/views/corewm/tooltip_controller_unittest.cc
@@ -77,7 +77,7 @@
TooltipControllerTest() : view_(NULL) {}
virtual ~TooltipControllerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
#if defined(OS_CHROMEOS)
views_delegate_.reset(new TestViewsDelegate);
#else
@@ -103,7 +103,7 @@
generator_.reset(new ui::test::EventGenerator(GetRootWindow()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
#if defined(OS_CHROMEOS)
root_window()->RemovePreTargetHandler(controller_.get());
aura::client::SetTooltipClient(root_window(), NULL);
@@ -418,18 +418,18 @@
// ScreenPositionClient overrides:
virtual void ConvertPointToScreen(const aura::Window* window,
- gfx::Point* point) OVERRIDE {
+ gfx::Point* point) override {
}
virtual void ConvertPointFromScreen(const aura::Window* window,
- gfx::Point* point) OVERRIDE {
+ gfx::Point* point) override {
}
virtual void ConvertHostPointToScreen(aura::Window* root_gwindow,
- gfx::Point* point) OVERRIDE {
+ gfx::Point* point) override {
NOTREACHED();
}
virtual void SetBounds(aura::Window* window,
const gfx::Rect& bounds,
- const gfx::Display& display) OVERRIDE {
+ const gfx::Display& display) override {
window->SetBounds(bounds);
}
@@ -444,7 +444,7 @@
TooltipControllerCaptureTest() {}
virtual ~TooltipControllerCaptureTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
TooltipControllerTest::SetUp();
aura::client::SetScreenPositionClient(GetRootWindow(),
&screen_position_client_);
@@ -455,7 +455,7 @@
#endif
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
#if !defined(OS_CHROMEOS)
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen());
desktop_screen_.reset();
@@ -559,17 +559,17 @@
// Tooltip:
virtual void SetText(aura::Window* window,
const base::string16& tooltip_text,
- const gfx::Point& location) OVERRIDE {
+ const gfx::Point& location) override {
tooltip_text_ = tooltip_text;
location_ = location;
}
- virtual void Show() OVERRIDE {
+ virtual void Show() override {
is_visible_ = true;
}
- virtual void Hide() OVERRIDE {
+ virtual void Hide() override {
is_visible_ = false;
}
- virtual bool IsVisible() OVERRIDE {
+ virtual bool IsVisible() override {
return is_visible_;
}
const gfx::Point& location() { return location_; }
@@ -590,7 +590,7 @@
TooltipControllerTest2() : test_tooltip_(new TestTooltip) {}
virtual ~TooltipControllerTest2() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
wm_state_.reset(new wm::WMState);
aura::test::AuraTestBase::SetUp();
new wm::DefaultActivationClient(root_window());
@@ -602,7 +602,7 @@
generator_.reset(new ui::test::EventGenerator(root_window()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
root_window()->RemovePreTargetHandler(controller_.get());
aura::client::SetTooltipClient(root_window(), NULL);
controller_.reset();
@@ -665,7 +665,7 @@
TooltipControllerTest3() : test_tooltip_(new TestTooltip) {}
virtual ~TooltipControllerTest3() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
wm_state_.reset(new wm::WMState);
aura::test::AuraTestBase::SetUp();
new wm::DefaultActivationClient(root_window());
@@ -687,7 +687,7 @@
SetTooltipClient(GetRootWindow(), controller_.get());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
GetRootWindow()->RemovePreTargetHandler(controller_.get());
aura::client::SetTooltipClient(GetRootWindow(), NULL);
diff --git a/ui/views/corewm/tooltip_win.h b/ui/views/corewm/tooltip_win.h
index b031a32..23ee640 100644
--- a/ui/views/corewm/tooltip_win.h
+++ b/ui/views/corewm/tooltip_win.h
@@ -39,10 +39,10 @@
// Tooltip:
virtual void SetText(aura::Window* window,
const base::string16& tooltip_text,
- const gfx::Point& location) OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual bool IsVisible() OVERRIDE;
+ const gfx::Point& location) override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual bool IsVisible() override;
// The window |tooltip_hwnd_| is parented to.
HWND parent_hwnd_;
diff --git a/ui/views/examples/bubble_example.cc b/ui/views/examples/bubble_example.cc
index 49a60e5..907611a 100644
--- a/ui/views/examples/bubble_example.cc
+++ b/ui/views/examples/bubble_example.cc
@@ -54,7 +54,7 @@
: BubbleDelegateView(anchor, arrow) {}
protected:
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 50, 50, 0));
AddChildView(new Label(GetArrowName(arrow())));
}
diff --git a/ui/views/examples/bubble_example.h b/ui/views/examples/bubble_example.h
index d9ad66d..eb5625c 100644
--- a/ui/views/examples/bubble_example.h
+++ b/ui/views/examples/bubble_example.h
@@ -19,11 +19,11 @@
virtual ~BubbleExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
Button* no_shadow_;
Button* big_shadow_;
diff --git a/ui/views/examples/button_example.h b/ui/views/examples/button_example.h
index 4e01a8a..8fc2c60 100644
--- a/ui/views/examples/button_example.h
+++ b/ui/views/examples/button_example.h
@@ -24,13 +24,13 @@
virtual ~ButtonExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
void LabelButtonPressed(const ui::Event& event);
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// Example buttons.
LabelButton* label_button_;
diff --git a/ui/views/examples/checkbox_example.h b/ui/views/examples/checkbox_example.h
index a5a8964..d95f1f4 100644
--- a/ui/views/examples/checkbox_example.h
+++ b/ui/views/examples/checkbox_example.h
@@ -22,11 +22,11 @@
virtual ~CheckboxExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// The only control in this test.
Checkbox* button_;
diff --git a/ui/views/examples/combobox_example.h b/ui/views/examples/combobox_example.h
index 89ccff2..3ea1c24 100644
--- a/ui/views/examples/combobox_example.h
+++ b/ui/views/examples/combobox_example.h
@@ -20,8 +20,8 @@
virtual ~ComboboxModelExample();
// ui::ComboboxModel:
- virtual int GetItemCount() const OVERRIDE;
- virtual base::string16 GetItemAt(int index) OVERRIDE;
+ virtual int GetItemCount() const override;
+ virtual base::string16 GetItemAt(int index) override;
private:
DISALLOW_COPY_AND_ASSIGN(ComboboxModelExample);
@@ -34,11 +34,11 @@
virtual ~ComboboxExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// ComboboxListener:
- virtual void OnPerformAction(Combobox* combobox) OVERRIDE;
+ virtual void OnPerformAction(Combobox* combobox) override;
ComboboxModelExample combobox_model_;
Combobox* combobox_;
diff --git a/ui/views/examples/double_split_view_example.cc b/ui/views/examples/double_split_view_example.cc
index 8ff40df..dc794e6 100644
--- a/ui/views/examples/double_split_view_example.cc
+++ b/ui/views/examples/double_split_view_example.cc
@@ -22,7 +22,7 @@
void SetColor(SkColor from, SkColor to);
// View:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
private:
DISALLOW_COPY_AND_ASSIGN(SplittedView);
diff --git a/ui/views/examples/double_split_view_example.h b/ui/views/examples/double_split_view_example.h
index fe37c79..c83b8cb 100644
--- a/ui/views/examples/double_split_view_example.h
+++ b/ui/views/examples/double_split_view_example.h
@@ -19,7 +19,7 @@
virtual ~DoubleSplitViewExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// The SingleSplitViews to be embedded.
diff --git a/ui/views/examples/example_base.cc b/ui/views/examples/example_base.cc
index a06fc1d..bb216f9 100644
--- a/ui/views/examples/example_base.cc
+++ b/ui/views/examples/example_base.cc
@@ -29,7 +29,7 @@
private:
// View:
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE {
+ const ViewHierarchyChangedDetails& details) override {
View::ViewHierarchyChanged(details);
// We're not using child == this because a Widget may not be
// available when this is added to the hierarchy.
diff --git a/ui/views/examples/example_combobox_model.h b/ui/views/examples/example_combobox_model.h
index 3b23332..4988c60 100644
--- a/ui/views/examples/example_combobox_model.h
+++ b/ui/views/examples/example_combobox_model.h
@@ -17,8 +17,8 @@
virtual ~ExampleComboboxModel();
// ui::ComboboxModel:
- virtual int GetItemCount() const OVERRIDE;
- virtual base::string16 GetItemAt(int index) OVERRIDE;
+ virtual int GetItemCount() const override;
+ virtual base::string16 GetItemAt(int index) override;
private:
const char** strings_;
diff --git a/ui/views/examples/examples_window.cc b/ui/views/examples/examples_window.cc
index 596cb75..040fcdc 100644
--- a/ui/views/examples/examples_window.cc
+++ b/ui/views/examples/examples_window.cc
@@ -105,8 +105,8 @@
}
// ui::ComboboxModel:
- virtual int GetItemCount() const OVERRIDE { return example_list_.size(); }
- virtual base::string16 GetItemAt(int index) OVERRIDE {
+ virtual int GetItemCount() const override { return example_list_.size(); }
+ virtual base::string16 GetItemAt(int index) override {
return base::UTF8ToUTF16(example_list_[index]->example_title());
}
@@ -172,21 +172,21 @@
private:
// WidgetDelegateView:
- virtual bool CanResize() const OVERRIDE { return true; }
- virtual bool CanMaximize() const OVERRIDE { return true; }
- virtual bool CanMinimize() const OVERRIDE { return true; }
- virtual base::string16 GetWindowTitle() const OVERRIDE {
+ virtual bool CanResize() const override { return true; }
+ virtual bool CanMaximize() const override { return true; }
+ virtual bool CanMinimize() const override { return true; }
+ virtual base::string16 GetWindowTitle() const override {
return base::ASCIIToUTF16("Views Examples");
}
- virtual View* GetContentsView() OVERRIDE { return this; }
- virtual void WindowClosing() OVERRIDE {
+ virtual View* GetContentsView() override { return this; }
+ virtual void WindowClosing() override {
instance_ = NULL;
if (operation_ == QUIT_ON_CLOSE)
base::MessageLoopForUI::current()->Quit();
}
// ComboboxListener:
- virtual void OnPerformAction(Combobox* combobox) OVERRIDE {
+ virtual void OnPerformAction(Combobox* combobox) override {
DCHECK_EQ(combobox, combobox_);
DCHECK(combobox->selected_index() < combobox_model_.GetItemCount());
example_shown_->RemoveAllChildViews(false);
diff --git a/ui/views/examples/label_example.cc b/ui/views/examples/label_example.cc
index 178b62b..89e3223 100644
--- a/ui/views/examples/label_example.cc
+++ b/ui/views/examples/label_example.cc
@@ -37,7 +37,7 @@
virtual ~PreferredSizeLabel() {}
// Label:
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(50, Label::GetPreferredSize().height());
}
diff --git a/ui/views/examples/label_example.h b/ui/views/examples/label_example.h
index ea6cd94..f597742 100644
--- a/ui/views/examples/label_example.h
+++ b/ui/views/examples/label_example.h
@@ -30,17 +30,17 @@
virtual ~LabelExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
// ButtonListener:
- virtual void ButtonPressed(Button* button, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* button, const ui::Event& event) override;
// ComboboxListener:
- virtual void OnPerformAction(Combobox* combobox) OVERRIDE;
+ virtual void OnPerformAction(Combobox* combobox) override;
// TextfieldController:
virtual void ContentsChanged(Textfield* sender,
- const base::string16& new_contents) OVERRIDE;
+ const base::string16& new_contents) override;
private:
// Add a customizable label and various controls to modify its presentation.
diff --git a/ui/views/examples/link_example.h b/ui/views/examples/link_example.h
index fd6e924..fa6bb57 100644
--- a/ui/views/examples/link_example.h
+++ b/ui/views/examples/link_example.h
@@ -19,11 +19,11 @@
virtual ~LinkExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// LinkListener:
- virtual void LinkClicked(Link* source, int event_flags) OVERRIDE;
+ virtual void LinkClicked(Link* source, int event_flags) override;
Link* link_;
diff --git a/ui/views/examples/menu_example.cc b/ui/views/examples/menu_example.cc
index bc8845e..1b95457 100644
--- a/ui/views/examples/menu_example.cc
+++ b/ui/views/examples/menu_example.cc
@@ -28,12 +28,12 @@
ExampleMenuModel();
// ui::SimpleMenuModel::Delegate:
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdChecked(int command_id) const override;
+ virtual bool IsCommandIdEnabled(int command_id) const override;
virtual bool GetAcceleratorForCommandId(
int command_id,
- ui::Accelerator* accelerator) OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+ ui::Accelerator* accelerator) override;
+ virtual void ExecuteCommand(int command_id, int event_flags) override;
private:
enum GroupID {
@@ -66,7 +66,7 @@
private:
// MenuButtonListener:
virtual void OnMenuButtonClicked(View* source,
- const gfx::Point& point) OVERRIDE;
+ const gfx::Point& point) override;
ui::SimpleMenuModel* GetMenuModel();
diff --git a/ui/views/examples/menu_example.h b/ui/views/examples/menu_example.h
index 3ed5d37..af370b3 100644
--- a/ui/views/examples/menu_example.h
+++ b/ui/views/examples/menu_example.h
@@ -19,7 +19,7 @@
virtual ~MenuExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
DISALLOW_COPY_AND_ASSIGN(MenuExample);
diff --git a/ui/views/examples/message_box_example.h b/ui/views/examples/message_box_example.h
index 692ae22..fe3ba67 100644
--- a/ui/views/examples/message_box_example.h
+++ b/ui/views/examples/message_box_example.h
@@ -24,11 +24,11 @@
virtual ~MessageBoxExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// The MessageBoxView to be tested.
MessageBoxView* message_box_view_;
diff --git a/ui/views/examples/multiline_example.cc b/ui/views/examples/multiline_example.cc
index 8c86d9e..d2d69cc 100644
--- a/ui/views/examples/multiline_example.cc
+++ b/ui/views/examples/multiline_example.cc
@@ -35,7 +35,7 @@
virtual ~PreferredSizeLabel() {}
// Label:
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(50, Label::GetPreferredSize().height());
}
@@ -55,12 +55,12 @@
SetBorder(Border::CreateSolidBorder(2, SK_ColorGRAY));
}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
View::OnPaint(canvas);
render_text_->Draw(canvas);
}
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
// Turn off multiline mode to get the single-line text size, which is the
// preferred size for this view.
render_text_->SetMultiline(false);
@@ -71,7 +71,7 @@
return size;
}
- virtual int GetHeightForWidth(int w) const OVERRIDE {
+ virtual int GetHeightForWidth(int w) const override {
// TODO(ckocagil): Why does this happen?
if (w == 0)
return View::GetHeightForWidth(w);
@@ -104,7 +104,7 @@
}
private:
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE {
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override {
gfx::Rect bounds = GetLocalBounds();
bounds.Inset(GetInsets());
render_text_->SetDisplayRect(bounds);
diff --git a/ui/views/examples/multiline_example.h b/ui/views/examples/multiline_example.h
index 94f4770..8b0888c 100644
--- a/ui/views/examples/multiline_example.h
+++ b/ui/views/examples/multiline_example.h
@@ -26,17 +26,17 @@
virtual ~MultilineExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
private:
class RenderTextView;
// TextfieldController:
virtual void ContentsChanged(Textfield* sender,
- const base::string16& new_contents) OVERRIDE;
+ const base::string16& new_contents) override;
RenderTextView* render_text_view_;
Label* label_;
diff --git a/ui/views/examples/progress_bar_example.h b/ui/views/examples/progress_bar_example.h
index 8533b7a..c3291d1 100644
--- a/ui/views/examples/progress_bar_example.h
+++ b/ui/views/examples/progress_bar_example.h
@@ -21,11 +21,11 @@
virtual ~ProgressBarExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// ButtonListener:
- virtual void ButtonPressed(Button* button, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* button, const ui::Event& event) override;
Button* minus_button_;
Button* plus_button_;
diff --git a/ui/views/examples/radio_button_example.h b/ui/views/examples/radio_button_example.h
index cc14522..844e315 100644
--- a/ui/views/examples/radio_button_example.h
+++ b/ui/views/examples/radio_button_example.h
@@ -25,11 +25,11 @@
virtual ~RadioButtonExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// Group of 3 radio buttons.
RadioButton* radio_buttons_[3];
diff --git a/ui/views/examples/scroll_view_example.cc b/ui/views/examples/scroll_view_example.cc
index 127442f..f6abfce 100644
--- a/ui/views/examples/scroll_view_example.cc
+++ b/ui/views/examples/scroll_view_example.cc
@@ -27,7 +27,7 @@
AddChildView(new RadioButton(ASCIIToUTF16("Radio Button"), 0));
}
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(width(), height());
}
@@ -41,7 +41,7 @@
view->SetBounds(0, y, size.width(), size.height());
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
PlaceChildY(0, 0);
PlaceChildY(1, height() / 2);
SizeToPreferredSize();
diff --git a/ui/views/examples/scroll_view_example.h b/ui/views/examples/scroll_view_example.h
index d850b01..b3fd3bf 100644
--- a/ui/views/examples/scroll_view_example.h
+++ b/ui/views/examples/scroll_view_example.h
@@ -25,11 +25,11 @@
virtual ~ScrollViewExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// Control buttons to change the size of scrollable and jump to
// predefined position.
diff --git a/ui/views/examples/single_split_view_example.cc b/ui/views/examples/single_split_view_example.cc
index 7e390b5..21dd88e 100644
--- a/ui/views/examples/single_split_view_example.cc
+++ b/ui/views/examples/single_split_view_example.cc
@@ -22,9 +22,9 @@
private:
// View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual void Layout() override;
DISALLOW_COPY_AND_ASSIGN(SplittedView);
};
diff --git a/ui/views/examples/single_split_view_example.h b/ui/views/examples/single_split_view_example.h
index 603482c..b53c5c3 100644
--- a/ui/views/examples/single_split_view_example.h
+++ b/ui/views/examples/single_split_view_example.h
@@ -20,11 +20,11 @@
virtual ~SingleSplitViewExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// SingleSplitViewListener:
- virtual bool SplitHandleMoved(SingleSplitView* sender) OVERRIDE;
+ virtual bool SplitHandleMoved(SingleSplitView* sender) override;
SingleSplitView* single_split_view_;
diff --git a/ui/views/examples/slider_example.h b/ui/views/examples/slider_example.h
index 32950f9..b27099b 100644
--- a/ui/views/examples/slider_example.h
+++ b/ui/views/examples/slider_example.h
@@ -21,14 +21,14 @@
virtual ~SliderExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// SliderListener:
virtual void SliderValueChanged(Slider* sender,
float value,
float old_value,
- SliderChangeReason reason) OVERRIDE;
+ SliderChangeReason reason) override;
Slider* slider_;
Label* label_;
diff --git a/ui/views/examples/tabbed_pane_example.h b/ui/views/examples/tabbed_pane_example.h
index f23f6b3..a211a75 100644
--- a/ui/views/examples/tabbed_pane_example.h
+++ b/ui/views/examples/tabbed_pane_example.h
@@ -26,14 +26,14 @@
virtual ~TabbedPaneExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// TabbedPaneListener:
- virtual void TabSelectedAt(int index) OVERRIDE;
+ virtual void TabSelectedAt(int index) override;
// Print the status of the tab in the status area.
void PrintStatus();
diff --git a/ui/views/examples/table_example.h b/ui/views/examples/table_example.h
index 06ac3c0..5f51316 100644
--- a/ui/views/examples/table_example.h
+++ b/ui/views/examples/table_example.h
@@ -36,25 +36,25 @@
virtual ~TableExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
// ui::TableModel:
- virtual int RowCount() OVERRIDE;
- virtual base::string16 GetText(int row, int column_id) OVERRIDE;
- virtual gfx::ImageSkia GetIcon(int row) OVERRIDE;
- virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE;
+ virtual int RowCount() override;
+ virtual base::string16 GetText(int row, int column_id) override;
+ virtual gfx::ImageSkia GetIcon(int row) override;
+ virtual void SetObserver(ui::TableModelObserver* observer) override;
// TableGrouper:
- virtual void GetGroupRange(int model_index, GroupRange* range) OVERRIDE;
+ virtual void GetGroupRange(int model_index, GroupRange* range) override;
// TableViewObserver:
- virtual void OnSelectionChanged() OVERRIDE;
- virtual void OnDoubleClick() OVERRIDE;
- virtual void OnMiddleClick() OVERRIDE;
- virtual void OnKeyDown(ui::KeyboardCode virtual_keycode) OVERRIDE;
+ virtual void OnSelectionChanged() override;
+ virtual void OnDoubleClick() override;
+ virtual void OnMiddleClick() override;
+ virtual void OnKeyDown(ui::KeyboardCode virtual_keycode) override;
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
private:
// The table to be tested.
diff --git a/ui/views/examples/text_example.cc b/ui/views/examples/text_example.cc
index 3145cfc..4dcf113 100644
--- a/ui/views/examples/text_example.cc
+++ b/ui/views/examples/text_example.cc
@@ -69,7 +69,7 @@
elide_(gfx::NO_ELIDE) {
}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
View::OnPaint(canvas);
const gfx::Rect bounds = GetContentsBounds();
const SkColor color = SK_ColorDKGRAY;
diff --git a/ui/views/examples/text_example.h b/ui/views/examples/text_example.h
index 18ebaab..dd4bffc 100644
--- a/ui/views/examples/text_example.h
+++ b/ui/views/examples/text_example.h
@@ -27,7 +27,7 @@
virtual ~TextExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// Creates and adds a check box to the layout.
@@ -40,10 +40,10 @@
int count);
// ButtonListener:
- virtual void ButtonPressed(Button* button, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* button, const ui::Event& event) override;
// ComboboxListener:
- virtual void OnPerformAction(Combobox* combobox) OVERRIDE;
+ virtual void OnPerformAction(Combobox* combobox) override;
class TextExampleView;
// The content of the scroll view.
diff --git a/ui/views/examples/textfield_example.h b/ui/views/examples/textfield_example.h
index db5e199..31aaaa9 100644
--- a/ui/views/examples/textfield_example.h
+++ b/ui/views/examples/textfield_example.h
@@ -27,19 +27,19 @@
virtual ~TextfieldExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// TextfieldController:
virtual void ContentsChanged(Textfield* sender,
- const base::string16& new_contents) OVERRIDE;
+ const base::string16& new_contents) override;
virtual bool HandleKeyEvent(Textfield* sender,
- const ui::KeyEvent& key_event) OVERRIDE;
+ const ui::KeyEvent& key_event) override;
virtual bool HandleMouseEvent(Textfield* sender,
- const ui::MouseEvent& mouse_event) OVERRIDE;
+ const ui::MouseEvent& mouse_event) override;
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// Textfields for name and password.
Textfield* name_;
diff --git a/ui/views/examples/throbber_example.cc b/ui/views/examples/throbber_example.cc
index 7bd18a2..51bbf3d 100644
--- a/ui/views/examples/throbber_example.cc
+++ b/ui/views/examples/throbber_example.cc
@@ -25,11 +25,11 @@
throbber_->Start();
}
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(width(), height());
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
View* child = child_at(0);
gfx::Size ps = child->GetPreferredSize();
child->SetBounds((width() - ps.width()) / 2,
diff --git a/ui/views/examples/throbber_example.h b/ui/views/examples/throbber_example.h
index 3c4f9c0..dcac287 100644
--- a/ui/views/examples/throbber_example.h
+++ b/ui/views/examples/throbber_example.h
@@ -17,7 +17,7 @@
virtual ~ThrobberExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
DISALLOW_COPY_AND_ASSIGN(ThrobberExample);
diff --git a/ui/views/examples/tree_view_example.h b/ui/views/examples/tree_view_example.h
index 55af17f..4678b2a 100644
--- a/ui/views/examples/tree_view_example.h
+++ b/ui/views/examples/tree_view_example.h
@@ -31,7 +31,7 @@
virtual ~TreeViewExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// IDs used by the context menu.
@@ -48,24 +48,24 @@
bool IsCommandIdEnabled(int command_id);
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// TreeViewController:
- virtual void OnTreeViewSelectionChanged(TreeView* tree_view) OVERRIDE;
- virtual bool CanEdit(TreeView* tree_view, ui::TreeModelNode* node) OVERRIDE;
+ virtual void OnTreeViewSelectionChanged(TreeView* tree_view) override;
+ virtual bool CanEdit(TreeView* tree_view, ui::TreeModelNode* node) override;
// ContextMenuController:
virtual void ShowContextMenuForView(View* source,
const gfx::Point& point,
- ui::MenuSourceType source_type) OVERRIDE;
+ ui::MenuSourceType source_type) override;
// SimpleMenuModel::Delegate:
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdChecked(int command_id) const override;
+ virtual bool IsCommandIdEnabled(int command_id) const override;
virtual bool GetAcceleratorForCommandId(
int command_id,
- ui::Accelerator* accelerator) OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+ ui::Accelerator* accelerator) override;
+ virtual void ExecuteCommand(int command_id, int event_flags) override;
// The tree view to be tested.
TreeView* tree_view_;
diff --git a/ui/views/examples/webview_example.h b/ui/views/examples/webview_example.h
index 3e35fe9..e55aced 100644
--- a/ui/views/examples/webview_example.h
+++ b/ui/views/examples/webview_example.h
@@ -23,7 +23,7 @@
virtual ~WebViewExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
WebView* webview_;
diff --git a/ui/views/examples/widget_example.cc b/ui/views/examples/widget_example.cc
index 1109a5a..2c061b7 100644
--- a/ui/views/examples/widget_example.cc
+++ b/ui/views/examples/widget_example.cc
@@ -24,10 +24,10 @@
public:
DialogExample();
virtual ~DialogExample();
- virtual base::string16 GetWindowTitle() const OVERRIDE;
- virtual View* CreateExtraView() OVERRIDE;
- virtual View* CreateTitlebarExtraView() OVERRIDE;
- virtual View* CreateFootnoteView() OVERRIDE;
+ virtual base::string16 GetWindowTitle() const override;
+ virtual View* CreateExtraView() override;
+ virtual View* CreateTitlebarExtraView() override;
+ virtual View* CreateFootnoteView() override;
};
DialogExample::DialogExample() {
diff --git a/ui/views/examples/widget_example.h b/ui/views/examples/widget_example.h
index ff08d70..44e1840 100644
--- a/ui/views/examples/widget_example.h
+++ b/ui/views/examples/widget_example.h
@@ -23,7 +23,7 @@
virtual ~WidgetExample();
// ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
+ virtual void CreateExampleView(View* container) override;
private:
// Button tags used to identify various commands.
@@ -41,7 +41,7 @@
void ShowWidget(View* sender, Widget::InitParams params);
// ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
DISALLOW_COPY_AND_ASSIGN(WidgetExample);
};
diff --git a/ui/views/focus/external_focus_tracker.h b/ui/views/focus/external_focus_tracker.h
index e4d9172..3cfacb3 100644
--- a/ui/views/focus/external_focus_tracker.h
+++ b/ui/views/focus/external_focus_tracker.h
@@ -33,9 +33,9 @@
// FocusChangeListener:
virtual void OnWillChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
virtual void OnDidChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
// Focuses last focused view which is not a child of parent view and is not
// parent view itself. Returns true if focus for a view was requested, false
diff --git a/ui/views/focus/focus_manager_factory.cc b/ui/views/focus/focus_manager_factory.cc
index 62770d7..bcbbfba 100644
--- a/ui/views/focus/focus_manager_factory.cc
+++ b/ui/views/focus/focus_manager_factory.cc
@@ -18,7 +18,7 @@
protected:
virtual FocusManager* CreateFocusManager(Widget* widget,
- bool desktop_widget) OVERRIDE {
+ bool desktop_widget) override {
return new FocusManager(widget, NULL /* delegate */);
}
diff --git a/ui/views/focus/focus_manager_unittest.cc b/ui/views/focus/focus_manager_unittest.cc
index 289ed23..f6d9a43 100644
--- a/ui/views/focus/focus_manager_unittest.cc
+++ b/ui/views/focus/focus_manager_unittest.cc
@@ -48,11 +48,11 @@
set_id(view_id);
}
- virtual void OnFocus() OVERRIDE {
+ virtual void OnFocus() override {
event_list_->push_back(FocusTestEvent(ON_FOCUS, id()));
}
- virtual void OnBlur() OVERRIDE {
+ virtual void OnBlur() override {
event_list_->push_back(FocusTestEvent(ON_BLUR, id()));
}
@@ -165,12 +165,12 @@
process_accelerator_(process_accelerator),
can_handle_accelerators_(true) {}
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE {
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override {
++accelerator_count_;
return process_accelerator_;
}
- virtual bool CanHandleAccelerators() const OVERRIDE {
+ virtual bool CanHandleAccelerators() const override {
return can_handle_accelerators_;
}
@@ -425,13 +425,13 @@
accelerator_count_(0) {
}
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE {
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override {
++accelerator_count_;
focus_manager_->UnregisterAccelerator(accelerator, this);
return true;
}
- virtual bool CanHandleAccelerators() const OVERRIDE {
+ virtual bool CanHandleAccelerators() const override {
return true;
}
@@ -499,7 +499,7 @@
}
virtual FocusManager* CreateFocusManager(Widget* widget,
- bool desktop_widget) OVERRIDE {
+ bool desktop_widget) override {
return new FocusManagerDtorTracked(widget, dtor_tracker_);
}
@@ -568,7 +568,7 @@
void set_view_to_focus(View* view) { view_to_focus_ = view; }
- virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE {
+ virtual void AboutToRequestFocusFromTabTraversal(bool reverse) override {
view_to_focus_->RequestFocus();
}
@@ -706,13 +706,13 @@
virtual ~FocusManagerArrowKeyTraversalTest() {}
// FocusManagerTest overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
FocusManagerTest::SetUp();
previous_arrow_key_traversal_enabled_ =
FocusManager::arrow_key_traversal_enabled();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
FocusManager::set_arrow_key_traversal_enabled(
previous_arrow_key_traversal_enabled_);
FocusManagerTest::TearDown();
@@ -786,7 +786,7 @@
public:
TextInputTestView() {}
- virtual ui::TextInputClient* GetTextInputClient() OVERRIDE {
+ virtual ui::TextInputClient* GetTextInputClient() override {
return &text_input_client_;
}
@@ -852,11 +852,11 @@
}
// WidgetDelegate overrides:
- virtual bool ShouldAdvanceFocusToTopLevelWidget() const OVERRIDE {
+ virtual bool ShouldAdvanceFocusToTopLevelWidget() const override {
return should_advance_focus_to_parent_;
}
- virtual Widget* GetWidget() OVERRIDE { return widget_; }
- virtual const Widget* GetWidget() const OVERRIDE { return widget_; }
+ virtual Widget* GetWidget() override { return widget_; }
+ virtual const Widget* GetWidget() const override { return widget_; }
private:
Widget* widget_;
diff --git a/ui/views/focus/focus_traversal_unittest.cc b/ui/views/focus/focus_traversal_unittest.cc
index ea68b16..db55e9d 100644
--- a/ui/views/focus/focus_traversal_unittest.cc
+++ b/ui/views/focus/focus_traversal_unittest.cc
@@ -89,8 +89,8 @@
class DummyComboboxModel : public ui::ComboboxModel {
public:
// Overridden from ui::ComboboxModel:
- virtual int GetItemCount() const OVERRIDE { return 10; }
- virtual base::string16 GetItemAt(int index) OVERRIDE {
+ virtual int GetItemCount() const override { return 10; }
+ virtual base::string16 GetItemAt(int index) override {
return ASCIIToUTF16("Item ") + base::IntToString16(index);
}
};
@@ -108,7 +108,7 @@
}
// Overridden from View:
- virtual FocusTraversable* GetPaneFocusTraversable() OVERRIDE {
+ virtual FocusTraversable* GetPaneFocusTraversable() override {
if (focus_search_)
return this;
else
@@ -116,13 +116,13 @@
}
// Overridden from FocusTraversable:
- virtual views::FocusSearch* GetFocusSearch() OVERRIDE {
+ virtual views::FocusSearch* GetFocusSearch() override {
return focus_search_;
}
- virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE {
+ virtual FocusTraversable* GetFocusTraversableParent() override {
return NULL;
}
- virtual View* GetFocusTraversableParentView() OVERRIDE {
+ virtual View* GetFocusTraversableParentView() override {
return NULL;
}
@@ -146,12 +146,12 @@
return static_cast<internal::RootView*>(widget_->GetRootView());
}
- virtual FocusTraversable* GetFocusTraversable() OVERRIDE {
+ virtual FocusTraversable* GetFocusTraversable() override {
return static_cast<internal::RootView*>(widget_->GetRootView());
}
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE {
+ const ViewHierarchyChangedDetails& details) override {
NativeViewHost::ViewHierarchyChanged(details);
if (details.child == this && details.is_add) {
@@ -185,7 +185,7 @@
public:
virtual ~FocusTraversalTest();
- virtual void InitContentView() OVERRIDE;
+ virtual void InitContentView() override;
protected:
FocusTraversalTest();
diff --git a/ui/views/ime/input_method_base.h b/ui/views/ime/input_method_base.h
index da454fb..4410796 100644
--- a/ui/views/ime/input_method_base.h
+++ b/ui/views/ime/input_method_base.h
@@ -29,16 +29,16 @@
virtual ~InputMethodBase();
// Overridden from InputMethod.
- virtual void SetDelegate(internal::InputMethodDelegate* delegate) OVERRIDE;
- virtual void Init(Widget* widget) OVERRIDE;
- virtual void OnTextInputTypeChanged(View* view) OVERRIDE;
- virtual ui::TextInputClient* GetTextInputClient() const OVERRIDE;
- virtual ui::TextInputType GetTextInputType() const OVERRIDE;
- virtual bool IsMock() const OVERRIDE;
+ virtual void SetDelegate(internal::InputMethodDelegate* delegate) override;
+ virtual void Init(Widget* widget) override;
+ virtual void OnTextInputTypeChanged(View* view) override;
+ virtual ui::TextInputClient* GetTextInputClient() const override;
+ virtual ui::TextInputType GetTextInputType() const override;
+ virtual bool IsMock() const override;
// Overridden from FocusChangeListener.
- virtual void OnWillChangeFocus(View* focused_before, View* focused) OVERRIDE;
- virtual void OnDidChangeFocus(View* focused_before, View* focused) OVERRIDE;
+ virtual void OnWillChangeFocus(View* focused_before, View* focused) override;
+ virtual void OnDidChangeFocus(View* focused_before, View* focused) override;
protected:
internal::InputMethodDelegate* delegate() const { return delegate_; }
diff --git a/ui/views/ime/input_method_bridge.cc b/ui/views/ime/input_method_bridge.cc
index 97b0400..8e321f0 100644
--- a/ui/views/ime/input_method_bridge.cc
+++ b/ui/views/ime/input_method_bridge.cc
@@ -24,16 +24,16 @@
virtual ~HostObserver();
virtual void OnTextInputTypeChanged(
- const ui::TextInputClient* client) OVERRIDE {}
- virtual void OnFocus() OVERRIDE {}
- virtual void OnBlur() OVERRIDE {}
+ const ui::TextInputClient* client) override {}
+ virtual void OnFocus() override {}
+ virtual void OnBlur() override {}
virtual void OnCaretBoundsChanged(
- const ui::TextInputClient* client) OVERRIDE {}
+ const ui::TextInputClient* client) override {}
virtual void OnTextInputStateChanged(
- const ui::TextInputClient* client) OVERRIDE {}
+ const ui::TextInputClient* client) override {}
virtual void OnInputMethodDestroyed(
- const ui::InputMethod* input_method) OVERRIDE;
- virtual void OnShowImeIfNeeded() OVERRIDE {}
+ const ui::InputMethod* input_method) override;
+ virtual void OnShowImeIfNeeded() override {}
private:
InputMethodBridge* bridge_;
diff --git a/ui/views/ime/input_method_bridge.h b/ui/views/ime/input_method_bridge.h
index cdabecd..43fb947 100644
--- a/ui/views/ime/input_method_bridge.h
+++ b/ui/views/ime/input_method_bridge.h
@@ -35,56 +35,56 @@
virtual ~InputMethodBridge();
// Overridden from InputMethod:
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual void DispatchKeyEvent(const ui::KeyEvent& key) OVERRIDE;
- virtual void OnTextInputTypeChanged(View* view) OVERRIDE;
- virtual void OnCaretBoundsChanged(View* view) OVERRIDE;
- virtual void CancelComposition(View* view) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
- virtual void ShowImeIfNeeded() OVERRIDE;
+ NativeEventResult* result) override;
+ virtual void DispatchKeyEvent(const ui::KeyEvent& key) override;
+ virtual void OnTextInputTypeChanged(View* view) override;
+ virtual void OnCaretBoundsChanged(View* view) override;
+ virtual void CancelComposition(View* view) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual bool IsCandidatePopupOpen() const override;
+ virtual void ShowImeIfNeeded() override;
// Overridden from TextInputClient:
virtual void SetCompositionText(
- const ui::CompositionText& composition) OVERRIDE;
- virtual void ConfirmCompositionText() OVERRIDE;
- virtual void ClearCompositionText() OVERRIDE;
- virtual void InsertText(const base::string16& text) OVERRIDE;
- virtual void InsertChar(base::char16 ch, int flags) OVERRIDE;
- virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE;
- virtual ui::TextInputType GetTextInputType() const OVERRIDE;
- virtual ui::TextInputMode GetTextInputMode() const OVERRIDE;
- virtual bool CanComposeInline() const OVERRIDE;
- virtual gfx::Rect GetCaretBounds() const OVERRIDE;
+ const ui::CompositionText& composition) override;
+ virtual void ConfirmCompositionText() override;
+ virtual void ClearCompositionText() override;
+ virtual void InsertText(const base::string16& text) override;
+ virtual void InsertChar(base::char16 ch, int flags) override;
+ virtual gfx::NativeWindow GetAttachedWindow() const override;
+ virtual ui::TextInputType GetTextInputType() const override;
+ virtual ui::TextInputMode GetTextInputMode() const override;
+ virtual bool CanComposeInline() const override;
+ virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,
- gfx::Rect* rect) const OVERRIDE;
- virtual bool HasCompositionText() const OVERRIDE;
- virtual bool GetTextRange(gfx::Range* range) const OVERRIDE;
- virtual bool GetCompositionTextRange(gfx::Range* range) const OVERRIDE;
- virtual bool GetSelectionRange(gfx::Range* range) const OVERRIDE;
- virtual bool SetSelectionRange(const gfx::Range& range) OVERRIDE;
- virtual bool DeleteRange(const gfx::Range& range) OVERRIDE;
+ gfx::Rect* rect) const override;
+ virtual bool HasCompositionText() const override;
+ virtual bool GetTextRange(gfx::Range* range) const override;
+ virtual bool GetCompositionTextRange(gfx::Range* range) const override;
+ virtual bool GetSelectionRange(gfx::Range* range) const override;
+ virtual bool SetSelectionRange(const gfx::Range& range) override;
+ virtual bool DeleteRange(const gfx::Range& range) override;
virtual bool GetTextFromRange(const gfx::Range& range,
- base::string16* text) const OVERRIDE;
- virtual void OnInputMethodChanged() OVERRIDE;
+ base::string16* text) const override;
+ virtual void OnInputMethodChanged() override;
virtual bool ChangeTextDirectionAndLayoutAlignment(
- base::i18n::TextDirection direction) OVERRIDE;
- virtual void ExtendSelectionAndDelete(size_t before, size_t after) OVERRIDE;
- virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE;
- virtual void OnCandidateWindowShown() OVERRIDE;
- virtual void OnCandidateWindowUpdated() OVERRIDE;
- virtual void OnCandidateWindowHidden() OVERRIDE;
- virtual bool IsEditingCommandEnabled(int command_id) OVERRIDE;
- virtual void ExecuteEditingCommand(int command_id) OVERRIDE;
+ base::i18n::TextDirection direction) override;
+ virtual void ExtendSelectionAndDelete(size_t before, size_t after) override;
+ virtual void EnsureCaretInRect(const gfx::Rect& rect) override;
+ virtual void OnCandidateWindowShown() override;
+ virtual void OnCandidateWindowUpdated() override;
+ virtual void OnCandidateWindowHidden() override;
+ virtual bool IsEditingCommandEnabled(int command_id) override;
+ virtual void ExecuteEditingCommand(int command_id) override;
// Overridden from FocusChangeListener.
- virtual void OnWillChangeFocus(View* focused_before, View* focused) OVERRIDE;
- virtual void OnDidChangeFocus(View* focused_before, View* focused) OVERRIDE;
+ virtual void OnWillChangeFocus(View* focused_before, View* focused) override;
+ virtual void OnDidChangeFocus(View* focused_before, View* focused) override;
ui::InputMethod* GetHostInputMethod() const;
diff --git a/ui/views/ime/mock_input_method.h b/ui/views/ime/mock_input_method.h
index 013742c..e55c4df 100644
--- a/ui/views/ime/mock_input_method.h
+++ b/ui/views/ime/mock_input_method.h
@@ -23,21 +23,21 @@
virtual ~MockInputMethod();
// Overridden from InputMethod:
- virtual void Init(Widget* widget) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual void Init(Widget* widget) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual void DispatchKeyEvent(const ui::KeyEvent& key) OVERRIDE;
- virtual void OnTextInputTypeChanged(View* view) OVERRIDE;
- virtual void OnCaretBoundsChanged(View* view) OVERRIDE;
- virtual void CancelComposition(View* view) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
- virtual void ShowImeIfNeeded() OVERRIDE;
- virtual bool IsMock() const OVERRIDE;
+ NativeEventResult* result) override;
+ virtual void DispatchKeyEvent(const ui::KeyEvent& key) override;
+ virtual void OnTextInputTypeChanged(View* view) override;
+ virtual void OnCaretBoundsChanged(View* view) override;
+ virtual void CancelComposition(View* view) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual bool IsCandidatePopupOpen() const override;
+ virtual void ShowImeIfNeeded() override;
+ virtual bool IsMock() const override;
bool focus_changed() const { return focus_changed_; }
bool untranslated_ime_message_called() const {
@@ -59,7 +59,7 @@
private:
// Overridden from InputMethodBase.
- virtual void OnWillChangeFocus(View* focused_before, View* focused) OVERRIDE;
+ virtual void OnWillChangeFocus(View* focused_before, View* focused) override;
// Clears boolean states defined below.
void ClearStates();
diff --git a/ui/views/ime/null_input_method.h b/ui/views/ime/null_input_method.h
index 49234d3..29142e6 100644
--- a/ui/views/ime/null_input_method.h
+++ b/ui/views/ime/null_input_method.h
@@ -22,24 +22,24 @@
NullInputMethod();
// Overridden from InputMethod:
- virtual void SetDelegate(internal::InputMethodDelegate* delegate) OVERRIDE;
- virtual void Init(Widget* widget) OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnBlur() OVERRIDE;
+ virtual void SetDelegate(internal::InputMethodDelegate* delegate) override;
+ virtual void Init(Widget* widget) override;
+ virtual void OnFocus() override;
+ virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
- NativeEventResult* result) OVERRIDE;
- virtual void DispatchKeyEvent(const ui::KeyEvent& key) OVERRIDE;
- virtual void OnTextInputTypeChanged(View* view) OVERRIDE;
- virtual void OnCaretBoundsChanged(View* view) OVERRIDE;
- virtual void CancelComposition(View* view) OVERRIDE;
- virtual void OnInputLocaleChanged() OVERRIDE;
- virtual std::string GetInputLocale() OVERRIDE;
- virtual bool IsActive() OVERRIDE;
- virtual ui::TextInputClient* GetTextInputClient() const OVERRIDE;
- virtual ui::TextInputType GetTextInputType() const OVERRIDE;
- virtual bool IsCandidatePopupOpen() const OVERRIDE;
- virtual void ShowImeIfNeeded() OVERRIDE;
- virtual bool IsMock() const OVERRIDE;
+ NativeEventResult* result) override;
+ virtual void DispatchKeyEvent(const ui::KeyEvent& key) override;
+ virtual void OnTextInputTypeChanged(View* view) override;
+ virtual void OnCaretBoundsChanged(View* view) override;
+ virtual void CancelComposition(View* view) override;
+ virtual void OnInputLocaleChanged() override;
+ virtual std::string GetInputLocale() override;
+ virtual bool IsActive() override;
+ virtual ui::TextInputClient* GetTextInputClient() const override;
+ virtual ui::TextInputType GetTextInputType() const override;
+ virtual bool IsCandidatePopupOpen() const override;
+ virtual void ShowImeIfNeeded() override;
+ virtual bool IsMock() const override;
private:
DISALLOW_COPY_AND_ASSIGN(NullInputMethod);
diff --git a/ui/views/layout/box_layout.h b/ui/views/layout/box_layout.h
index 1bcbcf9..b07afaf 100644
--- a/ui/views/layout/box_layout.h
+++ b/ui/views/layout/box_layout.h
@@ -98,13 +98,13 @@
void SetDefaultFlex(int default_flex);
// Overridden from views::LayoutManager:
- virtual void Installed(View* host) OVERRIDE;
- virtual void Uninstalled(View* host) OVERRIDE;
- virtual void ViewRemoved(View* host, View* view) OVERRIDE;
- virtual void Layout(View* host) OVERRIDE;
- virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE;
+ virtual void Installed(View* host) override;
+ virtual void Uninstalled(View* host) override;
+ virtual void ViewRemoved(View* host, View* view) override;
+ virtual void Layout(View* host) override;
+ virtual gfx::Size GetPreferredSize(const View* host) const override;
virtual int GetPreferredHeightForWidth(const View* host,
- int width) const OVERRIDE;
+ int width) const override;
private:
// Returns the flex for the specified |view|.
diff --git a/ui/views/layout/box_layout_unittest.cc b/ui/views/layout/box_layout_unittest.cc
index c5a5edd..708d2fe 100644
--- a/ui/views/layout/box_layout_unittest.cc
+++ b/ui/views/layout/box_layout_unittest.cc
@@ -14,7 +14,7 @@
class BoxLayoutTest : public testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
host_.reset(new View);
}
diff --git a/ui/views/layout/fill_layout.h b/ui/views/layout/fill_layout.h
index f50bde0..7496f7c 100644
--- a/ui/views/layout/fill_layout.h
+++ b/ui/views/layout/fill_layout.h
@@ -24,10 +24,10 @@
virtual ~FillLayout();
// Overridden from LayoutManager:
- virtual void Layout(View* host) OVERRIDE;
- virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE;
+ virtual void Layout(View* host) override;
+ virtual gfx::Size GetPreferredSize(const View* host) const override;
virtual int GetPreferredHeightForWidth(const View* host,
- int width) const OVERRIDE;
+ int width) const override;
private:
DISALLOW_COPY_AND_ASSIGN(FillLayout);
diff --git a/ui/views/layout/grid_layout.cc b/ui/views/layout/grid_layout.cc
index 7ab8108..99b39f2 100644
--- a/ui/views/layout/grid_layout.cc
+++ b/ui/views/layout/grid_layout.cc
@@ -178,7 +178,7 @@
GridLayout::Alignment h_align() { return h_align_; }
GridLayout::Alignment v_align() { return v_align_; }
- virtual void ResetSize() OVERRIDE;
+ virtual void ResetSize() override;
private:
friend class ColumnSet;
@@ -190,7 +190,7 @@
// to that size. This should only be used for the master column.
void UnifySameSizedColumnSizes();
- virtual void AdjustSize(int size) OVERRIDE;
+ virtual void AdjustSize(int size) override;
const GridLayout::Alignment h_align_;
const GridLayout::Alignment v_align_;
@@ -269,7 +269,7 @@
virtual ~Row() {}
- virtual void ResetSize() OVERRIDE {
+ virtual void ResetSize() override {
max_ascent_ = max_descent_ = 0;
SetSize(height_);
}
diff --git a/ui/views/layout/grid_layout.h b/ui/views/layout/grid_layout.h
index ea578c8..ad228d5 100644
--- a/ui/views/layout/grid_layout.h
+++ b/ui/views/layout/grid_layout.h
@@ -162,26 +162,26 @@
// Notification we've been installed on a particular host. Checks that host
// is the same as the View supplied in the constructor.
- virtual void Installed(View* host) OVERRIDE;
+ virtual void Installed(View* host) override;
// Notification we've been uninstalled on a particular host. Checks that host
// is the same as the View supplied in the constructor.
- virtual void Uninstalled(View* host) OVERRIDE;
+ virtual void Uninstalled(View* host) override;
// Notification that a view has been added.
- virtual void ViewAdded(View* host, View* view) OVERRIDE;
+ virtual void ViewAdded(View* host, View* view) override;
// Notification that a view has been removed.
- virtual void ViewRemoved(View* host, View* view) OVERRIDE;
+ virtual void ViewRemoved(View* host, View* view) override;
// Layouts out the components.
- virtual void Layout(View* host) OVERRIDE;
+ virtual void Layout(View* host) override;
// Returns the preferred size for the GridLayout.
- virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE;
+ virtual gfx::Size GetPreferredSize(const View* host) const override;
virtual int GetPreferredHeightForWidth(const View* host,
- int width) const OVERRIDE;
+ int width) const override;
void set_minimum_size(const gfx::Size& size) { minimum_size_ = size; }
diff --git a/ui/views/layout/grid_layout_unittest.cc b/ui/views/layout/grid_layout_unittest.cc
index ea7d231..72f5053 100644
--- a/ui/views/layout/grid_layout_unittest.cc
+++ b/ui/views/layout/grid_layout_unittest.cc
@@ -24,7 +24,7 @@
pref_ = pref;
}
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return pref_;
}
@@ -39,11 +39,11 @@
circumference_ = circumference;
}
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(0, circumference_ / 2);
}
- virtual int GetHeightForWidth(int width) const OVERRIDE {
+ virtual int GetHeightForWidth(int width) const override {
return std::max(0, circumference_ / 2 - width);
}
diff --git a/ui/views/linux_ui/window_button_order_provider.cc b/ui/views/linux_ui/window_button_order_provider.cc
index 9032478..fa65cab 100644
--- a/ui/views/linux_ui/window_button_order_provider.cc
+++ b/ui/views/linux_ui/window_button_order_provider.cc
@@ -20,7 +20,7 @@
// WindowButtonOrderObserver:
virtual void OnWindowButtonOrderingChange(
const std::vector<views::FrameButton>& leading_buttons,
- const std::vector<views::FrameButton>& trailing_buttons) OVERRIDE;
+ const std::vector<views::FrameButton>& trailing_buttons) override;
private:
DISALLOW_COPY_AND_ASSIGN(WindowButtonOrderObserverDelegate);
};
diff --git a/ui/views/masked_targeter_delegate.h b/ui/views/masked_targeter_delegate.h
index 548a364..ee8701c 100644
--- a/ui/views/masked_targeter_delegate.h
+++ b/ui/views/masked_targeter_delegate.h
@@ -32,7 +32,7 @@
// ViewTargeterDelegate:
virtual bool DoesIntersectRect(const View* target,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
private:
DISALLOW_COPY_AND_ASSIGN(MaskedTargeterDelegate);
diff --git a/ui/views/mouse_watcher_aura.cc b/ui/views/mouse_watcher_aura.cc
index 3793f0e..6fa463b 100644
--- a/ui/views/mouse_watcher_aura.cc
+++ b/ui/views/mouse_watcher_aura.cc
@@ -36,7 +36,7 @@
}
// ui::EventHandler implementation:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
switch (event->type()) {
case ui::ET_MOUSE_MOVED:
case ui::ET_MOUSE_DRAGGED:
diff --git a/ui/views/mouse_watcher_view_host.h b/ui/views/mouse_watcher_view_host.h
index f19aa8f..ada3444 100644
--- a/ui/views/mouse_watcher_view_host.h
+++ b/ui/views/mouse_watcher_view_host.h
@@ -23,7 +23,7 @@
// MouseWatcherHost.
virtual bool Contains(const gfx::Point& screen_point,
- MouseEventType type) OVERRIDE;
+ MouseEventType type) override;
private:
bool IsCursorInViewZone(const gfx::Point& screen_point);
diff --git a/ui/views/painter.cc b/ui/views/painter.cc
index df67030..37a5a30 100644
--- a/ui/views/painter.cc
+++ b/ui/views/painter.cc
@@ -30,8 +30,8 @@
virtual ~DashedFocusPainter();
// Painter:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) override;
private:
const gfx::Insets insets_;
@@ -64,8 +64,8 @@
virtual ~SolidFocusPainter();
// Painter:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) override;
private:
const SkColor color_;
@@ -104,8 +104,8 @@
virtual ~GradientPainter();
// Painter:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) override;
private:
// If |horizontal_| is true then the gradient is painted horizontally.
@@ -175,8 +175,8 @@
virtual ~ImagePainter();
// Painter:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) override;
private:
scoped_ptr<gfx::NineImagePainter> nine_painter_;
diff --git a/ui/views/painter.h b/ui/views/painter.h
index 6efd281..e703150 100644
--- a/ui/views/painter.h
+++ b/ui/views/painter.h
@@ -100,8 +100,8 @@
virtual ~HorizontalPainter();
// Painter:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) override;
private:
// The image chunks.
diff --git a/ui/views/round_rect_painter.h b/ui/views/round_rect_painter.h
index b7ee6cc..e498e8c 100644
--- a/ui/views/round_rect_painter.h
+++ b/ui/views/round_rect_painter.h
@@ -24,8 +24,8 @@
virtual ~RoundRectPainter();
// Painter:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) override;
private:
const SkColor border_color_;
diff --git a/ui/views/run_all_unittests.cc b/ui/views/run_all_unittests.cc
index e5d7b9d..bf7624c 100644
--- a/ui/views/run_all_unittests.cc
+++ b/ui/views/run_all_unittests.cc
@@ -18,7 +18,7 @@
ViewTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
protected:
- virtual void Initialize() OVERRIDE {
+ virtual void Initialize() override {
base::TestSuite::Initialize();
gfx::GLSurface::InitializeOneOffForTests();
ui::RegisterPathProvider();
@@ -28,7 +28,7 @@
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
}
- virtual void Shutdown() OVERRIDE {
+ virtual void Shutdown() override {
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
diff --git a/ui/views/shadow_border.h b/ui/views/shadow_border.h
index 60439f5..b6aff3f 100644
--- a/ui/views/shadow_border.h
+++ b/ui/views/shadow_border.h
@@ -22,9 +22,9 @@
protected:
// Overridden from views::Border:
- virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::Insets GetInsets() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual void Paint(const views::View& view, gfx::Canvas* canvas) override;
+ virtual gfx::Insets GetInsets() const override;
+ virtual gfx::Size GetMinimumSize() const override;
private:
// Blur amount of the shadow in pixels. For details on how blur is defined see
diff --git a/ui/views/test/capture_tracking_view.h b/ui/views/test/capture_tracking_view.h
index fa914d1..a80cab0 100644
--- a/ui/views/test/capture_tracking_view.h
+++ b/ui/views/test/capture_tracking_view.h
@@ -26,8 +26,8 @@
void reset() { got_press_ = got_capture_lost_ = false; }
// Overridden from views::View
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
private:
// See description above getters.
diff --git a/ui/views/test/desktop_test_views_delegate.h b/ui/views/test/desktop_test_views_delegate.h
index 32f2ad7..26d24c2 100644
--- a/ui/views/test/desktop_test_views_delegate.h
+++ b/ui/views/test/desktop_test_views_delegate.h
@@ -19,7 +19,7 @@
// Overridden from ViewsDelegate:
virtual void OnBeforeWidgetInit(Widget::InitParams* params,
- internal::NativeWidgetDelegate* delegate) OVERRIDE;
+ internal::NativeWidgetDelegate* delegate) override;
private:
DISALLOW_COPY_AND_ASSIGN(DesktopTestViewsDelegate);
diff --git a/ui/views/test/event_generator_delegate_mac.mm b/ui/views/test/event_generator_delegate_mac.mm
index db94d34..d156aa5 100644
--- a/ui/views/test/event_generator_delegate_mac.mm
+++ b/ui/views/test/event_generator_delegate_mac.mm
@@ -243,47 +243,47 @@
}
// Overridden from ui::EventTarget:
- virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE { return true; }
- virtual ui::EventTarget* GetParentTarget() OVERRIDE { return NULL; }
- virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE;
- virtual ui::EventTargeter* GetEventTargeter() OVERRIDE {
+ virtual bool CanAcceptEvent(const ui::Event& event) override { return true; }
+ virtual ui::EventTarget* GetParentTarget() override { return NULL; }
+ virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override;
+ virtual ui::EventTargeter* GetEventTargeter() override {
return this;
}
// Overridden from ui::EventHandler (via ui::EventTarget):
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
// Overridden from ui::EventSource:
- virtual ui::EventProcessor* GetEventProcessor() OVERRIDE { return this; }
+ virtual ui::EventProcessor* GetEventProcessor() override { return this; }
// Overridden from ui::EventProcessor:
- virtual ui::EventTarget* GetRootTarget() OVERRIDE { return this; }
+ virtual ui::EventTarget* GetRootTarget() override { return this; }
// Overridden from ui::EventDispatcherDelegate (via ui::EventProcessor):
- virtual bool CanDispatchToTarget(EventTarget* target) OVERRIDE {
+ virtual bool CanDispatchToTarget(EventTarget* target) override {
return true;
}
// Overridden from ui::test::EventGeneratorDelegate:
virtual void SetContext(ui::test::EventGenerator* owner,
gfx::NativeWindow root_window,
- gfx::NativeWindow window) OVERRIDE;
- virtual ui::EventTarget* GetTargetAt(const gfx::Point& location) OVERRIDE {
+ gfx::NativeWindow window) override;
+ virtual ui::EventTarget* GetTargetAt(const gfx::Point& location) override {
return this;
}
- virtual ui::EventSource* GetEventSource(ui::EventTarget* target) OVERRIDE {
+ virtual ui::EventSource* GetEventSource(ui::EventTarget* target) override {
return this;
}
virtual gfx::Point CenterOfTarget(
- const ui::EventTarget* target) const OVERRIDE;
- virtual gfx::Point CenterOfWindow(gfx::NativeWindow window) const OVERRIDE;
+ const ui::EventTarget* target) const override;
+ virtual gfx::Point CenterOfWindow(gfx::NativeWindow window) const override;
virtual void ConvertPointFromTarget(const ui::EventTarget* target,
- gfx::Point* point) const OVERRIDE {}
+ gfx::Point* point) const override {}
virtual void ConvertPointToTarget(const ui::EventTarget* target,
- gfx::Point* point) const OVERRIDE {}
+ gfx::Point* point) const override {}
virtual void ConvertPointFromHost(const ui::EventTarget* hosted_target,
- gfx::Point* point) const OVERRIDE {}
+ gfx::Point* point) const override {}
private:
friend struct DefaultSingletonTraits<EventGeneratorDelegateMac>;
diff --git a/ui/views/test/focus_manager_test.h b/ui/views/test/focus_manager_test.h
index 380d6f3..39184d2 100644
--- a/ui/views/test/focus_manager_test.h
+++ b/ui/views/test/focus_manager_test.h
@@ -23,14 +23,14 @@
FocusManager* GetFocusManager();
// Overridden from ViewsTestBase:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
// Overridden from WidgetDelegate:
- virtual View* GetContentsView() OVERRIDE;
- virtual Widget* GetWidget() OVERRIDE;
- virtual const Widget* GetWidget() const OVERRIDE;
- virtual void GetAccessiblePanes(std::vector<View*>* panes) OVERRIDE;
+ virtual View* GetContentsView() override;
+ virtual Widget* GetWidget() override;
+ virtual const Widget* GetWidget() const override;
+ virtual void GetAccessiblePanes(std::vector<View*>* panes) override;
protected:
// Called after the Widget is initialized and the content view is added.
@@ -65,9 +65,9 @@
// Overridden from FocusChangeListener:
virtual void OnWillChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
virtual void OnDidChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
private:
// A vector of which views lost/gained focus.
@@ -91,7 +91,7 @@
// Overridden from WidgetFocusChangeListener:
virtual void OnNativeFocusChange(gfx::NativeView focused_before,
- gfx::NativeView focused_now) OVERRIDE;
+ gfx::NativeView focused_now) override;
private:
// Pairs of (focused_before, focused_now) parameters we've received via calls
diff --git a/ui/views/test/test_views.h b/ui/views/test/test_views.h
index be6f778..429e59f 100644
--- a/ui/views/test/test_views.h
+++ b/ui/views/test/test_views.h
@@ -16,7 +16,7 @@
explicit StaticSizedView(const gfx::Size& size);
virtual ~StaticSizedView();
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
private:
gfx::Size size_;
@@ -32,8 +32,8 @@
void set_preferred_width(int width) { preferred_width_ = width; }
- virtual int GetHeightForWidth(int w) const OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual int GetHeightForWidth(int w) const override;
+ virtual gfx::Size GetPreferredSize() const override;
private:
// The multiplicative factor between width and height, i.e.
diff --git a/ui/views/test/test_views_delegate.h b/ui/views/test/test_views_delegate.h
index 626bc79..20802e7 100644
--- a/ui/views/test/test_views_delegate.h
+++ b/ui/views/test/test_views_delegate.h
@@ -33,7 +33,7 @@
// ViewsDelegate:
virtual void OnBeforeWidgetInit(
Widget::InitParams* params,
- internal::NativeWidgetDelegate* delegate) OVERRIDE;
+ internal::NativeWidgetDelegate* delegate) override;
private:
bool use_desktop_native_widgets_;
diff --git a/ui/views/test/test_widget_observer.h b/ui/views/test/test_widget_observer.h
index 84bf185..064db84 100644
--- a/ui/views/test/test_widget_observer.h
+++ b/ui/views/test/test_widget_observer.h
@@ -24,7 +24,7 @@
private:
// WidgetObserver overrides:
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE;
+ virtual void OnWidgetDestroying(Widget* widget) override;
Widget* widget_;
diff --git a/ui/views/test/ui_controls_factory_desktop_aurax11.cc b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
index a7982bf..201f884 100644
--- a/ui/views/test/ui_controls_factory_desktop_aurax11.cc
+++ b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
@@ -77,7 +77,7 @@
bool control,
bool shift,
bool alt,
- bool command) OVERRIDE {
+ bool command) override {
DCHECK(!command); // No command key on Aura
return SendKeyPressNotifyWhenDone(
window, key, control, shift, alt, command, base::Closure());
@@ -90,7 +90,7 @@
bool shift,
bool alt,
bool command,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
DCHECK(!command); // No command key on Aura
aura::WindowTreeHost* host = window->GetHost();
@@ -124,13 +124,13 @@
return true;
}
- virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE {
+ virtual bool SendMouseMove(long screen_x, long screen_y) override {
return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure());
}
virtual bool SendMouseMoveNotifyWhenDone(
long screen_x,
long screen_y,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
gfx::Point screen_location(screen_x, screen_y);
gfx::Point root_location = screen_location;
aura::Window* root_window = RootWindowForPoint(screen_location);
@@ -165,13 +165,13 @@
RunClosureAfterAllPendingUIEvents(closure);
return true;
}
- virtual bool SendMouseEvents(MouseButton type, int state) OVERRIDE {
+ virtual bool SendMouseEvents(MouseButton type, int state) override {
return SendMouseEventsNotifyWhenDone(type, state, base::Closure());
}
virtual bool SendMouseEventsNotifyWhenDone(
MouseButton type,
int state,
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
XEvent xevent = {0};
XButtonEvent* xbutton = &xevent.xbutton;
gfx::Point mouse_loc = aura::Env::GetInstance()->last_mouse_location();
@@ -211,11 +211,11 @@
RunClosureAfterAllPendingUIEvents(closure);
return true;
}
- virtual bool SendMouseClick(MouseButton type) OVERRIDE {
+ virtual bool SendMouseClick(MouseButton type) override {
return SendMouseEvents(type, UP | DOWN);
}
virtual void RunClosureAfterAllPendingUIEvents(
- const base::Closure& closure) OVERRIDE {
+ const base::Closure& closure) override {
if (closure.is_null())
return;
static XEvent* marker_event = NULL;
diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h
index 6664cba..9339da3 100644
--- a/ui/views/test/views_test_base.h
+++ b/ui/views/test/views_test_base.h
@@ -27,8 +27,8 @@
virtual ~ViewsTestBase();
// testing::Test:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
void RunPendingMessages();
diff --git a/ui/views/test/views_test_helper_aura.h b/ui/views/test/views_test_helper_aura.h
index 77733bb..87d48ae 100644
--- a/ui/views/test/views_test_helper_aura.h
+++ b/ui/views/test/views_test_helper_aura.h
@@ -33,9 +33,9 @@
virtual ~ViewsTestHelperAura();
// Overridden from ViewsTestHelper:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
- virtual gfx::NativeWindow GetContext() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
+ virtual gfx::NativeWindow GetContext() override;
private:
ui::ContextFactory* context_factory_;
diff --git a/ui/views/test/widget_test.h b/ui/views/test/widget_test.h
index 1c06fac..dfeca47 100644
--- a/ui/views/test/widget_test.h
+++ b/ui/views/test/widget_test.h
@@ -51,9 +51,9 @@
explicit NativeWidgetCapture(internal::NativeWidgetDelegate* delegate);
virtual ~NativeWidgetCapture();
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual bool HasCapture() const OVERRIDE;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual bool HasCapture() const override;
private:
bool mouse_capture_;
diff --git a/ui/views/test/x11_property_change_waiter.h b/ui/views/test/x11_property_change_waiter.h
index 366b9cb..af4ef71 100644
--- a/ui/views/test/x11_property_change_waiter.h
+++ b/ui/views/test/x11_property_change_waiter.h
@@ -37,8 +37,8 @@
private:
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
XID x_window_;
const char* property_;
diff --git a/ui/views/touchui/touch_editing_menu.h b/ui/views/touchui/touch_editing_menu.h
index 19f0d34..0dfff49 100644
--- a/ui/views/touchui/touch_editing_menu.h
+++ b/ui/views/touchui/touch_editing_menu.h
@@ -58,13 +58,13 @@
gfx::NativeView context);
// views::WidgetDelegate overrides:
- virtual void WindowClosing() OVERRIDE;
+ virtual void WindowClosing() override;
// Overridden from ButtonListener.
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
// Overridden from BubbleDelegateView.
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
// Queries the |controller_| for what elements to show in the menu and sizes
// the menu appropriately.
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index 4b09762..36b73d1 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -138,7 +138,7 @@
private:
// wm::MaskedWindowTargeter:
virtual bool GetHitTestMask(aura::Window* window,
- gfx::Path* mask) const OVERRIDE;
+ gfx::Path* mask) const override;
EditingHandleView* handle_view_;
@@ -170,11 +170,11 @@
}
// Overridden from views::WidgetDelegateView:
- virtual bool WidgetHasHitTestMask() const OVERRIDE {
+ virtual bool WidgetHasHitTestMask() const override {
return true;
}
- virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE {
+ virtual void GetWidgetHitTestMask(gfx::Path* mask) const override {
gfx::Size image_size = GetHandleImageSize();
mask->addRect(SkIntToScalar(0), SkIntToScalar(selection_rect_.height()),
SkIntToScalar(image_size.width()) + 2 * kSelectionHandleHorizPadding,
@@ -182,12 +182,12 @@
kSelectionHandleVertPadding));
}
- virtual void DeleteDelegate() OVERRIDE {
+ virtual void DeleteDelegate() override {
// We are owned and deleted by TouchSelectionController.
}
// Overridden from views::View:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
if (draw_invisible_)
return;
gfx::Size image_size = GetHandleImageSize();
@@ -205,7 +205,7 @@
kSelectionHandleHorizPadding, selection_rect_.height());
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
event->SetHandled();
switch (event->type()) {
case ui::ET_GESTURE_SCROLL_BEGIN:
@@ -230,7 +230,7 @@
}
}
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
gfx::Size image_size = GetHandleImageSize();
return gfx::Size(image_size.width() + 2 * kSelectionHandleHorizPadding,
image_size.height() + selection_rect_.height() +
diff --git a/ui/views/touchui/touch_selection_controller_impl.h b/ui/views/touchui/touch_selection_controller_impl.h
index 353c949..158666c 100644
--- a/ui/views/touchui/touch_selection_controller_impl.h
+++ b/ui/views/touchui/touch_selection_controller_impl.h
@@ -37,9 +37,9 @@
virtual ~TouchSelectionControllerImpl();
// TextSelectionController.
- virtual void SelectionChanged() OVERRIDE;
- virtual bool IsHandleDragInProgress() OVERRIDE;
- virtual void HideHandles(bool quick) OVERRIDE;
+ virtual void SelectionChanged() override;
+ virtual bool IsHandleDragInProgress() override;
+ virtual void HideHandles(bool quick) override;
private:
friend class TouchSelectionControllerImplTest;
@@ -65,26 +65,26 @@
bool ShouldShowHandleFor(const gfx::Rect& rect) const;
// Overridden from TouchEditingMenuController.
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
- virtual void OpenContextMenu() OVERRIDE;
- virtual void OnMenuClosed(TouchEditingMenuView* menu) OVERRIDE;
+ virtual bool IsCommandIdEnabled(int command_id) const override;
+ virtual void ExecuteCommand(int command_id, int event_flags) override;
+ virtual void OpenContextMenu() override;
+ virtual void OnMenuClosed(TouchEditingMenuView* menu) override;
// Overriden from aura::WindowObserver.
virtual void OnAncestorWindowTransformed(aura::Window* source,
- aura::Window* window) OVERRIDE;
+ aura::Window* window) override;
// Overridden from WidgetObserver. We will observe the widget backing the
// |client_view_| so that when its moved/resized, we can update the selection
// handles appropriately.
- virtual void OnWidgetClosing(Widget* widget) OVERRIDE;
+ virtual void OnWidgetClosing(Widget* widget) override;
virtual void OnWidgetBoundsChanged(Widget* widget,
- const gfx::Rect& new_bounds) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
// Overriden from ui::EventHandler.
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
// Time to show context menu.
void ContextMenuTimerFired();
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
index b268d2c..214b3c7 100644
--- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -575,59 +575,59 @@
private:
// Overridden from ui::TouchEditable.
virtual void SelectRect(
- const gfx::Point& start, const gfx::Point& end) OVERRIDE {
+ const gfx::Point& start, const gfx::Point& end) override {
NOTREACHED();
}
- virtual void MoveCaretTo(const gfx::Point& point) OVERRIDE {
+ virtual void MoveCaretTo(const gfx::Point& point) override {
NOTREACHED();
}
- virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) OVERRIDE {
+ virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) override {
*p1 = *p2 = cursor_rect_;
}
- virtual gfx::Rect GetBounds() OVERRIDE {
+ virtual gfx::Rect GetBounds() override {
return gfx::Rect(bounds_.size());
}
- virtual gfx::NativeView GetNativeView() const OVERRIDE {
+ virtual gfx::NativeView GetNativeView() const override {
return window_;
}
- virtual void ConvertPointToScreen(gfx::Point* point) OVERRIDE {
+ virtual void ConvertPointToScreen(gfx::Point* point) override {
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(window_->GetRootWindow());
if (screen_position_client)
screen_position_client->ConvertPointToScreen(window_, point);
}
- virtual void ConvertPointFromScreen(gfx::Point* point) OVERRIDE {
+ virtual void ConvertPointFromScreen(gfx::Point* point) override {
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(window_->GetRootWindow());
if (screen_position_client)
screen_position_client->ConvertPointFromScreen(window_, point);
}
- virtual bool DrawsHandles() OVERRIDE {
+ virtual bool DrawsHandles() override {
return false;
}
- virtual void OpenContextMenu(const gfx::Point& anchor) OVERRIDE {
+ virtual void OpenContextMenu(const gfx::Point& anchor) override {
NOTREACHED();
}
- virtual void DestroyTouchSelection() OVERRIDE {
+ virtual void DestroyTouchSelection() override {
NOTREACHED();
}
// Overridden from ui::SimpleMenuModel::Delegate.
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE {
+ virtual bool IsCommandIdChecked(int command_id) const override {
NOTREACHED();
return false;
}
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE {
+ virtual bool IsCommandIdEnabled(int command_id) const override {
NOTREACHED();
return false;
}
virtual bool GetAcceleratorForCommandId(
int command_id,
- ui::Accelerator* accelerator) OVERRIDE {
+ ui::Accelerator* accelerator) override {
NOTREACHED();
return false;
}
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE {
+ virtual void ExecuteCommand(int command_id, int event_flags) override {
NOTREACHED();
}
@@ -733,18 +733,18 @@
virtual ~TestTouchEditingMenuController() {}
// Overriden from TouchEditingMenuController.
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE {
+ virtual bool IsCommandIdEnabled(int command_id) const override {
// Return true, since we want the menu to have all |kMenuCommandCount|
// available commands.
return true;
}
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE {
+ virtual void ExecuteCommand(int command_id, int event_flags) override {
NOTREACHED();
}
- virtual void OpenContextMenu() OVERRIDE {
+ virtual void OpenContextMenu() override {
NOTREACHED();
}
- virtual void OnMenuClosed(TouchEditingMenuView* menu) OVERRIDE {}
+ virtual void OnMenuClosed(TouchEditingMenuView* menu) override {}
private:
DISALLOW_COPY_AND_ASSIGN(TestTouchEditingMenuController);
diff --git a/ui/views/view.h b/ui/views/view.h
index d9a0acf..5ae0c02 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -714,19 +714,19 @@
ViewTargeter* targeter() const { return targeter_.get(); }
// Overridden from ui::EventTarget:
- virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
- virtual ui::EventTarget* GetParentTarget() OVERRIDE;
- virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE;
- virtual ui::EventTargeter* GetEventTargeter() OVERRIDE;
+ virtual bool CanAcceptEvent(const ui::Event& event) override;
+ virtual ui::EventTarget* GetParentTarget() override;
+ virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override;
+ virtual ui::EventTargeter* GetEventTargeter() override;
virtual void ConvertEventToTarget(ui::EventTarget* target,
- ui::LocatedEvent* event) OVERRIDE;
+ ui::LocatedEvent* event) override;
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE FINAL;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
+ virtual void OnTouchEvent(ui::TouchEvent* event) override final;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Accelerators --------------------------------------------------------------
@@ -744,12 +744,12 @@
virtual void ResetAccelerators();
// Overridden from AcceleratorTarget:
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
// Returns whether accelerators are enabled for this view. Accelerators are
// enabled if the containing widget is visible and the view is enabled() and
// IsDrawn()
- virtual bool CanHandleAccelerators() const OVERRIDE;
+ virtual bool CanHandleAccelerators() const override;
// Focus ---------------------------------------------------------------------
@@ -1117,11 +1117,11 @@
void UpdateChildLayerBounds(const gfx::Vector2d& offset);
// Overridden from ui::LayerDelegate:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override;
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE;
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE;
+ const gfx::Rect& damage_rect_in_dip) override;
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
+ virtual base::Closure PrepareForLayerBoundsChange() override;
// Finds the layer that this view paints to (it may belong to an ancestor
// view), then reorders the immediate children of that layer to match the
diff --git a/ui/views/view_targeter.h b/ui/views/view_targeter.h
index 79f5ca6..de87909 100644
--- a/ui/views/view_targeter.h
+++ b/ui/views/view_targeter.h
@@ -33,15 +33,15 @@
protected:
// ui::EventTargeter:
virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root,
- ui::Event* event) OVERRIDE;
+ ui::Event* event) override;
virtual ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target,
- ui::Event* event) OVERRIDE;
+ ui::Event* event) override;
virtual bool SubtreeCanAcceptEvent(
ui::EventTarget* target,
- const ui::LocatedEvent& event) const OVERRIDE;
+ const ui::LocatedEvent& event) const override;
virtual bool EventLocationInsideBounds(
ui::EventTarget* target,
- const ui::LocatedEvent& event) const OVERRIDE;
+ const ui::LocatedEvent& event) const override;
private:
// TODO(tdanderson): Un-friend RootView once RootView::DispatchGestureEvent()
diff --git a/ui/views/view_targeter_unittest.cc b/ui/views/view_targeter_unittest.cc
index 15d65ad..a3acb46 100644
--- a/ui/views/view_targeter_unittest.cc
+++ b/ui/views/view_targeter_unittest.cc
@@ -34,7 +34,7 @@
}
// View:
- virtual bool CanProcessEventsWithinSubtree() const OVERRIDE {
+ virtual bool CanProcessEventsWithinSubtree() const override {
return can_process_events_within_subtree_;
}
@@ -58,7 +58,7 @@
private:
// MaskedTargeterDelegate:
- virtual bool GetHitTestMask(gfx::Path* mask) const OVERRIDE {
+ virtual bool GetHitTestMask(gfx::Path* mask) const override {
DCHECK(mask);
SkScalar w = SkIntToScalar(width());
SkScalar h = SkIntToScalar(height());
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index fccb4fc..4f15a21 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -219,23 +219,23 @@
can_process_events_within_subtree_ = can_process;
}
- virtual bool CanProcessEventsWithinSubtree() const OVERRIDE {
+ virtual bool CanProcessEventsWithinSubtree() const override {
return can_process_events_within_subtree_;
}
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
- virtual void Paint(gfx::Canvas* canvas, const CullSet& cull_set) OVERRIDE;
- virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+ virtual void Paint(gfx::Canvas* canvas, const CullSet& cull_set) override;
+ virtual void SchedulePaintInRect(const gfx::Rect& rect) override;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
virtual void OnNativeThemeChanged(const ui::NativeTheme* native_theme)
- OVERRIDE;
+ override;
// OnBoundsChanged.
bool did_change_bounds_;
@@ -1495,14 +1495,14 @@
// View overrides:
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE {
+ const ViewHierarchyChangedDetails& details) override {
if (details.is_add) {
toplevel_ = GetWidget() ? GetWidget()->GetTopLevelWidget() : NULL;
} else {
toplevel_ = NULL;
}
}
- virtual void NativeViewHierarchyChanged() OVERRIDE {
+ virtual void NativeViewHierarchyChanged() override {
toplevel_ = GetWidget() ? GetWidget()->GetTopLevelWidget() : NULL;
}
@@ -1569,7 +1569,7 @@
gfx::Rect scheduled_paint_rect() const { return scheduled_paint_rect_; }
// Overridden from View:
- virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE {
+ virtual void SchedulePaintInRect(const gfx::Rect& rect) override {
gfx::Rect xrect = ConvertRectToParent(rect);
scheduled_paint_rect_.Union(xrect);
}
@@ -1808,10 +1808,10 @@
private:
// Overridden from View:
- virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const OVERRIDE {
+ virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const override {
return true;
}
- virtual void OnVisibleBoundsChanged() OVERRIDE {
+ virtual void OnVisibleBoundsChanged() override {
received_notification_ = true;
}
@@ -2233,7 +2233,7 @@
private:
// View:
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
bool has_add_details_;
bool has_remove_details_;
@@ -2652,7 +2652,7 @@
ActiveWidget() {}
virtual ~ActiveWidget() {}
- virtual bool IsActive() const OVERRIDE {
+ virtual bool IsActive() const override {
return true;
}
@@ -2718,7 +2718,7 @@
const gfx::Rect& last_bounds() const { return last_bounds_; }
// LayerAnimator.
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
protected:
virtual ~TestLayerAnimator() { }
@@ -2751,7 +2751,7 @@
return widget()->GetLayer();
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewTest::SetUp();
widget_ = new Widget;
Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP);
@@ -2761,7 +2761,7 @@
widget_->GetRootView()->SetBounds(0, 0, 200, 200);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
widget_->CloseNow();
ViewsTestBase::TearDown();
}
@@ -3070,7 +3070,7 @@
bool painted() const { return painted_; }
void set_painted(bool value) { painted_ = value; }
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnPaint(gfx::Canvas* canvas) override {
painted_ = true;
}
@@ -3309,7 +3309,7 @@
BoundsTreeTestView() {}
virtual void PaintChildren(gfx::Canvas* canvas,
- const CullSet& cull_set) OVERRIDE {
+ const CullSet& cull_set) override {
// Save out a copy of the cull_set before calling the base implementation.
last_cull_set_.clear();
if (cull_set.cull_set_) {
diff --git a/ui/views/views_touch_selection_controller_factory.h b/ui/views/views_touch_selection_controller_factory.h
index 6b02c1e..9ddaa8f 100644
--- a/ui/views/views_touch_selection_controller_factory.h
+++ b/ui/views/views_touch_selection_controller_factory.h
@@ -17,7 +17,7 @@
// Overridden from ui::TouchSelectionControllerFactory.
virtual ui::TouchSelectionController* create(
- ui::TouchEditable* client_view) OVERRIDE;
+ ui::TouchEditable* client_view) override;
};
} // namespace views
diff --git a/ui/views/widget/OWNERS b/ui/views/widget/OWNERS
new file mode 100644
index 0000000..c487030
--- /dev/null
+++ b/ui/views/widget/OWNERS
@@ -0,0 +1 @@
+per-file native_widget_mac*=tapted@chromium.org
diff --git a/ui/views/widget/desktop_aura/desktop_capture_client.h b/ui/views/widget/desktop_aura/desktop_capture_client.h
index 24d2029..26c21d9 100644
--- a/ui/views/widget/desktop_aura/desktop_capture_client.h
+++ b/ui/views/widget/desktop_aura/desktop_capture_client.h
@@ -38,10 +38,10 @@
virtual ~DesktopCaptureClient();
// Overridden from aura::client::CaptureClient:
- virtual void SetCapture(aura::Window* window) OVERRIDE;
- virtual void ReleaseCapture(aura::Window* window) OVERRIDE;
- virtual aura::Window* GetCaptureWindow() OVERRIDE;
- virtual aura::Window* GetGlobalCaptureWindow() OVERRIDE;
+ virtual void SetCapture(aura::Window* window) override;
+ virtual void ReleaseCapture(aura::Window* window) override;
+ virtual aura::Window* GetCaptureWindow() override;
+ virtual aura::Window* GetGlobalCaptureWindow() override;
private:
typedef std::set<DesktopCaptureClient*> CaptureClients;
diff --git a/ui/views/widget/desktop_aura/desktop_cursor_loader_updater_auralinux.h b/ui/views/widget/desktop_aura/desktop_cursor_loader_updater_auralinux.h
index c367518..3b496f9 100644
--- a/ui/views/widget/desktop_aura/desktop_cursor_loader_updater_auralinux.h
+++ b/ui/views/widget/desktop_aura/desktop_cursor_loader_updater_auralinux.h
@@ -18,9 +18,9 @@
// Overridden from DesktopCursorLoaderUpdater:
virtual void OnCreate(float device_scale_factor,
- ui::CursorLoader* loader) OVERRIDE;
+ ui::CursorLoader* loader) override;
virtual void OnDisplayUpdated(const gfx::Display& display,
- ui::CursorLoader* loader) OVERRIDE;
+ ui::CursorLoader* loader) override;
};
} // namespace views
diff --git a/ui/views/widget/desktop_aura/desktop_dispatcher_client.h b/ui/views/widget/desktop_aura/desktop_dispatcher_client.h
index 284e81c..5e5ec01 100644
--- a/ui/views/widget/desktop_aura/desktop_dispatcher_client.h
+++ b/ui/views/widget/desktop_aura/desktop_dispatcher_client.h
@@ -22,7 +22,7 @@
virtual void PrepareNestedLoopClosures(
base::MessagePumpDispatcher* dispatcher,
base::Closure* run_closure,
- base::Closure* quit_closure) OVERRIDE;
+ base::Closure* quit_closure) override;
private:
DISALLOW_COPY_AND_ASSIGN(DesktopDispatcherClient);
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
index 5dbc2b5..ed7059a 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
@@ -144,8 +144,8 @@
void MaskOperation(::Atom xdnd_operation, int* drag_operation) const;
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
// The atom cache owned by our parent.
ui::X11AtomCache* atom_cache_;
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h
index 8d30153..02d64c1 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h
@@ -86,21 +86,21 @@
aura::Window* source_window,
const gfx::Point& root_location,
int operation,
- ui::DragDropTypes::DragEventSource source) OVERRIDE;
+ ui::DragDropTypes::DragEventSource source) override;
virtual void DragUpdate(aura::Window* target,
- const ui::LocatedEvent& event) OVERRIDE;
+ const ui::LocatedEvent& event) override;
virtual void Drop(aura::Window* target,
- const ui::LocatedEvent& event) OVERRIDE;
- virtual void DragCancel() OVERRIDE;
- virtual bool IsDragDropInProgress() OVERRIDE;
+ const ui::LocatedEvent& event) override;
+ virtual void DragCancel() override;
+ virtual bool IsDragDropInProgress() override;
// Overridden from aura::WindowObserver:
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
// Overridden from X11WholeScreenMoveLoopDelegate:
- virtual void OnMouseMovement(XMotionEvent* event) OVERRIDE;
- virtual void OnMouseReleased() OVERRIDE;
- virtual void OnMoveLoopEnded() OVERRIDE;
+ virtual void OnMouseMovement(XMotionEvent* event) override;
+ virtual void OnMouseReleased() override;
+ virtual void OnMoveLoopEnded() override;
protected:
// The following methods are virtual for the sake of testing.
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc
index 1008289..f69d27c 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc
@@ -87,9 +87,9 @@
// X11MoveLoop:
virtual bool RunMoveLoop(aura::Window* window,
- gfx::NativeCursor cursor) OVERRIDE;
- virtual void UpdateCursor(gfx::NativeCursor cursor) OVERRIDE;
- virtual void EndMoveLoop() OVERRIDE;
+ gfx::NativeCursor cursor) override;
+ virtual void UpdateCursor(gfx::NativeCursor cursor) override;
+ virtual void EndMoveLoop() override;
private:
// Not owned.
@@ -153,9 +153,9 @@
private:
// DesktopDragDropClientAuraX11:
virtual scoped_ptr<X11MoveLoop> CreateMoveLoop(
- X11MoveLoopDelegate* delegate) OVERRIDE;
- virtual ::Window FindWindowFor(const gfx::Point& screen_point) OVERRIDE;
- virtual void SendXClientEvent(::Window xid, XEvent* event) OVERRIDE;
+ X11MoveLoopDelegate* delegate) override;
+ virtual ::Window FindWindowFor(const gfx::Point& screen_point) override;
+ virtual void SendXClientEvent(::Window xid, XEvent* event) override;
// The XID of the window which initiated the drag.
::Window source_xid_;
@@ -366,7 +366,7 @@
}
// ViewsTestBase:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
// Create widget to initiate the drags.
@@ -386,7 +386,7 @@
client_->Init();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
client_.reset();
cursor_manager_.reset();
widget_.reset();
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h
index a8051ca..0da14e0 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h
@@ -30,13 +30,13 @@
aura::Window* source_window,
const gfx::Point& root_location,
int operation,
- ui::DragDropTypes::DragEventSource source) OVERRIDE;
+ ui::DragDropTypes::DragEventSource source) override;
virtual void DragUpdate(aura::Window* target,
- const ui::LocatedEvent& event) OVERRIDE;
+ const ui::LocatedEvent& event) override;
virtual void Drop(aura::Window* target,
- const ui::LocatedEvent& event) OVERRIDE;
- virtual void DragCancel() OVERRIDE;
- virtual bool IsDragDropInProgress() OVERRIDE;
+ const ui::LocatedEvent& event) override;
+ virtual void DragCancel() override;
+ virtual bool IsDragDropInProgress() override;
void OnNativeWidgetDestroying(HWND window);
diff --git a/ui/views/widget/desktop_aura/desktop_drop_target_win.h b/ui/views/widget/desktop_aura/desktop_drop_target_win.h
index 9e11ff6..d376182 100644
--- a/ui/views/widget/desktop_aura/desktop_drop_target_win.h
+++ b/ui/views/widget/desktop_aura/desktop_drop_target_win.h
@@ -36,19 +36,19 @@
virtual DWORD OnDragEnter(IDataObject* data_object,
DWORD key_state,
POINT position,
- DWORD effect) OVERRIDE;
+ DWORD effect) override;
virtual DWORD OnDragOver(IDataObject* data_object,
DWORD key_state,
POINT position,
- DWORD effect) OVERRIDE;
- virtual void OnDragLeave(IDataObject* data_object) OVERRIDE;
+ DWORD effect) override;
+ virtual void OnDragLeave(IDataObject* data_object) override;
virtual DWORD OnDrop(IDataObject* data_object,
DWORD key_state,
POINT position,
- DWORD effect) OVERRIDE;
+ DWORD effect) override;
// aura::WindowObserver implementation:
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
// Common functionality for the ui::DropTargetWin methods to translate from
// COM data types to Aura ones.
diff --git a/ui/views/widget/desktop_aura/desktop_event_client.h b/ui/views/widget/desktop_aura/desktop_event_client.h
index d16b5c9..92bde0d 100644
--- a/ui/views/widget/desktop_aura/desktop_event_client.h
+++ b/ui/views/widget/desktop_aura/desktop_event_client.h
@@ -19,8 +19,8 @@
// Overridden from aura::client::EventClient:
virtual bool CanProcessEventsWithinSubtree(
- const aura::Window* window) const OVERRIDE;
- virtual ui::EventTarget* GetToplevelEventTarget() OVERRIDE;
+ const aura::Window* window) const override;
+ virtual ui::EventTarget* GetToplevelEventTarget() override;
private:
DISALLOW_COPY_AND_ASSIGN(DesktopEventClient);
diff --git a/ui/views/widget/desktop_aura/desktop_focus_rules.h b/ui/views/widget/desktop_aura/desktop_focus_rules.h
index e096e80..a1f32e1 100644
--- a/ui/views/widget/desktop_aura/desktop_focus_rules.h
+++ b/ui/views/widget/desktop_aura/desktop_focus_rules.h
@@ -16,13 +16,13 @@
private:
// Overridden from wm::BaseFocusRules:
- virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE;
- virtual bool SupportsChildActivation(aura::Window* window) const OVERRIDE;
+ virtual bool CanActivateWindow(aura::Window* window) const override;
+ virtual bool SupportsChildActivation(aura::Window* window) const override;
virtual bool IsWindowConsideredVisibleForActivation(
- aura::Window* window) const OVERRIDE;
- virtual aura::Window* GetToplevelWindow(aura::Window* window) const OVERRIDE;
+ aura::Window* window) const override;
+ virtual aura::Window* GetToplevelWindow(aura::Window* window) const override;
virtual aura::Window* GetNextActivatableWindow(
- aura::Window* window) const OVERRIDE;
+ aura::Window* window) const override;
// The content window. This is an activatable window even though it is a
// child.
diff --git a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
index ee15634..8dbfcfb 100644
--- a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
+++ b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h
@@ -50,19 +50,19 @@
// Overridden from wm::NativeCursorManager:
virtual void SetDisplay(
const gfx::Display& display,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) override;
virtual void SetCursor(
gfx::NativeCursor cursor,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) override;
virtual void SetVisibility(
bool visible,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) override;
virtual void SetCursorSet(
ui::CursorSetType cursor_set,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) override;
virtual void SetMouseEventsEnabled(
bool enabled,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE;
+ wm::NativeCursorManagerDelegate* delegate) override;
// The set of hosts to notify of changes in cursor state.
typedef std::set<aura::WindowTreeHost*> Hosts;
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index 5dae218..2ddbf72 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -118,7 +118,7 @@
}
// aura::WindowObserver overrides
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {
+ virtual void OnWindowDestroying(aura::Window* window) override {
window->RemoveObserver(this);
// If the widget is being destroyed by the OS then we should not try and
@@ -143,7 +143,7 @@
virtual void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
if (top_level_widget_ && window == child_window_)
top_level_widget_->SetSize(new_bounds.size());
}
@@ -176,7 +176,7 @@
// Overridden from client::WindowTreeClient:
virtual aura::Window* GetDefaultParent(aura::Window* context,
aura::Window* window,
- const gfx::Rect& bounds) OVERRIDE {
+ const gfx::Rect& bounds) override {
bool is_fullscreen = window->GetProperty(aura::client::kShowStateKey) ==
ui::SHOW_STATE_FULLSCREEN;
bool is_menu = window->type() == ui::wm::WINDOW_TYPE_MENU;
@@ -208,7 +208,7 @@
: desktop_native_widget_aura_(desktop_native_widget_aura) {}
// Implementation of ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE {
+ virtual void OnKeyEvent(ui::KeyEvent* event) override {
Widget* widget = desktop_native_widget_aura_->GetWidget();
if (widget && widget->GetFocusManager()->GetFocusedView() &&
!widget->GetFocusManager()->OnKeyEvent(*event)) {
@@ -230,7 +230,7 @@
private:
// Overridden from aura::WindowObserver:
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(aura::Window* window) override {
parent_->RootWindowDestroyed();
window->RemoveObserver(this);
delete this;
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
index b4383c8..6b8d93d 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
@@ -95,144 +95,144 @@
protected:
// Overridden from internal::NativeWidgetPrivate:
- virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE;
- virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
- virtual bool ShouldUseNativeFrame() const OVERRIDE;
- virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE;
- virtual void FrameTypeChanged() OVERRIDE;
- virtual Widget* GetWidget() OVERRIDE;
- virtual const Widget* GetWidget() const OVERRIDE;
- virtual gfx::NativeView GetNativeView() const OVERRIDE;
- virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE;
- virtual Widget* GetTopLevelWidget() OVERRIDE;
- virtual const ui::Compositor* GetCompositor() const OVERRIDE;
- virtual ui::Compositor* GetCompositor() OVERRIDE;
- virtual ui::Layer* GetLayer() OVERRIDE;
- virtual void ReorderNativeViews() OVERRIDE;
- virtual void ViewRemoved(View* view) OVERRIDE;
- virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE;
- virtual void* GetNativeWindowProperty(const char* name) const OVERRIDE;
- virtual TooltipManager* GetTooltipManager() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual bool HasCapture() const OVERRIDE;
- virtual InputMethod* CreateInputMethod() OVERRIDE;
- virtual internal::InputMethodDelegate* GetInputMethodDelegate() OVERRIDE;
- virtual ui::InputMethod* GetHostInputMethod() OVERRIDE;
- virtual void CenterWindow(const gfx::Size& size) OVERRIDE;
+ virtual void InitNativeWidget(const Widget::InitParams& params) override;
+ virtual NonClientFrameView* CreateNonClientFrameView() override;
+ virtual bool ShouldUseNativeFrame() const override;
+ virtual bool ShouldWindowContentsBeTransparent() const override;
+ virtual void FrameTypeChanged() override;
+ virtual Widget* GetWidget() override;
+ virtual const Widget* GetWidget() const override;
+ virtual gfx::NativeView GetNativeView() const override;
+ virtual gfx::NativeWindow GetNativeWindow() const override;
+ virtual Widget* GetTopLevelWidget() override;
+ virtual const ui::Compositor* GetCompositor() const override;
+ virtual ui::Compositor* GetCompositor() override;
+ virtual ui::Layer* GetLayer() override;
+ virtual void ReorderNativeViews() override;
+ virtual void ViewRemoved(View* view) override;
+ virtual void SetNativeWindowProperty(const char* name, void* value) override;
+ virtual void* GetNativeWindowProperty(const char* name) const override;
+ virtual TooltipManager* GetTooltipManager() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual bool HasCapture() const override;
+ virtual InputMethod* CreateInputMethod() override;
+ virtual internal::InputMethodDelegate* GetInputMethodDelegate() override;
+ virtual ui::InputMethod* GetHostInputMethod() override;
+ virtual void CenterWindow(const gfx::Size& size) override;
virtual void GetWindowPlacement(
gfx::Rect* bounds,
- ui::WindowShowState* maximized) const OVERRIDE;
- virtual bool SetWindowTitle(const base::string16& title) OVERRIDE;
+ ui::WindowShowState* maximized) const override;
+ virtual bool SetWindowTitle(const base::string16& title) override;
virtual void SetWindowIcons(const gfx::ImageSkia& window_icon,
- const gfx::ImageSkia& app_icon) OVERRIDE;
- virtual void InitModalType(ui::ModalType modal_type) OVERRIDE;
- virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual void SetSize(const gfx::Size& size) OVERRIDE;
- virtual void StackAbove(gfx::NativeView native_view) OVERRIDE;
- virtual void StackAtTop() OVERRIDE;
- virtual void StackBelow(gfx::NativeView native_view) OVERRIDE;
- virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void CloseNow() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
+ const gfx::ImageSkia& app_icon) override;
+ virtual void InitModalType(ui::ModalType modal_type) override;
+ virtual gfx::Rect GetWindowBoundsInScreen() const override;
+ virtual gfx::Rect GetClientAreaBoundsInScreen() const override;
+ virtual gfx::Rect GetRestoredBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual void SetSize(const gfx::Size& size) override;
+ virtual void StackAbove(gfx::NativeView native_view) override;
+ virtual void StackAtTop() override;
+ virtual void StackBelow(gfx::NativeView native_view) override;
+ virtual void SetShape(gfx::NativeRegion shape) override;
+ virtual void Close() override;
+ virtual void CloseNow() override;
+ virtual void Show() override;
+ virtual void Hide() override;
virtual void ShowMaximizedWithBounds(
- const gfx::Rect& restored_bounds) OVERRIDE;
- virtual void ShowWithWindowState(ui::WindowShowState state) OVERRIDE;
- virtual bool IsVisible() const OVERRIDE;
- virtual void Activate() OVERRIDE;
- virtual void Deactivate() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
- virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
- virtual bool IsAlwaysOnTop() const OVERRIDE;
- virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual bool IsMaximized() const OVERRIDE;
- virtual bool IsMinimized() const OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetFullscreen(bool fullscreen) OVERRIDE;
- virtual bool IsFullscreen() const OVERRIDE;
- virtual void SetOpacity(unsigned char opacity) OVERRIDE;
- virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE;
- virtual void FlashFrame(bool flash_frame) OVERRIDE;
+ const gfx::Rect& restored_bounds) override;
+ virtual void ShowWithWindowState(ui::WindowShowState state) override;
+ virtual bool IsVisible() const override;
+ virtual void Activate() override;
+ virtual void Deactivate() override;
+ virtual bool IsActive() const override;
+ virtual void SetAlwaysOnTop(bool always_on_top) override;
+ virtual bool IsAlwaysOnTop() const override;
+ virtual void SetVisibleOnAllWorkspaces(bool always_visible) override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual bool IsMaximized() const override;
+ virtual bool IsMinimized() const override;
+ virtual void Restore() override;
+ virtual void SetFullscreen(bool fullscreen) override;
+ virtual bool IsFullscreen() const override;
+ virtual void SetOpacity(unsigned char opacity) override;
+ virtual void SetUseDragFrame(bool use_drag_frame) override;
+ virtual void FlashFrame(bool flash_frame) override;
virtual void RunShellDrag(View* view,
const ui::OSExchangeData& data,
const gfx::Point& location,
int operation,
- ui::DragDropTypes::DragEventSource source) OVERRIDE;
- virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
- virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
- virtual bool IsMouseEventsEnabled() const OVERRIDE;
- virtual void ClearNativeFocus() OVERRIDE;
- virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE;
+ ui::DragDropTypes::DragEventSource source) override;
+ virtual void SchedulePaintInRect(const gfx::Rect& rect) override;
+ virtual void SetCursor(gfx::NativeCursor cursor) override;
+ virtual bool IsMouseEventsEnabled() const override;
+ virtual void ClearNativeFocus() override;
+ virtual gfx::Rect GetWorkAreaBoundsInScreen() const override;
virtual Widget::MoveLoopResult RunMoveLoop(
const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source,
- Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE;
- virtual void EndMoveLoop() OVERRIDE;
- virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE;
- virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE;
- virtual void OnRootViewLayout() OVERRIDE;
- virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE;
- virtual void OnSizeConstraintsChanged() OVERRIDE;
- virtual void RepostNativeEvent(gfx::NativeEvent native_event) OVERRIDE;
+ Widget::MoveLoopEscapeBehavior escape_behavior) override;
+ virtual void EndMoveLoop() override;
+ virtual void SetVisibilityChangedAnimationsEnabled(bool value) override;
+ virtual ui::NativeTheme* GetNativeTheme() const override;
+ virtual void OnRootViewLayout() override;
+ virtual bool IsTranslucentWindowOpacitySupported() const override;
+ virtual void OnSizeConstraintsChanged() override;
+ virtual void RepostNativeEvent(gfx::NativeEvent native_event) override;
// Overridden from aura::WindowDelegate:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {}
- virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
+ const gfx::Rect& new_bounds) override {}
+ virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override;
+ virtual int GetNonClientComponent(const gfx::Point& point) const override;
virtual bool ShouldDescendIntoChildForEventHandling(
aura::Window* child,
- const gfx::Point& location) OVERRIDE;
- virtual bool CanFocus() OVERRIDE;
- virtual void OnCaptureLost() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
- virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE;
- virtual bool HasHitTestMask() const OVERRIDE;
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE;
+ const gfx::Point& location) override;
+ virtual bool CanFocus() override;
+ virtual void OnCaptureLost() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
+ virtual void OnWindowDestroying(aura::Window* window) override;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
+ virtual void OnWindowTargetVisibilityChanged(bool visible) override;
+ virtual bool HasHitTestMask() const override;
+ virtual void GetHitTestMask(gfx::Path* mask) const override;
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Overridden from aura::client::ActivationDelegate:
- virtual bool ShouldActivate() const OVERRIDE;
+ virtual bool ShouldActivate() const override;
// Overridden from aura::client::ActivationChangeObserver:
virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE;
+ aura::Window* lost_active) override;
// Overridden from aura::client::FocusChangeObserver:
virtual void OnWindowFocused(aura::Window* gained_focus,
- aura::Window* lost_focus) OVERRIDE;
+ aura::Window* lost_focus) override;
// Overridden from views::internal::InputMethodDelegate:
- virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE;
+ virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) override;
// Overridden from aura::client::DragDropDelegate:
- virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE;
- virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE;
- virtual void OnDragExited() OVERRIDE;
- virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
+ virtual void OnDragEntered(const ui::DropTargetEvent& event) override;
+ virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
+ virtual void OnDragExited() override;
+ virtual int OnPerformDrop(const ui::DropTargetEvent& event) override;
// Overridden from aura::WindowTreeHostObserver:
- virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) OVERRIDE;
- virtual void OnHostResized(const aura::WindowTreeHost* host) OVERRIDE;
+ virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) override;
+ virtual void OnHostResized(const aura::WindowTreeHost* host) override;
virtual void OnHostMoved(const aura::WindowTreeHost* host,
- const gfx::Point& new_origin) OVERRIDE;
+ const gfx::Point& new_origin) override;
private:
friend class FocusManagerEventHandler;
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
index 72bc3fb..27a5d01 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
@@ -261,7 +261,7 @@
// views::TestViewsDelegate overrides.
virtual void OnBeforeWidgetInit(
Widget::InitParams* params,
- internal::NativeWidgetDelegate* delegate) OVERRIDE {
+ internal::NativeWidgetDelegate* delegate) override {
if (!params->native_widget)
params->native_widget = new views::DesktopNativeWidgetAura(delegate);
}
@@ -311,7 +311,7 @@
top_level_widget_->CloseNow();
}
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {
+ virtual void OnWindowDestroying(aura::Window* window) override {
window->RemoveObserver(this);
if (window == owned_window_) {
owned_window_destroyed_ = true;
diff --git a/ui/views/widget/desktop_aura/desktop_screen_position_client.h b/ui/views/widget/desktop_aura/desktop_screen_position_client.h
index 222c2a1..9ccf72c 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_position_client.h
+++ b/ui/views/widget/desktop_aura/desktop_screen_position_client.h
@@ -20,14 +20,14 @@
// aura::client::ScreenPositionClient overrides:
virtual void ConvertPointToScreen(const aura::Window* window,
- gfx::Point* point) OVERRIDE;
+ gfx::Point* point) override;
virtual void ConvertPointFromScreen(const aura::Window* window,
- gfx::Point* point) OVERRIDE;
+ gfx::Point* point) override;
virtual void ConvertHostPointToScreen(aura::Window* window,
- gfx::Point* point) OVERRIDE;
+ gfx::Point* point) override;
virtual void SetBounds(aura::Window* window,
const gfx::Rect& bounds,
- const gfx::Display& display) OVERRIDE;
+ const gfx::Display& display) override;
private:
aura::Window* root_window_;
diff --git a/ui/views/widget/desktop_aura/desktop_screen_win.h b/ui/views/widget/desktop_aura/desktop_screen_win.h
index 3225d61..0ba1f5d 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_win.h
+++ b/ui/views/widget/desktop_aura/desktop_screen_win.h
@@ -17,11 +17,11 @@
private:
// Overridden from gfx::ScreenWin:
- virtual bool IsDIPEnabled() OVERRIDE;
+ virtual bool IsDIPEnabled() override;
virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const OVERRIDE;
- virtual HWND GetHWNDFromNativeView(gfx::NativeView window) const OVERRIDE;
- virtual gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const OVERRIDE;
+ const gfx::Rect& match_rect) const override;
+ virtual HWND GetHWNDFromNativeView(gfx::NativeView window) const override;
+ virtual gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const override;
DISALLOW_COPY_AND_ASSIGN(DesktopScreenWin);
};
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.h b/ui/views/widget/desktop_aura/desktop_screen_x11.h
index ff47806..1fc32d1 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11.h
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11.h
@@ -31,26 +31,26 @@
virtual ~DesktopScreenX11();
// Overridden from gfx::Screen:
- virtual bool IsDIPEnabled() OVERRIDE;
- virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
- virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE;
+ virtual bool IsDIPEnabled() override;
+ virtual gfx::Point GetCursorScreenPoint() override;
+ virtual gfx::NativeWindow GetWindowUnderCursor() override;
virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
- OVERRIDE;
- virtual int GetNumDisplays() const OVERRIDE;
- virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE;
+ override;
+ virtual int GetNumDisplays() const override;
+ virtual std::vector<gfx::Display> GetAllDisplays() const override;
virtual gfx::Display GetDisplayNearestWindow(
- gfx::NativeView window) const OVERRIDE;
+ gfx::NativeView window) const override;
virtual gfx::Display GetDisplayNearestPoint(
- const gfx::Point& point) const OVERRIDE;
+ const gfx::Point& point) const override;
virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const OVERRIDE;
- virtual gfx::Display GetPrimaryDisplay() const OVERRIDE;
- virtual void AddObserver(gfx::DisplayObserver* observer) OVERRIDE;
- virtual void RemoveObserver(gfx::DisplayObserver* observer) OVERRIDE;
+ const gfx::Rect& match_rect) const override;
+ virtual gfx::Display GetPrimaryDisplay() const override;
+ virtual void AddObserver(gfx::DisplayObserver* observer) override;
+ virtual void RemoveObserver(gfx::DisplayObserver* observer) override;
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
private:
friend class DesktopScreenX11Test;
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
index 75a71ac..4b18ee7 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
@@ -34,7 +34,7 @@
}
// DesktopNativeWidgetAura:
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
+ virtual int GetNonClientComponent(const gfx::Point& point) const override {
return window_component_;
}
@@ -58,7 +58,7 @@
virtual ~DesktopScreenX11Test() {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
// Initialize the world to the single monitor case.
std::vector<gfx::Display> displays;
@@ -67,7 +67,7 @@
screen_->AddObserver(this);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
screen_.reset();
ViewsTestBase::TearDown();
}
@@ -111,16 +111,16 @@
private:
// Overridden from gfx::DisplayObserver:
- virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE {
+ virtual void OnDisplayAdded(const gfx::Display& new_display) override {
added_display_.push_back(new_display);
}
- virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE {
+ virtual void OnDisplayRemoved(const gfx::Display& old_display) override {
removed_display_.push_back(old_display);
}
virtual void OnDisplayMetricsChanged(const gfx::Display& display,
- uint32_t metrics) OVERRIDE {
+ uint32_t metrics) override {
changed_display_.push_back(display);
}
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
index b6718a5..83ffd08 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
@@ -46,163 +46,163 @@
protected:
// Overridden from DesktopWindowTreeHost:
virtual void Init(aura::Window* content_window,
- const Widget::InitParams& params) OVERRIDE;
- virtual void OnNativeWidgetCreated(const Widget::InitParams& params) OVERRIDE;
- virtual scoped_ptr<corewm::Tooltip> CreateTooltip() OVERRIDE;
+ const Widget::InitParams& params) override;
+ virtual void OnNativeWidgetCreated(const Widget::InitParams& params) override;
+ virtual scoped_ptr<corewm::Tooltip> CreateTooltip() override;
virtual scoped_ptr<aura::client::DragDropClient>
- CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void CloseNow() OVERRIDE;
- virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE;
- virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE;
+ CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) override;
+ virtual void Close() override;
+ virtual void CloseNow() override;
+ virtual aura::WindowTreeHost* AsWindowTreeHost() override;
+ virtual void ShowWindowWithState(ui::WindowShowState show_state) override;
virtual void ShowMaximizedWithBounds(
- const gfx::Rect& restored_bounds) OVERRIDE;
- virtual bool IsVisible() const OVERRIDE;
- virtual void SetSize(const gfx::Size& size) OVERRIDE;
- virtual void StackAtTop() OVERRIDE;
- virtual void CenterWindow(const gfx::Size& size) OVERRIDE;
+ const gfx::Rect& restored_bounds) override;
+ virtual bool IsVisible() const override;
+ virtual void SetSize(const gfx::Size& size) override;
+ virtual void StackAtTop() override;
+ virtual void CenterWindow(const gfx::Size& size) override;
virtual void GetWindowPlacement(
gfx::Rect* bounds,
- ui::WindowShowState* show_state) const OVERRIDE;
- virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
- virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE;
- virtual void SetShape(gfx::NativeRegion native_region) OVERRIDE;
- virtual void Activate() OVERRIDE;
- virtual void Deactivate() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual bool IsMaximized() const OVERRIDE;
- virtual bool IsMinimized() const OVERRIDE;
- virtual bool HasCapture() const OVERRIDE;
- virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
- virtual bool IsAlwaysOnTop() const OVERRIDE;
- virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE;
- virtual bool SetWindowTitle(const base::string16& title) OVERRIDE;
- virtual void ClearNativeFocus() OVERRIDE;
+ ui::WindowShowState* show_state) const override;
+ virtual gfx::Rect GetWindowBoundsInScreen() const override;
+ virtual gfx::Rect GetClientAreaBoundsInScreen() const override;
+ virtual gfx::Rect GetRestoredBounds() const override;
+ virtual gfx::Rect GetWorkAreaBoundsInScreen() const override;
+ virtual void SetShape(gfx::NativeRegion native_region) override;
+ virtual void Activate() override;
+ virtual void Deactivate() override;
+ virtual bool IsActive() const override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual void Restore() override;
+ virtual bool IsMaximized() const override;
+ virtual bool IsMinimized() const override;
+ virtual bool HasCapture() const override;
+ virtual void SetAlwaysOnTop(bool always_on_top) override;
+ virtual bool IsAlwaysOnTop() const override;
+ virtual void SetVisibleOnAllWorkspaces(bool always_visible) override;
+ virtual bool SetWindowTitle(const base::string16& title) override;
+ virtual void ClearNativeFocus() override;
virtual Widget::MoveLoopResult RunMoveLoop(
const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source,
- Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE;
- virtual void EndMoveLoop() OVERRIDE;
- virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE;
- virtual bool ShouldUseNativeFrame() const OVERRIDE;
- virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE;
- virtual void FrameTypeChanged() OVERRIDE;
- virtual void SetFullscreen(bool fullscreen) OVERRIDE;
- virtual bool IsFullscreen() const OVERRIDE;
- virtual void SetOpacity(unsigned char opacity) OVERRIDE;
+ Widget::MoveLoopEscapeBehavior escape_behavior) override;
+ virtual void EndMoveLoop() override;
+ virtual void SetVisibilityChangedAnimationsEnabled(bool value) override;
+ virtual bool ShouldUseNativeFrame() const override;
+ virtual bool ShouldWindowContentsBeTransparent() const override;
+ virtual void FrameTypeChanged() override;
+ virtual void SetFullscreen(bool fullscreen) override;
+ virtual bool IsFullscreen() const override;
+ virtual void SetOpacity(unsigned char opacity) override;
virtual void SetWindowIcons(const gfx::ImageSkia& window_icon,
- const gfx::ImageSkia& app_icon) OVERRIDE;
- virtual void InitModalType(ui::ModalType modal_type) OVERRIDE;
- virtual void FlashFrame(bool flash_frame) OVERRIDE;
- virtual void OnRootViewLayout() OVERRIDE;
- virtual void OnNativeWidgetFocus() OVERRIDE;
- virtual void OnNativeWidgetBlur() OVERRIDE;
- virtual bool IsAnimatingClosed() const OVERRIDE;
- virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE;
- virtual void SizeConstraintsChanged() OVERRIDE;
+ const gfx::ImageSkia& app_icon) override;
+ virtual void InitModalType(ui::ModalType modal_type) override;
+ virtual void FlashFrame(bool flash_frame) override;
+ virtual void OnRootViewLayout() override;
+ virtual void OnNativeWidgetFocus() override;
+ virtual void OnNativeWidgetBlur() override;
+ virtual bool IsAnimatingClosed() const override;
+ virtual bool IsTranslucentWindowOpacitySupported() const override;
+ virtual void SizeConstraintsChanged() override;
// Overridden from aura::WindowTreeHost:
- virtual ui::EventSource* GetEventSource() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual gfx::Rect GetBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
- virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE;
- virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE;
- virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE;
+ virtual ui::EventSource* GetEventSource() override;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual gfx::Rect GetBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual gfx::Point GetLocationOnNativeScreen() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void PostNativeEvent(const base::NativeEvent& native_event) override;
+ virtual void SetCursorNative(gfx::NativeCursor cursor) override;
+ virtual void OnCursorVisibilityChangedNative(bool show) override;
+ virtual void MoveCursorToNative(const gfx::Point& location) override;
// Overridden frm ui::EventSource
- virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
+ virtual ui::EventProcessor* GetEventProcessor() override;
// Overridden from aura::client::AnimationHost
virtual void SetHostTransitionOffsets(
const gfx::Vector2d& top_left_delta,
- const gfx::Vector2d& bottom_right_delta) OVERRIDE;
- virtual void OnWindowHidingAnimationCompleted() OVERRIDE;
+ const gfx::Vector2d& bottom_right_delta) override;
+ virtual void OnWindowHidingAnimationCompleted() override;
// Overridden from HWNDMessageHandlerDelegate:
- virtual bool IsWidgetWindow() const OVERRIDE;
- virtual bool IsUsingCustomFrame() const OVERRIDE;
- virtual void SchedulePaint() OVERRIDE;
- virtual void EnableInactiveRendering() OVERRIDE;
- virtual bool IsInactiveRenderingDisabled() OVERRIDE;
- virtual bool CanResize() const OVERRIDE;
- virtual bool CanMaximize() const OVERRIDE;
- virtual bool CanMinimize() const OVERRIDE;
- virtual bool CanActivate() const OVERRIDE;
- virtual bool WidgetSizeIsClientSize() const OVERRIDE;
- virtual bool IsModal() const OVERRIDE;
- virtual int GetInitialShowState() const OVERRIDE;
- virtual bool WillProcessWorkAreaChange() const OVERRIDE;
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
- virtual void GetWindowMask(const gfx::Size& size, gfx::Path* path) OVERRIDE;
- virtual bool GetClientAreaInsets(gfx::Insets* insets) const OVERRIDE;
+ virtual bool IsWidgetWindow() const override;
+ virtual bool IsUsingCustomFrame() const override;
+ virtual void SchedulePaint() override;
+ virtual void EnableInactiveRendering() override;
+ virtual bool IsInactiveRenderingDisabled() override;
+ virtual bool CanResize() const override;
+ virtual bool CanMaximize() const override;
+ virtual bool CanMinimize() const override;
+ virtual bool CanActivate() const override;
+ virtual bool WidgetSizeIsClientSize() const override;
+ virtual bool IsModal() const override;
+ virtual int GetInitialShowState() const override;
+ virtual bool WillProcessWorkAreaChange() const override;
+ virtual int GetNonClientComponent(const gfx::Point& point) const override;
+ virtual void GetWindowMask(const gfx::Size& size, gfx::Path* path) override;
+ virtual bool GetClientAreaInsets(gfx::Insets* insets) const override;
virtual void GetMinMaxSize(gfx::Size* min_size,
- gfx::Size* max_size) const OVERRIDE;
- virtual gfx::Size GetRootViewSize() const OVERRIDE;
- virtual void ResetWindowControls() OVERRIDE;
- virtual void PaintLayeredWindow(gfx::Canvas* canvas) OVERRIDE;
- virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
- virtual bool ShouldHandleSystemCommands() const OVERRIDE;
- virtual InputMethod* GetInputMethod() OVERRIDE;
- virtual void HandleAppDeactivated() OVERRIDE;
- virtual void HandleActivationChanged(bool active) OVERRIDE;
- virtual bool HandleAppCommand(short command) OVERRIDE;
- virtual void HandleCancelMode() OVERRIDE;
- virtual void HandleCaptureLost() OVERRIDE;
- virtual void HandleClose() OVERRIDE;
- virtual bool HandleCommand(int command) OVERRIDE;
- virtual void HandleAccelerator(const ui::Accelerator& accelerator) OVERRIDE;
- virtual void HandleCreate() OVERRIDE;
- virtual void HandleDestroying() OVERRIDE;
- virtual void HandleDestroyed() OVERRIDE;
- virtual bool HandleInitialFocus(ui::WindowShowState show_state) OVERRIDE;
- virtual void HandleDisplayChange() OVERRIDE;
- virtual void HandleBeginWMSizeMove() OVERRIDE;
- virtual void HandleEndWMSizeMove() OVERRIDE;
- virtual void HandleMove() OVERRIDE;
- virtual void HandleWorkAreaChanged() OVERRIDE;
- virtual void HandleVisibilityChanging(bool visible) OVERRIDE;
- virtual void HandleVisibilityChanged(bool visible) OVERRIDE;
- virtual void HandleClientSizeChanged(const gfx::Size& new_size) OVERRIDE;
- virtual void HandleFrameChanged() OVERRIDE;
- virtual void HandleNativeFocus(HWND last_focused_window) OVERRIDE;
- virtual void HandleNativeBlur(HWND focused_window) OVERRIDE;
- virtual bool HandleMouseEvent(const ui::MouseEvent& event) OVERRIDE;
- virtual bool HandleKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual bool HandleUntranslatedKeyEvent(const ui::KeyEvent& event) OVERRIDE;
- virtual void HandleTouchEvent(const ui::TouchEvent& event) OVERRIDE;
+ gfx::Size* max_size) const override;
+ virtual gfx::Size GetRootViewSize() const override;
+ virtual void ResetWindowControls() override;
+ virtual void PaintLayeredWindow(gfx::Canvas* canvas) override;
+ virtual gfx::NativeViewAccessible GetNativeViewAccessible() override;
+ virtual bool ShouldHandleSystemCommands() const override;
+ virtual InputMethod* GetInputMethod() override;
+ virtual void HandleAppDeactivated() override;
+ virtual void HandleActivationChanged(bool active) override;
+ virtual bool HandleAppCommand(short command) override;
+ virtual void HandleCancelMode() override;
+ virtual void HandleCaptureLost() override;
+ virtual void HandleClose() override;
+ virtual bool HandleCommand(int command) override;
+ virtual void HandleAccelerator(const ui::Accelerator& accelerator) override;
+ virtual void HandleCreate() override;
+ virtual void HandleDestroying() override;
+ virtual void HandleDestroyed() override;
+ virtual bool HandleInitialFocus(ui::WindowShowState show_state) override;
+ virtual void HandleDisplayChange() override;
+ virtual void HandleBeginWMSizeMove() override;
+ virtual void HandleEndWMSizeMove() override;
+ virtual void HandleMove() override;
+ virtual void HandleWorkAreaChanged() override;
+ virtual void HandleVisibilityChanging(bool visible) override;
+ virtual void HandleVisibilityChanged(bool visible) override;
+ virtual void HandleClientSizeChanged(const gfx::Size& new_size) override;
+ virtual void HandleFrameChanged() override;
+ virtual void HandleNativeFocus(HWND last_focused_window) override;
+ virtual void HandleNativeBlur(HWND focused_window) override;
+ virtual bool HandleMouseEvent(const ui::MouseEvent& event) override;
+ virtual bool HandleKeyEvent(const ui::KeyEvent& event) override;
+ virtual bool HandleUntranslatedKeyEvent(const ui::KeyEvent& event) override;
+ virtual void HandleTouchEvent(const ui::TouchEvent& event) override;
virtual bool HandleIMEMessage(UINT message,
WPARAM w_param,
LPARAM l_param,
- LRESULT* result) OVERRIDE;
+ LRESULT* result) override;
virtual void HandleInputLanguageChange(DWORD character_set,
- HKL input_language_id) OVERRIDE;
- virtual bool HandlePaintAccelerated(const gfx::Rect& invalid_rect) OVERRIDE;
- virtual void HandlePaint(gfx::Canvas* canvas) OVERRIDE;
+ HKL input_language_id) override;
+ virtual bool HandlePaintAccelerated(const gfx::Rect& invalid_rect) override;
+ virtual void HandlePaint(gfx::Canvas* canvas) override;
virtual bool HandleTooltipNotify(int w_param,
NMHDR* l_param,
- LRESULT* l_result) OVERRIDE;
- virtual void HandleMenuLoop(bool in_menu_loop) OVERRIDE;
+ LRESULT* l_result) override;
+ virtual void HandleMenuLoop(bool in_menu_loop) override;
virtual bool PreHandleMSG(UINT message,
WPARAM w_param,
LPARAM l_param,
- LRESULT* result) OVERRIDE;
+ LRESULT* result) override;
virtual void PostHandleMSG(UINT message,
WPARAM w_param,
- LPARAM l_param) OVERRIDE;
- virtual bool HandleScrollEvent(const ui::ScrollEvent& event) OVERRIDE;
- virtual void HandleWindowSizeChanging() OVERRIDE;
+ LPARAM l_param) override;
+ virtual bool HandleScrollEvent(const ui::ScrollEvent& event) override;
+ virtual void HandleWindowSizeChanging() override;
Widget* GetWidget();
const Widget* GetWidget() const;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
index 8a5e51f..808bed7 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -88,83 +88,83 @@
protected:
// Overridden from DesktopWindowTreeHost:
virtual void Init(aura::Window* content_window,
- const Widget::InitParams& params) OVERRIDE;
- virtual void OnNativeWidgetCreated(const Widget::InitParams& params) OVERRIDE;
- virtual scoped_ptr<corewm::Tooltip> CreateTooltip() OVERRIDE;
+ const Widget::InitParams& params) override;
+ virtual void OnNativeWidgetCreated(const Widget::InitParams& params) override;
+ virtual scoped_ptr<corewm::Tooltip> CreateTooltip() override;
virtual scoped_ptr<aura::client::DragDropClient>
- CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void CloseNow() OVERRIDE;
- virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE;
- virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE;
+ CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) override;
+ virtual void Close() override;
+ virtual void CloseNow() override;
+ virtual aura::WindowTreeHost* AsWindowTreeHost() override;
+ virtual void ShowWindowWithState(ui::WindowShowState show_state) override;
virtual void ShowMaximizedWithBounds(
- const gfx::Rect& restored_bounds) OVERRIDE;
- virtual bool IsVisible() const OVERRIDE;
- virtual void SetSize(const gfx::Size& requested_size) OVERRIDE;
- virtual void StackAtTop() OVERRIDE;
- virtual void CenterWindow(const gfx::Size& size) OVERRIDE;
+ const gfx::Rect& restored_bounds) override;
+ virtual bool IsVisible() const override;
+ virtual void SetSize(const gfx::Size& requested_size) override;
+ virtual void StackAtTop() override;
+ virtual void CenterWindow(const gfx::Size& size) override;
virtual void GetWindowPlacement(
gfx::Rect* bounds,
- ui::WindowShowState* show_state) const OVERRIDE;
- virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
- virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE;
- virtual void SetShape(gfx::NativeRegion native_region) OVERRIDE;
- virtual void Activate() OVERRIDE;
- virtual void Deactivate() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual bool IsMaximized() const OVERRIDE;
- virtual bool IsMinimized() const OVERRIDE;
- virtual bool HasCapture() const OVERRIDE;
- virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
- virtual bool IsAlwaysOnTop() const OVERRIDE;
- virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE;
- virtual bool SetWindowTitle(const base::string16& title) OVERRIDE;
- virtual void ClearNativeFocus() OVERRIDE;
+ ui::WindowShowState* show_state) const override;
+ virtual gfx::Rect GetWindowBoundsInScreen() const override;
+ virtual gfx::Rect GetClientAreaBoundsInScreen() const override;
+ virtual gfx::Rect GetRestoredBounds() const override;
+ virtual gfx::Rect GetWorkAreaBoundsInScreen() const override;
+ virtual void SetShape(gfx::NativeRegion native_region) override;
+ virtual void Activate() override;
+ virtual void Deactivate() override;
+ virtual bool IsActive() const override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual void Restore() override;
+ virtual bool IsMaximized() const override;
+ virtual bool IsMinimized() const override;
+ virtual bool HasCapture() const override;
+ virtual void SetAlwaysOnTop(bool always_on_top) override;
+ virtual bool IsAlwaysOnTop() const override;
+ virtual void SetVisibleOnAllWorkspaces(bool always_visible) override;
+ virtual bool SetWindowTitle(const base::string16& title) override;
+ virtual void ClearNativeFocus() override;
virtual Widget::MoveLoopResult RunMoveLoop(
const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source,
- Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE;
- virtual void EndMoveLoop() OVERRIDE;
- virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE;
- virtual bool ShouldUseNativeFrame() const OVERRIDE;
- virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE;
- virtual void FrameTypeChanged() OVERRIDE;
- virtual void SetFullscreen(bool fullscreen) OVERRIDE;
- virtual bool IsFullscreen() const OVERRIDE;
- virtual void SetOpacity(unsigned char opacity) OVERRIDE;
+ Widget::MoveLoopEscapeBehavior escape_behavior) override;
+ virtual void EndMoveLoop() override;
+ virtual void SetVisibilityChangedAnimationsEnabled(bool value) override;
+ virtual bool ShouldUseNativeFrame() const override;
+ virtual bool ShouldWindowContentsBeTransparent() const override;
+ virtual void FrameTypeChanged() override;
+ virtual void SetFullscreen(bool fullscreen) override;
+ virtual bool IsFullscreen() const override;
+ virtual void SetOpacity(unsigned char opacity) override;
virtual void SetWindowIcons(const gfx::ImageSkia& window_icon,
- const gfx::ImageSkia& app_icon) OVERRIDE;
- virtual void InitModalType(ui::ModalType modal_type) OVERRIDE;
- virtual void FlashFrame(bool flash_frame) OVERRIDE;
- virtual void OnRootViewLayout() OVERRIDE;
- virtual void OnNativeWidgetFocus() OVERRIDE;
- virtual void OnNativeWidgetBlur() OVERRIDE;
- virtual bool IsAnimatingClosed() const OVERRIDE;
- virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE;
- virtual void SizeConstraintsChanged() OVERRIDE;
+ const gfx::ImageSkia& app_icon) override;
+ virtual void InitModalType(ui::ModalType modal_type) override;
+ virtual void FlashFrame(bool flash_frame) override;
+ virtual void OnRootViewLayout() override;
+ virtual void OnNativeWidgetFocus() override;
+ virtual void OnNativeWidgetBlur() override;
+ virtual bool IsAnimatingClosed() const override;
+ virtual bool IsTranslucentWindowOpacitySupported() const override;
+ virtual void SizeConstraintsChanged() override;
// Overridden from aura::WindowTreeHost:
- virtual ui::EventSource* GetEventSource() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
- virtual gfx::Rect GetBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& requested_bounds) OVERRIDE;
- virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
- virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE;
- virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE;
- virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE;
+ virtual ui::EventSource* GetEventSource() override;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() override;
+ virtual void Show() override;
+ virtual void Hide() override;
+ virtual gfx::Rect GetBounds() const override;
+ virtual void SetBounds(const gfx::Rect& requested_bounds) override;
+ virtual gfx::Point GetLocationOnNativeScreen() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual void PostNativeEvent(const base::NativeEvent& native_event) override;
+ virtual void SetCursorNative(gfx::NativeCursor cursor) override;
+ virtual void MoveCursorToNative(const gfx::Point& location) override;
+ virtual void OnCursorVisibilityChangedNative(bool show) override;
// Overridden frm ui::EventSource
- virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
+ virtual ui::EventProcessor* GetEventProcessor() override;
private:
// Initializes our X11 surface to draw on. This method performs all
@@ -235,8 +235,8 @@
void Relayout();
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
void DelayedResize(const gfx::Size& size);
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc
index 8a986d7..869a3c7 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc
@@ -44,7 +44,7 @@
private:
// X11PropertyChangeWaiter:
- virtual bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) OVERRIDE {
+ virtual bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) override {
XID xid = 0;
ui::GetXIDProperty(ui::GetX11RootWindow(), "_NET_ACTIVE_WINDOW", &xid);
return xid != window_;
@@ -64,7 +64,7 @@
}
// ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
if (event->type() == ui::ET_MOUSE_MOVED)
++count_;
}
@@ -135,7 +135,7 @@
}
// testing::Test
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
// Make X11 synchronous for our display connection. This does not force the
@@ -143,7 +143,7 @@
XSynchronize(gfx::GetXDisplay(), True);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
XSynchronize(gfx::GetXDisplay(), False);
ViewsTestBase::TearDown();
}
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
index bcd8f86..4eb4958 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
@@ -53,7 +53,7 @@
private:
// X11PropertyChangeWaiter:
- virtual bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) OVERRIDE {
+ virtual bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) override {
std::vector<Atom> hints;
if (ui::GetAtomArrayProperty(xwindow(), "_NET_WM_STATE", &hints)) {
std::vector<Atom>::iterator it = std::find(
@@ -87,18 +87,18 @@
}
// NonClientFrameView:
- virtual gfx::Rect GetBoundsForClientView() const OVERRIDE {
+ virtual gfx::Rect GetBoundsForClientView() const override {
return bounds();
}
virtual gfx::Rect GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds) const OVERRIDE {
+ const gfx::Rect& client_bounds) const override {
return client_bounds;
}
- virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE {
+ virtual int NonClientHitTest(const gfx::Point& point) override {
return HTNOWHERE;
}
virtual void GetWindowMask(const gfx::Size& size,
- gfx::Path* window_mask) OVERRIDE {
+ gfx::Path* window_mask) override {
int right = size.width();
int bottom = size.height();
@@ -110,13 +110,13 @@
window_mask->lineTo(right - 10, 0);
window_mask->close();
}
- virtual void ResetWindowControls() OVERRIDE {
+ virtual void ResetWindowControls() override {
}
- virtual void UpdateWindowIcon() OVERRIDE {
+ virtual void UpdateWindowIcon() override {
}
- virtual void UpdateWindowTitle() OVERRIDE {
+ virtual void UpdateWindowTitle() override {
}
- virtual void SizeConstraintsChanged() OVERRIDE {
+ virtual void SizeConstraintsChanged() override {
}
private:
@@ -133,7 +133,7 @@
// WidgetDelegateView:
virtual NonClientFrameView* CreateNonClientFrameView(
- Widget* widget) OVERRIDE {
+ Widget* widget) override {
return new ShapedNonClientFrameView;
}
@@ -198,7 +198,7 @@
virtual ~DesktopWindowTreeHostX11Test() {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
// Make X11 synchronous for our display connection. This does not force the
@@ -206,7 +206,7 @@
XSynchronize(gfx::GetXDisplay(), True);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
XSynchronize(gfx::GetXDisplay(), False);
ViewsTestBase::TearDown();
}
@@ -266,7 +266,7 @@
// xvfb does not support Xrandr so we cannot check the maximized window's
// bounds.
gfx::Rect maximized_bounds;
- ui::GetWindowRect(xid1, &maximized_bounds);
+ ui::GetOuterWindowBounds(xid1, &maximized_bounds);
shape_rects = GetShapeRects(xid1);
ASSERT_FALSE(shape_rects.empty());
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.h b/ui/views/widget/desktop_aura/x11_desktop_handler.h
index e97b68a..8a1e61e 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.h
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.h
@@ -57,12 +57,12 @@
void ProcessXEvent(XEvent* event);
// ui::PlatformEventDispatcher
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
// Overridden from aura::EnvObserver:
- virtual void OnWindowInitialized(aura::Window* window) OVERRIDE;
- virtual void OnWillDestroyEnv() OVERRIDE;
+ virtual void OnWindowInitialized(aura::Window* window) override;
+ virtual void OnWillDestroyEnv() override;
private:
enum ActiveState {
diff --git a/ui/views/widget/desktop_aura/x11_desktop_window_move_client.h b/ui/views/widget/desktop_aura/x11_desktop_window_move_client.h
index 1c93271..4da16c7 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_window_move_client.h
+++ b/ui/views/widget/desktop_aura/x11_desktop_window_move_client.h
@@ -31,16 +31,16 @@
virtual ~X11DesktopWindowMoveClient();
// Overridden from X11WholeScreenMoveLoopDelegate:
- virtual void OnMouseMovement(XMotionEvent* event) OVERRIDE;
- virtual void OnMouseReleased() OVERRIDE;
- virtual void OnMoveLoopEnded() OVERRIDE;
+ virtual void OnMouseMovement(XMotionEvent* event) override;
+ virtual void OnMouseReleased() override;
+ virtual void OnMoveLoopEnded() override;
// Overridden from aura::client::WindowMoveClient:
virtual aura::client::WindowMoveResult RunMoveLoop(
aura::Window* window,
const gfx::Vector2d& drag_offset,
- aura::client::WindowMoveSource move_source) OVERRIDE;
- virtual void EndMoveLoop() OVERRIDE;
+ aura::client::WindowMoveSource move_source) override;
+ virtual void EndMoveLoop() override;
private:
X11WholeScreenMoveLoop move_loop_;
diff --git a/ui/views/widget/desktop_aura/x11_topmost_window_finder.h b/ui/views/widget/desktop_aura/x11_topmost_window_finder.h
index cf8498a..a8a2e41 100644
--- a/ui/views/widget/desktop_aura/x11_topmost_window_finder.h
+++ b/ui/views/widget/desktop_aura/x11_topmost_window_finder.h
@@ -35,7 +35,7 @@
private:
// ui::EnumerateWindowsDelegate:
- virtual bool ShouldStopIterating(XID xid) OVERRIDE;
+ virtual bool ShouldStopIterating(XID xid) override;
// Returns true if |window| does not not belong to |ignore|, is visible and
// contains |screen_loc_|.
diff --git a/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc b/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
index a3ca346..edf9bca 100644
--- a/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
+++ b/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
@@ -51,7 +51,7 @@
private:
// X11PropertyChangeWaiter:
- virtual bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) OVERRIDE {
+ virtual bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) override {
std::vector<Atom> wm_states;
if (ui::GetAtomArrayProperty(xwindow(), "_NET_WM_STATE", &wm_states)) {
std::vector<Atom>::iterator it = std::find(
@@ -82,7 +82,7 @@
}
// X11PropertyChangeWaiter:
- virtual void Wait() OVERRIDE {
+ virtual void Wait() override {
// StackingClientListWaiter may be created after
// _NET_CLIENT_LIST_STACKING already contains |expected_windows|.
if (!ShouldKeepOnWaiting(NULL))
@@ -93,7 +93,7 @@
private:
// X11PropertyChangeWaiter:
- virtual bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) OVERRIDE {
+ virtual bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) override {
std::vector<XID> stack;
ui::GetXWindowStack(ui::GetX11RootWindow(), &stack);
for (size_t i = 0; i < expected_windows_.size(); ++i) {
@@ -205,7 +205,7 @@
}
// ViewsTestBase:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
// Make X11 synchronous for our display connection. This does not force the
@@ -217,7 +217,7 @@
X11DesktopHandler::get();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
XSynchronize(xdisplay(), False);
ViewsTestBase::TearDown();
}
diff --git a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h
index 08cb71a..b8815fe 100644
--- a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h
+++ b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h
@@ -39,14 +39,14 @@
virtual ~X11WholeScreenMoveLoop();
// ui:::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
// X11MoveLoop:
virtual bool RunMoveLoop(aura::Window* window,
- gfx::NativeCursor cursor) OVERRIDE;
- virtual void UpdateCursor(gfx::NativeCursor cursor) OVERRIDE;
- virtual void EndMoveLoop() OVERRIDE;
+ gfx::NativeCursor cursor) override;
+ virtual void UpdateCursor(gfx::NativeCursor cursor) override;
+ virtual void EndMoveLoop() override;
private:
// Grabs the pointer, setting the mouse cursor to |cursor|. Returns true if
diff --git a/ui/views/widget/desktop_aura/x11_window_event_filter.h b/ui/views/widget/desktop_aura/x11_window_event_filter.h
index 920733f..e21097c 100644
--- a/ui/views/widget/desktop_aura/x11_window_event_filter.h
+++ b/ui/views/widget/desktop_aura/x11_window_event_filter.h
@@ -33,7 +33,7 @@
virtual ~X11WindowEventFilter();
// Overridden from ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
private:
// Called when the user clicked the caption area.
diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h
index a32dc87..969f478 100644
--- a/ui/views/widget/native_widget_aura.h
+++ b/ui/views/widget/native_widget_aura.h
@@ -51,143 +51,143 @@
aura::Window* window);
// Overridden from internal::NativeWidgetPrivate:
- virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE;
- virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
- virtual bool ShouldUseNativeFrame() const OVERRIDE;
- virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE;
- virtual void FrameTypeChanged() OVERRIDE;
- virtual Widget* GetWidget() OVERRIDE;
- virtual const Widget* GetWidget() const OVERRIDE;
- virtual gfx::NativeView GetNativeView() const OVERRIDE;
- virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE;
- virtual Widget* GetTopLevelWidget() OVERRIDE;
- virtual const ui::Compositor* GetCompositor() const OVERRIDE;
- virtual ui::Compositor* GetCompositor() OVERRIDE;
- virtual ui::Layer* GetLayer() OVERRIDE;
- virtual void ReorderNativeViews() OVERRIDE;
- virtual void ViewRemoved(View* view) OVERRIDE;
- virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE;
- virtual void* GetNativeWindowProperty(const char* name) const OVERRIDE;
- virtual TooltipManager* GetTooltipManager() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual bool HasCapture() const OVERRIDE;
- virtual InputMethod* CreateInputMethod() OVERRIDE;
- virtual internal::InputMethodDelegate* GetInputMethodDelegate() OVERRIDE;
- virtual ui::InputMethod* GetHostInputMethod() OVERRIDE;
- virtual void CenterWindow(const gfx::Size& size) OVERRIDE;
+ virtual void InitNativeWidget(const Widget::InitParams& params) override;
+ virtual NonClientFrameView* CreateNonClientFrameView() override;
+ virtual bool ShouldUseNativeFrame() const override;
+ virtual bool ShouldWindowContentsBeTransparent() const override;
+ virtual void FrameTypeChanged() override;
+ virtual Widget* GetWidget() override;
+ virtual const Widget* GetWidget() const override;
+ virtual gfx::NativeView GetNativeView() const override;
+ virtual gfx::NativeWindow GetNativeWindow() const override;
+ virtual Widget* GetTopLevelWidget() override;
+ virtual const ui::Compositor* GetCompositor() const override;
+ virtual ui::Compositor* GetCompositor() override;
+ virtual ui::Layer* GetLayer() override;
+ virtual void ReorderNativeViews() override;
+ virtual void ViewRemoved(View* view) override;
+ virtual void SetNativeWindowProperty(const char* name, void* value) override;
+ virtual void* GetNativeWindowProperty(const char* name) const override;
+ virtual TooltipManager* GetTooltipManager() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual bool HasCapture() const override;
+ virtual InputMethod* CreateInputMethod() override;
+ virtual internal::InputMethodDelegate* GetInputMethodDelegate() override;
+ virtual ui::InputMethod* GetHostInputMethod() override;
+ virtual void CenterWindow(const gfx::Size& size) override;
virtual void GetWindowPlacement(
gfx::Rect* bounds,
- ui::WindowShowState* maximized) const OVERRIDE;
- virtual bool SetWindowTitle(const base::string16& title) OVERRIDE;
+ ui::WindowShowState* maximized) const override;
+ virtual bool SetWindowTitle(const base::string16& title) override;
virtual void SetWindowIcons(const gfx::ImageSkia& window_icon,
- const gfx::ImageSkia& app_icon) OVERRIDE;
- virtual void InitModalType(ui::ModalType modal_type) OVERRIDE;
- virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual void SetSize(const gfx::Size& size) OVERRIDE;
- virtual void StackAbove(gfx::NativeView native_view) OVERRIDE;
- virtual void StackAtTop() OVERRIDE;
- virtual void StackBelow(gfx::NativeView native_view) OVERRIDE;
- virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void CloseNow() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
+ const gfx::ImageSkia& app_icon) override;
+ virtual void InitModalType(ui::ModalType modal_type) override;
+ virtual gfx::Rect GetWindowBoundsInScreen() const override;
+ virtual gfx::Rect GetClientAreaBoundsInScreen() const override;
+ virtual gfx::Rect GetRestoredBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual void SetSize(const gfx::Size& size) override;
+ virtual void StackAbove(gfx::NativeView native_view) override;
+ virtual void StackAtTop() override;
+ virtual void StackBelow(gfx::NativeView native_view) override;
+ virtual void SetShape(gfx::NativeRegion shape) override;
+ virtual void Close() override;
+ virtual void CloseNow() override;
+ virtual void Show() override;
+ virtual void Hide() override;
virtual void ShowMaximizedWithBounds(
- const gfx::Rect& restored_bounds) OVERRIDE;
- virtual void ShowWithWindowState(ui::WindowShowState state) OVERRIDE;
- virtual bool IsVisible() const OVERRIDE;
- virtual void Activate() OVERRIDE;
- virtual void Deactivate() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
- virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
- virtual bool IsAlwaysOnTop() const OVERRIDE;
- virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual bool IsMaximized() const OVERRIDE;
- virtual bool IsMinimized() const OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetFullscreen(bool fullscreen) OVERRIDE;
- virtual bool IsFullscreen() const OVERRIDE;
- virtual void SetOpacity(unsigned char opacity) OVERRIDE;
- virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE;
- virtual void FlashFrame(bool flash_frame) OVERRIDE;
+ const gfx::Rect& restored_bounds) override;
+ virtual void ShowWithWindowState(ui::WindowShowState state) override;
+ virtual bool IsVisible() const override;
+ virtual void Activate() override;
+ virtual void Deactivate() override;
+ virtual bool IsActive() const override;
+ virtual void SetAlwaysOnTop(bool always_on_top) override;
+ virtual bool IsAlwaysOnTop() const override;
+ virtual void SetVisibleOnAllWorkspaces(bool always_visible) override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual bool IsMaximized() const override;
+ virtual bool IsMinimized() const override;
+ virtual void Restore() override;
+ virtual void SetFullscreen(bool fullscreen) override;
+ virtual bool IsFullscreen() const override;
+ virtual void SetOpacity(unsigned char opacity) override;
+ virtual void SetUseDragFrame(bool use_drag_frame) override;
+ virtual void FlashFrame(bool flash_frame) override;
virtual void RunShellDrag(View* view,
const ui::OSExchangeData& data,
const gfx::Point& location,
int operation,
- ui::DragDropTypes::DragEventSource source) OVERRIDE;
- virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
- virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
- virtual bool IsMouseEventsEnabled() const OVERRIDE;
- virtual void ClearNativeFocus() OVERRIDE;
- virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE;
+ ui::DragDropTypes::DragEventSource source) override;
+ virtual void SchedulePaintInRect(const gfx::Rect& rect) override;
+ virtual void SetCursor(gfx::NativeCursor cursor) override;
+ virtual bool IsMouseEventsEnabled() const override;
+ virtual void ClearNativeFocus() override;
+ virtual gfx::Rect GetWorkAreaBoundsInScreen() const override;
virtual Widget::MoveLoopResult RunMoveLoop(
const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source,
- Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE;
- virtual void EndMoveLoop() OVERRIDE;
- virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE;
- virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE;
- virtual void OnRootViewLayout() OVERRIDE;
- virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE;
- virtual void OnSizeConstraintsChanged() OVERRIDE;
- virtual void RepostNativeEvent(gfx::NativeEvent native_event) OVERRIDE;
+ Widget::MoveLoopEscapeBehavior escape_behavior) override;
+ virtual void EndMoveLoop() override;
+ virtual void SetVisibilityChangedAnimationsEnabled(bool value) override;
+ virtual ui::NativeTheme* GetNativeTheme() const override;
+ virtual void OnRootViewLayout() override;
+ virtual bool IsTranslucentWindowOpacitySupported() const override;
+ virtual void OnSizeConstraintsChanged() override;
+ virtual void RepostNativeEvent(gfx::NativeEvent native_event) override;
// Overridden from views::InputMethodDelegate:
- virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE;
+ virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) override;
// Overridden from aura::WindowDelegate:
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override;
+ virtual int GetNonClientComponent(const gfx::Point& point) const override;
virtual bool ShouldDescendIntoChildForEventHandling(
aura::Window* child,
- const gfx::Point& location) OVERRIDE;
- virtual bool CanFocus() OVERRIDE;
- virtual void OnCaptureLost() OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
- virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE;
- virtual bool HasHitTestMask() const OVERRIDE;
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE;
+ const gfx::Point& location) override;
+ virtual bool CanFocus() override;
+ virtual void OnCaptureLost() override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
+ virtual void OnWindowDestroying(aura::Window* window) override;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
+ virtual void OnWindowTargetVisibilityChanged(bool visible) override;
+ virtual bool HasHitTestMask() const override;
+ virtual void GetHitTestMask(gfx::Path* mask) const override;
// Overridden from aura::WindowObserver:
virtual void OnWindowPropertyChanged(aura::Window* window,
const void* key,
- intptr_t old) OVERRIDE;
+ intptr_t old) override;
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Overridden from aura::client::ActivationDelegate:
- virtual bool ShouldActivate() const OVERRIDE;
+ virtual bool ShouldActivate() const override;
// Overridden from aura::client::ActivationChangeObserver:
virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE;
+ aura::Window* lost_active) override;
// Overridden from aura::client::FocusChangeObserver:
virtual void OnWindowFocused(aura::Window* gained_focus,
- aura::Window* lost_focus) OVERRIDE;
+ aura::Window* lost_focus) override;
// Overridden from aura::client::DragDropDelegate:
- virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE;
- virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE;
- virtual void OnDragExited() OVERRIDE;
- virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
+ virtual void OnDragEntered(const ui::DropTargetEvent& event) override;
+ virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
+ virtual void OnDragExited() override;
+ virtual int OnPerformDrop(const ui::DropTargetEvent& event) override;
protected:
virtual ~NativeWidgetAura();
diff --git a/ui/views/widget/native_widget_aura_unittest.cc b/ui/views/widget/native_widget_aura_unittest.cc
index be0041d..6ca6f34 100644
--- a/ui/views/widget/native_widget_aura_unittest.cc
+++ b/ui/views/widget/native_widget_aura_unittest.cc
@@ -40,7 +40,7 @@
virtual ~NativeWidgetAuraTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AuraTestBase::SetUp();
new wm::DefaultActivationClient(root_window());
host()->SetBounds(gfx::Rect(640, 480));
@@ -106,14 +106,14 @@
virtual ~TestLayoutManagerBase() {}
// aura::LayoutManager:
- virtual void OnWindowResized() OVERRIDE {}
- virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE {}
- virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE {}
- virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE {}
+ virtual void OnWindowResized() override {}
+ virtual void OnWindowAddedToLayout(aura::Window* child) override {}
+ virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override {}
+ virtual void OnWindowRemovedFromLayout(aura::Window* child) override {}
virtual void OnChildWindowVisibilityChanged(aura::Window* child,
- bool visible) OVERRIDE {}
+ bool visible) override {}
virtual void SetChildBounds(aura::Window* child,
- const gfx::Rect& requested_bounds) OVERRIDE {}
+ const gfx::Rect& requested_bounds) override {}
private:
DISALLOW_COPY_AND_ASSIGN(TestLayoutManagerBase);
@@ -127,7 +127,7 @@
private:
// aura::LayoutManager:
- virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE {
+ virtual void OnWindowAddedToLayout(aura::Window* child) override {
// This simulates what happens when adding a maximized window.
SetChildBoundsDirect(child, gfx::Rect(0, 0, 300, 300));
}
@@ -148,7 +148,7 @@
return did_size_change_more_than_once_;
}
- virtual void OnNativeWidgetSizeChanged(const gfx::Size& new_size) OVERRIDE {
+ virtual void OnNativeWidgetSizeChanged(const gfx::Size& new_size) override {
if (last_size_.IsEmpty())
last_size_ = new_size;
else if (!did_size_change_more_than_once_ && new_size != last_size_)
@@ -191,7 +191,7 @@
private:
// aura::LayoutManager:
- virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE {
+ virtual void OnWindowAddedToLayout(aura::Window* child) override {
EXPECT_TRUE(child->GetProperty(aura::client::kCanMaximizeKey));
EXPECT_TRUE(child->GetProperty(aura::client::kCanMinimizeKey));
EXPECT_TRUE(child->GetProperty(aura::client::kCanResizeKey));
@@ -210,22 +210,22 @@
private:
// views::WidgetDelegate:
- virtual bool CanMaximize() const OVERRIDE {
+ virtual bool CanMaximize() const override {
return true;
}
- virtual bool CanMinimize() const OVERRIDE {
+ virtual bool CanMinimize() const override {
return true;
}
- virtual bool CanResize() const OVERRIDE {
+ virtual bool CanResize() const override {
return true;
}
- virtual void DeleteDelegate() OVERRIDE {
+ virtual void DeleteDelegate() override {
delete this;
}
- virtual Widget* GetWidget() OVERRIDE {
+ virtual Widget* GetWidget() override {
return widget_;
}
- virtual const Widget* GetWidget() const OVERRIDE {
+ virtual const Widget* GetWidget() const override {
return widget_;
}
@@ -286,7 +286,7 @@
}
// View overrides:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
got_gesture_event_ = true;
if (consume_gesture_event_)
event->StopPropagation();
@@ -454,7 +454,7 @@
bool got_move() const { return got_move_; }
// WidgetDelegate overrides:
- virtual void OnWidgetMove() OVERRIDE { got_move_ = true; }
+ virtual void OnWidgetMove() override { got_move_ = true; }
private:
bool got_move_;
diff --git a/ui/views/widget/native_widget_mac.h b/ui/views/widget/native_widget_mac.h
index a7bbbac..a293eb8 100644
--- a/ui/views/widget/native_widget_mac.h
+++ b/ui/views/widget/native_widget_mac.h
@@ -25,92 +25,92 @@
void OnWindowWillClose();
// internal::NativeWidgetPrivate:
- virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE;
- virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
- virtual bool ShouldUseNativeFrame() const OVERRIDE;
- virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE;
- virtual void FrameTypeChanged() OVERRIDE;
- virtual Widget* GetWidget() OVERRIDE;
- virtual const Widget* GetWidget() const OVERRIDE;
- virtual gfx::NativeView GetNativeView() const OVERRIDE;
- virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE;
- virtual Widget* GetTopLevelWidget() OVERRIDE;
- virtual const ui::Compositor* GetCompositor() const OVERRIDE;
- virtual ui::Compositor* GetCompositor() OVERRIDE;
- virtual ui::Layer* GetLayer() OVERRIDE;
- virtual void ReorderNativeViews() OVERRIDE;
- virtual void ViewRemoved(View* view) OVERRIDE;
- virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE;
- virtual void* GetNativeWindowProperty(const char* name) const OVERRIDE;
- virtual TooltipManager* GetTooltipManager() const OVERRIDE;
- virtual void SetCapture() OVERRIDE;
- virtual void ReleaseCapture() OVERRIDE;
- virtual bool HasCapture() const OVERRIDE;
- virtual InputMethod* CreateInputMethod() OVERRIDE;
- virtual internal::InputMethodDelegate* GetInputMethodDelegate() OVERRIDE;
- virtual ui::InputMethod* GetHostInputMethod() OVERRIDE;
- virtual void CenterWindow(const gfx::Size& size) OVERRIDE;
+ virtual void InitNativeWidget(const Widget::InitParams& params) override;
+ virtual NonClientFrameView* CreateNonClientFrameView() override;
+ virtual bool ShouldUseNativeFrame() const override;
+ virtual bool ShouldWindowContentsBeTransparent() const override;
+ virtual void FrameTypeChanged() override;
+ virtual Widget* GetWidget() override;
+ virtual const Widget* GetWidget() const override;
+ virtual gfx::NativeView GetNativeView() const override;
+ virtual gfx::NativeWindow GetNativeWindow() const override;
+ virtual Widget* GetTopLevelWidget() override;
+ virtual const ui::Compositor* GetCompositor() const override;
+ virtual ui::Compositor* GetCompositor() override;
+ virtual ui::Layer* GetLayer() override;
+ virtual void ReorderNativeViews() override;
+ virtual void ViewRemoved(View* view) override;
+ virtual void SetNativeWindowProperty(const char* name, void* value) override;
+ virtual void* GetNativeWindowProperty(const char* name) const override;
+ virtual TooltipManager* GetTooltipManager() const override;
+ virtual void SetCapture() override;
+ virtual void ReleaseCapture() override;
+ virtual bool HasCapture() const override;
+ virtual InputMethod* CreateInputMethod() override;
+ virtual internal::InputMethodDelegate* GetInputMethodDelegate() override;
+ virtual ui::InputMethod* GetHostInputMethod() override;
+ virtual void CenterWindow(const gfx::Size& size) override;
virtual void GetWindowPlacement(
gfx::Rect* bounds,
- ui::WindowShowState* maximized) const OVERRIDE;
- virtual bool SetWindowTitle(const base::string16& title) OVERRIDE;
+ ui::WindowShowState* maximized) const override;
+ virtual bool SetWindowTitle(const base::string16& title) override;
virtual void SetWindowIcons(const gfx::ImageSkia& window_icon,
- const gfx::ImageSkia& app_icon) OVERRIDE;
- virtual void InitModalType(ui::ModalType modal_type) OVERRIDE;
- virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE;
- virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
- virtual void SetSize(const gfx::Size& size) OVERRIDE;
- virtual void StackAbove(gfx::NativeView native_view) OVERRIDE;
- virtual void StackAtTop() OVERRIDE;
- virtual void StackBelow(gfx::NativeView native_view) OVERRIDE;
- virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void CloseNow() OVERRIDE;
- virtual void Show() OVERRIDE;
- virtual void Hide() OVERRIDE;
+ const gfx::ImageSkia& app_icon) override;
+ virtual void InitModalType(ui::ModalType modal_type) override;
+ virtual gfx::Rect GetWindowBoundsInScreen() const override;
+ virtual gfx::Rect GetClientAreaBoundsInScreen() const override;
+ virtual gfx::Rect GetRestoredBounds() const override;
+ virtual void SetBounds(const gfx::Rect& bounds) override;
+ virtual void SetSize(const gfx::Size& size) override;
+ virtual void StackAbove(gfx::NativeView native_view) override;
+ virtual void StackAtTop() override;
+ virtual void StackBelow(gfx::NativeView native_view) override;
+ virtual void SetShape(gfx::NativeRegion shape) override;
+ virtual void Close() override;
+ virtual void CloseNow() override;
+ virtual void Show() override;
+ virtual void Hide() override;
virtual void ShowMaximizedWithBounds(
- const gfx::Rect& restored_bounds) OVERRIDE;
- virtual void ShowWithWindowState(ui::WindowShowState state) OVERRIDE;
- virtual bool IsVisible() const OVERRIDE;
- virtual void Activate() OVERRIDE;
- virtual void Deactivate() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
- virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
- virtual bool IsAlwaysOnTop() const OVERRIDE;
- virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE;
- virtual void Maximize() OVERRIDE;
- virtual void Minimize() OVERRIDE;
- virtual bool IsMaximized() const OVERRIDE;
- virtual bool IsMinimized() const OVERRIDE;
- virtual void Restore() OVERRIDE;
- virtual void SetFullscreen(bool fullscreen) OVERRIDE;
- virtual bool IsFullscreen() const OVERRIDE;
- virtual void SetOpacity(unsigned char opacity) OVERRIDE;
- virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE;
- virtual void FlashFrame(bool flash_frame) OVERRIDE;
+ const gfx::Rect& restored_bounds) override;
+ virtual void ShowWithWindowState(ui::WindowShowState state) override;
+ virtual bool IsVisible() const override;
+ virtual void Activate() override;
+ virtual void Deactivate() override;
+ virtual bool IsActive() const override;
+ virtual void SetAlwaysOnTop(bool always_on_top) override;
+ virtual bool IsAlwaysOnTop() const override;
+ virtual void SetVisibleOnAllWorkspaces(bool always_visible) override;
+ virtual void Maximize() override;
+ virtual void Minimize() override;
+ virtual bool IsMaximized() const override;
+ virtual bool IsMinimized() const override;
+ virtual void Restore() override;
+ virtual void SetFullscreen(bool fullscreen) override;
+ virtual bool IsFullscreen() const override;
+ virtual void SetOpacity(unsigned char opacity) override;
+ virtual void SetUseDragFrame(bool use_drag_frame) override;
+ virtual void FlashFrame(bool flash_frame) override;
virtual void RunShellDrag(View* view,
const ui::OSExchangeData& data,
const gfx::Point& location,
int operation,
- ui::DragDropTypes::DragEventSource source) OVERRIDE;
- virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
- virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
- virtual bool IsMouseEventsEnabled() const OVERRIDE;
- virtual void ClearNativeFocus() OVERRIDE;
- virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE;
+ ui::DragDropTypes::DragEventSource source) override;
+ virtual void SchedulePaintInRect(const gfx::Rect& rect) override;
+ virtual void SetCursor(gfx::NativeCursor cursor) override;
+ virtual bool IsMouseEventsEnabled() const override;
+ virtual void ClearNativeFocus() override;
+ virtual gfx::Rect GetWorkAreaBoundsInScreen() const override;
virtual Widget::MoveLoopResult RunMoveLoop(
const gfx::Vector2d& drag_offset,
Widget::MoveLoopSource source,
- Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE;
- virtual void EndMoveLoop() OVERRIDE;
- virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE;
- virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE;
- virtual void OnRootViewLayout() OVERRIDE;
- virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE;
- virtual void OnSizeConstraintsChanged() OVERRIDE;
- virtual void RepostNativeEvent(gfx::NativeEvent native_event) OVERRIDE;
+ Widget::MoveLoopEscapeBehavior escape_behavior) override;
+ virtual void EndMoveLoop() override;
+ virtual void SetVisibilityChangedAnimationsEnabled(bool value) override;
+ virtual ui::NativeTheme* GetNativeTheme() const override;
+ virtual void OnRootViewLayout() override;
+ virtual bool IsTranslucentWindowOpacitySupported() const override;
+ virtual void OnSizeConstraintsChanged() override;
+ virtual void RepostNativeEvent(gfx::NativeEvent native_event) override;
protected:
internal::NativeWidgetDelegate* delegate() { return delegate_; }
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm
index 9f3a156..c6d851d 100644
--- a/ui/views/widget/native_widget_mac.mm
+++ b/ui/views/widget/native_widget_mac.mm
@@ -269,8 +269,7 @@
}
gfx::Rect NativeWidgetMac::GetRestoredBounds() const {
- NOTIMPLEMENTED();
- return gfx::Rect();
+ return bridge_ ? bridge_->GetRestoredBounds() : gfx::Rect();
}
void NativeWidgetMac::SetBounds(const gfx::Rect& bounds) {
@@ -405,7 +404,7 @@
}
void NativeWidgetMac::Maximize() {
- NOTIMPLEMENTED();
+ NOTIMPLEMENTED(); // See IsMaximized().
}
void NativeWidgetMac::Minimize() {
@@ -413,7 +412,8 @@
}
bool NativeWidgetMac::IsMaximized() const {
- NOTIMPLEMENTED();
+ // The window frame isn't altered on Mac unless going fullscreen. The green
+ // "+" button just makes the window bigger. So, always false.
return false;
}
@@ -427,12 +427,14 @@
}
void NativeWidgetMac::SetFullscreen(bool fullscreen) {
- NOTIMPLEMENTED();
+ if (!bridge_ || fullscreen == IsFullscreen())
+ return;
+
+ bridge_->ToggleDesiredFullscreenState();
}
bool NativeWidgetMac::IsFullscreen() const {
- NOTIMPLEMENTED();
- return false;
+ return bridge_ && bridge_->target_fullscreen_state();
}
void NativeWidgetMac::SetOpacity(unsigned char opacity) {
diff --git a/ui/views/widget/native_widget_mac_interactive_uitest.mm b/ui/views/widget/native_widget_mac_interactive_uitest.mm
index aaba60a..7cb6afb 100644
--- a/ui/views/widget/native_widget_mac_interactive_uitest.mm
+++ b/ui/views/widget/native_widget_mac_interactive_uitest.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "ui/views/test/widget_test.h"
+#include "ui/views/test/test_widget_observer.h"
namespace views {
namespace test {
@@ -17,7 +18,10 @@
: public WidgetTest,
public ::testing::WithParamInterface<bool> {
public:
- NativeWidgetMacInteractiveUITest() {}
+ class Observer;
+
+ NativeWidgetMacInteractiveUITest()
+ : activationCount_(0), deactivationCount_(0) {}
Widget* MakeWidget() {
return GetParam() ? CreateTopLevelFramelessPlatformWidget()
@@ -33,21 +37,70 @@
WidgetTest::SetUp();
}
+ protected:
+ scoped_ptr<Observer> observer_;
+ int activationCount_;
+ int deactivationCount_;
+
private:
DISALLOW_COPY_AND_ASSIGN(NativeWidgetMacInteractiveUITest);
};
+class NativeWidgetMacInteractiveUITest::Observer : public TestWidgetObserver {
+ public:
+ Observer(NativeWidgetMacInteractiveUITest* parent, Widget* widget)
+ : TestWidgetObserver(widget), parent_(parent) {}
+
+ virtual void OnWidgetActivationChanged(Widget* widget, bool active) override {
+ if (active)
+ parent_->activationCount_++;
+ else
+ parent_->deactivationCount_++;
+ }
+
+ private:
+ NativeWidgetMacInteractiveUITest* parent_;
+
+ DISALLOW_COPY_AND_ASSIGN(Observer);
+};
+
// Test that showing a window causes it to attain global keyWindow status.
TEST_P(NativeWidgetMacInteractiveUITest, ShowAttainsKeyStatus) {
Widget* widget = MakeWidget();
+ observer_.reset(new Observer(this, widget));
EXPECT_FALSE(widget->IsActive());
+ EXPECT_EQ(0, activationCount_);
widget->Show();
EXPECT_TRUE(widget->IsActive());
-
RunPendingMessages();
EXPECT_TRUE([widget->GetNativeWindow() isKeyWindow]);
+ EXPECT_EQ(1, activationCount_);
+ EXPECT_EQ(0, deactivationCount_);
+
+ // Now check that losing and gaining key status due events outside of Widget
+ // works correctly.
+ Widget* widget2 = MakeWidget(); // Note: not observed.
+ EXPECT_EQ(0, deactivationCount_);
+ widget2->Show();
+ EXPECT_EQ(1, deactivationCount_);
+
+ RunPendingMessages();
+ EXPECT_FALSE(widget->IsActive());
+ EXPECT_EQ(1, deactivationCount_);
+ EXPECT_EQ(1, activationCount_);
+
+ [widget->GetNativeWindow() makeKeyAndOrderFront:nil];
+ RunPendingMessages();
+ EXPECT_TRUE(widget->IsActive());
+ EXPECT_EQ(1, deactivationCount_);
+ EXPECT_EQ(2, activationCount_);
+
+ widget2->CloseNow();
widget->CloseNow();
+
+ EXPECT_EQ(1, deactivationCount_);
+ EXPECT_EQ(2, activationCount_);
}
// Test that ShowInactive does not take keyWindow status from an active window.
diff --git a/ui/views/widget/native_widget_private.h b/ui/views/widget/native_widget_private.h
index ccb15b9..cd52012 100644
--- a/ui/views/widget/native_widget_private.h
+++ b/ui/views/widget/native_widget_private.h
@@ -231,7 +231,7 @@
virtual void RepostNativeEvent(gfx::NativeEvent native_event) = 0;
// Overridden from NativeWidget:
- virtual internal::NativeWidgetPrivate* AsNativeWidgetPrivate() OVERRIDE;
+ virtual internal::NativeWidgetPrivate* AsNativeWidgetPrivate() override;
};
} // namespace internal
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index a1f0813..38fe053 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -64,7 +64,7 @@
private:
// ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE {
+ virtual void OnKeyEvent(ui::KeyEvent* event) override {
CHECK_EQ(ui::EP_PRETARGET, event->phase());
if (event->handled())
return;
@@ -106,7 +106,7 @@
private:
// Overridden from ui::EventHandler:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
DCHECK_EQ(ui::EP_POSTTARGET, event->phase());
if (event->handled())
return;
diff --git a/ui/views/widget/root_view.h b/ui/views/widget/root_view.h
index df01aea..ad2ca4c 100644
--- a/ui/views/widget/root_view.h
+++ b/ui/views/widget/root_view.h
@@ -87,42 +87,42 @@
void LocaleChanged();
// Overridden from FocusTraversable:
- virtual FocusSearch* GetFocusSearch() OVERRIDE;
- virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE;
- virtual View* GetFocusTraversableParentView() OVERRIDE;
+ virtual FocusSearch* GetFocusSearch() override;
+ virtual FocusTraversable* GetFocusTraversableParent() override;
+ virtual View* GetFocusTraversableParentView() override;
// Overridden from ui::EventProcessor:
- virtual ui::EventTarget* GetRootTarget() OVERRIDE;
- virtual void OnEventProcessingStarted(ui::Event* event) OVERRIDE;
- virtual void OnEventProcessingFinished(ui::Event* event) OVERRIDE;
+ virtual ui::EventTarget* GetRootTarget() override;
+ virtual void OnEventProcessingStarted(ui::Event* event) override;
+ virtual void OnEventProcessingFinished(ui::Event* event) override;
// Overridden from View:
- virtual const Widget* GetWidget() const OVERRIDE;
- virtual Widget* GetWidget() OVERRIDE;
- virtual bool IsDrawn() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
- virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
- virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void UpdateParentLayer() OVERRIDE;
+ virtual const Widget* GetWidget() const override;
+ virtual Widget* GetWidget() override;
+ virtual bool IsDrawn() const override;
+ virtual void Layout() override;
+ virtual const char* GetClassName() const override;
+ virtual void SchedulePaintInRect(const gfx::Rect& rect) override;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override;
+ virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual void OnMouseMoved(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
+ virtual void SetMouseHandler(View* new_mouse_handler) override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void UpdateParentLayer() override;
protected:
// Overridden from View:
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
- virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE;
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
+ virtual void VisibilityChanged(View* starting_from, bool is_visible) override;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
virtual gfx::Vector2d CalculateOffsetToAncestorWithLayer(
- ui::Layer** layer_parent) OVERRIDE;
- virtual View::DragInfo* GetDragInfo() OVERRIDE;
+ ui::Layer** layer_parent) override;
+ virtual View::DragInfo* GetDragInfo() override;
private:
friend class ::views::RootViewTargeter;
@@ -154,11 +154,11 @@
View* sibling);
// Overridden from ui::EventDispatcherDelegate:
- virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE;
+ virtual bool CanDispatchToTarget(ui::EventTarget* target) override;
virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target,
- ui::Event* event) OVERRIDE;
+ ui::Event* event) override;
virtual ui::EventDispatchDetails PostDispatchEvent(
- ui::EventTarget* target, const ui::Event& event) OVERRIDE;
+ ui::EventTarget* target, const ui::Event& event) override;
//////////////////////////////////////////////////////////////////////////////
// Tree operations -----------------------------------------------------------
diff --git a/ui/views/widget/root_view_targeter.h b/ui/views/widget/root_view_targeter.h
index e6cad9c..6b10a4e 100644
--- a/ui/views/widget/root_view_targeter.h
+++ b/ui/views/widget/root_view_targeter.h
@@ -31,10 +31,10 @@
// ViewTargeter:
virtual View* FindTargetForGestureEvent(
View* root,
- const ui::GestureEvent& gesture) OVERRIDE;
+ const ui::GestureEvent& gesture) override;
virtual ui::EventTarget* FindNextBestTargetForGestureEvent(
ui::EventTarget* previous_target,
- const ui::GestureEvent& gesture) OVERRIDE;
+ const ui::GestureEvent& gesture) override;
// A pointer to the RootView on which |this| is installed.
internal::RootView* root_view_;
diff --git a/ui/views/widget/root_view_unittest.cc b/ui/views/widget/root_view_unittest.cc
index f4836cd..21b1cc2 100644
--- a/ui/views/widget/root_view_unittest.cc
+++ b/ui/views/widget/root_view_unittest.cc
@@ -19,7 +19,7 @@
explicit DeleteOnKeyEventView(bool* set_on_key) : set_on_key_(set_on_key) {}
virtual ~DeleteOnKeyEventView() {}
- virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE {
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) override {
*set_on_key_ = true;
delete this;
return true;
@@ -89,7 +89,7 @@
virtual void ShowContextMenuForView(
View* source,
const gfx::Point& point,
- ui::MenuSourceType source_type) OVERRIDE {
+ ui::MenuSourceType source_type) override {
show_context_menu_calls_++;
menu_source_view_ = source;
menu_source_type_ = source_type;
@@ -163,7 +163,7 @@
virtual ~GestureHandlingView() {
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
event->SetHandled();
}
diff --git a/ui/views/widget/tooltip_manager_aura.h b/ui/views/widget/tooltip_manager_aura.h
index e723299..73266a1 100644
--- a/ui/views/widget/tooltip_manager_aura.h
+++ b/ui/views/widget/tooltip_manager_aura.h
@@ -38,9 +38,9 @@
static const gfx::FontList& GetDefaultFontList();
// TooltipManager:
- virtual const gfx::FontList& GetFontList() const OVERRIDE;
- virtual void UpdateTooltip() OVERRIDE;
- virtual void TooltipTextChanged(View* view) OVERRIDE;
+ virtual const gfx::FontList& GetFontList() const override;
+ virtual void UpdateTooltip() override;
+ virtual void TooltipTextChanged(View* view) override;
private:
View* GetViewUnderPoint(const gfx::Point& point);
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 52209f8..8469f6d 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -74,16 +74,16 @@
virtual ~DefaultWidgetDelegate() {}
// Overridden from WidgetDelegate:
- virtual void DeleteDelegate() OVERRIDE {
+ virtual void DeleteDelegate() override {
delete this;
}
- virtual Widget* GetWidget() OVERRIDE {
+ virtual Widget* GetWidget() override {
return widget_;
}
- virtual const Widget* GetWidget() const OVERRIDE {
+ virtual const Widget* GetWidget() const override {
return widget_;
}
- virtual bool ShouldAdvanceFocusToTopLevelWidget() const OVERRIDE {
+ virtual bool ShouldAdvanceFocusToTopLevelWidget() const override {
// In most situations where a Widget is used without a delegate the Widget
// is used as a container, so that we want focus to advance to the top-level
// widget. A good example of this is the find bar.
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
index e785d7b..08ab939 100644
--- a/ui/views/widget/widget.h
+++ b/ui/views/widget/widget.h
@@ -742,55 +742,55 @@
virtual void OnOwnerClosing();
// Overridden from NativeWidgetDelegate:
- virtual bool IsModal() const OVERRIDE;
- virtual bool IsDialogBox() const OVERRIDE;
- virtual bool CanActivate() const OVERRIDE;
- virtual bool IsInactiveRenderingDisabled() const OVERRIDE;
- virtual void EnableInactiveRendering() OVERRIDE;
- virtual void OnNativeWidgetActivationChanged(bool active) OVERRIDE;
- virtual void OnNativeFocus(gfx::NativeView old_focused_view) OVERRIDE;
- virtual void OnNativeBlur(gfx::NativeView new_focused_view) OVERRIDE;
- virtual void OnNativeWidgetVisibilityChanging(bool visible) OVERRIDE;
- virtual void OnNativeWidgetVisibilityChanged(bool visible) OVERRIDE;
- virtual void OnNativeWidgetCreated(bool desktop_widget) OVERRIDE;
- virtual void OnNativeWidgetDestroying() OVERRIDE;
- virtual void OnNativeWidgetDestroyed() OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
- virtual void OnNativeWidgetMove() OVERRIDE;
- virtual void OnNativeWidgetSizeChanged(const gfx::Size& new_size) OVERRIDE;
- virtual void OnNativeWidgetWindowShowStateChanged() OVERRIDE;
- virtual void OnNativeWidgetBeginUserBoundsChange() OVERRIDE;
- virtual void OnNativeWidgetEndUserBoundsChange() OVERRIDE;
- virtual bool HasFocusManager() const OVERRIDE;
+ virtual bool IsModal() const override;
+ virtual bool IsDialogBox() const override;
+ virtual bool CanActivate() const override;
+ virtual bool IsInactiveRenderingDisabled() const override;
+ virtual void EnableInactiveRendering() override;
+ virtual void OnNativeWidgetActivationChanged(bool active) override;
+ virtual void OnNativeFocus(gfx::NativeView old_focused_view) override;
+ virtual void OnNativeBlur(gfx::NativeView new_focused_view) override;
+ virtual void OnNativeWidgetVisibilityChanging(bool visible) override;
+ virtual void OnNativeWidgetVisibilityChanged(bool visible) override;
+ virtual void OnNativeWidgetCreated(bool desktop_widget) override;
+ virtual void OnNativeWidgetDestroying() override;
+ virtual void OnNativeWidgetDestroyed() override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
+ virtual void OnNativeWidgetMove() override;
+ virtual void OnNativeWidgetSizeChanged(const gfx::Size& new_size) override;
+ virtual void OnNativeWidgetWindowShowStateChanged() override;
+ virtual void OnNativeWidgetBeginUserBoundsChange() override;
+ virtual void OnNativeWidgetEndUserBoundsChange() override;
+ virtual bool HasFocusManager() const override;
virtual bool OnNativeWidgetPaintAccelerated(
- const gfx::Rect& dirty_region) OVERRIDE;
- virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual int GetNonClientComponent(const gfx::Point& point) OVERRIDE;
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnMouseCaptureLost() OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- virtual bool ExecuteCommand(int command_id) OVERRIDE;
- virtual InputMethod* GetInputMethodDirect() OVERRIDE;
- virtual const std::vector<ui::Layer*>& GetRootLayers() OVERRIDE;
- virtual bool HasHitTestMask() const OVERRIDE;
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE;
- virtual Widget* AsWidget() OVERRIDE;
- virtual const Widget* AsWidget() const OVERRIDE;
- virtual bool SetInitialFocus(ui::WindowShowState show_state) OVERRIDE;
+ const gfx::Rect& dirty_region) override;
+ virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) override;
+ virtual int GetNonClientComponent(const gfx::Point& point) override;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnMouseCaptureLost() override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
+ virtual bool ExecuteCommand(int command_id) override;
+ virtual InputMethod* GetInputMethodDirect() override;
+ virtual const std::vector<ui::Layer*>& GetRootLayers() override;
+ virtual bool HasHitTestMask() const override;
+ virtual void GetHitTestMask(gfx::Path* mask) const override;
+ virtual Widget* AsWidget() override;
+ virtual const Widget* AsWidget() const override;
+ virtual bool SetInitialFocus(ui::WindowShowState show_state) override;
// Overridden from ui::EventSource:
- virtual ui::EventProcessor* GetEventProcessor() OVERRIDE;
+ virtual ui::EventProcessor* GetEventProcessor() override;
// Overridden from FocusTraversable:
- virtual FocusSearch* GetFocusSearch() OVERRIDE;
- virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE;
- virtual View* GetFocusTraversableParentView() OVERRIDE;
+ virtual FocusSearch* GetFocusSearch() override;
+ virtual FocusTraversable* GetFocusTraversableParent() override;
+ virtual View* GetFocusTraversableParentView() override;
// Overridden from ui::NativeThemeObserver:
- virtual void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) OVERRIDE;
+ virtual void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;
protected:
// Creates the RootView to be used within this Widget. Subclasses may override
diff --git a/ui/views/widget/widget_delegate.h b/ui/views/widget/widget_delegate.h
index 422c286..3f67cb4 100644
--- a/ui/views/widget/widget_delegate.h
+++ b/ui/views/widget/widget_delegate.h
@@ -204,9 +204,9 @@
virtual ~WidgetDelegateView();
// Overridden from WidgetDelegate:
- virtual void DeleteDelegate() OVERRIDE;
- virtual Widget* GetWidget() OVERRIDE;
- virtual const Widget* GetWidget() const OVERRIDE;
+ virtual void DeleteDelegate() override;
+ virtual Widget* GetWidget() override;
+ virtual const Widget* GetWidget() const override;
private:
DISALLOW_COPY_AND_ASSIGN(WidgetDelegateView);
diff --git a/ui/views/widget/widget_deletion_observer.h b/ui/views/widget/widget_deletion_observer.h
index 7182d2d..785e132 100644
--- a/ui/views/widget/widget_deletion_observer.h
+++ b/ui/views/widget/widget_deletion_observer.h
@@ -23,7 +23,7 @@
bool IsWidgetAlive() { return widget_ != NULL; }
// Overridden from WidgetObserver.
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE;
+ virtual void OnWidgetDestroying(Widget* widget) override;
private:
void CleanupWidget();
diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc
index 68d646c..681f1d1 100644
--- a/ui/views/widget/widget_interactive_uitest.cc
+++ b/ui/views/widget/widget_interactive_uitest.cc
@@ -47,7 +47,7 @@
private:
// Overridden from View:
- virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE {
+ virtual void OnMouseReleased(const ui::MouseEvent& event) override {
GetWidget()->Close();
base::MessageLoop::current()->QuitNow();
}
@@ -63,7 +63,7 @@
private:
// Overridden from View:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
GetWidget()->SetCapture(this);
event->StopPropagation();
@@ -84,16 +84,16 @@
}
virtual ~MouseView() {}
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE {
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override {
pressed_++;
return true;
}
- virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE {
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override {
entered_++;
}
- virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE {
+ virtual void OnMouseExited(const ui::MouseEvent& event) override {
exited_++;
}
@@ -131,7 +131,7 @@
private:
// Overridden from View:
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE {
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override {
// Start a nested loop.
widget_->Show();
widget_->SetCapture(widget_->GetContentsView());
@@ -157,7 +157,7 @@
WidgetTestInteractive() {}
virtual ~WidgetTestInteractive() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
gfx::GLSurface::InitializeOneOffForTests();
ui::RegisterPathProvider();
base::FilePath ui_test_pak_path;
@@ -587,7 +587,7 @@
virtual ~WidgetActivationTest() {}
- virtual void OnNativeWidgetActivationChanged(bool active) OVERRIDE {
+ virtual void OnNativeWidgetActivationChanged(bool active) override {
active_ = active;
}
@@ -640,7 +640,7 @@
virtual ~ModalDialogDelegate() {}
// WidgetDelegate overrides.
- virtual ui::ModalType GetModalType() const OVERRIDE {
+ virtual ui::ModalType GetModalType() const override {
return type_;
}
@@ -867,7 +867,7 @@
}
// Widget:
- virtual void OnMouseCaptureLost() OVERRIDE {
+ virtual void OnMouseCaptureLost() override {
got_capture_lost_ = true;
Widget::OnMouseCaptureLost();
}
@@ -888,7 +888,7 @@
virtual ~WidgetCaptureTest() {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
gfx::GLSurface::InitializeOneOffForTests();
ui::RegisterPathProvider();
base::FilePath ui_test_pak_path;
@@ -1048,7 +1048,7 @@
}
// WidgetObserver:
- virtual void OnWidgetActivationChanged(Widget* widget, bool active) OVERRIDE {
+ virtual void OnWidgetActivationChanged(Widget* widget, bool active) override {
if (active)
widget->SetCapture(NULL);
}
@@ -1101,7 +1101,7 @@
}
// Widget:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
got_mouse_event_ = true;
Widget::OnMouseEvent(event);
}
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index 5bcc006..12e3cc1 100644
--- a/ui/views/widget/widget_unittest.cc
+++ b/ui/views/widget/widget_unittest.cc
@@ -87,23 +87,23 @@
protected:
// Overridden from View:
- virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE {
+ virtual void OnMouseMoved(const ui::MouseEvent& event) override {
// MouseMove events are not re-dispatched from the RootView.
++event_count_[ui::ET_MOUSE_MOVED];
last_flags_ = 0;
}
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE {
+ virtual void OnKeyEvent(ui::KeyEvent* event) override {
RecordEvent(event);
}
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
RecordEvent(event);
}
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE {
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override {
RecordEvent(event);
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
RecordEvent(event);
}
@@ -131,7 +131,7 @@
private:
// Overridden from ui::EventHandler:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
EventCountView::OnGestureEvent(event);
switch (event->type()) {
case ui::ET_GESTURE_SCROLL_BEGIN:
@@ -145,7 +145,7 @@
}
}
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE {
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override {
EventCountView::OnScrollEvent(event);
if (event->type() == ui::ET_SCROLL)
event->SetHandled();
@@ -162,7 +162,7 @@
private:
// Overridden from View:
- virtual gfx::Size GetMinimumSize() const OVERRIDE {
+ virtual gfx::Size GetMinimumSize() const override {
return gfx::Size(300, 400);
}
@@ -186,7 +186,7 @@
protected:
// Overridden from ui::EventHandler:
- virtual void OnEvent(ui::Event* event) OVERRIDE {
+ virtual void OnEvent(ui::Event* event) override {
RecordEvent(*event);
ui::EventHandler::OnEvent(event);
}
@@ -210,7 +210,7 @@
}
// ui::EventHandler override:
- virtual void OnEvent(ui::Event* event) OVERRIDE {
+ virtual void OnEvent(ui::Event* event) override {
if (event->type() == event_type_) {
// Go through NativeWidgetPrivate to simulate what happens if the OS
// deletes the NativeWindow out from under us.
@@ -718,14 +718,14 @@
virtual ~WidgetObserverTest() {}
// Overridden from WidgetObserver:
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE {
+ virtual void OnWidgetDestroying(Widget* widget) override {
if (active_ == widget)
active_ = NULL;
widget_closed_ = widget;
}
virtual void OnWidgetActivationChanged(Widget* widget,
- bool active) OVERRIDE {
+ bool active) override {
if (active) {
if (widget_activated_)
widget_activated_->Deactivate();
@@ -739,7 +739,7 @@
}
virtual void OnWidgetVisibilityChanged(Widget* widget,
- bool visible) OVERRIDE {
+ bool visible) override {
if (visible)
widget_shown_ = widget;
else
@@ -747,7 +747,7 @@
}
virtual void OnWidgetBoundsChanged(Widget* widget,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
widget_bounds_changed_ = widget;
}
@@ -928,7 +928,9 @@
widget->CloseNow();
}
-#if defined(false)
+// Before being enabled on Mac, this was #ifdef(false).
+// TODO(tapted): Fix this for DesktopNativeWidgets on other platforms.
+#if defined(OS_MACOSX)
// Aura needs shell to maximize/fullscreen window.
// NativeWidgetGtk doesn't implement GetRestoredBounds.
TEST_F(WidgetTest, GetRestoredBounds) {
@@ -938,8 +940,14 @@
toplevel->Show();
toplevel->Maximize();
RunPendingMessages();
+#if defined(OS_MACOSX)
+ // Current expectation on Mac is to do nothing on Maximize.
+ EXPECT_EQ(toplevel->GetWindowBoundsInScreen().ToString(),
+ toplevel->GetRestoredBounds().ToString());
+#else
EXPECT_NE(toplevel->GetWindowBoundsInScreen().ToString(),
toplevel->GetRestoredBounds().ToString());
+#endif
EXPECT_GT(toplevel->GetRestoredBounds().width(), 0);
EXPECT_GT(toplevel->GetRestoredBounds().height(), 0);
@@ -975,6 +983,9 @@
// And it should still be in normal state after getting out of full screen.
EXPECT_EQ(ui::SHOW_STATE_NORMAL, GetWidgetShowState(toplevel));
+// On Mac, a "maximized" state is indistinguishable from a window that just
+// fills the screen, so nothing to check there.
+#if !defined(OS_MACOSX)
// Now, make it maximized.
toplevel->Maximize();
EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, GetWidgetShowState(toplevel));
@@ -986,6 +997,7 @@
// And it stays maximized after getting out of full screen.
EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, GetWidgetShowState(toplevel));
+#endif
// Clean up.
toplevel->Close();
@@ -1062,7 +1074,7 @@
reset_controls_called_(false) {}
virtual ~TestBubbleDelegateView() {}
- virtual bool ShouldShowCloseButton() const OVERRIDE {
+ virtual bool ShouldShowCloseButton() const override {
reset_controls_called_ = true;
return true;
}
@@ -1120,12 +1132,12 @@
virtual ~DesktopAuraTestValidPaintWidget() {
}
- virtual void Show() OVERRIDE {
+ virtual void Show() override {
expect_paint_ = true;
views::Widget::Show();
}
- virtual void Close() OVERRIDE {
+ virtual void Close() override {
expect_paint_ = false;
views::Widget::Close();
}
@@ -1135,7 +1147,7 @@
views::Widget::Hide();
}
- virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE {
+ virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) override {
EXPECT_TRUE(expect_paint_);
if (!expect_paint_)
received_paint_while_hidden_ = true;
@@ -1551,7 +1563,7 @@
private:
// ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
if (event->type() == ui::ET_MOUSE_PRESSED)
event->SetHandled();
}
@@ -1596,9 +1608,9 @@
void set_widget(views::Widget* widget) { widget_ = widget; }
// WidgetDelegate overrides:
- virtual Widget* GetWidget() OVERRIDE { return widget_; }
- virtual const Widget* GetWidget() const OVERRIDE { return widget_; }
- virtual void WindowClosing() OVERRIDE {
+ virtual Widget* GetWidget() override { return widget_; }
+ virtual const Widget* GetWidget() const override { return widget_; }
+ virtual void WindowClosing() override {
count_++;
}
@@ -1732,7 +1744,7 @@
VerifyNativeTheme();
}
- virtual View* GetContentsView() OVERRIDE {
+ virtual View* GetContentsView() override {
return this;
}
@@ -1807,7 +1819,7 @@
bool animation_completed() const { return animation_completed_; }
// ui::ImplicitAnimationObserver:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE {
+ virtual void OnImplicitAnimationsCompleted() override {
animation_completed_ = true;
}
@@ -1826,7 +1838,7 @@
gfx::Rect bounds() { return bounds_; }
// WidgetObserver:
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE {
+ virtual void OnWidgetDestroying(Widget* widget) override {
bounds_ = widget->GetWindowBoundsInScreen();
}
@@ -1897,11 +1909,11 @@
RootViewTestView(): View() {}
private:
- virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE {
+ virtual bool OnMousePressed(const ui::MouseEvent& event) override {
return true;
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
if (event->type() == ui::ET_GESTURE_TAP_DOWN)
event->SetHandled();
}
@@ -2447,7 +2459,7 @@
}
// EventCountView:
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
EventCountView::OnGestureEvent(event);
// Verify that the location of |event| is in the local coordinate
@@ -2774,7 +2786,7 @@
virtual ~ModalDialogDelegate() {}
// WidgetDelegate overrides.
- virtual ui::ModalType GetModalType() const OVERRIDE {
+ virtual ui::ModalType GetModalType() const override {
return ui::MODAL_TYPE_WINDOW;
}
@@ -2903,19 +2915,19 @@
virtual ~ModalWindowTestWidgetDelegate() {}
// Overridden from WidgetDelegate:
- virtual void DeleteDelegate() OVERRIDE {
+ virtual void DeleteDelegate() override {
delete this;
}
- virtual Widget* GetWidget() OVERRIDE {
+ virtual Widget* GetWidget() override {
return widget_;
}
- virtual const Widget* GetWidget() const OVERRIDE {
+ virtual const Widget* GetWidget() const override {
return widget_;
}
- virtual bool CanActivate() const OVERRIDE {
+ virtual bool CanActivate() const override {
return can_activate_;
}
- virtual bool ShouldAdvanceFocusToTopLevelWidget() const OVERRIDE {
+ virtual bool ShouldAdvanceFocusToTopLevelWidget() const override {
return true;
}
@@ -3086,25 +3098,25 @@
virtual ~FullscreenAwareFrame() {}
// views::NonClientFrameView overrides:
- virtual gfx::Rect GetBoundsForClientView() const OVERRIDE {
+ virtual gfx::Rect GetBoundsForClientView() const override {
return gfx::Rect();
}
virtual gfx::Rect GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds) const OVERRIDE {
+ const gfx::Rect& client_bounds) const override {
return gfx::Rect();
}
- virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE {
+ virtual int NonClientHitTest(const gfx::Point& point) override {
return HTNOWHERE;
}
virtual void GetWindowMask(const gfx::Size& size,
- gfx::Path* window_mask) OVERRIDE {}
- virtual void ResetWindowControls() OVERRIDE {}
- virtual void UpdateWindowIcon() OVERRIDE {}
- virtual void UpdateWindowTitle() OVERRIDE {}
- virtual void SizeConstraintsChanged() OVERRIDE {}
+ gfx::Path* window_mask) override {}
+ virtual void ResetWindowControls() override {}
+ virtual void UpdateWindowIcon() override {}
+ virtual void UpdateWindowTitle() override {}
+ virtual void SizeConstraintsChanged() override {}
// views::View overrides:
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
if (widget_->IsFullscreen())
fullscreen_layout_called_ = true;
}
@@ -3148,7 +3160,7 @@
public:
IsActiveFromDestroyObserver() {}
virtual ~IsActiveFromDestroyObserver() {}
- virtual void OnWidgetDestroying(Widget* widget) OVERRIDE {
+ virtual void OnWidgetDestroying(Widget* widget) override {
widget->IsActive();
}
diff --git a/ui/views/widget/window_reorderer.cc b/ui/views/widget/window_reorderer.cc
index dcf51c8..098796c 100644
--- a/ui/views/widget/window_reorderer.cc
+++ b/ui/views/widget/window_reorderer.cc
@@ -71,8 +71,8 @@
// aura::WindowObserver overrides:
virtual void OnWindowPropertyChanged(aura::Window* window,
const void* key,
- intptr_t old) OVERRIDE;
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
+ intptr_t old) override;
+ virtual void OnWindowDestroying(aura::Window* window) override;
// Not owned.
WindowReorderer* reorderer_;
diff --git a/ui/views/widget/window_reorderer.h b/ui/views/widget/window_reorderer.h
index b04e48f..5091cf4 100644
--- a/ui/views/widget/window_reorderer.h
+++ b/ui/views/widget/window_reorderer.h
@@ -37,9 +37,9 @@
private:
// aura::WindowObserver overrides:
- virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE;
- virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE;
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
+ virtual void OnWindowAdded(aura::Window* new_window) override;
+ virtual void OnWillRemoveWindow(aura::Window* window) override;
+ virtual void OnWindowDestroying(aura::Window* window) override;
// The window and the root view of the native widget which owns the
// WindowReorderer.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 744b9ea..1544507 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1431,10 +1431,11 @@
CR_DEFLATE_RECT(&window_rect, &client_rect);
min_window_size.Enlarge(window_rect.right - window_rect.left,
window_rect.bottom - window_rect.top);
- if (!max_window_size.IsEmpty()) {
- max_window_size.Enlarge(window_rect.right - window_rect.left,
- window_rect.bottom - window_rect.top);
- }
+ // Either axis may be zero, so enlarge them independently.
+ if (max_window_size.width())
+ max_window_size.Enlarge(window_rect.right - window_rect.left, 0);
+ if (max_window_size.height())
+ max_window_size.Enlarge(0, window_rect.bottom - window_rect.top);
}
minmax_info->ptMinTrackSize.x = min_window_size.width();
minmax_info->ptMinTrackSize.y = min_window_size.height();
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index f19dfef..86d3d52 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -212,37 +212,37 @@
typedef std::set<DWORD> TouchIDs;
// Overridden from internal::InputMethodDelegate:
- virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE;
+ virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) override;
// Overridden from WindowImpl:
- virtual HICON GetDefaultWindowIcon() const OVERRIDE;
+ virtual HICON GetDefaultWindowIcon() const override;
virtual LRESULT OnWndProc(UINT message,
WPARAM w_param,
- LPARAM l_param) OVERRIDE;
+ LPARAM l_param) override;
// Overridden from WindowEventTarget
virtual LRESULT HandleMouseMessage(unsigned int message,
WPARAM w_param,
LPARAM l_param,
- bool* handled) OVERRIDE;
+ bool* handled) override;
virtual LRESULT HandleKeyboardMessage(unsigned int message,
WPARAM w_param,
LPARAM l_param,
- bool* handled) OVERRIDE;
+ bool* handled) override;
virtual LRESULT HandleTouchMessage(unsigned int message,
WPARAM w_param,
LPARAM l_param,
- bool* handled) OVERRIDE;
+ bool* handled) override;
virtual LRESULT HandleScrollMessage(unsigned int message,
WPARAM w_param,
LPARAM l_param,
- bool* handled) OVERRIDE;
+ bool* handled) override;
virtual LRESULT HandleNcHitTestMessage(unsigned int message,
WPARAM w_param,
LPARAM l_param,
- bool* handled) OVERRIDE;
+ bool* handled) override;
// Returns the auto-hide edges of the appbar. See
// ViewsDelegate::GetAppbarAutohideEdges() for details. If the edges change,
diff --git a/ui/views/window/client_view.h b/ui/views/window/client_view.h
index 5a329aa..53d393b 100644
--- a/ui/views/window/client_view.h
+++ b/ui/views/window/client_view.h
@@ -57,18 +57,18 @@
virtual int NonClientHitTest(const gfx::Point& point);
// Overridden from View:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
+ virtual void Layout() override;
+ virtual const char* GetClassName() const override;
protected:
// Overridden from View:
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
// Accessors for private data members.
View* contents_view() const { return contents_view_; }
diff --git a/ui/views/window/custom_frame_view.h b/ui/views/window/custom_frame_view.h
index f2f738b..a09dd33 100644
--- a/ui/views/window/custom_frame_view.h
+++ b/ui/views/window/custom_frame_view.h
@@ -39,26 +39,26 @@
void Init(Widget* frame);
// Overridden from NonClientFrameView:
- virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
+ virtual gfx::Rect GetBoundsForClientView() const override;
virtual gfx::Rect GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds) const OVERRIDE;
- virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
+ const gfx::Rect& client_bounds) const override;
+ virtual int NonClientHitTest(const gfx::Point& point) override;
virtual void GetWindowMask(const gfx::Size& size,
- gfx::Path* window_mask) OVERRIDE;
- virtual void ResetWindowControls() OVERRIDE;
- virtual void UpdateWindowIcon() OVERRIDE;
- virtual void UpdateWindowTitle() OVERRIDE;
- virtual void SizeConstraintsChanged() OVERRIDE;
+ gfx::Path* window_mask) override;
+ virtual void ResetWindowControls() override;
+ virtual void UpdateWindowIcon() override;
+ virtual void UpdateWindowTitle() override;
+ virtual void SizeConstraintsChanged() override;
// Overridden from View:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
+ virtual void OnPaint(gfx::Canvas* canvas) override;
+ virtual void Layout() override;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
// Overridden from ButtonListener:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
private:
friend class CustomFrameViewTest;
diff --git a/ui/views/window/custom_frame_view_unittest.cc b/ui/views/window/custom_frame_view_unittest.cc
index f4dc37a..68c79e8 100644
--- a/ui/views/window/custom_frame_view_unittest.cc
+++ b/ui/views/window/custom_frame_view_unittest.cc
@@ -35,8 +35,8 @@
}
// WidgetDelegate:
- virtual bool CanMaximize() const OVERRIDE { return can_maximize_; }
- virtual bool CanMinimize() const OVERRIDE { return can_minimize_; }
+ virtual bool CanMaximize() const override { return can_maximize_; }
+ virtual bool CanMinimize() const override { return can_minimize_; }
private:
bool can_maximize_;
@@ -66,8 +66,8 @@
}
// ViewsTestBase:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
protected:
const std::vector<views::FrameButton>& leading_buttons() {
diff --git a/ui/views/window/dialog_client_view.h b/ui/views/window/dialog_client_view.h
index 1e8ced1..bf38f25 100644
--- a/ui/views/window/dialog_client_view.h
+++ b/ui/views/window/dialog_client_view.h
@@ -46,27 +46,27 @@
void UpdateDialogButtons();
// ClientView implementation:
- virtual bool CanClose() OVERRIDE;
- virtual DialogClientView* AsDialogClientView() OVERRIDE;
- virtual const DialogClientView* AsDialogClientView() const OVERRIDE;
+ virtual bool CanClose() override;
+ virtual DialogClientView* AsDialogClientView() override;
+ virtual const DialogClientView* AsDialogClientView() const override;
// FocusChangeListener implementation:
virtual void OnWillChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
virtual void OnDidChangeFocus(View* focused_before,
- View* focused_now) OVERRIDE;
+ View* focused_now) override;
// View implementation:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual void Layout() override;
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
- virtual void NativeViewHierarchyChanged() OVERRIDE;
- virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
+ virtual void NativeViewHierarchyChanged() override;
+ virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
// ButtonListener implementation:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override;
protected:
// For testing.
@@ -82,8 +82,8 @@
void CreateFootnoteView();
// View implementation.
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
- virtual void ChildVisibilityChanged(View* child) OVERRIDE;
+ virtual void ChildPreferredSizeChanged(View* child) override;
+ virtual void ChildVisibilityChanged(View* child) override;
private:
FRIEND_TEST_ALL_PREFIXES(DialogClientViewTest, FocusManager);
diff --git a/ui/views/window/dialog_client_view_unittest.cc b/ui/views/window/dialog_client_view_unittest.cc
index 28b001f..6f4812c 100644
--- a/ui/views/window/dialog_client_view_unittest.cc
+++ b/ui/views/window/dialog_client_view_unittest.cc
@@ -23,7 +23,7 @@
virtual ~TestDialogClientView() {}
// DialogClientView implementation.
- virtual DialogDelegate* GetDialogDelegate() const OVERRIDE { return dialog_; }
+ virtual DialogDelegate* GetDialogDelegate() const override { return dialog_; }
View* GetContentsView() { return contents_view(); }
@@ -48,7 +48,7 @@
virtual ~DialogClientViewTest() {}
// testing::Test implementation.
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
dialog_buttons_ = ui::DIALOG_BUTTON_NONE;
contents_.reset(new StaticSizedView(gfx::Size(100, 200)));
client_view_.reset(new TestDialogClientView(contents_.get(), this));
@@ -57,10 +57,10 @@
}
// DialogDelegateView implementation.
- virtual View* GetContentsView() OVERRIDE { return contents_.get(); }
- virtual View* CreateExtraView() OVERRIDE { return extra_view_; }
- virtual View* CreateFootnoteView() OVERRIDE { return footnote_view_; }
- virtual int GetDialogButtons() const OVERRIDE { return dialog_buttons_; }
+ virtual View* GetContentsView() override { return contents_.get(); }
+ virtual View* CreateExtraView() override { return extra_view_; }
+ virtual View* CreateFootnoteView() override { return footnote_view_; }
+ virtual int GetDialogButtons() const override { return dialog_buttons_; }
protected:
gfx::Rect GetUpdatedClientBounds() {
diff --git a/ui/views/window/dialog_delegate.h b/ui/views/window/dialog_delegate.h
index 8a2533e..d2294c2 100644
--- a/ui/views/window/dialog_delegate.h
+++ b/ui/views/window/dialog_delegate.h
@@ -83,20 +83,20 @@
virtual bool Close();
// Overridden from ui::DialogModel:
- virtual base::string16 GetDialogLabel() const OVERRIDE;
- virtual base::string16 GetDialogTitle() const OVERRIDE;
- virtual int GetDialogButtons() const OVERRIDE;
- virtual int GetDefaultDialogButton() const OVERRIDE;
- virtual bool ShouldDefaultButtonBeBlue() const OVERRIDE;
+ virtual base::string16 GetDialogLabel() const override;
+ virtual base::string16 GetDialogTitle() const override;
+ virtual int GetDialogButtons() const override;
+ virtual int GetDefaultDialogButton() const override;
+ virtual bool ShouldDefaultButtonBeBlue() const override;
virtual base::string16 GetDialogButtonLabel(
- ui::DialogButton button) const OVERRIDE;
- virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE;
+ ui::DialogButton button) const override;
+ virtual bool IsDialogButtonEnabled(ui::DialogButton button) const override;
// Overridden from WidgetDelegate:
- virtual View* GetInitiallyFocusedView() OVERRIDE;
- virtual DialogDelegate* AsDialogDelegate() OVERRIDE;
- virtual ClientView* CreateClientView(Widget* widget) OVERRIDE;
- virtual NonClientFrameView* CreateNonClientFrameView(Widget* widget) OVERRIDE;
+ virtual View* GetInitiallyFocusedView() override;
+ virtual DialogDelegate* AsDialogDelegate() override;
+ virtual ClientView* CreateClientView(Widget* widget) override;
+ virtual NonClientFrameView* CreateNonClientFrameView(Widget* widget) override;
// Create a frame view using the new dialog style.
static NonClientFrameView* CreateDialogFrameView(Widget* widget);
@@ -114,7 +114,7 @@
protected:
// Overridden from WidgetDelegate:
- virtual ui::AXRole GetAccessibleWindowRole() const OVERRIDE;
+ virtual ui::AXRole GetAccessibleWindowRole() const override;
private:
// A flag indicating whether this dialog supports the new style.
@@ -132,10 +132,10 @@
virtual ~DialogDelegateView();
// Overridden from DialogDelegate:
- virtual void DeleteDelegate() OVERRIDE;
- virtual Widget* GetWidget() OVERRIDE;
- virtual const Widget* GetWidget() const OVERRIDE;
- virtual View* GetContentsView() OVERRIDE;
+ virtual void DeleteDelegate() override;
+ virtual Widget* GetWidget() override;
+ virtual const Widget* GetWidget() const override;
+ virtual View* GetContentsView() override;
private:
DISALLOW_COPY_AND_ASSIGN(DialogDelegateView);
diff --git a/ui/views/window/dialog_delegate_unittest.cc b/ui/views/window/dialog_delegate_unittest.cc
index b355104..bbfa66b 100644
--- a/ui/views/window/dialog_delegate_unittest.cc
+++ b/ui/views/window/dialog_delegate_unittest.cc
@@ -27,24 +27,24 @@
virtual ~TestDialog() {}
// DialogDelegateView overrides:
- virtual bool Cancel() OVERRIDE {
+ virtual bool Cancel() override {
canceled_ = true;
return closeable_;
}
- virtual bool Accept() OVERRIDE {
+ virtual bool Accept() override {
accepted_ = true;
return closeable_;
}
// DialogDelegateView overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE {
+ virtual gfx::Size GetPreferredSize() const override {
return gfx::Size(200, 200);
}
- virtual base::string16 GetWindowTitle() const OVERRIDE { return title_; }
- virtual bool UseNewStyleForThisDialog() const OVERRIDE { return true; }
+ virtual base::string16 GetWindowTitle() const override { return title_; }
+ virtual bool UseNewStyleForThisDialog() const override { return true; }
// ButtonListener override:
- virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE {
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) override {
last_pressed_button_ = sender;
}
@@ -94,13 +94,13 @@
DialogTest() : dialog_(NULL) {}
virtual ~DialogTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ViewsTestBase::SetUp();
dialog_ = new TestDialog();
DialogDelegate::CreateDialogWidget(dialog_, GetContext(), NULL)->Show();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
dialog_->TearDown();
ViewsTestBase::TearDown();
}
diff --git a/ui/views/window/native_frame_view.h b/ui/views/window/native_frame_view.h
index 444bf96..3f4d09a 100644
--- a/ui/views/window/native_frame_view.h
+++ b/ui/views/window/native_frame_view.h
@@ -19,22 +19,22 @@
virtual ~NativeFrameView();
// NonClientFrameView overrides:
- virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
+ virtual gfx::Rect GetBoundsForClientView() const override;
virtual gfx::Rect GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds) const OVERRIDE;
- virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
+ const gfx::Rect& client_bounds) const override;
+ virtual int NonClientHitTest(const gfx::Point& point) override;
virtual void GetWindowMask(const gfx::Size& size,
- gfx::Path* window_mask) OVERRIDE;
- virtual void ResetWindowControls() OVERRIDE;
- virtual void UpdateWindowIcon() OVERRIDE;
- virtual void UpdateWindowTitle() OVERRIDE;
- virtual void SizeConstraintsChanged() OVERRIDE;
+ gfx::Path* window_mask) override;
+ virtual void ResetWindowControls() override;
+ virtual void UpdateWindowIcon() override;
+ virtual void UpdateWindowTitle() override;
+ virtual void SizeConstraintsChanged() override;
// View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
+ virtual const char* GetClassName() const override;
private:
// Our containing frame.
diff --git a/ui/views/window/non_client_view.h b/ui/views/window/non_client_view.h
index 434b782..99a6880 100644
--- a/ui/views/window/non_client_view.h
+++ b/ui/views/window/non_client_view.h
@@ -82,18 +82,18 @@
virtual void SizeConstraintsChanged() = 0;
// View:
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual const char* GetClassName() const override;
protected:
NonClientFrameView();
// ViewTargeterDelegate:
virtual bool DoesIntersectRect(const View* target,
- const gfx::Rect& rect) const OVERRIDE;
+ const gfx::Rect& rect) const override;
// View:
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
private:
// Prevents the non-client frame view from being rendered as inactive when
@@ -215,24 +215,24 @@
void SetAccessibleName(const base::string16& name);
// NonClientView, View overrides:
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
- virtual gfx::Size GetMinimumSize() const OVERRIDE;
- virtual gfx::Size GetMaximumSize() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
- virtual const char* GetClassName() const OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const override;
+ virtual gfx::Size GetMinimumSize() const override;
+ virtual gfx::Size GetMaximumSize() const override;
+ virtual void Layout() override;
+ virtual void GetAccessibleState(ui::AXViewState* state) override;
+ virtual const char* GetClassName() const override;
virtual views::View* GetTooltipHandlerForPoint(
- const gfx::Point& point) OVERRIDE;
+ const gfx::Point& point) override;
protected:
// NonClientView, View overrides:
virtual void ViewHierarchyChanged(
- const ViewHierarchyChangedDetails& details) OVERRIDE;
+ const ViewHierarchyChangedDetails& details) override;
private:
// ViewTargeterDelegate:
- virtual View* TargetForRect(View* root, const gfx::Rect& rect) OVERRIDE;
+ virtual View* TargetForRect(View* root, const gfx::Rect& rect) override;
// A ClientView object or subclass, responsible for sizing the contents view
// of the window, hit testing and perhaps other tasks depending on the
diff --git a/ui/views_content_client/views_content_browser_client.h b/ui/views_content_client/views_content_browser_client.h
index f01cd3a..a24ece9 100644
--- a/ui/views_content_client/views_content_browser_client.h
+++ b/ui/views_content_client/views_content_browser_client.h
@@ -25,11 +25,11 @@
// content::ContentBrowserClient:
virtual content::BrowserMainParts* CreateBrowserMainParts(
- const content::MainFunctionParams& parameters) OVERRIDE;
+ const content::MainFunctionParams& parameters) override;
virtual net::URLRequestContextGetter* CreateRequestContext(
content::BrowserContext* browser_context,
content::ProtocolHandlerMap* protocol_handlers,
- content::URLRequestInterceptorScopedVector request_interceptors) OVERRIDE;
+ content::URLRequestInterceptorScopedVector request_interceptors) override;
private:
ViewsContentClientMainParts* views_content_main_parts_;
diff --git a/ui/views_content_client/views_content_client_main_parts.h b/ui/views_content_client/views_content_client_main_parts.h
index 113e352..1e9ad4d 100644
--- a/ui/views_content_client/views_content_client_main_parts.h
+++ b/ui/views_content_client/views_content_client_main_parts.h
@@ -32,9 +32,9 @@
virtual ~ViewsContentClientMainParts();
// content::BrowserMainParts:
- virtual void PreMainMessageLoopRun() OVERRIDE;
- virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
- virtual void PostMainMessageLoopRun() OVERRIDE;
+ virtual void PreMainMessageLoopRun() override;
+ virtual bool MainMessageLoopRun(int* result_code) override;
+ virtual void PostMainMessageLoopRun() override;
content::ShellBrowserContext* browser_context() {
return browser_context_.get();
diff --git a/ui/views_content_client/views_content_client_main_parts_aura.h b/ui/views_content_client/views_content_client_main_parts_aura.h
index 06b273a..4a8f56d 100644
--- a/ui/views_content_client/views_content_client_main_parts_aura.h
+++ b/ui/views_content_client/views_content_client_main_parts_aura.h
@@ -23,8 +23,8 @@
virtual ~ViewsContentClientMainPartsAura();
// content::BrowserMainParts:
- virtual void ToolkitInitialized() OVERRIDE;
- virtual void PostMainMessageLoopRun() OVERRIDE;
+ virtual void ToolkitInitialized() override;
+ virtual void PostMainMessageLoopRun() override;
private:
scoped_ptr< ::wm::WMState> wm_state_;
diff --git a/ui/views_content_client/views_content_client_main_parts_chromeos.cc b/ui/views_content_client/views_content_client_main_parts_chromeos.cc
index b2d304e..5198eeb 100644
--- a/ui/views_content_client/views_content_client_main_parts_chromeos.cc
+++ b/ui/views_content_client/views_content_client_main_parts_chromeos.cc
@@ -25,7 +25,7 @@
// ::wm::NestedAcceleratorDelegate:
virtual Result ProcessAccelerator(
- const ui::Accelerator& accelerator) OVERRIDE {
+ const ui::Accelerator& accelerator) override {
return RESULT_NOT_PROCESSED;
}
@@ -42,8 +42,8 @@
virtual ~ViewsContentClientMainPartsChromeOS() {}
// content::BrowserMainParts:
- virtual void PreMainMessageLoopRun() OVERRIDE;
- virtual void PostMainMessageLoopRun() OVERRIDE;
+ virtual void PreMainMessageLoopRun() override;
+ virtual void PostMainMessageLoopRun() override;
private:
// Enable a minimal set of views::corewm to be initialized.
diff --git a/ui/views_content_client/views_content_client_main_parts_desktop_aura.cc b/ui/views_content_client/views_content_client_main_parts_desktop_aura.cc
index ec8b75b..cb2293b 100644
--- a/ui/views_content_client/views_content_client_main_parts_desktop_aura.cc
+++ b/ui/views_content_client/views_content_client_main_parts_desktop_aura.cc
@@ -22,7 +22,7 @@
virtual ~ViewsContentClientMainPartsDesktopAura() {}
// content::BrowserMainParts:
- virtual void PreMainMessageLoopRun() OVERRIDE;
+ virtual void PreMainMessageLoopRun() override;
private:
DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsDesktopAura);
diff --git a/ui/views_content_client/views_content_client_main_parts_mac.mm b/ui/views_content_client/views_content_client_main_parts_mac.mm
index 2c86c37..afeae12 100644
--- a/ui/views_content_client/views_content_client_main_parts_mac.mm
+++ b/ui/views_content_client/views_content_client_main_parts_mac.mm
@@ -7,6 +7,7 @@
#include "base/files/file_path.h"
#include "base/mac/scoped_nsobject.h"
#include "base/path_service.h"
+#include "content/public/browser/plugin_service.h"
#include "content/public/common/content_paths.h"
#include "content/shell/browser/shell_browser_context.h"
#include "ui/views_content_client/views_content_client.h"
@@ -36,7 +37,7 @@
virtual ~ViewsContentClientMainPartsMac();
// content::BrowserMainParts:
- virtual void PreMainMessageLoopRun() OVERRIDE;
+ virtual void PreMainMessageLoopRun() override;
private:
base::scoped_nsobject<ViewsContentClientAppController> app_controller_;
@@ -52,6 +53,10 @@
base::FilePath child_process_exe;
PathService::Get(content::CHILD_PROCESS_EXE, &child_process_exe);
+ // Disable plugin discovery since NPAPI plugin support on Mac requires this to
+ // be done in a utility process type which isn't bundled with this executable.
+ content::PluginService::GetInstance()->DisablePluginsDiscoveryForTesting();
+
app_controller_.reset([[ViewsContentClientAppController alloc] init]);
[[NSApplication sharedApplication] setDelegate:app_controller_];
}
diff --git a/ui/views_content_client/views_content_main_delegate.h b/ui/views_content_client/views_content_main_delegate.h
index f56eece..646201a 100644
--- a/ui/views_content_client/views_content_main_delegate.h
+++ b/ui/views_content_client/views_content_main_delegate.h
@@ -21,9 +21,9 @@
virtual ~ViewsContentMainDelegate();
// content::ContentMainDelegate implementation
- virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
- virtual void PreSandboxStartup() OVERRIDE;
- virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE;
+ virtual bool BasicStartupComplete(int* exit_code) override;
+ virtual void PreSandboxStartup() override;
+ virtual content::ContentBrowserClient* CreateContentBrowserClient() override;
private:
scoped_ptr<ViewsContentBrowserClient> browser_client_;
diff --git a/ui/web_dialogs/test/test_web_contents_handler.h b/ui/web_dialogs/test/test_web_contents_handler.h
index abe2c73..86e197b 100644
--- a/ui/web_dialogs/test/test_web_contents_handler.h
+++ b/ui/web_dialogs/test/test_web_contents_handler.h
@@ -23,13 +23,13 @@
virtual content::WebContents* OpenURLFromTab(
content::BrowserContext* context,
content::WebContents* source,
- const content::OpenURLParams& params) OVERRIDE;
+ const content::OpenURLParams& params) override;
virtual void AddNewContents(content::BrowserContext* context,
content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
- bool user_gesture) OVERRIDE;
+ bool user_gesture) override;
DISALLOW_COPY_AND_ASSIGN(TestWebContentsHandler);
};
diff --git a/ui/web_dialogs/test/test_web_dialog_delegate.h b/ui/web_dialogs/test/test_web_dialog_delegate.h
index 18a73b2..b289536 100644
--- a/ui/web_dialogs/test/test_web_dialog_delegate.h
+++ b/ui/web_dialogs/test/test_web_dialog_delegate.h
@@ -25,17 +25,17 @@
}
// WebDialogDelegate implementation:
- virtual ModalType GetDialogModalType() const OVERRIDE;
- virtual base::string16 GetDialogTitle() const OVERRIDE;
- virtual GURL GetDialogContentURL() const OVERRIDE;
+ virtual ModalType GetDialogModalType() const override;
+ virtual base::string16 GetDialogTitle() const override;
+ virtual GURL GetDialogContentURL() const override;
virtual void GetWebUIMessageHandlers(
- std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
- virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
- virtual std::string GetDialogArgs() const OVERRIDE;
- virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
+ std::vector<content::WebUIMessageHandler*>* handlers) const override;
+ virtual void GetDialogSize(gfx::Size* size) const override;
+ virtual std::string GetDialogArgs() const override;
+ virtual void OnDialogClosed(const std::string& json_retval) override;
virtual void OnCloseContents(content::WebContents* source,
- bool* out_close_dialog) OVERRIDE;
- virtual bool ShouldShowDialogTitle() const OVERRIDE;
+ bool* out_close_dialog) override;
+ virtual bool ShouldShowDialogTitle() const override;
protected:
const GURL url_;
diff --git a/ui/web_dialogs/web_dialog_ui.h b/ui/web_dialogs/web_dialog_ui.h
index 99dce4f..144b8c7 100644
--- a/ui/web_dialogs/web_dialog_ui.h
+++ b/ui/web_dialogs/web_dialog_ui.h
@@ -69,7 +69,7 @@
private:
// WebUIController
virtual void RenderViewCreated(
- content::RenderViewHost* render_view_host) OVERRIDE;
+ content::RenderViewHost* render_view_host) override;
// Gets the delegate for the WebContent set with SetDelegate.
static WebDialogDelegate* GetDelegate(content::WebContents* web_contents);
diff --git a/ui/web_dialogs/web_dialog_web_contents_delegate.h b/ui/web_dialogs/web_dialog_web_contents_delegate.h
index 50b4a65..d5ed725 100644
--- a/ui/web_dialogs/web_dialog_web_contents_delegate.h
+++ b/ui/web_dialogs/web_dialog_web_contents_delegate.h
@@ -55,18 +55,18 @@
// content::WebContentsDelegate declarations.
virtual content::WebContents* OpenURLFromTab(
content::WebContents* source,
- const content::OpenURLParams& params) OVERRIDE;
+ const content::OpenURLParams& params) override;
virtual void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
bool user_gesture,
- bool* was_blocked) OVERRIDE;
+ bool* was_blocked) override;
virtual bool IsPopupOrPanel(
- const content::WebContents* source) const OVERRIDE;
+ const content::WebContents* source) const override;
virtual bool PreHandleGestureEvent(
content::WebContents* source,
- const blink::WebGestureEvent& event) OVERRIDE;
+ const blink::WebGestureEvent& event) override;
private:
// Weak pointer. Always an original profile.
diff --git a/ui/webui/resources/js/chromeos/ui_account_tweaks.js b/ui/webui/resources/js/chromeos/ui_account_tweaks.js
index 76c2d90..6dab42b 100644
--- a/ui/webui/resources/js/chromeos/ui_account_tweaks.js
+++ b/ui/webui/resources/js/chromeos/ui_account_tweaks.js
@@ -57,6 +57,26 @@
};
/**
+ * Enables an element unless it should be disabled for the session type.
+ *
+ * @param {!Element} element Element that should be enabled.
+ */
+ UIAccountTweaks.enableElementIfPossible = function(element) {
+ var sessionType;
+ if (UIAccountTweaks.loggedInAsGuest())
+ sessionType = SESSION_TYPE_GUEST;
+ else if (UIAccountTweaks.loggedInAsPublicAccount())
+ sessionType = SESSION_TYPE_PUBLIC;
+
+ if (sessionType &&
+ element.getAttribute(sessionType + '-visibility') == 'disabled') {
+ return;
+ }
+
+ element.disabled = false;
+ }
+
+ /**
* Disables or hides some elements in specified type of session in ChromeOS.
* All elements within given document with *sessionType*-visibility
* attribute are either hidden (for *sessionType*-visibility="hidden")
@@ -68,10 +88,10 @@
*/
UIAccountTweaks.applySessionTypeVisibility_ = function(document,
sessionType) {
- var elements = document.querySelectorAll('['+ sessionType +'-visibility]');
+ var elements = document.querySelectorAll('['+ sessionType + '-visibility]');
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
- var visibility = element.getAttribute(sessionType +'-visibility');
+ var visibility = element.getAttribute(sessionType + '-visibility');
if (visibility == 'hidden')
element.hidden = true;
else if (visibility == 'disabled')
@@ -86,7 +106,7 @@
* @param {Document} document Document that should processed.
*/
UIAccountTweaks.applyGuestSessionVisibility = function(document) {
- if (!cr.isChromeOS || !UIAccountTweaks.loggedInAsGuest())
+ if (!UIAccountTweaks.loggedInAsGuest())
return;
UIAccountTweaks.applySessionTypeVisibility_(document, SESSION_TYPE_GUEST);
}
@@ -98,7 +118,7 @@
* @param {Document} document Document that should processed.
*/
UIAccountTweaks.applyPublicSessionVisibility = function(document) {
- if (!cr.isChromeOS || !UIAccountTweaks.loggedInAsPublicAccount())
+ if (!UIAccountTweaks.loggedInAsPublicAccount())
return;
UIAccountTweaks.applySessionTypeVisibility_(document, SESSION_TYPE_PUBLIC);
}
diff --git a/ui/webui/resources/js/cr/ui/autocomplete_list.js b/ui/webui/resources/js/cr/ui/autocomplete_list.js
index ab74955..b9515e4 100644
--- a/ui/webui/resources/js/cr/ui/autocomplete_list.js
+++ b/ui/webui/resources/js/cr/ui/autocomplete_list.js
@@ -11,7 +11,7 @@
* Creates a new autocomplete list item.
* This is suitable for selecting a web site, and used by default.
* A different behavior can be set by AutocompleteListItem.itemConstructor.
- * @param {Object} pageInfo The page this item represents.
+ * @param {*} pageInfo The page this item represents.
* @constructor
* @extends {cr.ui.ListItem}
*/
diff --git a/ui/webui/resources/js/cr/ui/command.js b/ui/webui/resources/js/cr/ui/command.js
index e23e958..cd1266c 100644
--- a/ui/webui/resources/js/cr/ui/command.js
+++ b/ui/webui/resources/js/cr/ui/command.js
@@ -290,7 +290,7 @@
* @class
*/
function CanExecuteEvent(command) {
- var e = new Event('canExecute', {bubbles: true});
+ var e = new Event('canExecute', {bubbles: true, cancelable: true});
e.__proto__ = CanExecuteEvent.prototype;
e.command = command;
return e;
@@ -307,7 +307,8 @@
/**
* Whether the target can execute the command. Setting this also stops the
- * propagation.
+ * propagation and prevents the default. Callers can tell if an event has
+ * been handled via |this.defaultPrevented|.
* @type {boolean}
*/
canExecute_: false,
@@ -317,6 +318,7 @@
set canExecute(canExecute) {
this.canExecute_ = !!canExecute;
this.stopPropagation();
+ this.preventDefault();
}
};
diff --git a/ui/webui/resources/js/cr/ui/list.js b/ui/webui/resources/js/cr/ui/list.js
index 2f7180c..36b3c35 100644
--- a/ui/webui/resources/js/cr/ui/list.js
+++ b/ui/webui/resources/js/cr/ui/list.js
@@ -92,7 +92,7 @@
/**
* Function used to create grid items.
- * @return {function(new:cr.ui.ListItem, Object)}
+ * @return {function(new:cr.ui.ListItem, *)}
*/
get itemConstructor() {
return this.itemConstructor_;
diff --git a/ui/webui/resources/js/cr/ui/table.js b/ui/webui/resources/js/cr/ui/table.js
index fcb81ec..f0540c0 100644
--- a/ui/webui/resources/js/cr/ui/table.js
+++ b/ui/webui/resources/js/cr/ui/table.js
@@ -61,7 +61,7 @@
/**
* The list of table.
*
- * @type {cr.ui.list}
+ * @type {cr.ui.List}
*/
get list() {
return this.list_;
@@ -92,7 +92,7 @@
* The table selection model.
*
* @type
- * {cr.ui.ListSelectionModel|cr.ui.table.ListSingleSelectionModel}
+ * {cr.ui.ListSelectionModel|cr.ui.ListSingleSelectionModel}
*/
get selectionModel() {
return this.list_.selectionModel;
@@ -126,7 +126,7 @@
/**
* Returns render function for row.
- * @return {Function(*, cr.ui.Table): HTMLElement} Render function.
+ * @return {function(*, cr.ui.Table): HTMLElement} Render function.
*/
getRenderFunction: function() {
return this.list_.renderFunction_;
@@ -134,7 +134,8 @@
/**
* Sets render function for row.
- * @param {Function(*, cr.ui.Table): HTMLElement} Render function.
+ * @param {function(*, cr.ui.Table): HTMLElement} renderFunction Render
+ * function.
*/
setRenderFunction: function(renderFunction) {
if (renderFunction === this.list_.renderFunction_)
@@ -164,7 +165,7 @@
this.appendChild(this.list_);
TableList.decorate(this.list_);
- this.list_.selectionModel = new ListSelectionModel(this);
+ this.list_.selectionModel = new ListSelectionModel();
this.list_.table = this;
this.list_.addEventListener('scroll', this.handleScroll_.bind(this));
@@ -190,7 +191,7 @@
/**
* Redraws the table.
*/
- redraw: function(index) {
+ redraw: function() {
this.list_.redraw();
this.header_.redraw();
},
@@ -226,7 +227,7 @@
/**
* Find the list item element at the given index.
* @param {number} index The index of the list item to get.
- * @return {ListItem} The found list item or null if not found.
+ * @return {cr.ui.ListItem} The found list item or null if not found.
*/
getListItemByIndex: function(index) {
return this.list_.getListItemByIndex(index);
diff --git a/ui/webui/resources/js/cr/ui/table/table_column.js b/ui/webui/resources/js/cr/ui/table/table_column.js
index ac14f30..193ca86 100644
--- a/ui/webui/resources/js/cr/ui/table/table_column.js
+++ b/ui/webui/resources/js/cr/ui/table/table_column.js
@@ -51,7 +51,8 @@
* @return {HTMLElement} Rendered element.
*/
renderFunction_: function(dataItem, columnId, table) {
- var div = table.ownerDocument.createElement('div');
+ var div = /** @type {HTMLElement} */
+ (table.ownerDocument.createElement('div'));
div.textContent = dataItem[columnId];
return div;
},
@@ -59,7 +60,7 @@
/**
* Renders table header. This is the default render function.
* @param {cr.ui.Table} table The table.
- * @return {HTMLElement} Rendered element.
+ * @return {Text} Rendered text node.
*/
headerRenderFunction_: function(table) {
return table.ownerDocument.createTextNode(this.name);
@@ -92,13 +93,13 @@
/**
* The column render function.
- * @type {Function(*, string, cr.ui.Table): HTMLElement}
+ * @type {function(*, string, cr.ui.Table): HTMLElement}
*/
cr.defineProperty(TableColumn, 'renderFunction');
/**
* The column header render function.
- * @type {Function(cr.ui.Table): HTMLElement}
+ * @type {function(cr.ui.Table): Text}
*/
cr.defineProperty(TableColumn, 'headerRenderFunction');
diff --git a/ui/webui/resources/js/cr/ui/table/table_column_model.js b/ui/webui/resources/js/cr/ui/table/table_column_model.js
index aefe1ba..da7803a 100644
--- a/ui/webui/resources/js/cr/ui/table/table_column_model.js
+++ b/ui/webui/resources/js/cr/ui/table/table_column_model.js
@@ -11,9 +11,10 @@
/**
* A table column model that wraps table columns array
* This implementation supports widths in percents.
- * @param {!Array<cr.ui.table.TableColumn>} columnIds Array of table columns.
+ * @param {!Array<cr.ui.table.TableColumn>} tableColumns Array of table
+ * columns.
* @constructor
- * @extends {EventTarget}
+ * @extends {cr.EventTarget}
*/
function TableColumnModel(tableColumns) {
this.columns_ = [];
@@ -107,7 +108,7 @@
/**
* Returns render function for the column at the given index.
* @param {number} index The index of the column.
- * @return {Function(*, string, cr.ui.Table): HTMLElement} Render function.
+ * @return {function(*, string, cr.ui.Table): HTMLElement} Render function.
*/
getRenderFunction: function(index) {
return this.columns_[index].renderFunction;
@@ -116,7 +117,8 @@
/**
* Sets render function for the column at the given index.
* @param {number} index The index of the column.
- * @param {Function(*, string, cr.ui.Table): HTMLElement} Render function.
+ * @param {function(*, string, cr.ui.Table): HTMLElement} renderFunction
+ * Render function.
*/
setRenderFunction: function(index, renderFunction) {
if (index < 0 || index >= this.columns_.size - 1)
diff --git a/ui/webui/resources/js/cr/ui/table/table_header.js b/ui/webui/resources/js/cr/ui/table/table_header.js
index f48eb5e..a05b264 100644
--- a/ui/webui/resources/js/cr/ui/table/table_header.js
+++ b/ui/webui/resources/js/cr/ui/table/table_header.js
@@ -180,9 +180,10 @@
/**
* Handles the touchstart event. If the touch happened close enough
* to a splitter starts dragging.
- * @param {TouchEvent} e The touch event.
+ * @param {Event} e The touch event.
*/
handleTouchStart_: function(e) {
+ e = /** @type {TouchEvent} */ (e);
if (e.touches.length != 1)
return;
var clientX = e.touches[0].clientX;
diff --git a/ui/webui/resources/js/cr/ui/table/table_list.js b/ui/webui/resources/js/cr/ui/table/table_list.js
index 3d3e50d..7e3c3b3 100644
--- a/ui/webui/resources/js/cr/ui/table/table_list.js
+++ b/ui/webui/resources/js/cr/ui/table/table_list.js
@@ -8,7 +8,6 @@
cr.define('cr.ui.table', function() {
/** @const */ var List = cr.ui.List;
- /** @const */ var TableRow = cr.ui.table.TableRow;
/** @const */ var ListItem = cr.ui.ListItem;
/**
diff --git a/ui/webui/resources/js/cr/ui/table/table_splitter.js b/ui/webui/resources/js/cr/ui/table/table_splitter.js
index edf61a5..0954be4 100644
--- a/ui/webui/resources/js/cr/ui/table/table_splitter.js
+++ b/ui/webui/resources/js/cr/ui/table/table_splitter.js
@@ -17,7 +17,7 @@
* Creates a new table splitter element.
* @param {Object=} opt_propertyBag Optional properties.
* @constructor
- * @extends {Splitter}
+ * @extends {cr.ui.Splitter}
*/
var TableSplitter = cr.ui.define('div');
diff --git a/ui/wm/BUILD.gn b/ui/wm/BUILD.gn
index e01ee94..67248f4 100644
--- a/ui/wm/BUILD.gn
+++ b/ui/wm/BUILD.gn
@@ -88,8 +88,6 @@
]
}
-if (false) {
-
static_library("test_support") {
testonly = true
sources = [
@@ -142,5 +140,3 @@
"//ui/gl",
]
}
-
-} # if (false)
diff --git a/ui/wm/core/accelerator_filter.h b/ui/wm/core/accelerator_filter.h
index 4e5295e..0ac7605 100644
--- a/ui/wm/core/accelerator_filter.h
+++ b/ui/wm/core/accelerator_filter.h
@@ -25,7 +25,7 @@
virtual ~AcceleratorFilter();
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
private:
scoped_ptr<AcceleratorDelegate> delegate_;
diff --git a/ui/wm/core/base_focus_rules.h b/ui/wm/core/base_focus_rules.h
index 07dfb65..8073541 100644
--- a/ui/wm/core/base_focus_rules.h
+++ b/ui/wm/core/base_focus_rules.h
@@ -26,15 +26,15 @@
aura::Window* window) const;
// Overridden from FocusRules:
- virtual bool IsToplevelWindow(aura::Window* window) const OVERRIDE;
- virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE;
- virtual bool CanFocusWindow(aura::Window* window) const OVERRIDE;
- virtual aura::Window* GetToplevelWindow(aura::Window* window) const OVERRIDE;
+ virtual bool IsToplevelWindow(aura::Window* window) const override;
+ virtual bool CanActivateWindow(aura::Window* window) const override;
+ virtual bool CanFocusWindow(aura::Window* window) const override;
+ virtual aura::Window* GetToplevelWindow(aura::Window* window) const override;
virtual aura::Window* GetActivatableWindow(
- aura::Window* window) const OVERRIDE;
- virtual aura::Window* GetFocusableWindow(aura::Window* window) const OVERRIDE;
+ aura::Window* window) const override;
+ virtual aura::Window* GetFocusableWindow(aura::Window* window) const override;
virtual aura::Window* GetNextActivatableWindow(
- aura::Window* ignore) const OVERRIDE;
+ aura::Window* ignore) const override;
private:
DISALLOW_COPY_AND_ASSIGN(BaseFocusRules);
diff --git a/ui/wm/core/capture_controller.h b/ui/wm/core/capture_controller.h
index d802818..230ea50 100644
--- a/ui/wm/core/capture_controller.h
+++ b/ui/wm/core/capture_controller.h
@@ -29,10 +29,10 @@
bool is_active() const { return !root_windows_.empty(); }
// Overridden from aura::client::CaptureClient:
- virtual void SetCapture(aura::Window* window) OVERRIDE;
- virtual void ReleaseCapture(aura::Window* window) OVERRIDE;
- virtual aura::Window* GetCaptureWindow() OVERRIDE;
- virtual aura::Window* GetGlobalCaptureWindow() OVERRIDE;
+ virtual void SetCapture(aura::Window* window) override;
+ virtual void ReleaseCapture(aura::Window* window) override;
+ virtual aura::Window* GetCaptureWindow() override;
+ virtual aura::Window* GetGlobalCaptureWindow() override;
private:
friend class ScopedCaptureClient;
@@ -66,7 +66,7 @@
}
// Overridden from aura::WindowObserver:
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
private:
// Invoked from destructor and OnWindowDestroyed() to cleanup.
diff --git a/ui/wm/core/compound_event_filter.h b/ui/wm/core/compound_event_filter.h
index ab4fdf8..a7767f3 100644
--- a/ui/wm/core/compound_event_filter.h
+++ b/ui/wm/core/compound_event_filter.h
@@ -73,11 +73,11 @@
bool enable);
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
+ virtual void OnTouchEvent(ui::TouchEvent* event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Additional pre-target event handlers.
ObserverList<ui::EventHandler, true> handlers_;
diff --git a/ui/wm/core/compound_event_filter_unittest.cc b/ui/wm/core/compound_event_filter_unittest.cc
index 85282fc..05f75e9 100644
--- a/ui/wm/core/compound_event_filter_unittest.cc
+++ b/ui/wm/core/compound_event_filter_unittest.cc
@@ -39,7 +39,7 @@
private:
// Overridden from ui::EventHandler:
- virtual void OnGestureEvent(ui::GestureEvent* e) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* e) override {
e->StopPropagation();
}
diff --git a/ui/wm/core/cursor_manager.h b/ui/wm/core/cursor_manager.h
index f60ef14..4f9c21b 100644
--- a/ui/wm/core/cursor_manager.h
+++ b/ui/wm/core/cursor_manager.h
@@ -43,33 +43,33 @@
virtual ~CursorManager();
// Overridden from aura::client::CursorClient:
- virtual void SetCursor(gfx::NativeCursor) OVERRIDE;
- virtual gfx::NativeCursor GetCursor() const OVERRIDE;
- virtual void ShowCursor() OVERRIDE;
- virtual void HideCursor() OVERRIDE;
- virtual bool IsCursorVisible() const OVERRIDE;
- virtual void SetCursorSet(ui::CursorSetType cursor_set) OVERRIDE;
- virtual ui::CursorSetType GetCursorSet() const OVERRIDE;
- virtual void EnableMouseEvents() OVERRIDE;
- virtual void DisableMouseEvents() OVERRIDE;
- virtual bool IsMouseEventsEnabled() const OVERRIDE;
- virtual void SetDisplay(const gfx::Display& display) OVERRIDE;
- virtual void LockCursor() OVERRIDE;
- virtual void UnlockCursor() OVERRIDE;
- virtual bool IsCursorLocked() const OVERRIDE;
+ virtual void SetCursor(gfx::NativeCursor) override;
+ virtual gfx::NativeCursor GetCursor() const override;
+ virtual void ShowCursor() override;
+ virtual void HideCursor() override;
+ virtual bool IsCursorVisible() const override;
+ virtual void SetCursorSet(ui::CursorSetType cursor_set) override;
+ virtual ui::CursorSetType GetCursorSet() const override;
+ virtual void EnableMouseEvents() override;
+ virtual void DisableMouseEvents() override;
+ virtual bool IsMouseEventsEnabled() const override;
+ virtual void SetDisplay(const gfx::Display& display) override;
+ virtual void LockCursor() override;
+ virtual void UnlockCursor() override;
+ virtual bool IsCursorLocked() const override;
virtual void AddObserver(
- aura::client::CursorClientObserver* observer) OVERRIDE;
+ aura::client::CursorClientObserver* observer) override;
virtual void RemoveObserver(
- aura::client::CursorClientObserver* observer) OVERRIDE;
+ aura::client::CursorClientObserver* observer) override;
virtual bool ShouldHideCursorOnKeyEvent(
- const ui::KeyEvent& event) const OVERRIDE;
+ const ui::KeyEvent& event) const override;
private:
// Overridden from NativeCursorManagerDelegate:
- virtual void CommitCursor(gfx::NativeCursor cursor) OVERRIDE;
- virtual void CommitVisibility(bool visible) OVERRIDE;
- virtual void CommitCursorSet(ui::CursorSetType cursor_set) OVERRIDE;
- virtual void CommitMouseEventsEnabled(bool enabled) OVERRIDE;
+ virtual void CommitCursor(gfx::NativeCursor cursor) override;
+ virtual void CommitVisibility(bool visible) override;
+ virtual void CommitCursorSet(ui::CursorSetType cursor_set) override;
+ virtual void CommitMouseEventsEnabled(bool enabled) override;
scoped_ptr<NativeCursorManager> delegate_;
diff --git a/ui/wm/core/cursor_manager_unittest.cc b/ui/wm/core/cursor_manager_unittest.cc
index 58c3b17..8dd2aa8 100644
--- a/ui/wm/core/cursor_manager_unittest.cc
+++ b/ui/wm/core/cursor_manager_unittest.cc
@@ -15,29 +15,29 @@
// Overridden from wm::NativeCursorManager:
virtual void SetDisplay(
const gfx::Display& display,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE {}
+ wm::NativeCursorManagerDelegate* delegate) override {}
virtual void SetCursor(
gfx::NativeCursor cursor,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE {
+ wm::NativeCursorManagerDelegate* delegate) override {
delegate->CommitCursor(cursor);
}
virtual void SetVisibility(
bool visible,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE {
+ wm::NativeCursorManagerDelegate* delegate) override {
delegate->CommitVisibility(visible);
}
virtual void SetMouseEventsEnabled(
bool enabled,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE {
+ wm::NativeCursorManagerDelegate* delegate) override {
delegate->CommitMouseEventsEnabled(enabled);
}
virtual void SetCursorSet(
ui::CursorSetType cursor_set,
- wm::NativeCursorManagerDelegate* delegate) OVERRIDE {
+ wm::NativeCursorManagerDelegate* delegate) override {
delegate->CommitCursorSet(cursor_set);
}
};
@@ -66,7 +66,7 @@
bool did_visibility_change() const { return did_visibility_change_; }
// Overridden from aura::client::CursorClientObserver:
- virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE {
+ virtual void OnCursorVisibilityChanged(bool is_visible) override {
cursor_visibility_ = is_visible;
did_visibility_change_ = true;
}
diff --git a/ui/wm/core/default_activation_client.cc b/ui/wm/core/default_activation_client.cc
index 94af0a5..d6383d6 100644
--- a/ui/wm/core/default_activation_client.cc
+++ b/ui/wm/core/default_activation_client.cc
@@ -23,7 +23,7 @@
virtual ~Deleter() {}
// Overridden from WindowObserver:
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(aura::Window* window) override {
DCHECK_EQ(window, root_window_);
root_window_->RemoveObserver(this);
delete client_;
diff --git a/ui/wm/core/default_activation_client.h b/ui/wm/core/default_activation_client.h
index 13b2474..fb9f9e2 100644
--- a/ui/wm/core/default_activation_client.h
+++ b/ui/wm/core/default_activation_client.h
@@ -33,18 +33,18 @@
// Overridden from aura::client::ActivationClient:
virtual void AddObserver(
- aura::client::ActivationChangeObserver* observer) OVERRIDE;
+ aura::client::ActivationChangeObserver* observer) override;
virtual void RemoveObserver(
- aura::client::ActivationChangeObserver* observer) OVERRIDE;
- virtual void ActivateWindow(aura::Window* window) OVERRIDE;
- virtual void DeactivateWindow(aura::Window* window) OVERRIDE;
- virtual aura::Window* GetActiveWindow() OVERRIDE;
- virtual aura::Window* GetActivatableWindow(aura::Window* window) OVERRIDE;
- virtual aura::Window* GetToplevelWindow(aura::Window* window) OVERRIDE;
- virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE;
+ aura::client::ActivationChangeObserver* observer) override;
+ virtual void ActivateWindow(aura::Window* window) override;
+ virtual void DeactivateWindow(aura::Window* window) override;
+ virtual aura::Window* GetActiveWindow() override;
+ virtual aura::Window* GetActivatableWindow(aura::Window* window) override;
+ virtual aura::Window* GetToplevelWindow(aura::Window* window) override;
+ virtual bool CanActivateWindow(aura::Window* window) const override;
// Overridden from WindowObserver:
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
private:
class Deleter;
diff --git a/ui/wm/core/easy_resize_window_targeter.h b/ui/wm/core/easy_resize_window_targeter.h
index 35b9eb2..5693300 100644
--- a/ui/wm/core/easy_resize_window_targeter.h
+++ b/ui/wm/core/easy_resize_window_targeter.h
@@ -34,7 +34,7 @@
// ui::EventTargeter:
virtual bool EventLocationInsideBounds(
ui::EventTarget* target,
- const ui::LocatedEvent& event) const OVERRIDE;
+ const ui::LocatedEvent& event) const override;
private:
// Returns true if the hit testing (EventLocationInsideBounds()) should use
diff --git a/ui/wm/core/focus_controller.h b/ui/wm/core/focus_controller.h
index 2f1aa0e..9e4149f 100644
--- a/ui/wm/core/focus_controller.h
+++ b/ui/wm/core/focus_controller.h
@@ -46,40 +46,40 @@
private:
// Overridden from aura::client::ActivationClient:
virtual void AddObserver(
- aura::client::ActivationChangeObserver* observer) OVERRIDE;
+ aura::client::ActivationChangeObserver* observer) override;
virtual void RemoveObserver(
- aura::client::ActivationChangeObserver* observer) OVERRIDE;
- virtual void ActivateWindow(aura::Window* window) OVERRIDE;
- virtual void DeactivateWindow(aura::Window* window) OVERRIDE;
- virtual aura::Window* GetActiveWindow() OVERRIDE;
- virtual aura::Window* GetActivatableWindow(aura::Window* window) OVERRIDE;
- virtual aura::Window* GetToplevelWindow(aura::Window* window) OVERRIDE;
- virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE;
+ aura::client::ActivationChangeObserver* observer) override;
+ virtual void ActivateWindow(aura::Window* window) override;
+ virtual void DeactivateWindow(aura::Window* window) override;
+ virtual aura::Window* GetActiveWindow() override;
+ virtual aura::Window* GetActivatableWindow(aura::Window* window) override;
+ virtual aura::Window* GetToplevelWindow(aura::Window* window) override;
+ virtual bool CanActivateWindow(aura::Window* window) const override;
// Overridden from aura::client::FocusClient:
virtual void AddObserver(
- aura::client::FocusChangeObserver* observer) OVERRIDE;
+ aura::client::FocusChangeObserver* observer) override;
virtual void RemoveObserver(
- aura::client::FocusChangeObserver* observer) OVERRIDE;
- virtual void FocusWindow(aura::Window* window) OVERRIDE;
- virtual void ResetFocusWithinActiveWindow(aura::Window* window) OVERRIDE;
- virtual aura::Window* GetFocusedWindow() OVERRIDE;
+ aura::client::FocusChangeObserver* observer) override;
+ virtual void FocusWindow(aura::Window* window) override;
+ virtual void ResetFocusWithinActiveWindow(aura::Window* window) override;
+ virtual aura::Window* GetFocusedWindow() override;
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
+ virtual void OnTouchEvent(ui::TouchEvent* event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
// Overridden from aura::WindowObserver:
virtual void OnWindowVisibilityChanged(aura::Window* window,
- bool visible) OVERRIDE;
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
+ bool visible) override;
+ virtual void OnWindowDestroying(aura::Window* window) override;
virtual void OnWindowHierarchyChanging(
- const HierarchyChangeParams& params) OVERRIDE;
+ const HierarchyChangeParams& params) override;
virtual void OnWindowHierarchyChanged(
- const HierarchyChangeParams& params) OVERRIDE;
+ const HierarchyChangeParams& params) override;
// Internal implementation that sets the focused window, fires events etc.
// This function must be called with a valid focusable window.
diff --git a/ui/wm/core/focus_controller_unittest.cc b/ui/wm/core/focus_controller_unittest.cc
index a10cef3..2508bcd 100644
--- a/ui/wm/core/focus_controller_unittest.cc
+++ b/ui/wm/core/focus_controller_unittest.cc
@@ -56,12 +56,12 @@
private:
// Overridden from aura::client::ActivationChangeObserver:
virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE {
+ aura::Window* lost_active) override {
++activation_changed_count_;
}
virtual void OnAttemptToReactivateWindow(
aura::Window* request_active,
- aura::Window* actual_active) OVERRIDE {
+ aura::Window* actual_active) override {
++reactivation_count_;
reactivation_requested_window_ = request_active;
reactivation_actual_window_ = actual_active;
@@ -69,7 +69,7 @@
// Overridden from aura::client::FocusChangeObserver:
virtual void OnWindowFocused(aura::Window* gained_focus,
- aura::Window* lost_focus) OVERRIDE {
+ aura::Window* lost_focus) override {
++focus_changed_count_;
}
@@ -116,14 +116,14 @@
// Overridden from aura::client::ActivationChangeObserver:
virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE {
+ aura::Window* lost_active) override {
if (lost_active && lost_active == deleter_->GetDeletedWindow())
was_notified_with_deleted_window_ = true;
}
// Overridden from aura::client::FocusChangeObserver:
virtual void OnWindowFocused(aura::Window* gained_focus,
- aura::Window* lost_focus) OVERRIDE {
+ aura::Window* lost_focus) override {
if (lost_focus && lost_focus == deleter_->GetDeletedWindow())
was_notified_with_deleted_window_ = true;
}
@@ -159,7 +159,7 @@
// Overridden from aura::client::ActivationChangeObserver:
virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE {
+ aura::Window* lost_active) override {
if (window_ && lost_active == window_) {
delete lost_active;
did_delete_ = true;
@@ -167,7 +167,7 @@
}
// Overridden from WindowDeleter:
- virtual aura::Window* GetDeletedWindow() OVERRIDE {
+ virtual aura::Window* GetDeletedWindow() override {
return did_delete_ ? window_ : NULL;
}
@@ -196,7 +196,7 @@
// Overridden from aura::client::FocusChangeObserver:
virtual void OnWindowFocused(aura::Window* gained_focus,
- aura::Window* lost_focus) OVERRIDE {
+ aura::Window* lost_focus) override {
if (window_ && lost_focus == window_) {
delete lost_focus;
did_delete_ = true;
@@ -204,7 +204,7 @@
}
// Overridden from WindowDeleter:
- virtual aura::Window* GetDeletedWindow() OVERRIDE {
+ virtual aura::Window* GetDeletedWindow() override {
return did_delete_ ? window_ : NULL;
}
@@ -267,7 +267,7 @@
private:
// Overridden from aura::client::FocusChangeObserver:
virtual void OnWindowFocused(aura::Window* gained_focus,
- aura::Window* lost_focus) OVERRIDE {
+ aura::Window* lost_focus) override {
ui::TextInputFocusManager::GetInstance()->FocusTextInputClient(
text_input_client_);
}
@@ -282,10 +282,10 @@
virtual ~SimpleEventHandler() {}
// Overridden from ui::EventHandler:
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
+ virtual void OnMouseEvent(ui::MouseEvent* event) override {
event->SetHandled();
}
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
+ virtual void OnGestureEvent(ui::GestureEvent* event) override {
event->SetHandled();
}
@@ -308,7 +308,7 @@
private:
// Overridden from aura::client::ActivationChangeObserver:
virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE {
+ aura::Window* lost_active) override {
// Shift focus to a child. This should prevent the default focusing from
// occurring in FocusController::FocusWindow().
if (gained_active == activated_window_) {
@@ -338,33 +338,33 @@
}
// Overridden from BaseFocusRules:
- virtual bool SupportsChildActivation(aura::Window* window) const OVERRIDE {
+ virtual bool SupportsChildActivation(aura::Window* window) const override {
// In FocusControllerTests, only the RootWindow has activatable children.
return window->GetRootWindow() == window;
}
- virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE {
+ virtual bool CanActivateWindow(aura::Window* window) const override {
// Restricting focus to a non-activatable child window means the activatable
// parent outside the focus restriction is activatable.
bool can_activate =
CanFocusOrActivate(window) || window->Contains(focus_restriction_);
return can_activate ? BaseFocusRules::CanActivateWindow(window) : false;
}
- virtual bool CanFocusWindow(aura::Window* window) const OVERRIDE {
+ virtual bool CanFocusWindow(aura::Window* window) const override {
return CanFocusOrActivate(window) ?
BaseFocusRules::CanFocusWindow(window) : false;
}
virtual aura::Window* GetActivatableWindow(
- aura::Window* window) const OVERRIDE {
+ aura::Window* window) const override {
return BaseFocusRules::GetActivatableWindow(
CanFocusOrActivate(window) ? window : focus_restriction_);
}
virtual aura::Window* GetFocusableWindow(
- aura::Window* window) const OVERRIDE {
+ aura::Window* window) const override {
return BaseFocusRules::GetFocusableWindow(
CanFocusOrActivate(window) ? window : focus_restriction_);
}
virtual aura::Window* GetNextActivatableWindow(
- aura::Window* ignore) const OVERRIDE {
+ aura::Window* ignore) const override {
aura::Window* next_activatable =
BaseFocusRules::GetNextActivatableWindow(ignore);
return CanFocusOrActivate(next_activatable) ?
@@ -387,7 +387,7 @@
FocusControllerTestBase() {}
// Overridden from aura::test::AuraTestBase:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
wm_state_.reset(new wm::WMState);
// FocusController registers itself as an Env observer so it can catch all
// window initializations, including the root_window()'s, so we create it
@@ -430,7 +430,7 @@
aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(), 3,
gfx::Rect(125, 125, 50, 50), root_window());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
root_window()->RemovePreTargetHandler(focus_controller_.get());
aura::test::AuraTestBase::TearDown();
test_focus_rules_ = NULL; // Owned by FocusController.
@@ -518,14 +518,14 @@
}
// Overridden from FocusControllerTestBase:
- virtual void BasicFocus() OVERRIDE {
+ virtual void BasicFocus() override {
EXPECT_EQ(NULL, GetFocusedWindow());
FocusWindowById(1);
EXPECT_EQ(1, GetFocusedWindowId());
FocusWindowById(2);
EXPECT_EQ(2, GetFocusedWindowId());
}
- virtual void BasicActivation() OVERRIDE {
+ virtual void BasicActivation() override {
EXPECT_EQ(NULL, GetActiveWindow());
ActivateWindowById(1);
EXPECT_EQ(1, GetActiveWindowId());
@@ -538,7 +538,7 @@
DeactivateWindow(GetActiveWindow());
EXPECT_EQ(1, GetActiveWindowId());
}
- virtual void FocusEvents() OVERRIDE {
+ virtual void FocusEvents() override {
ScopedFocusNotificationObserver root_observer(root_window());
ScopedTargetFocusNotificationObserver observer1(root_window(), 1);
ScopedTargetFocusNotificationObserver observer2(root_window(), 2);
@@ -557,7 +557,7 @@
observer1.ExpectCounts(2, 2);
observer2.ExpectCounts(1, 1);
}
- virtual void DuplicateFocusEvents() OVERRIDE {
+ virtual void DuplicateFocusEvents() override {
// Focusing an existing focused window should not resend focus events.
ScopedFocusNotificationObserver root_observer(root_window());
ScopedTargetFocusNotificationObserver observer1(root_window(), 1);
@@ -573,7 +573,7 @@
root_observer.ExpectCounts(1, 1);
observer1.ExpectCounts(1, 1);
}
- virtual void ActivationEvents() OVERRIDE {
+ virtual void ActivationEvents() override {
ActivateWindowById(1);
ScopedFocusNotificationObserver root_observer(root_window());
@@ -589,7 +589,7 @@
observer1.ExpectCounts(1, 1);
observer2.ExpectCounts(1, 1);
}
- virtual void ReactivationEvents() OVERRIDE {
+ virtual void ReactivationEvents() override {
ActivateWindowById(1);
ScopedFocusNotificationObserver root_observer(root_window());
EXPECT_EQ(0, root_observer.reactivation_count());
@@ -603,7 +603,7 @@
EXPECT_EQ(root_window()->GetChildById(1),
root_observer.reactivation_actual_window());
}
- virtual void DuplicateActivationEvents() OVERRIDE {
+ virtual void DuplicateActivationEvents() override {
// Activating an existing active window should not resend activation events.
ActivateWindowById(1);
@@ -625,7 +625,7 @@
observer1.ExpectCounts(1, 1);
observer2.ExpectCounts(1, 1);
}
- virtual void ShiftFocusWithinActiveWindow() OVERRIDE {
+ virtual void ShiftFocusWithinActiveWindow() override {
ActivateWindowById(1);
EXPECT_EQ(1, GetActiveWindowId());
EXPECT_EQ(1, GetFocusedWindowId());
@@ -634,7 +634,7 @@
FocusWindowById(12);
EXPECT_EQ(12, GetFocusedWindowId());
}
- virtual void ShiftFocusToChildOfInactiveWindow() OVERRIDE {
+ virtual void ShiftFocusToChildOfInactiveWindow() override {
ActivateWindowById(2);
EXPECT_EQ(2, GetActiveWindowId());
EXPECT_EQ(2, GetFocusedWindowId());
@@ -642,7 +642,7 @@
EXPECT_EQ(1, GetActiveWindowId());
EXPECT_EQ(11, GetFocusedWindowId());
}
- virtual void ShiftFocusToParentOfFocusedWindow() OVERRIDE {
+ virtual void ShiftFocusToParentOfFocusedWindow() override {
ActivateWindowById(1);
EXPECT_EQ(1, GetFocusedWindowId());
FocusWindowById(11);
@@ -651,7 +651,7 @@
// Focus should _not_ shift to the parent of the already-focused window.
EXPECT_EQ(11, GetFocusedWindowId());
}
- virtual void FocusRulesOverride() OVERRIDE {
+ virtual void FocusRulesOverride() override {
EXPECT_EQ(NULL, GetFocusedWindow());
FocusWindowById(11);
EXPECT_EQ(11, GetFocusedWindowId());
@@ -667,7 +667,7 @@
FocusWindowById(12);
EXPECT_EQ(12, GetFocusedWindowId());
}
- virtual void ActivationRulesOverride() OVERRIDE {
+ virtual void ActivationRulesOverride() override {
ActivateWindowById(1);
EXPECT_EQ(1, GetActiveWindowId());
EXPECT_EQ(1, GetFocusedWindowId());
@@ -687,7 +687,7 @@
EXPECT_EQ(2, GetActiveWindowId());
EXPECT_EQ(2, GetFocusedWindowId());
}
- virtual void ShiftFocusOnActivation() OVERRIDE {
+ virtual void ShiftFocusOnActivation() override {
// When a window is activated, by default that window is also focused.
// An ActivationChangeObserver may shift focus to another window within the
// same activatable window.
@@ -729,7 +729,7 @@
ActivateWindowById(1);
EXPECT_EQ(1, GetFocusedWindowId());
}
- virtual void ShiftFocusOnActivationDueToHide() OVERRIDE {
+ virtual void ShiftFocusOnActivationDueToHide() override {
// Similar to ShiftFocusOnActivation except the activation change is
// triggered by hiding the active window.
ActivateWindowById(1);
@@ -755,12 +755,12 @@
client->RemoveObserver(observer.get());
}
- virtual void NoShiftActiveOnActivation() OVERRIDE {
+ virtual void NoShiftActiveOnActivation() override {
// When a window is activated, we need to prevent any change to activation
// from being made in response to an activation change notification.
}
- virtual void NoFocusChangeOnClickOnCaptureWindow() OVERRIDE {
+ virtual void NoFocusChangeOnClickOnCaptureWindow() override {
scoped_ptr<aura::client::DefaultCaptureClient> capture_client(
new aura::client::DefaultCaptureClient(root_window()));
// Clicking on a window which has capture should not cause a focus change
@@ -781,7 +781,7 @@
}
// Verifies focus change is honored while capture held.
- virtual void ChangeFocusWhenNothingFocusedAndCaptured() OVERRIDE {
+ virtual void ChangeFocusWhenNothingFocusedAndCaptured() override {
scoped_ptr<aura::client::DefaultCaptureClient> capture_client(
new aura::client::DefaultCaptureClient(root_window()));
aura::Window* w1 = root_window()->GetChildById(1);
@@ -800,7 +800,7 @@
// Verifies if a window that loses activation or focus is deleted during
// observer notification we don't pass the deleted window to other observers.
- virtual void DontPassDeletedWindow() OVERRIDE {
+ virtual void DontPassDeletedWindow() override {
FocusWindowById(1);
EXPECT_EQ(1, GetActiveWindowId());
@@ -839,7 +839,7 @@
// Verifies if the focused text input client is cleared when a window gains
// or loses the focus.
- virtual void FocusedTextInputClient() OVERRIDE {
+ virtual void FocusedTextInputClient() override {
ui::TextInputFocusManager* text_input_focus_manager =
ui::TextInputFocusManager::GetInstance();
ui::DummyTextInputClient text_input_client;
@@ -883,16 +883,16 @@
private:
// Overridden from FocusControllerTestBase:
- virtual void FocusWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void FocusWindowDirect(aura::Window* window) override {
FocusWindow(window);
}
- virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void ActivateWindowDirect(aura::Window* window) override {
ActivateWindow(window);
}
- virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void DeactivateWindowDirect(aura::Window* window) override {
DeactivateWindow(window);
}
- virtual bool IsInputEvent() OVERRIDE { return false; }
+ virtual bool IsInputEvent() override { return false; }
DISALLOW_COPY_AND_ASSIGN(FocusControllerApiTest);
};
@@ -921,21 +921,21 @@
private:
// Overridden from FocusControllerTestBase:
- virtual void FocusWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void FocusWindowDirect(aura::Window* window) override {
ui::test::EventGenerator generator(root_window(), window);
generator.ClickLeftButton();
}
- virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void ActivateWindowDirect(aura::Window* window) override {
ui::test::EventGenerator generator(root_window(), window);
generator.ClickLeftButton();
}
- virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void DeactivateWindowDirect(aura::Window* window) override {
aura::Window* next_activatable =
test_focus_rules()->GetNextActivatableWindow(window);
ui::test::EventGenerator generator(root_window(), next_activatable);
generator.ClickLeftButton();
}
- virtual bool IsInputEvent() OVERRIDE { return true; }
+ virtual bool IsInputEvent() override { return true; }
DISALLOW_COPY_AND_ASSIGN(FocusControllerMouseEventTest);
};
@@ -946,21 +946,21 @@
private:
// Overridden from FocusControllerTestBase:
- virtual void FocusWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void FocusWindowDirect(aura::Window* window) override {
ui::test::EventGenerator generator(root_window(), window);
generator.GestureTapAt(window->bounds().CenterPoint());
}
- virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void ActivateWindowDirect(aura::Window* window) override {
ui::test::EventGenerator generator(root_window(), window);
generator.GestureTapAt(window->bounds().CenterPoint());
}
- virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE {
+ virtual void DeactivateWindowDirect(aura::Window* window) override {
aura::Window* next_activatable =
test_focus_rules()->GetNextActivatableWindow(window);
ui::test::EventGenerator generator(root_window(), next_activatable);
generator.GestureTapAt(window->bounds().CenterPoint());
}
- virtual bool IsInputEvent() OVERRIDE { return true; }
+ virtual bool IsInputEvent() override { return true; }
DISALLOW_COPY_AND_ASSIGN(FocusControllerGestureEventTest);
};
@@ -984,7 +984,7 @@
virtual void PostDispostionChangeExpectations() {}
// Overridden from FocusControllerTestBase:
- virtual void BasicFocus() OVERRIDE {
+ virtual void BasicFocus() override {
EXPECT_EQ(NULL, GetFocusedWindow());
aura::Window* w211 = root_window()->GetChildById(211);
@@ -995,7 +995,7 @@
// BasicFocusRules passes focus to the parent.
EXPECT_EQ(parent_ ? 2 : 21, GetFocusedWindowId());
}
- virtual void BasicActivation() OVERRIDE {
+ virtual void BasicActivation() override {
DCHECK(!parent_) << "Activation tests don't support parent changes.";
EXPECT_EQ(NULL, GetActiveWindow());
@@ -1008,7 +1008,7 @@
EXPECT_EQ(3, GetActiveWindowId());
PostDispostionChangeExpectations();
}
- virtual void FocusEvents() OVERRIDE {
+ virtual void FocusEvents() override {
aura::Window* w211 = root_window()->GetChildById(211);
FocusWindow(w211);
@@ -1021,7 +1021,7 @@
root_observer.ExpectCounts(0, 1);
observer211.ExpectCounts(0, 1);
}
- virtual void ActivationEvents() OVERRIDE {
+ virtual void ActivationEvents() override {
DCHECK(!parent_) << "Activation tests don't support parent changes.";
aura::Window* w2 = root_window()->GetChildById(2);
@@ -1039,7 +1039,7 @@
observer2.ExpectCounts(1, 1);
observer3.ExpectCounts(1, 1);
}
- virtual void FocusRulesOverride() OVERRIDE {
+ virtual void FocusRulesOverride() override {
EXPECT_EQ(NULL, GetFocusedWindow());
aura::Window* w211 = root_window()->GetChildById(211);
FocusWindow(w211);
@@ -1053,7 +1053,7 @@
test_focus_rules()->set_focus_restriction(NULL);
}
- virtual void ActivationRulesOverride() OVERRIDE {
+ virtual void ActivationRulesOverride() override {
DCHECK(!parent_) << "Activation tests don't support parent changes.";
aura::Window* w1 = root_window()->GetChildById(1);
@@ -1096,7 +1096,7 @@
: FocusControllerImplicitTestBase(parent) {}
// Overridden from FocusControllerImplicitTestBase:
- virtual void ChangeWindowDisposition(aura::Window* window) OVERRIDE {
+ virtual void ChangeWindowDisposition(aura::Window* window) override {
GetDispositionWindow(window)->Hide();
}
@@ -1124,7 +1124,7 @@
: FocusControllerImplicitTestBase(parent) {}
// Overridden from FocusControllerImplicitTestBase:
- virtual void ChangeWindowDisposition(aura::Window* window) OVERRIDE {
+ virtual void ChangeWindowDisposition(aura::Window* window) override {
delete GetDispositionWindow(window);
}
@@ -1153,12 +1153,12 @@
: FocusControllerImplicitTestBase(parent) {}
// Overridden from FocusControllerImplicitTestBase:
- virtual void ChangeWindowDisposition(aura::Window* window) OVERRIDE {
+ virtual void ChangeWindowDisposition(aura::Window* window) override {
aura::Window* disposition_window = GetDispositionWindow(window);
disposition_window->parent()->RemoveChild(disposition_window);
window_owner_.reset(disposition_window);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
window_owner_.reset();
FocusControllerImplicitTestBase::TearDown();
}
diff --git a/ui/wm/core/image_grid.h b/ui/wm/core/image_grid.h
index 1242dcb..6102f8b 100644
--- a/ui/wm/core/image_grid.h
+++ b/ui/wm/core/image_grid.h
@@ -137,11 +137,11 @@
void SetClipRect(const gfx::Rect& clip_rect, ui::Layer* layer);
// ui::LayerDelegate implementation:
- virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnPaintLayer(gfx::Canvas* canvas) override;
virtual void OnDelegatedFrameDamage(
- const gfx::Rect& damage_rect_in_dip) OVERRIDE;
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
- virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE;
+ const gfx::Rect& damage_rect_in_dip) override;
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override;
+ virtual base::Closure PrepareForLayerBoundsChange() override;
private:
friend class TestAPI;
diff --git a/ui/wm/core/input_method_event_filter.h b/ui/wm/core/input_method_event_filter.h
index af82308..d658d77 100644
--- a/ui/wm/core/input_method_event_filter.h
+++ b/ui/wm/core/input_method_event_filter.h
@@ -35,10 +35,10 @@
private:
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
// Overridden from ui::internal::InputMethodDelegate:
- virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) OVERRIDE;
+ virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override;
scoped_ptr<ui::InputMethod> input_method_;
diff --git a/ui/wm/core/input_method_event_filter_unittest.cc b/ui/wm/core/input_method_event_filter_unittest.cc
index 810ba2a..9a2d31b 100644
--- a/ui/wm/core/input_method_event_filter_unittest.cc
+++ b/ui/wm/core/input_method_event_filter_unittest.cc
@@ -33,7 +33,7 @@
public:
explicit TestTextInputClient(aura::Window* window) : window_(window) {}
- virtual aura::Window* GetAttachedWindow() const OVERRIDE { return window_; }
+ virtual aura::Window* GetAttachedWindow() const override { return window_; }
private:
aura::Window* window_;
@@ -47,7 +47,7 @@
virtual ~InputMethodEventFilterTest() {}
// testing::Test overrides:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
aura::test::AuraTestBase::SetUp();
root_window()->AddPreTargetHandler(&root_filter_);
@@ -66,7 +66,7 @@
test_input_client_.get());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
test_window_.reset();
root_filter_.RemoveHandler(&test_filter_);
root_filter_.RemoveHandler(input_method_event_filter_.get());
diff --git a/ui/wm/core/masked_window_targeter.h b/ui/wm/core/masked_window_targeter.h
index 61bb3b1..e289329 100644
--- a/ui/wm/core/masked_window_targeter.h
+++ b/ui/wm/core/masked_window_targeter.h
@@ -27,7 +27,7 @@
// ui::EventTargeter:
virtual bool EventLocationInsideBounds(
ui::EventTarget* target,
- const ui::LocatedEvent& event) const OVERRIDE;
+ const ui::LocatedEvent& event) const override;
private:
aura::Window* masked_window_;
diff --git a/ui/wm/core/nested_accelerator_controller.h b/ui/wm/core/nested_accelerator_controller.h
index 2826d72..1eca937 100644
--- a/ui/wm/core/nested_accelerator_controller.h
+++ b/ui/wm/core/nested_accelerator_controller.h
@@ -29,7 +29,7 @@
virtual void PrepareNestedLoopClosures(
base::MessagePumpDispatcher* dispatcher,
base::Closure* run_closure,
- base::Closure* quit_closure) OVERRIDE;
+ base::Closure* quit_closure) override;
private:
void RunNestedMessageLoop(scoped_ptr<base::RunLoop> run_loop,
diff --git a/ui/wm/core/nested_accelerator_controller_unittest.cc b/ui/wm/core/nested_accelerator_controller_unittest.cc
index d0a3688..ce548d5 100644
--- a/ui/wm/core/nested_accelerator_controller_unittest.cc
+++ b/ui/wm/core/nested_accelerator_controller_unittest.cc
@@ -40,10 +40,10 @@
private:
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override {
return true;
}
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override {
if (ui::EventTypeFromNative(event) == ui::ET_KEY_RELEASED)
num_key_events_dispatched_++;
return ui::POST_DISPATCH_NONE;
@@ -62,11 +62,11 @@
int accelerator_pressed_count() const { return accelerator_pressed_count_; }
// Overridden from ui::AcceleratorTarget:
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE {
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override {
accelerator_pressed_count_++;
return true;
}
- virtual bool CanHandleAccelerators() const OVERRIDE { return true; }
+ virtual bool CanHandleAccelerators() const override { return true; }
private:
int accelerator_pressed_count_;
@@ -105,7 +105,7 @@
// NestedAcceleratorDelegate:
virtual Result ProcessAccelerator(
- const ui::Accelerator& accelerator) OVERRIDE {
+ const ui::Accelerator& accelerator) override {
return accelerator_manager_->Process(accelerator) ?
RESULT_PROCESSED : RESULT_NOT_PROCESSED;
}
@@ -127,7 +127,7 @@
NestedAcceleratorTest() {}
virtual ~NestedAcceleratorTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AuraTestBase::SetUp();
delegate_ = new MockNestedAcceleratorDelegate();
nested_accelerator_controller_.reset(
@@ -136,7 +136,7 @@
nested_accelerator_controller_.get());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
aura::client::SetDispatcherClient(root_window(), NULL);
AuraTestBase::TearDown();
delegate_ = NULL;
diff --git a/ui/wm/core/nested_accelerator_dispatcher_linux.cc b/ui/wm/core/nested_accelerator_dispatcher_linux.cc
index 3379419..ee5b587 100644
--- a/ui/wm/core/nested_accelerator_dispatcher_linux.cc
+++ b/ui/wm/core/nested_accelerator_dispatcher_linux.cc
@@ -55,16 +55,16 @@
private:
// AcceleratorDispatcher:
- virtual scoped_ptr<base::RunLoop> CreateRunLoop() OVERRIDE {
+ virtual scoped_ptr<base::RunLoop> CreateRunLoop() override {
return scoped_ptr<base::RunLoop>(new base::RunLoop());
}
// ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override {
return true;
}
- virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override {
if (IsKeyEvent(event)) {
ui::KeyEvent key_event(event);
ui::Accelerator accelerator = CreateAcceleratorFromKeyEvent(key_event);
diff --git a/ui/wm/core/nested_accelerator_dispatcher_win.cc b/ui/wm/core/nested_accelerator_dispatcher_win.cc
index 3b3fb2d..5504d57 100644
--- a/ui/wm/core/nested_accelerator_dispatcher_win.cc
+++ b/ui/wm/core/nested_accelerator_dispatcher_win.cc
@@ -35,12 +35,12 @@
private:
// NestedAcceleratorDispatcher:
- virtual scoped_ptr<base::RunLoop> CreateRunLoop() OVERRIDE {
+ virtual scoped_ptr<base::RunLoop> CreateRunLoop() override {
return scoped_ptr<base::RunLoop>(new base::RunLoop(this));
}
// MessagePumpDispatcher:
- virtual uint32_t Dispatch(const MSG& event) OVERRIDE {
+ virtual uint32_t Dispatch(const MSG& event) override {
if (IsKeyEvent(event)) {
ui::KeyEvent key_event(event);
ui::Accelerator accelerator = CreateAcceleratorFromKeyEvent(key_event);
diff --git a/ui/wm/core/shadow.h b/ui/wm/core/shadow.h
index 5e90650..19f5972 100644
--- a/ui/wm/core/shadow.h
+++ b/ui/wm/core/shadow.h
@@ -54,7 +54,7 @@
void SetStyle(Style style);
// ui::ImplicitAnimationObserver overrides:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ virtual void OnImplicitAnimationsCompleted() override;
private:
// Updates the shadow images to the current |style_|.
diff --git a/ui/wm/core/shadow_controller.cc b/ui/wm/core/shadow_controller.cc
index 9d1f50e..abd33ad 100644
--- a/ui/wm/core/shadow_controller.cc
+++ b/ui/wm/core/shadow_controller.cc
@@ -97,16 +97,16 @@
static Impl* GetInstance();
// aura::EnvObserver override:
- virtual void OnWindowInitialized(aura::Window* window) OVERRIDE;
+ virtual void OnWindowInitialized(aura::Window* window) override;
// aura::WindowObserver overrides:
virtual void OnWindowPropertyChanged(
- aura::Window* window, const void* key, intptr_t old) OVERRIDE;
+ aura::Window* window, const void* key, intptr_t old) override;
virtual void OnWindowBoundsChanged(
aura::Window* window,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
private:
friend class base::RefCounted<Impl>;
diff --git a/ui/wm/core/shadow_controller.h b/ui/wm/core/shadow_controller.h
index c846894..9deeda6 100644
--- a/ui/wm/core/shadow_controller.h
+++ b/ui/wm/core/shadow_controller.h
@@ -52,7 +52,7 @@
// aura::client::ActivationChangeObserver overrides:
virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE;
+ aura::Window* lost_active) override;
private:
class Impl;
diff --git a/ui/wm/core/shadow_controller_unittest.cc b/ui/wm/core/shadow_controller_unittest.cc
index 477e3ac..1b1aa18 100644
--- a/ui/wm/core/shadow_controller_unittest.cc
+++ b/ui/wm/core/shadow_controller_unittest.cc
@@ -27,7 +27,7 @@
ShadowControllerTest() {}
virtual ~ShadowControllerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
wm_state_.reset(new wm::WMState);
AuraTestBase::SetUp();
new wm::DefaultActivationClient(root_window());
@@ -35,7 +35,7 @@
aura::client::GetActivationClient(root_window());
shadow_controller_.reset(new ShadowController(activation_client));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
shadow_controller_.reset();
AuraTestBase::TearDown();
wm_state_.reset();
diff --git a/ui/wm/core/shadow_unittest.cc b/ui/wm/core/shadow_unittest.cc
index 2090b06..2ffdd4a 100644
--- a/ui/wm/core/shadow_unittest.cc
+++ b/ui/wm/core/shadow_unittest.cc
@@ -40,15 +40,15 @@
// ResourceBundle::Delegate:
virtual base::FilePath GetPathForResourcePack(
const base::FilePath& pack_path,
- ui::ScaleFactor scale_factor) OVERRIDE {
+ ui::ScaleFactor scale_factor) override {
return base::FilePath();
}
virtual base::FilePath GetPathForLocalePack(
const base::FilePath& pack_path,
- const std::string& locale) OVERRIDE {
+ const std::string& locale) override {
return base::FilePath();
}
- virtual gfx::Image GetImageNamed(int resource_id) OVERRIDE {
+ virtual gfx::Image GetImageNamed(int resource_id) override {
last_resource_id_ = resource_id;
switch (resource_id) {
case IDR_WINDOW_BUBBLE_SHADOW_SMALL:
@@ -62,24 +62,24 @@
}
}
virtual gfx::Image GetNativeImageNamed(
- int resource_id, ui::ResourceBundle::ImageRTL rtl) OVERRIDE {
+ int resource_id, ui::ResourceBundle::ImageRTL rtl) override {
return gfx::Image();
}
virtual base::RefCountedStaticMemory* LoadDataResourceBytes(
- int resource_id, ui::ScaleFactor scale_factor) OVERRIDE {
+ int resource_id, ui::ScaleFactor scale_factor) override {
return NULL;
}
virtual bool GetRawDataResource(
int resource_id, ui::ScaleFactor scale_factor,
- base::StringPiece* value) OVERRIDE {
+ base::StringPiece* value) override {
return false;
}
virtual bool GetLocalizedString(
- int message_id, base::string16* value) OVERRIDE {
+ int message_id, base::string16* value) override {
return false;
}
virtual scoped_ptr<gfx::Font> GetFont(
- ui::ResourceBundle::FontStyle style) OVERRIDE {
+ ui::ResourceBundle::FontStyle style) override {
return scoped_ptr<gfx::Font>();
}
@@ -103,7 +103,7 @@
MockResourceBundleDelegate* delegate() { return delegate_.get(); }
// aura::testAuraBase:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
aura::test::AuraTestBase::SetUp();
delegate_.reset(new MockResourceBundleDelegate());
if (ResourceBundle::HasSharedInstance())
@@ -111,7 +111,7 @@
ui::ResourceBundle::InitSharedInstanceWithLocale(
"en-US", delegate(), ui::ResourceBundle::LOAD_COMMON_RESOURCES);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
ui::ResourceBundle::CleanupSharedInstance();
base::FilePath ui_test_pak_path;
ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
diff --git a/ui/wm/core/transient_window_controller.h b/ui/wm/core/transient_window_controller.h
index 8638824..4322b41 100644
--- a/ui/wm/core/transient_window_controller.h
+++ b/ui/wm/core/transient_window_controller.h
@@ -20,12 +20,12 @@
// TransientWindowClient:
virtual void AddTransientChild(aura::Window* parent,
- aura::Window* child) OVERRIDE;
+ aura::Window* child) override;
virtual void RemoveTransientChild(aura::Window* parent,
- aura::Window* child) OVERRIDE;
- virtual aura::Window* GetTransientParent(aura::Window* window) OVERRIDE;
+ aura::Window* child) override;
+ virtual aura::Window* GetTransientParent(aura::Window* window) override;
virtual const aura::Window* GetTransientParent(
- const aura::Window* window) OVERRIDE;
+ const aura::Window* window) override;
private:
DISALLOW_COPY_AND_ASSIGN(TransientWindowController);
diff --git a/ui/wm/core/transient_window_manager.h b/ui/wm/core/transient_window_manager.h
index 7a7ee46..a6c5139 100644
--- a/ui/wm/core/transient_window_manager.h
+++ b/ui/wm/core/transient_window_manager.h
@@ -81,13 +81,13 @@
// WindowObserver:
virtual void OnWindowParentChanged(aura::Window* window,
- aura::Window* parent) OVERRIDE;
+ aura::Window* parent) override;
virtual void OnWindowVisibilityChanging(aura::Window* window,
- bool visible) OVERRIDE;
+ bool visible) override;
virtual void OnWindowVisibilityChanged(aura::Window* window,
- bool visible) OVERRIDE;
- virtual void OnWindowStackingChanged(aura::Window* window) OVERRIDE;
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
+ bool visible) override;
+ virtual void OnWindowStackingChanged(aura::Window* window) override;
+ virtual void OnWindowDestroying(aura::Window* window) override;
aura::Window* window_;
aura::Window* transient_parent_;
diff --git a/ui/wm/core/transient_window_manager_unittest.cc b/ui/wm/core/transient_window_manager_unittest.cc
index eaac027..79d2559 100644
--- a/ui/wm/core/transient_window_manager_unittest.cc
+++ b/ui/wm/core/transient_window_manager_unittest.cc
@@ -34,11 +34,11 @@
// TransientWindowObserver overrides:
virtual void OnTransientChildAdded(Window* window,
- Window* transient) OVERRIDE {
+ Window* transient) override {
add_count_++;
}
virtual void OnTransientChildRemoved(Window* window,
- Window* transient) OVERRIDE {
+ Window* transient) override {
remove_count_++;
}
@@ -54,12 +54,12 @@
TransientWindowManagerTest() {}
virtual ~TransientWindowManagerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AuraTestBase::SetUp();
wm_state_.reset(new wm::WMState);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
wm_state_.reset();
AuraTestBase::TearDown();
}
@@ -349,7 +349,7 @@
: name_(name),
results_(results) {}
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(aura::Window* window) override {
results_->push_back(name_);
}
@@ -462,12 +462,12 @@
private:
// Overridden from LayoutManager:
- virtual void OnWindowResized() OVERRIDE {}
- virtual void OnWindowAddedToLayout(Window* child) OVERRIDE {}
- virtual void OnWillRemoveWindowFromLayout(Window* child) OVERRIDE {}
- virtual void OnWindowRemovedFromLayout(Window* child) OVERRIDE {}
+ virtual void OnWindowResized() override {}
+ virtual void OnWindowAddedToLayout(Window* child) override {}
+ virtual void OnWillRemoveWindowFromLayout(Window* child) override {}
+ virtual void OnWindowRemovedFromLayout(Window* child) override {}
virtual void OnChildWindowVisibilityChanged(Window* child,
- bool visible) OVERRIDE {
+ bool visible) override {
Window::Windows::const_iterator it = root_window_->children().begin();
Window* last_window = NULL;
for (; it != root_window_->children().end(); ++it) {
@@ -482,7 +482,7 @@
}
}
virtual void SetChildBounds(Window* child,
- const gfx::Rect& requested_bounds) OVERRIDE {
+ const gfx::Rect& requested_bounds) override {
SetChildBoundsDirect(child, requested_bounds);
}
@@ -506,7 +506,7 @@
private:
// Overridden from client::VisibilityClient:
- virtual void UpdateLayerVisibility(Window* window, bool visible) OVERRIDE {
+ virtual void UpdateLayerVisibility(Window* window, bool visible) override {
if (!visible) {
if (window == ignored_window_)
window->layer()->set_delegate(NULL);
diff --git a/ui/wm/core/transient_window_stacking_client.h b/ui/wm/core/transient_window_stacking_client.h
index 4ab4aea..ce9d55c 100644
--- a/ui/wm/core/transient_window_stacking_client.h
+++ b/ui/wm/core/transient_window_stacking_client.h
@@ -21,7 +21,7 @@
// WindowStackingClient:
virtual bool AdjustStacking(aura::Window** child,
aura::Window** target,
- aura::Window::StackDirection* direction) OVERRIDE;
+ aura::Window::StackDirection* direction) override;
private:
// Purely for DCHECKs.
diff --git a/ui/wm/core/transient_window_stacking_client_unittest.cc b/ui/wm/core/transient_window_stacking_client_unittest.cc
index c5d3bd0..c067496 100644
--- a/ui/wm/core/transient_window_stacking_client_unittest.cc
+++ b/ui/wm/core/transient_window_stacking_client_unittest.cc
@@ -21,13 +21,13 @@
TransientWindowStackingClientTest() {}
virtual ~TransientWindowStackingClientTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AuraTestBase::SetUp();
client_.reset(new TransientWindowStackingClient);
aura::client::SetWindowStackingClient(client_.get());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
aura::client::SetWindowStackingClient(NULL);
AuraTestBase::TearDown();
}
diff --git a/ui/wm/core/user_activity_detector.h b/ui/wm/core/user_activity_detector.h
index 851f07a..7e5db9f 100644
--- a/ui/wm/core/user_activity_detector.h
+++ b/ui/wm/core/user_activity_detector.h
@@ -41,11 +41,11 @@
void OnDisplayPowerChanging();
// ui::EventHandler implementation.
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
- virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnScrollEvent(ui::ScrollEvent* event) override;
+ virtual void OnTouchEvent(ui::TouchEvent* event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
private:
// Returns |now_for_test_| if set or base::TimeTicks::Now() otherwise.
diff --git a/ui/wm/core/user_activity_detector_unittest.cc b/ui/wm/core/user_activity_detector_unittest.cc
index 620ab0c..0273093 100644
--- a/ui/wm/core/user_activity_detector_unittest.cc
+++ b/ui/wm/core/user_activity_detector_unittest.cc
@@ -26,7 +26,7 @@
void reset_stats() { num_invocations_ = 0; }
// UserActivityObserver implementation.
- virtual void OnUserActivity(const ui::Event* event) OVERRIDE {
+ virtual void OnUserActivity(const ui::Event* event) override {
num_invocations_++;
}
@@ -42,7 +42,7 @@
UserActivityDetectorTest() {}
virtual ~UserActivityDetectorTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
AuraTestBase::SetUp();
observer_.reset(new TestUserActivityObserver);
detector_.reset(new UserActivityDetector);
@@ -52,7 +52,7 @@
detector_->set_now_for_test(now_);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
detector_->RemoveObserver(observer_.get());
AuraTestBase::TearDown();
}
diff --git a/ui/wm/core/visibility_controller.h b/ui/wm/core/visibility_controller.h
index 47ae991..d29a6da 100644
--- a/ui/wm/core/visibility_controller.h
+++ b/ui/wm/core/visibility_controller.h
@@ -29,7 +29,7 @@
private:
// Overridden from aura::client::VisibilityClient:
virtual void UpdateLayerVisibility(aura::Window* window,
- bool visible) OVERRIDE;
+ bool visible) override;
DISALLOW_COPY_AND_ASSIGN(VisibilityController);
};
diff --git a/ui/wm/core/window_animations.cc b/ui/wm/core/window_animations.cc
index 8284990..746ea48 100644
--- a/ui/wm/core/window_animations.cc
+++ b/ui/wm/core/window_animations.cc
@@ -69,12 +69,12 @@
}
// aura::WindowObserver:
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {
+ virtual void OnWindowDestroying(aura::Window* window) override {
DCHECK_EQ(window, window_);
WindowInvalid();
}
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {
+ virtual void OnWindowDestroyed(aura::Window* window) override {
DCHECK_EQ(window, window_);
WindowInvalid();
}
@@ -168,7 +168,7 @@
virtual ~ImplicitHidingWindowAnimationObserver() {}
// ui::ImplicitAnimationObserver:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ virtual void OnImplicitAnimationsCompleted() override;
private:
DISALLOW_COPY_AND_ASSIGN(ImplicitHidingWindowAnimationObserver);
@@ -410,15 +410,15 @@
// ui::LayerAnimationObserver:
virtual void OnLayerAnimationEnded(
- ui::LayerAnimationSequence* sequence) OVERRIDE {
+ ui::LayerAnimationSequence* sequence) override {
OnAnimationCompleted();
}
virtual void OnLayerAnimationAborted(
- ui::LayerAnimationSequence* sequence) OVERRIDE {
+ ui::LayerAnimationSequence* sequence) override {
OnAnimationCompleted();
}
virtual void OnLayerAnimationScheduled(
- ui::LayerAnimationSequence* sequence) OVERRIDE {}
+ ui::LayerAnimationSequence* sequence) override {}
private:
DISALLOW_COPY_AND_ASSIGN(RotateHidingWindowAnimationObserver);
diff --git a/ui/wm/core/window_animations_unittest.cc b/ui/wm/core/window_animations_unittest.cc
index 0a9a944..b1db736 100644
--- a/ui/wm/core/window_animations_unittest.cc
+++ b/ui/wm/core/window_animations_unittest.cc
@@ -47,7 +47,7 @@
public:
WindowAnimationsTest() {}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
AuraTestBase::TearDown();
}
@@ -258,13 +258,13 @@
virtual ~NotifyHideCompletedAnimationHost() {}
// Overridden from TestWindowDelegate:
- virtual void OnWindowHidingAnimationCompleted() OVERRIDE {
+ virtual void OnWindowHidingAnimationCompleted() override {
hide_completed_ = true;
}
virtual void SetHostTransitionOffsets(
const gfx::Vector2d& top_left,
- const gfx::Vector2d& bottom_right) OVERRIDE {}
+ const gfx::Vector2d& bottom_right) override {}
bool hide_completed() const { return hide_completed_; }
diff --git a/ui/wm/core/window_modality_controller.h b/ui/wm/core/window_modality_controller.h
index 4d52c21..33386ce 100644
--- a/ui/wm/core/window_modality_controller.h
+++ b/ui/wm/core/window_modality_controller.h
@@ -38,20 +38,20 @@
virtual ~WindowModalityController();
// Overridden from ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
- virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
- virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
+ virtual void OnKeyEvent(ui::KeyEvent* event) override;
+ virtual void OnMouseEvent(ui::MouseEvent* event) override;
+ virtual void OnTouchEvent(ui::TouchEvent* event) override;
// Overridden from aura::EnvObserver:
- virtual void OnWindowInitialized(aura::Window* window) OVERRIDE;
+ virtual void OnWindowInitialized(aura::Window* window) override;
// Overridden from aura::WindowObserver:
virtual void OnWindowPropertyChanged(aura::Window* window,
const void* key,
- intptr_t old) OVERRIDE;
+ intptr_t old) override;
virtual void OnWindowVisibilityChanged(aura::Window* window,
- bool visible) OVERRIDE;
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+ bool visible) override;
+ virtual void OnWindowDestroyed(aura::Window* window) override;
private:
// Processes a mouse/touch event, and returns true if the event should be
diff --git a/ui/wm/public/scoped_tooltip_disabler.h b/ui/wm/public/scoped_tooltip_disabler.h
index 0fd3e11..1022788 100644
--- a/ui/wm/public/scoped_tooltip_disabler.h
+++ b/ui/wm/public/scoped_tooltip_disabler.h
@@ -24,7 +24,7 @@
void EnableTooltips();
// aura::WindowObserver:
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
+ virtual void OnWindowDestroying(aura::Window* window) override;
// The RootWindow to disable Tooltips on; NULL if the Window passed to the
// constructor was not in a root or the root has been destroyed.
diff --git a/ui/wm/test/run_all_unittests.cc b/ui/wm/test/run_all_unittests.cc
index 6e04469..a0ac59d 100644
--- a/ui/wm/test/run_all_unittests.cc
+++ b/ui/wm/test/run_all_unittests.cc
@@ -18,7 +18,7 @@
WMTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
protected:
- virtual void Initialize() OVERRIDE {
+ virtual void Initialize() override {
base::TestSuite::Initialize();
gfx::GLSurface::InitializeOneOffForTests();
ui::RegisterPathProvider();
@@ -28,7 +28,7 @@
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
}
- virtual void Shutdown() OVERRIDE {
+ virtual void Shutdown() override {
ui::ResourceBundle::CleanupSharedInstance();
base::TestSuite::Shutdown();
}
diff --git a/ui/wm/test/wm_test_helper.h b/ui/wm/test/wm_test_helper.h
index 79e15ff..990b478 100644
--- a/ui/wm/test/wm_test_helper.h
+++ b/ui/wm/test/wm_test_helper.h
@@ -47,7 +47,7 @@
// Overridden from client::WindowTreeClient:
virtual aura::Window* GetDefaultParent(aura::Window* context,
aura::Window* window,
- const gfx::Rect& bounds) OVERRIDE;
+ const gfx::Rect& bounds) override;
private:
scoped_ptr<aura::WindowTreeHost> host_;