From 1e246403c8ca085728dab122c5266de0bcbb25db Mon Sep 17 00:00:00 2001 From: roytam1 Date: Fri, 12 Apr 2024 11:51:15 +0800 Subject: [PATCH] =?UTF-8?q?import=20changes=20from=20`dev'=20branch=20of?= =?UTF-8?q?=20rmottola/Arctic-Fox:=20-=20Bug=201165052=20-=20Part=209:=20U?= =?UTF-8?q?se=20ArraySpeciesCreate=20in=20Array.prototype.filter.=20r=3Def?= =?UTF-8?q?aust=20(198da18845)=20-=20Bug=201165052=20-=20Part=2010:=20Use?= =?UTF-8?q?=20ArraySpeciesCreate=20in=20Array.prototype.map.=20r=3Defaust?= =?UTF-8?q?=20(9dcd625daa)=20-=20Bug=201263618:=20Adapt=20assertions=20in?= =?UTF-8?q?=20RegExp*Raw=20functions=20for=20int32=5Ft;=20r=3Darai=20(8ad4?= =?UTF-8?q?6db66d)=20-=20Bug=201263340=20-=20Part=201:=20Use=20internal=20?= =?UTF-8?q?slot=20for=20global=20and=20sticky=20flags=20in=20RegExpBuiltin?= =?UTF-8?q?Exec.=20r=3Dh4writer=20(9b5fbe6358)=20-=20Bug=201263340=20-=20P?= =?UTF-8?q?art=202:=20Use=20internal=20slot=20for=20sticky=20flag=20in=20@?= =?UTF-8?q?@replace=20and=20@@search=20optimized=20path.=20r=3Dh4writer=20?= =?UTF-8?q?(2b64567c6a)=20-=20Bug=201264264=20-=20Add=20optimized=20path?= =?UTF-8?q?=20for=20RegExp.prototype[@@replace]=20with=20functional=20repl?= =?UTF-8?q?ace=20and=20substitution.=20r=3Dtill=20(e55722bc0a)=20-=20Bug?= =?UTF-8?q?=201263340=20-=20Part=203:=20Use=20internal=20slot=20for=20stic?= =?UTF-8?q?ky=20flag=20in=20RegExp=20native=20functions.=20r=3Dh4writer=20?= =?UTF-8?q?(725cf7b9b0)=20-=20Bug=201264264=20-=20Part=202:=20Enable=20opt?= =?UTF-8?q?imization=20for=20packers=20again=20in=20RegExp.prototype[@@rep?= =?UTF-8?q?lace].=20r=3Dh4writer=20(7f4b819e40)=20-=20Bug=201268056=20-=20?= =?UTF-8?q?Check=20if=20|this|=20value=20is=20a=20RegExp=20object=20in=20t?= =?UTF-8?q?he=20optimized=20path=20in=20RegExpSplit.=20r=3Dh4writer=20(889?= =?UTF-8?q?1f0a3ef)=20-=20Bug=201263340=20-=20Part=204:=20Followup=20for?= =?UTF-8?q?=20@@split=20-=20Apply=20optimized=20path=20for=20empty=20strin?= =?UTF-8?q?g=20too.=20r=3Dtill=20(956d1804a5)=20-=20Bug=201261207=20-=20Fo?= =?UTF-8?q?rward=20declare=20js::ScriptSource=20instead=20of=20casting=20`?= =?UTF-8?q?=C3=82=C2=A6void*`=20pointers;=20r=3Djimb=20(4914273e96)=20-=20?= =?UTF-8?q?Bug=201041586=20-=20Implement=20Symbol.isConcatSpreadable.=20r?= =?UTF-8?q?=3Darai=20(238e5f97c6)=20-=20Bug=201041586=20-=20Use=20IsConcat?= =?UTF-8?q?Spreadable=20in=20Array.prototype.concat.=20r=3Darai=20(33333cb?= =?UTF-8?q?30f)=20-=20Bug=201165052=20-=20Part=2011:=20Use=20ArraySpeciesC?= =?UTF-8?q?reate=20in=20Array.prototype.slice.=20r=3Defaust=20(45f34c0a87)?= =?UTF-8?q?=20-=20Bug=201165052=20-=20Part=2012:=20Use=20ArraySpeciesCreat?= =?UTF-8?q?e=20in=20Array.prototype.splice.=20r=3Defaust,evilpie=20(096f9f?= =?UTF-8?q?f03d)=20-=20Bug=201165052=20-=20Part=2013:=20Add=20tests=20for?= =?UTF-8?q?=20ArraySpeciesCreate.=20r=3Defaust=20(4403642d3c)=20-=20Bug=20?= =?UTF-8?q?1041586=20-=20Tests.=20r=3Darai=20(efc2d06863)=20-=20Bug=201267?= =?UTF-8?q?364=20-=20Check=20isNative=20every=20time=20in=20GetStringDataP?= =?UTF-8?q?roperty.=20r=3Dh4writer=20(6e7898c494)=20-=20Bug=201041586=20-?= =?UTF-8?q?=20Fold=20away=20property=20accesses=20to=20not-defined=20prope?= =?UTF-8?q?rties.=20r=3Djandem=20(216e6387db)=20-=20add=20emacs=20(fa85877?= =?UTF-8?q?1bf)=20-=20Bug=201268574=20-=20Check=20the=20outparam=20JSFunct?= =?UTF-8?q?ion*=20value=20after=20GetGetterPure.=20r=3Dlth=20(3d80c79337)?= =?UTF-8?q?=20-=20Bug=201263888=20-=20Push=20TypeBarrier=20after=20ArraySl?= =?UTF-8?q?ice.=20r=3Djandem=20(2617518401)=20-=20Bug=201255316=20-=20IonM?= =?UTF-8?q?onkey:=20Enable=20folding=20of=20MLoadUnboxedObjectOrNull=20wit?= =?UTF-8?q?h=20the=20stored=20value,=20r=3Djandem=20(0f75675721)=20-=20Bug?= =?UTF-8?q?=201252313=20-=20Fix=20wasm=20i64=20shift=20ops=20with=20a=20co?= =?UTF-8?q?nstant=20rhs.=20r=3Dbbouvier=20(2c05b901c6)=20-=20Bug=201263609?= =?UTF-8?q?:=20SharedStubs=20-=20Port=20JSOP=5FPOW=20to=20shared=20stubs,?= =?UTF-8?q?=20r=3Defaust=20(54523590d9)=20-=20Bug=201247880=20-=20Only=20r?= =?UTF-8?q?emove=20MUrsh=20operands=20when=20the=20input=20of=20MUrsh=20is?= =?UTF-8?q?=20guaranteed=20to=20be=20unsigned.=20r=3Dsunfish=20(4a29e0b071?= =?UTF-8?q?)=20-=20Bug=201254528:=20IonMonkey=20-=20Check=20slot=20before?= =?UTF-8?q?=20removing=20load=20with=20value=20of=20store,=20r=3Dnbp=20(35?= =?UTF-8?q?27eb5263)=20-=20Bug=201255316=20-=20IonMonkey:=20Also=20take=20?= =?UTF-8?q?into=20account=20the=20offsetAdjustment=20when=20folding=20MLoa?= =?UTF-8?q?dUnboxedObjectOrNull,=20r=3Djandem=20(9cbea97df1)=20-=20Bug=201?= =?UTF-8?q?263558=20-=20Part=201:=20Self-host=20Array=20generics.=20r=3Dti?= =?UTF-8?q?ll,bholley=20(e1dc0c54c8)=20-=20Bug=201103588=20-=20Part=203:?= =?UTF-8?q?=20Replace=20deprecated=20String#contains=20warning=20with=20an?= =?UTF-8?q?=20expression=20closure=20warning=20in=20sharedWorker=5FsharedW?= =?UTF-8?q?orker.js=20test.=20r=3Dbz=20(221ff40ebc)=20-=20Bug=201103588=20?= =?UTF-8?q?-=20Part=204:=20Replace=20deprecated=20String#contains=20in=20j?= =?UTF-8?q?s=20tests.=20r=3Dtill=20(a794c0b385)=20-=20Bug=201103588=20-=20?= =?UTF-8?q?Part=205:=20Remove=20deprecated=20String#contains=20function;?= =?UTF-8?q?=20use=20String#includes=20instead.=20r=3Dtill=20(bc1365603e)?= =?UTF-8?q?=20-=20Bug=20964709=20-=20Updates=20Parser=20regex=20and=20test?= =?UTF-8?q?s=20to=20support=20self-closing=20script=20tags,=20r=3Dvporof?= =?UTF-8?q?=20(f04c475ec8)=20-=20Bug=201224726=20-=20Do=20not=20attempt=20?= =?UTF-8?q?to=20parse=20source=20file=20when=20searching=20in=20debugger?= =?UTF-8?q?=20if=20text=20>=201MB;r=3Djlongster=20(8743b7bf19)=20-=20Bug?= =?UTF-8?q?=201263558=20-=20Part=202:=20Self-host=20String=20generics.=20r?= =?UTF-8?q?=3Dtill=20(4e5766489b)=20-=20Bug=201263558=20-=20Part=203:=20Re?= =?UTF-8?q?move=20JSFUN=5FGENERIC=5FNATIVE.=20r=3Dtill=20(3f94c198b0)=20-?= =?UTF-8?q?=20Bug=201263558=20-=20Part=204:=20Call=20initBuiltinConstructo?= =?UTF-8?q?r=20after=20defining=20properties=20in=20InitStringClass.=20r?= =?UTF-8?q?=3Dtill=20(f25edc6096)=20-=20Bug=201263558=20-=20Part=200.1:=20?= =?UTF-8?q?Handle=20OOM=20inside=20BuildDominatorTree=20at=20AnalyzeNewScr?= =?UTF-8?q?iptDefiniteProperties=20and=20AnalyzeArgumentsUsage.=20r=3Djand?= =?UTF-8?q?em=20(0f4745e9d4)=20-=20Bug=201266573=20-=20Add=20the=20JS::ubi?= =?UTF-8?q?::dumpPaths=20debug=20utility;=20r=3Djimb=20(9a8680d7c7)=20-=20?= =?UTF-8?q?Bug=201266835=20-=20Request=20names=20from=20the=20rootlist=20i?= =?UTF-8?q?n=20JS::ubi::dumpPaths=20and=20clean=20up=20formatting=20of=20d?= =?UTF-8?q?umped=20paths.=20r=3Djimb=20(1e15dd3ab9)=20-=20Bug=201259911:?= =?UTF-8?q?=20Only=20add=20predecessors=20to=20the=20join=20block=20once;?= =?UTF-8?q?=20r=3Dsunfish=20(53a9522e68)=20-=20Bug=201258905:=20Remove=20a?= =?UTF-8?q?=20bunch=20of=20dead=20IPC=20code.=20r=3Djld=20(0d9f930a14)=20-?= =?UTF-8?q?=20Bug=201266869=20-=20Print=20a=20message=20when=20no=20retain?= =?UTF-8?q?ing=20paths=20are=20found=20in=20JS::ubi::dumpPaths.=20r=3Djimb?= =?UTF-8?q?=20(77a541b4d1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dom/base/nsFrameMessageManager.cpp | 14 + dom/media/gmp/GMPProcessChild.cpp | 1 - dom/plugins/ipc/PluginProcessChild.cpp | 1 - dom/workers/test/sharedWorker_sharedWorker.js | 8 +- gfx/2d/convolver.h | 1 - ipc/chromium/moz.build | 7 - ipc/chromium/src/base/base_switches.cc | 43 -- ipc/chromium/src/base/base_switches.h | 27 -- ipc/chromium/src/base/idle_timer.cc | 159 ------- ipc/chromium/src/base/idle_timer.h | 97 ---- ipc/chromium/src/base/idle_timer_none.cc | 25 - ipc/chromium/src/base/linux_util.h | 19 - ipc/chromium/src/base/process_util_linux.cc | 1 - ipc/chromium/src/base/registry.cc | 417 ----------------- ipc/chromium/src/base/registry.h | 225 --------- ipc/chromium/src/base/string_tokenizer.h | 202 -------- .../src/base/sys_string_conversions.h | 12 - .../src/base/sys_string_conversions_win.cc | 36 +- .../src/base/thread_collision_warner.cc | 64 --- .../src/base/thread_collision_warner.h | 242 ---------- ipc/chromium/src/base/time_format.h | 40 -- ipc/chromium/src/base/win_util.cc | 35 -- ipc/chromium/src/base/win_util.h | 13 - .../src/chrome/common/chrome_switches.cc | 423 ----------------- .../src/chrome/common/chrome_switches.h | 158 +------ ipc/chromium/src/chrome/common/env_vars.cc | 33 -- ipc/chromium/src/chrome/common/env_vars.h | 26 -- .../src/chrome/common/ipc_channel_posix.cc | 256 ++--------- .../src/chrome/common/ipc_channel_posix.h | 4 - .../src/chrome/common/process_watcher_win.cc | 10 - ipc/glue/MessageChannel.cpp | 10 + js/public/TrackedOptimizationInfo.h | 2 + js/public/UbiNodeShortestPaths.h | 13 + js/src/asmjs/WasmIonCompile.cpp | 18 +- js/src/builtin/Array.js | 128 ++++-- js/src/builtin/RegExp.cpp | 323 +++++++++---- js/src/builtin/RegExp.h | 24 +- js/src/builtin/RegExp.js | 435 +++++++++--------- js/src/builtin/RegExpGlobalReplaceOpt.h.js | 125 +++++ js/src/builtin/RegExpLocalReplaceOpt.h.js | 95 ++++ js/src/builtin/SelfHostingDefines.h | 8 + js/src/builtin/String.js | 111 ++++- js/src/builtin/embedjs.py | 4 +- js/src/jit-test/tests/asm.js/bug940864.js | 10 + .../jit-test/tests/auto-regress/bug1263558.js | 16 + .../tests/basic/splice-check-steps.js | 15 + .../basic/testArrayBufferSpeciesDelete.js | 5 + .../tests/basic/testArraySpeciesDelete.js | 5 + js/src/jit-test/tests/ion/bug1247880.js | 12 + js/src/jit-test/tests/ion/testStringMatch.js | 48 -- .../self-hosting/GetStringDataProperty.js | 33 ++ js/src/jit-test/tests/wasm/basic-integer.js | 10 + .../tests/wasm/random-control-flow.js | 5 + js/src/jit/CodeGenerator.cpp | 105 +---- js/src/jit/IonAnalysis.cpp | 8 +- js/src/jit/IonBuilder.cpp | 171 +++++-- js/src/jit/IonBuilder.h | 7 +- js/src/jit/Lowering.cpp | 12 +- js/src/jit/MCallOptimize.cpp | 134 +----- js/src/jit/MIR.cpp | 80 +++- js/src/jit/MIR.h | 63 +-- js/src/jit/Recover.cpp | 9 +- js/src/jit/TypePolicy.cpp | 2 +- js/src/jit/arm/Assembler-arm.h | 2 - js/src/jit/arm64/Assembler-arm64.h | 2 - .../jit/mips-shared/Assembler-mips-shared.h | 2 - js/src/jit/shared/LIR-shared.h | 24 +- js/src/jit/x64/Assembler-x64.h | 2 - js/src/jit/x64/CodeGenerator-x64.cpp | 2 +- js/src/jit/x86/Assembler-x86.h | 2 - js/src/js.msg | 1 - js/src/jsapi.cpp | 9 +- js/src/jsapi.h | 22 +- js/src/jsarray.cpp | 321 +++++++++---- js/src/jsarray.h | 6 + js/src/jsobj.cpp | 49 -- js/src/jsstr.cpp | 121 ++--- js/src/jsstr.h | 38 ++ js/src/moz.build | 2 + .../ecma_6/Array/concat-spreadable-basic.js | 37 ++ .../Array/concat-spreadable-primitive.js | 34 ++ js/src/tests/ecma_6/Array/species.js | 182 ++++++++ js/src/tests/ecma_6/Comprehensions/sudoku.js | 25 +- js/src/tests/ecma_6/RegExp/split-obj.js | 12 + js/src/tests/ecma_6/Symbol/well-known.js | 1 + js/src/tests/js1_6/Array/generics.js | 331 +++++++++++++ js/src/tests/js1_6/String/generics.js | 228 +++++++++ js/src/tests/shell/warning.js | 9 +- js/src/vm/GlobalObject.cpp | 8 + js/src/vm/GlobalObject.h | 7 - js/src/vm/RegExpObject.cpp | 28 +- js/src/vm/RegExpObject.h | 63 ++- js/src/vm/RegExpStatics.cpp | 2 +- js/src/vm/RegExpStatics.h | 11 +- js/src/vm/SelfHosting.cpp | 20 + js/src/vm/TypedArrayObject.cpp | 3 + js/src/vm/UbiNodeShortestPaths.cpp | 56 +++ js/xpconnect/tests/chrome/test_xrayToJS.xul | 8 +- toolkit/components/telemetry/Histograms.json | 20 + toolkit/devtools/debugger/debugger-view.js | 7 + .../devtools/debugger/views/filter-view.js | 8 +- toolkit/devtools/shared/Parser.jsm | 6 +- 102 files changed, 2812 insertions(+), 3544 deletions(-) delete mode 100644 ipc/chromium/src/base/base_switches.cc delete mode 100644 ipc/chromium/src/base/base_switches.h delete mode 100644 ipc/chromium/src/base/idle_timer.cc delete mode 100644 ipc/chromium/src/base/idle_timer.h delete mode 100644 ipc/chromium/src/base/idle_timer_none.cc delete mode 100644 ipc/chromium/src/base/linux_util.h delete mode 100644 ipc/chromium/src/base/registry.cc delete mode 100644 ipc/chromium/src/base/registry.h delete mode 100644 ipc/chromium/src/base/string_tokenizer.h delete mode 100644 ipc/chromium/src/base/thread_collision_warner.cc delete mode 100644 ipc/chromium/src/base/thread_collision_warner.h delete mode 100644 ipc/chromium/src/base/time_format.h delete mode 100644 ipc/chromium/src/chrome/common/env_vars.cc delete mode 100644 ipc/chromium/src/chrome/common/env_vars.h create mode 100644 js/src/builtin/RegExpGlobalReplaceOpt.h.js create mode 100644 js/src/builtin/RegExpLocalReplaceOpt.h.js create mode 100644 js/src/jit-test/tests/asm.js/bug940864.js create mode 100644 js/src/jit-test/tests/auto-regress/bug1263558.js create mode 100644 js/src/jit-test/tests/basic/testArrayBufferSpeciesDelete.js create mode 100644 js/src/jit-test/tests/basic/testArraySpeciesDelete.js create mode 100644 js/src/jit-test/tests/ion/bug1247880.js create mode 100644 js/src/jit-test/tests/self-hosting/GetStringDataProperty.js create mode 100644 js/src/tests/ecma_6/Array/concat-spreadable-basic.js create mode 100644 js/src/tests/ecma_6/Array/concat-spreadable-primitive.js create mode 100644 js/src/tests/ecma_6/Array/species.js create mode 100644 js/src/tests/ecma_6/RegExp/split-obj.js create mode 100644 js/src/tests/js1_6/Array/generics.js create mode 100644 js/src/tests/js1_6/String/generics.js diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp index 8da9a7000b..e8a7796ff0 100644 --- a/dom/base/nsFrameMessageManager.cpp +++ b/dom/base/nsFrameMessageManager.cpp @@ -69,6 +69,8 @@ using namespace mozilla; using namespace mozilla::dom; using namespace mozilla::dom::ipc; +static const int kMinTelemetryMessageSize = 8192; + nsFrameMessageManager::nsFrameMessageManager(mozilla::dom::ipc::MessageManagerCallback* aCallback, nsFrameMessageManager* aParentManager, /* mozilla::dom::ipc::MessageManagerFlags */ uint32_t aFlags) @@ -730,6 +732,12 @@ nsFrameMessageManager::SendMessage(const nsAString& aMessageName, return NS_ERROR_DOM_DATA_CLONE_ERR; } + if (data.DataLength() >= kMinTelemetryMessageSize) { + Telemetry::Accumulate(Telemetry::MESSAGE_MANAGER_MESSAGE_SIZE, + NS_ConvertUTF16toUTF8(aMessageName), + data.DataLength()); + } + JS::Rooted objects(aCx); if (aArgc >= 3 && aObjects.isObject()) { objects = &aObjects.toObject(); @@ -810,6 +818,12 @@ nsFrameMessageManager::DispatchAsyncMessage(const nsAString& aMessageName, return NS_ERROR_DOM_DATA_CLONE_ERR; } + if (data.DataLength() >= kMinTelemetryMessageSize) { + Telemetry::Accumulate(Telemetry::MESSAGE_MANAGER_MESSAGE_SIZE, + NS_ConvertUTF16toUTF8(aMessageName), + data.DataLength()); + } + JS::Rooted objects(aCx); if (aArgc >= 3 && aObjects.isObject()) { objects = &aObjects.toObject(); diff --git a/dom/media/gmp/GMPProcessChild.cpp b/dom/media/gmp/GMPProcessChild.cpp index ce2d0e3fc2..294cabb425 100644 --- a/dom/media/gmp/GMPProcessChild.cpp +++ b/dom/media/gmp/GMPProcessChild.cpp @@ -7,7 +7,6 @@ #include "base/command_line.h" #include "base/string_util.h" -#include "chrome/common/chrome_switches.h" #include "mozilla/ipc/IOThreadChild.h" #include "mozilla/BackgroundHangMonitor.h" diff --git a/dom/plugins/ipc/PluginProcessChild.cpp b/dom/plugins/ipc/PluginProcessChild.cpp index 85a6bb500f..a82549d3dc 100644 --- a/dom/plugins/ipc/PluginProcessChild.cpp +++ b/dom/plugins/ipc/PluginProcessChild.cpp @@ -11,7 +11,6 @@ #include "base/command_line.h" #include "base/string_util.h" -#include "chrome/common/chrome_switches.h" #include "nsDebugImpl.h" #if defined(XP_MACOSX) diff --git a/dom/workers/test/sharedWorker_sharedWorker.js b/dom/workers/test/sharedWorker_sharedWorker.js index 869d290ebf..5e8e93392b 100644 --- a/dom/workers/test/sharedWorker_sharedWorker.js +++ b/dom/workers/test/sharedWorker_sharedWorker.js @@ -72,10 +72,10 @@ onconnect = function(event) { throw new Error("'connect' event has data: " + event.data); } - // "".contains("") should trigger a warning in debug builds, but NOT fire - // error events at us. If we ever actually remove contains() we'll need - // something else to test this case. - "".contains(""); + // The expression closures should trigger a warning in debug builds, but NOT + // fire error events at us. If we ever actually remove expression closures + // (in bug 1083458), we'll need something else to test this case. + (function() "Expected console warning: expression closures are deprecated"); event.ports[0].onmessage = function(event) { if (!(event instanceof MessageEvent)) { diff --git a/gfx/2d/convolver.h b/gfx/2d/convolver.h index 156193eb71..0c4591ac80 100644 --- a/gfx/2d/convolver.h +++ b/gfx/2d/convolver.h @@ -33,7 +33,6 @@ #include #include "base/basictypes.h" -#include "base/cpu.h" #include "mozilla/Assertions.h" #include "skia/include/core/SkTypes.h" diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build index 88aaafe859..97d00a281e 100644 --- a/ipc/chromium/moz.build +++ b/ipc/chromium/moz.build @@ -9,7 +9,6 @@ include(libevent_path_prefix + '/libeventcommon.mozbuild') UNIFIED_SOURCES += [ 'src/base/at_exit.cc', - 'src/base/base_switches.cc', 'src/base/command_line.cc', 'src/base/file_path.cc', 'src/base/file_util.cc', @@ -25,7 +24,6 @@ UNIFIED_SOURCES += [ 'src/base/string_piece.cc', 'src/base/string_util.cc', 'src/base/thread.cc', - 'src/base/thread_collision_warner.cc', 'src/base/time.cc', 'src/base/timer.cc', 'src/base/tracked.cc', @@ -35,7 +33,6 @@ UNIFIED_SOURCES += [ 'src/chrome/common/child_process_info.cc', 'src/chrome/common/child_thread.cc', 'src/chrome/common/chrome_switches.cc', - 'src/chrome/common/env_vars.cc', 'src/chrome/common/ipc_channel.cc', 'src/chrome/common/ipc_channel_proxy.cc', 'src/chrome/common/ipc_message.cc', @@ -50,7 +47,6 @@ if os_win: 'src/base/condition_variable_win.cc', 'src/base/cpu.cc', 'src/base/file_util_win.cc', - 'src/base/idle_timer.cc', 'src/base/lock_impl_win.cc', 'src/base/message_pump_win.cc', 'src/base/object_watcher.cc', @@ -59,7 +55,6 @@ if os_win: 'src/base/process_util_win.cc', 'src/base/process_win.cc', 'src/base/rand_util_win.cc', - 'src/base/registry.cc', 'src/base/shared_memory_win.cc', 'src/base/sys_info_win.cc', 'src/base/sys_string_conversions_win.cc', @@ -104,7 +99,6 @@ if os_macosx: UNIFIED_SOURCES += [ 'src/base/chrome_application_mac.mm', 'src/base/file_util_mac.mm', - 'src/base/idle_timer.cc', 'src/base/mac_util.mm', 'src/base/message_pump_mac.mm', 'src/base/process_util_mac.mm', @@ -139,7 +133,6 @@ if os_bsd: if os_linux: SOURCES += [ 'src/base/atomicops_internals_x86_gcc.cc', - 'src/base/idle_timer_none.cc', 'src/base/process_util_linux.cc', 'src/base/time_posix.cc', ] diff --git a/ipc/chromium/src/base/base_switches.cc b/ipc/chromium/src/base/base_switches.cc deleted file mode 100644 index 77d263c4da..0000000000 --- a/ipc/chromium/src/base/base_switches.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2006-2008 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/base_switches.h" - -namespace switches { - -// If the program includes chrome/common/debug_on_start.h, the process will -// start the JIT system-registered debugger on itself and will wait for 60 -// seconds for the debugger to attach to itself. Then a break point will be hit. -const wchar_t kDebugOnStart[] = L"debug-on-start"; - -// Will wait for 60 seconds for a debugger to come to attach to the process. -const wchar_t kWaitForDebugger[] = L"wait-for-debugger"; - -// Suppresses all error dialogs when present. -const wchar_t kNoErrorDialogs[] = L"noerrdialogs"; - -// Disables the crash reporting. -const wchar_t kDisableBreakpad[] = L"disable-breakpad"; - -// Generates full memory crash dump. -const wchar_t kFullMemoryCrashReport[] = L"full-memory-crash-report"; - -// The value of this switch determines whether the process is started as a -// renderer or plugin host. If it's empty, it's the browser. -const wchar_t kProcessType[] = L"type"; - -// Enable DCHECKs in release mode. -const wchar_t kEnableDCHECK[] = L"enable-dcheck"; - -// Refuse to make HTTP connections and refuse to accept certificate errors. -// For more information about the design of this feature, please see -// -// ForceHTTPS: Protecting High-Security Web Sites from Network Attacks -// Collin Jackson and Adam Barth -// In Proc. of the 17th International World Wide Web Conference (WWW 2008) -// -// Available at http://www.adambarth.com/papers/2008/jackson-barth.pdf -const wchar_t kForceHTTPS[] = L"force-https"; - -} // namespace switches diff --git a/ipc/chromium/src/base/base_switches.h b/ipc/chromium/src/base/base_switches.h deleted file mode 100644 index bc679111ab..0000000000 --- a/ipc/chromium/src/base/base_switches.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2006-2008 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. - -// Defines all the "base" command-line switches. - -#ifndef BASE_BASE_SWITCHES_H_ -#define BASE_BASE_SWITCHES_H_ - -#if defined(COMPILER_MSVC) -#include -#endif - -namespace switches { - -extern const wchar_t kDebugOnStart[]; -extern const wchar_t kWaitForDebugger[]; -extern const wchar_t kDisableBreakpad[]; -extern const wchar_t kFullMemoryCrashReport[]; -extern const wchar_t kNoErrorDialogs[]; -extern const wchar_t kProcessType[]; -extern const wchar_t kEnableDCHECK[]; -extern const wchar_t kForceHTTPS[]; - -} // namespace switches - -#endif // BASE_BASE_SWITCHES_H_ diff --git a/ipc/chromium/src/base/idle_timer.cc b/ipc/chromium/src/base/idle_timer.cc deleted file mode 100644 index 8a7301fa6e..0000000000 --- a/ipc/chromium/src/base/idle_timer.cc +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) 2006-2008 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/idle_timer.h" - -// We may not want to port idle_timer to Linux, but we have implemented it -// anyway. Define this to 1 to enable the Linux idle timer and then add the -// libs that need to be linked (Xss). -#define ENABLE_XSS_SUPPORT 0 - -#if defined(OS_MACOSX) -#include -#endif - -#if defined(OS_LINUX) && ENABLE_XSS_SUPPORT -// We may not want to port idle_timer to Linux, but we have implemented it -// anyway. Remove the 0 above if we want it. -#include -#include -#include "base/thread_local.h" -#endif - -#include "base/message_loop.h" -#include "base/time.h" - -namespace base { - -#if defined(OS_WIN) -bool OSIdleTimeSource(int32_t *milliseconds_interval_since_last_event) { - LASTINPUTINFO lastInputInfo; - lastInputInfo.cbSize = sizeof(lastInputInfo); - if (GetLastInputInfo(&lastInputInfo) == 0) { - return false; - } - int32_t last_input_time = lastInputInfo.dwTime; - - // Note: On Windows GetLastInputInfo returns a 32bit value which rolls over - // ~49days. - int32_t current_time = GetTickCount(); - int32_t delta = current_time - last_input_time; - // delta will go negative if we've been idle for 2GB of ticks. - if (delta < 0) - delta = -delta; - *milliseconds_interval_since_last_event = delta; - return true; -} -#elif defined(OS_MACOSX) -bool OSIdleTimeSource(int32_t *milliseconds_interval_since_last_event) { - *milliseconds_interval_since_last_event = - CGEventSourceSecondsSinceLastEventType( - kCGEventSourceStateCombinedSessionState, - kCGAnyInputEventType) * 1000.0; - return true; -} -#elif defined(OS_LINUX) && ENABLE_XSS_SUPPORT -class IdleState { - public: - IdleState() { - int event_base, error_base; - have_idle_info_ = XScreenSaverQueryExtension(GDK_DISPLAY(), &event_base, - &error_base); - if (have_idle_info_) - idle_info_.Set(XScreenSaverAllocInfo()); - } - - ~IdleState() { - if (idle_info_.Get()) { - XFree(idle_info_.Get()); - idle_info_.~ThreadLocalPointer(); - } - } - - int32_t IdleTime() { - if (have_idle_info_ && idle_info_.Get()) { - XScreenSaverQueryInfo(GDK_DISPLAY(), GDK_ROOT_WINDOW(), - idle_info_.Get()); - return idle_info_.Get()->idle; - } - return -1; - } - - private: - bool have_idle_info_; - ThreadLocalPointer idle_info_; - - DISALLOW_COPY_AND_ASSIGN(IdleState); -}; - -bool OSIdleTimeSource(int32_t* milliseconds_interval_since_last_event) { - static IdleState state; - int32_t idle_time = state.IdleTime(); - if (0 < idle_time) { - *milliseconds_interval_since_last_event = idle_time; - return true; - } - return false; -} -#endif - -IdleTimer::IdleTimer(TimeDelta idle_time, bool repeat) - : idle_interval_(idle_time), - repeat_(repeat), - idle_time_source_(OSIdleTimeSource) { - DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()) << - "Requires a thread that processes Windows UI events"; -} - -IdleTimer::~IdleTimer() { - Stop(); -} - -void IdleTimer::Start() { - StartTimer(); -} - -void IdleTimer::Stop() { - timer_.Stop(); -} - -void IdleTimer::Run() { - // Verify we can fire the idle timer. - if (TimeUntilIdle().InMilliseconds() <= 0) { - OnIdle(); - last_time_fired_ = Time::Now(); - } - Stop(); - StartTimer(); // Restart the timer for next run. -} - -void IdleTimer::StartTimer() { - DCHECK(!timer_.IsRunning()); - TimeDelta delay = TimeUntilIdle(); - if (delay.InMilliseconds() < 0) - delay = TimeDelta(); - timer_.Start(delay, this, &IdleTimer::Run); -} - -TimeDelta IdleTimer::CurrentIdleTime() { - int32_t interval = 0; - if (idle_time_source_(&interval)) { - return TimeDelta::FromMilliseconds(interval); - } - NOTREACHED(); - return TimeDelta::FromMilliseconds(0); -} - -TimeDelta IdleTimer::TimeUntilIdle() { - TimeDelta time_since_last_fire = Time::Now() - last_time_fired_; - TimeDelta current_idle_time = CurrentIdleTime(); - if (current_idle_time > time_since_last_fire) { - if (repeat_) - return idle_interval_ - time_since_last_fire; - return idle_interval_; - } - return idle_interval_ - current_idle_time; -} - -} // namespace base diff --git a/ipc/chromium/src/base/idle_timer.h b/ipc/chromium/src/base/idle_timer.h deleted file mode 100644 index 746c246893..0000000000 --- a/ipc/chromium/src/base/idle_timer.h +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2006-2008 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. - -// IdleTimer is a recurring Timer which runs only when the system is idle. -// System Idle time is defined as not having any user keyboard or mouse -// activity for some period of time. Because the timer is user dependant, it -// is possible for the timer to never fire. -// -// Usage should be for low-priority work, and may look like this: -// -// class MyIdleTimer : public IdleTimer { -// public: -// // This timer will run repeatedly after 5 seconds of idle time -// MyIdleTimer() : IdleTimer(TimeDelta::FromSeconds(5), true) {}; -// virtual void OnIdle() { do something }; -// } -// -// MyIdleTimer *timer = new MyIdleTimer(); -// timer->Start(); -// -// // As with all Timers, the caller must dispose the object. -// delete timer; // Will Stop the timer and cleanup. -// -// NOTE: An IdleTimer can only be used on a thread that processes UI events. -// Such a thread should be running a MessageLoopForUI. - -#ifndef BASE_IDLE_TIMER_H_ -#define BASE_IDLE_TIMER_H_ - -#if defined(OS_WIN) -#include -#endif - -#include "base/basictypes.h" -#include "base/task.h" -#include "base/timer.h" - -namespace base { - -// Function prototype - Get the number of milliseconds that the user has been -// idle. -typedef bool (*IdleTimeSource)(int32_t *milliseconds_interval_since_last_event); - -class IdleTimer { - public: - // Create an IdleTimer. - // idle_time: idle time required before this timer can run. - // repeat: true if the timer should fire multiple times per idle, - // false to fire once per idle. - IdleTimer(TimeDelta idle_time, bool repeat); - - // On destruction, the IdleTimer will Stop itself. - virtual ~IdleTimer(); - - // Start the IdleTimer. - void Start(); - - // Stop the IdleTimer. - void Stop(); - - // The method to run when the timer elapses. - virtual void OnIdle() = 0; - - protected: - // Override the IdleTimeSource. - void set_idle_time_source(IdleTimeSource idle_time_source) { - idle_time_source_ = idle_time_source; - } - - private: - // Called when timer_ expires. - void Run(); - - // Start the timer. - void StartTimer(); - - // Gets the number of milliseconds since the last input event. - TimeDelta CurrentIdleTime(); - - // Compute time until idle. Returns 0 if we are now idle. - TimeDelta TimeUntilIdle(); - - TimeDelta idle_interval_; - bool repeat_; - Time last_time_fired_; // The last time the idle timer fired. - // will be 0 until the timer fires the first time. - OneShotTimer timer_; - - IdleTimeSource idle_time_source_; - - DISALLOW_COPY_AND_ASSIGN(IdleTimer); -}; - -} // namespace base - -#endif // BASE_IDLE_TIMER_H_ diff --git a/ipc/chromium/src/base/idle_timer_none.cc b/ipc/chromium/src/base/idle_timer_none.cc deleted file mode 100644 index 946535e1af..0000000000 --- a/ipc/chromium/src/base/idle_timer_none.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2006-2008 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. - -// A stub implementation of IdleTimer used to provide symbols needed by Chrome. -// It's unclear whether we need the idle timer in the linux port, so we're -// leaving it unported for now. - -#include "base/idle_timer.h" - -namespace base { - -IdleTimer::IdleTimer(TimeDelta idle_time, bool repeat) { -} - -IdleTimer::~IdleTimer() { -} - -void IdleTimer::Start() { -} - -void IdleTimer::Stop() { -} - -} // namespace base diff --git a/ipc/chromium/src/base/linux_util.h b/ipc/chromium/src/base/linux_util.h deleted file mode 100644 index aa418cc8f8..0000000000 --- a/ipc/chromium/src/base/linux_util.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2009 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_LINUX_UTIL_H__ -#define BASE_LINUX_UTIL_H__ - -#include - -namespace base { - -// Makes a copy of |pixels| with the ordering changed from BGRA to RGBA. -// The caller is responsible for free()ing the data. If |stride| is 0, -// it's assumed to be 4 * |width|. -uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride); - -} // namespace base - -#endif // BASE_LINUX_UTIL_H__ diff --git a/ipc/chromium/src/base/process_util_linux.cc b/ipc/chromium/src/base/process_util_linux.cc index 722a5d1a6a..dc0f0fccda 100644 --- a/ipc/chromium/src/base/process_util_linux.cc +++ b/ipc/chromium/src/base/process_util_linux.cc @@ -17,7 +17,6 @@ #include "base/eintr_wrapper.h" #include "base/file_util.h" #include "base/logging.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "nsLiteralString.h" #include "mozilla/UniquePtr.h" diff --git a/ipc/chromium/src/base/registry.cc b/ipc/chromium/src/base/registry.cc deleted file mode 100644 index e5709f2344..0000000000 --- a/ipc/chromium/src/base/registry.cc +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright (c) 2006-2008 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. -// All Rights Reserved. - -#include "base/registry.h" - -#include -#include -#include - -#pragma comment(lib, "shlwapi.lib") // for SHDeleteKey - -// local types (see the same declarations in the header file) -#define tchar TCHAR -#define CTP const tchar* -#define tstr std::basic_string - -// -// RegistryValueIterator -// - -RegistryValueIterator::RegistryValueIterator(HKEY root_key, - LPCTSTR folder_key) { - LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_); - if (result != ERROR_SUCCESS) { - key_ = NULL; - } else { - DWORD count = 0; - result = ::RegQueryInfoKey(key_, NULL, 0, NULL, NULL, NULL, NULL, &count, - NULL, NULL, NULL, NULL); - - if (result != ERROR_SUCCESS) { - ::RegCloseKey(key_); - key_ = NULL; - } else { - index_ = count - 1; - } - } - - Read(); -} - -RegistryValueIterator::~RegistryValueIterator() { - if (key_) - ::RegCloseKey(key_); -} - -bool RegistryValueIterator::Valid() const { - // true while the iterator is valid - return key_ != NULL && index_ >= 0; -} - -void RegistryValueIterator::operator ++ () { - // advance to the next entry in the folder - --index_; - Read(); -} - -bool RegistryValueIterator::Read() { - if (Valid()) { - DWORD ncount = sizeof(name_)/sizeof(*name_); - value_size_ = sizeof(value_); - LRESULT r = ::RegEnumValue(key_, index_, name_, &ncount, NULL, &type_, - reinterpret_cast(value_), &value_size_); - if (ERROR_SUCCESS == r) - return true; - } - - name_[0] = '\0'; - value_[0] = '\0'; - value_size_ = 0; - return false; -} - -DWORD RegistryValueIterator::ValueCount() const { - - DWORD count = 0; - HRESULT result = ::RegQueryInfoKey(key_, NULL, 0, NULL, NULL, NULL, NULL, - &count, NULL, NULL, NULL, NULL); - - if (result != ERROR_SUCCESS) - return 0; - - return count; -} - -// -// RegistryKeyIterator -// - -RegistryKeyIterator::RegistryKeyIterator(HKEY root_key, - LPCTSTR folder_key) { - LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_); - if (result != ERROR_SUCCESS) { - key_ = NULL; - } else { - DWORD count = 0; - HRESULT 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(); -} - -RegistryKeyIterator::~RegistryKeyIterator() { - if (key_) - ::RegCloseKey(key_); -} - -bool RegistryKeyIterator::Valid() const { - // true while the iterator is valid - return key_ != NULL && index_ >= 0; -} - -void RegistryKeyIterator::operator ++ () { - // advance to the next entry in the folder - --index_; - Read(); -} - -bool RegistryKeyIterator::Read() { - if (Valid()) { - DWORD ncount = sizeof(name_)/sizeof(*name_); - FILETIME written; - LRESULT r = ::RegEnumKeyEx(key_, index_, name_, &ncount, NULL, NULL, - NULL, &written); - if (ERROR_SUCCESS == r) - return true; - } - - name_[0] = '\0'; - return false; -} - -DWORD RegistryKeyIterator::SubkeyCount() const { - - DWORD count = 0; - HRESULT result = ::RegQueryInfoKey(key_, NULL, 0, NULL, &count, NULL, NULL, - NULL, NULL, NULL, NULL, NULL); - - if (result != ERROR_SUCCESS) - return 0; - - return count; -} - -// -// RegKey -// - -RegKey::RegKey(HKEY rootkey, const tchar* subkey, REGSAM access) - : key_(NULL), watch_event_(0) { - if (rootkey) { - if (access & (KEY_SET_VALUE | KEY_CREATE_SUB_KEY | KEY_CREATE_LINK)) - this->Create(rootkey, subkey, access); - else - this->Open(rootkey, subkey, access); - } - else assert(!subkey); -} - -void RegKey::Close() { - StopWatching(); - if (key_) { - ::RegCloseKey(key_); - key_ = NULL; - } -} - -bool RegKey::Create(HKEY rootkey, const tchar* subkey, REGSAM access) { - DWORD disposition_value; - return CreateWithDisposition(rootkey, subkey, &disposition_value, access); -} - -bool RegKey::CreateWithDisposition(HKEY rootkey, const tchar* subkey, - DWORD* disposition, REGSAM access) { - assert(rootkey && subkey && access && disposition); - this->Close(); - - LONG const result = RegCreateKeyEx(rootkey, - subkey, - 0, - NULL, - REG_OPTION_NON_VOLATILE, - access, - NULL, - &key_, - disposition ); - if (result != ERROR_SUCCESS) { - key_ = NULL; - return false; - } - else return true; -} - -bool RegKey::Open(HKEY rootkey, const tchar* subkey, REGSAM access) { - assert(rootkey && subkey && access); - this->Close(); - - LONG const result = RegOpenKeyEx(rootkey, subkey, 0, - access, &key_ ); - if (result != ERROR_SUCCESS) { - key_ = NULL; - return false; - } - else return true; -} - -bool RegKey::CreateKey(const tchar* name, REGSAM access) { - assert(name && access); - - HKEY subkey = NULL; - LONG const result = RegCreateKeyEx(key_, name, 0, NULL, - REG_OPTION_NON_VOLATILE, - access, NULL, &subkey, NULL); - this->Close(); - - key_ = subkey; - return (result == ERROR_SUCCESS); -} - -bool RegKey::OpenKey(const tchar* name, REGSAM access) { - assert(name && access); - - HKEY subkey = NULL; - LONG const result = RegOpenKeyEx(key_, name, 0, access, &subkey); - - this->Close(); - - key_ = subkey; - return (result == ERROR_SUCCESS); -} - -DWORD RegKey::ValueCount() { - DWORD count = 0; - HRESULT const result = ::RegQueryInfoKey(key_, NULL, 0, NULL, NULL, NULL, - NULL, &count, NULL, NULL, NULL, NULL); - return (result != ERROR_SUCCESS) ? 0 : count; -} - -bool RegKey::ReadName(int index, tstr* name) { - tchar buf[256]; - DWORD bufsize = sizeof(buf)/sizeof(*buf); - LRESULT r = ::RegEnumValue(key_, index, buf, &bufsize, NULL, NULL, - NULL, NULL); - if (r != ERROR_SUCCESS) - return false; - if (name) - *name = buf; - return true; -} - -bool RegKey::ValueExists(const tchar* name) { - if (!key_) return false; - const HRESULT result = RegQueryValueEx(key_, name, 0, NULL, NULL, NULL); - return (result == ERROR_SUCCESS); -} - -bool RegKey::ReadValue(const tchar* name, void* data, - DWORD* dsize, DWORD* dtype) { - if (!key_) return false; - HRESULT const result = RegQueryValueEx(key_, name, 0, dtype, - reinterpret_cast(data), - dsize); - return (result == ERROR_SUCCESS); -} - -bool RegKey::ReadValue(const tchar* name, tstr * value) { - assert(value); - static const size_t kMaxStringLength = 1024; // This is after expansion. - // Use the one of the other forms of ReadValue if 1024 is too small for you. - TCHAR raw_value[kMaxStringLength]; - DWORD type = REG_SZ, size = sizeof(raw_value); - if (this->ReadValue(name, raw_value, &size, &type)) { - if (type == REG_SZ) { - *value = raw_value; - } else if (type == REG_EXPAND_SZ) { - TCHAR expanded[kMaxStringLength]; - size = ExpandEnvironmentStrings(raw_value, expanded, kMaxStringLength); - // Success: returns the number of TCHARs copied - // Fail: buffer too small, returns the size required - // Fail: other, returns 0 - if (size == 0 || size > kMaxStringLength) - return false; - *value = expanded; - } else { - // Not a string. Oops. - return false; - } - return true; - } - else return false; -} - -bool RegKey::ReadValueDW(const tchar* name, DWORD * value) { - assert(value); - DWORD type = REG_DWORD, size = sizeof(DWORD), result = 0; - if (this->ReadValue(name, &result, &size, &type) - && (type == REG_DWORD || type == REG_BINARY) - && size == sizeof(DWORD)) { - *value = result; - return true; - } - else return false; -} - -bool RegKey::WriteValue(const tchar* name, - const void * data, - DWORD dsize, - DWORD dtype) { - assert(data); - if (!key_) return false; - HRESULT const result = RegSetValueEx( - key_, - name, - 0, - dtype, - reinterpret_cast(const_cast(data)), - dsize); - return (result == ERROR_SUCCESS); -} - -bool RegKey::WriteValue(const tchar * name, const tchar * value) { - return this->WriteValue(name, value, - static_cast(sizeof(*value) * (_tcslen(value) + 1)), REG_SZ); -} - -bool RegKey::WriteValue(const tchar * name, DWORD value) { - return this->WriteValue(name, &value, - static_cast(sizeof(value)), REG_DWORD); -} - -bool RegKey::DeleteKey(const tchar * name) { - if (!key_) return false; - return (ERROR_SUCCESS == SHDeleteKey(key_, name)); -} - - -bool RegKey::DeleteValue(const tchar * value_name) { - assert(value_name); - HRESULT const result = RegDeleteValue(key_, value_name); - return (result == ERROR_SUCCESS); -} - -bool RegKey::StartWatching() { - if (!watch_event_) - watch_event_ = CreateEvent(NULL, TRUE, FALSE, NULL); - - DWORD filter = REG_NOTIFY_CHANGE_NAME | - REG_NOTIFY_CHANGE_ATTRIBUTES | - REG_NOTIFY_CHANGE_LAST_SET | - REG_NOTIFY_CHANGE_SECURITY; - - // Watch the registry key for a change of value. - HRESULT result = RegNotifyChangeKeyValue(key_, TRUE, filter, - watch_event_, TRUE); - if (SUCCEEDED(result)) { - return true; - } else { - CloseHandle(watch_event_); - watch_event_ = 0; - return false; - } -} - -bool RegKey::StopWatching() { - if (watch_event_) { - CloseHandle(watch_event_); - watch_event_ = 0; - return true; - } - return false; -} - -bool RegKey::HasChanged() { - if (watch_event_) { - if (WaitForSingleObject(watch_event_, 0) == WAIT_OBJECT_0) { - StartWatching(); - return true; - } - } - return false; -} - -// Register a COM object with the most usual properties. -bool RegisterCOMServer(const tchar* guid, - const tchar* name, - const tchar* path) { - RegKey key(HKEY_CLASSES_ROOT, _T("CLSID"), KEY_WRITE); - key.CreateKey(guid, KEY_WRITE); - key.WriteValue(NULL, name); - key.CreateKey(_T("InprocServer32"), KEY_WRITE); - key.WriteValue(NULL, path); - key.WriteValue(_T("ThreadingModel"), _T("Apartment")); - return true; -} - -bool RegisterCOMServer(const tchar* guid, const tchar* name, HINSTANCE module) { - tchar module_path[MAX_PATH]; - ::GetModuleFileName(module, module_path, MAX_PATH); - _tcslwr_s(module_path, MAX_PATH); - return RegisterCOMServer(guid, name, module_path); -} - -bool UnregisterCOMServer(const tchar* guid) { - RegKey key(HKEY_CLASSES_ROOT, _T("CLSID"), KEY_WRITE); - key.DeleteKey(guid); - return true; -} diff --git a/ipc/chromium/src/base/registry.h b/ipc/chromium/src/base/registry.h deleted file mode 100644 index 757e409360..0000000000 --- a/ipc/chromium/src/base/registry.h +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) 2006-2008 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. -// All Rights Reserved. - -#ifndef BASE_REGISTRY_H__ -#define BASE_REGISTRY_H__ - -#include -#include -#include -#include - -// The shared file uses a bunch of header files that define types that we don't. -// To avoid changing much code from the standard version, and also to avoid -// polluting our namespace with extra types we don't want, we define these types -// here with the preprocessor and undefine them at the end of the file. -#define tchar TCHAR -#define CTP const tchar* -#define tstr std::basic_string - -// RegKey -// Utility class to read from and manipulate the registry. -// Registry vocabulary primer: a "key" is like a folder, in which there -// are "values", which are pairs, with an associated data type. - -class RegKey { - public: - RegKey(HKEY rootkey = NULL, CTP subkey = NULL, REGSAM access = KEY_READ); - // start there - - ~RegKey() { this->Close(); } - - bool Create(HKEY rootkey, CTP subkey, REGSAM access = KEY_READ); - - bool CreateWithDisposition(HKEY rootkey, CTP subkey, DWORD* disposition, - REGSAM access = KEY_READ); - - bool Open(HKEY rootkey, CTP subkey, REGSAM access = KEY_READ); - - // Create a subkey (or open if exists) - bool CreateKey(CTP name, REGSAM access); - - // Open a subkey - bool OpenKey(CTP name, REGSAM access); - - // all done, eh? - void Close(); - - DWORD ValueCount(); // Count of the number of value extant - - bool ReadName(int index, tstr* name); // Determine the Nth value's name - - // True while the key is valid - bool Valid() const { return NULL != key_; } - - // Kill key and everything that liveth below it; please be careful out there - bool DeleteKey(CTP name); - - // Delete a single value within the key - bool DeleteValue(CTP name); - - bool ValueExists(CTP name); - bool ReadValue(CTP name, void * data, DWORD * dsize, DWORD * dtype = NULL); - bool ReadValue(CTP name, tstr * value); - bool ReadValueDW(CTP name, DWORD * value); // Named to differ from tstr* - - bool WriteValue(CTP name, const void * data, DWORD dsize, - DWORD dtype = REG_BINARY); - bool WriteValue(CTP name, CTP value); - bool WriteValue(CTP name, DWORD value); - - // StartWatching() - // Start watching the key to see if any of its values have changed. - // The key must have been opened with the KEY_NOTIFY access - // privelege. - bool StartWatching(); - - // HasChanged() - // If StartWatching hasn't been called, always returns false. - // Otherwise, returns true if anything under the key has changed. - // This can't be const because the watch_event_ may be refreshed. - bool HasChanged(); - - // StopWatching() - // Will automatically be called by destructor if not manually called - // beforehand. Returns true if it was watching, false otherwise. - bool StopWatching(); - - inline bool IsWatching() const { return watch_event_ != 0; } - HANDLE watch_event() const { return watch_event_; } - HKEY Handle() const { return key_; } - - private: - HKEY key_; // the registry key being iterated - HANDLE watch_event_; -}; - - -// Standalone registry functions -- sorta deprecated, they now map to -// using RegKey - - -// Add a raw data to the registry -- you can pass NULL for the data if -// you just want to create a key -inline bool AddToRegistry(HKEY root_key, CTP key, CTP value_name, - void const * data, DWORD dsize, - DWORD dtype = REG_BINARY) { - return RegKey(root_key, key, KEY_WRITE).WriteValue(value_name, data, dsize, - dtype); -} - -// Convenience routine to add a string value to the registry -inline bool AddToRegistry(HKEY root_key, CTP key, CTP value_name, CTP value) { - return AddToRegistry(root_key, key, value_name, value, - sizeof(*value) * (lstrlen(value) + 1), REG_SZ); -} - -// Read raw data from the registry -- pass something as the dtype -// parameter if you care to learn what type the value was stored as -inline bool ReadFromRegistry(HKEY root_key, CTP key, CTP value_name, - void* data, DWORD* dsize, DWORD* dtype = NULL) { - return RegKey(root_key, key).ReadValue(value_name, data, dsize, dtype); -} - - -// Delete a value or a key from the registry -inline bool DeleteFromRegistry(HKEY root_key, CTP subkey, CTP value_name) { - if (value_name) - return ERROR_SUCCESS == ::SHDeleteValue(root_key, subkey, value_name); - else - return ERROR_SUCCESS == ::SHDeleteKey(root_key, subkey); -} - - - -// delete a key and all subkeys from the registry -inline bool DeleteKeyFromRegistry(HKEY root_key, CTP key_path, CTP key_name) { - RegKey key; - return key.Open(root_key, key_path, KEY_WRITE) - && key.DeleteKey(key_name); -} - - -// Iterates the entries found in a particular folder on the registry. -// For this application I happen to know I wont need data size larger -// than MAX_PATH, but in real life this wouldn't neccessarily be -// adequate. -class RegistryValueIterator { - public: - // Specify a key in construction - RegistryValueIterator(HKEY root_key, LPCTSTR folder_key); - - ~RegistryValueIterator(); - - DWORD ValueCount() const; // count of the number of subkeys extant - - bool Valid() const; // true while the iterator is valid - - void operator++(); // advance to the next entry in the folder - - // The pointers returned by these functions are statics owned by the - // Name and Value functions - CTP Name() const { return name_; } - CTP Value() const { return value_; } - DWORD ValueSize() const { return value_size_; } - DWORD Type() const { return type_; } - - int Index() const { return index_; } - - private: - bool Read(); // read in the current values - - HKEY key_; // the registry key being iterated - int index_; // current index of the iteration - - // Current values - TCHAR name_[MAX_PATH]; - TCHAR value_[MAX_PATH]; - DWORD value_size_; - DWORD type_; -}; - - -class RegistryKeyIterator { - public: - // Specify a parent key in construction - RegistryKeyIterator(HKEY root_key, LPCTSTR folder_key); - - ~RegistryKeyIterator(); - - DWORD SubkeyCount() const; // count of the number of subkeys extant - - bool Valid() const; // true while the iterator is valid - - void operator++(); // advance to the next entry in the folder - - // The pointer returned by Name() is a static owned by the function - CTP Name() const { return name_; } - - int Index() const { return index_; } - - private: - bool Read(); // read in the current values - - HKEY key_; // the registry key being iterated - int index_; // current index of the iteration - - // Current values - TCHAR name_[MAX_PATH]; -}; - - -// Register a COM object with the most usual properties. -bool RegisterCOMServer(const tchar* guid, const tchar* name, - const tchar* modulepath); -bool RegisterCOMServer(const tchar* guid, const tchar* name, HINSTANCE module); -bool UnregisterCOMServer(const tchar* guid); - -// undo the local types defined above -#undef tchar -#undef CTP -#undef tstr - -#endif // BASE_REGISTRY_H__ diff --git a/ipc/chromium/src/base/string_tokenizer.h b/ipc/chromium/src/base/string_tokenizer.h deleted file mode 100644 index 654e7c9614..0000000000 --- a/ipc/chromium/src/base/string_tokenizer.h +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) 2006-2008 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_STRING_TOKENIZER_H_ -#define BASE_STRING_TOKENIZER_H_ - -#include - -// StringTokenizerT is a simple string tokenizer class. It works like an -// iterator that with each step (see the Advance method) updates members that -// refer to the next token in the input string. The user may optionally -// configure the tokenizer to return delimiters. -// -// -// EXAMPLE 1: -// -// StringTokenizer t("this is a test", " "); -// while (t.GetNext()) { -// printf("%s\n", t.token().c_str()); -// } -// -// Output: -// -// this -// is -// a -// test -// -// -// EXAMPLE 2: -// -// StringTokenizer t("no-cache=\"foo, bar\", private", ", "); -// t.set_quote_chars("\""); -// while (t.GetNext()) { -// printf("%s\n", t.token().c_str()); -// } -// -// Output: -// -// no-cache="foo, bar" -// private -// -// -// EXAMPLE 3: -// -// bool next_is_option = false, next_is_value = false; -// std::string input = "text/html; charset=UTF-8; foo=bar"; -// StringTokenizer t(input, "; ="); -// t.set_options(StringTokenizer::RETURN_DELIMS); -// while (t.GetNext()) { -// if (t.token_is_delim()) { -// switch (*t.token_begin()) { -// case ';': -// next_is_option = true; -// break; -// case '=': -// next_is_value = true; -// break; -// } -// } else { -// const char* label; -// if (next_is_option) { -// label = "option-name"; -// next_is_option = false; -// } else if (next_is_value) { -// label = "option-value"; -// next_is_value = false; -// } else { -// label = "mime-type"; -// } -// printf("%s: %s\n", label, t.token().c_str()); -// } -// } -// -// -template -class StringTokenizerT { - public: - typedef typename str::value_type char_type; - - // Options that may be pass to set_options() - enum { - // Specifies the delimiters should be returned as tokens - RETURN_DELIMS = 1 << 0, - }; - - StringTokenizerT(const str& string, - const str& delims) { - Init(string.begin(), string.end(), delims); - } - - StringTokenizerT(const_iterator string_begin, - const_iterator string_end, - const str& delims) { - Init(string_begin, string_end, delims); - } - - // Set the options for this tokenizer. By default, this is 0. - void set_options(int options) { options_ = options; } - - // Set the characters to regard as quotes. By default, this is empty. When - // a quote char is encountered, the tokenizer will switch into a mode where - // it ignores delimiters that it finds. It switches out of this mode once it - // finds another instance of the quote char. If a backslash is encountered - // within a quoted string, then the next character is skipped. - void set_quote_chars(const str& quotes) { quotes_ = quotes; } - - // Call this method to advance the tokenizer to the next delimiter. This - // returns false if the tokenizer is complete. This method must be called - // before calling any of the token* methods. - bool GetNext() { - AdvanceState state; - token_is_delim_ = false; - for (;;) { - token_begin_ = token_end_; - if (token_end_ == end_) - return false; - ++token_end_; - if (AdvanceOne(&state, *token_begin_)) - break; - if (options_ & RETURN_DELIMS) { - token_is_delim_ = true; - return true; - } - // else skip over delim - } - while (token_end_ != end_ && AdvanceOne(&state, *token_end_)) - ++token_end_; - return true; - } - - // Returns true if token is a delimiter. When the tokenizer is constructed - // with the RETURN_DELIMS option, this method can be used to check if the - // returned token is actually a delimiter. - bool token_is_delim() const { return token_is_delim_; } - - // If GetNext() returned true, then these methods may be used to read the - // value of the token. - const_iterator token_begin() const { return token_begin_; } - const_iterator token_end() const { return token_end_; } - str token() const { return str(token_begin_, token_end_); } - - private: - void Init(const_iterator string_begin, - const_iterator string_end, - const str& delims) { - token_end_ = string_begin; - end_ = string_end; - delims_ = delims; - options_ = 0; - } - - bool IsDelim(char_type c) const { - return delims_.find(c) != str::npos; - } - - bool IsQuote(char_type c) const { - return quotes_.find(c) != str::npos; - } - - struct AdvanceState { - bool in_quote; - bool in_escape; - char_type quote_char; - AdvanceState() : in_quote(false), in_escape(false) {} - }; - - // Returns true if a delimiter was not hit. - bool AdvanceOne(AdvanceState* state, char_type c) { - if (state->in_quote) { - if (state->in_escape) { - state->in_escape = false; - } else if (c == '\\') { - state->in_escape = true; - } else if (c == state->quote_char) { - state->in_quote = false; - } - } else { - if (IsDelim(c)) - return false; - state->in_quote = IsQuote(state->quote_char = c); - } - return true; - } - - const_iterator token_begin_; - const_iterator token_end_; - const_iterator end_; - str delims_; - str quotes_; - int options_; - bool token_is_delim_; -}; - -typedef StringTokenizerT - StringTokenizer; -typedef StringTokenizerT - WStringTokenizer; -typedef StringTokenizerT CStringTokenizer; - -#endif // BASE_STRING_TOKENIZER_H_ diff --git a/ipc/chromium/src/base/sys_string_conversions.h b/ipc/chromium/src/base/sys_string_conversions.h index 3fc937422b..ed20fcfd6a 100644 --- a/ipc/chromium/src/base/sys_string_conversions.h +++ b/ipc/chromium/src/base/sys_string_conversions.h @@ -28,18 +28,6 @@ std::wstring SysUTF8ToWide(const StringPiece& utf8); std::string SysWideToNativeMB(const std::wstring& wide); std::wstring SysNativeMBToWide(const StringPiece& native_mb); -// Windows-specific ------------------------------------------------------------ - -#if defined(OS_WIN) - -// Converts between 8-bit and wide strings, using the given code page. The -// code page identifier is one accepted by the Windows function -// MultiByteToWideChar(). -std::wstring SysMultiByteToWide(const StringPiece& mb, uint32_t code_page); -std::string SysWideToMultiByte(const std::wstring& wide, uint32_t code_page); - -#endif // defined(OS_WIN) - } // namespace base #endif // BASE_SYS_STRING_CONVERSIONS_H_ diff --git a/ipc/chromium/src/base/sys_string_conversions_win.cc b/ipc/chromium/src/base/sys_string_conversions_win.cc index bc995f2e26..0e81a27ef5 100644 --- a/ipc/chromium/src/base/sys_string_conversions_win.cc +++ b/ipc/chromium/src/base/sys_string_conversions_win.cc @@ -10,24 +10,6 @@ namespace base { -// Do not assert in this function since it is used by the asssertion code! -std::string SysWideToUTF8(const std::wstring& wide) { - return SysWideToMultiByte(wide, CP_UTF8); -} - -// Do not assert in this function since it is used by the asssertion code! -std::wstring SysUTF8ToWide(const StringPiece& utf8) { - return SysMultiByteToWide(utf8, CP_UTF8); -} - -std::string SysWideToNativeMB(const std::wstring& wide) { - return SysWideToMultiByte(wide, CP_ACP); -} - -std::wstring SysNativeMBToWide(const StringPiece& native_mb) { - return SysMultiByteToWide(native_mb, CP_ACP); -} - // Do not assert in this function since it is used by the asssertion code! std::wstring SysMultiByteToWide(const StringPiece& mb, uint32_t code_page) { if (mb.empty()) @@ -67,4 +49,22 @@ std::string SysWideToMultiByte(const std::wstring& wide, uint32_t code_page) { return mb; } +// Do not assert in this function since it is used by the asssertion code! +std::string SysWideToUTF8(const std::wstring& wide) { + return SysWideToMultiByte(wide, CP_UTF8); +} + +// Do not assert in this function since it is used by the asssertion code! +std::wstring SysUTF8ToWide(const StringPiece& utf8) { + return SysMultiByteToWide(utf8, CP_UTF8); +} + +std::string SysWideToNativeMB(const std::wstring& wide) { + return SysWideToMultiByte(wide, CP_ACP); +} + +std::wstring SysNativeMBToWide(const StringPiece& native_mb) { + return SysMultiByteToWide(native_mb, CP_ACP); +} + } // namespace base diff --git a/ipc/chromium/src/base/thread_collision_warner.cc b/ipc/chromium/src/base/thread_collision_warner.cc deleted file mode 100644 index 1a13643973..0000000000 --- a/ipc/chromium/src/base/thread_collision_warner.cc +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2006-2008 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/thread_collision_warner.h" - -#include "base/logging.h" -#include "base/platform_thread.h" - -namespace base { - -void DCheckAsserter::warn() { - NOTREACHED() << "Thread Collision"; -} - -static subtle::Atomic32 CurrentThread() { - const PlatformThreadId current_thread_id = PlatformThread::CurrentId(); - // We need to get the thread id into an atomic data type. This might be a - // truncating conversion, but any loss-of-information just increases the - // chance of a fault negative, not a false positive. - const subtle::Atomic32 atomic_thread_id = - static_cast(current_thread_id); - - return atomic_thread_id; -} - -void ThreadCollisionWarner::EnterSelf() { - // If the active thread is 0 then I'll write the current thread ID - // if two or more threads arrive here only one will succeed to - // write on valid_thread_id_ the current thread ID. - subtle::Atomic32 current_thread_id = CurrentThread(); - - int previous_value = subtle::NoBarrier_CompareAndSwap(&valid_thread_id_, - 0, - current_thread_id); - if (previous_value != 0 && previous_value != current_thread_id) { - // gotcha! a thread is trying to use the same class and that is - // not current thread. - asserter_->warn(); - } - - subtle::NoBarrier_AtomicIncrement(&counter_, 1); -} - -void ThreadCollisionWarner::Enter() { - subtle::Atomic32 current_thread_id = CurrentThread(); - - if (subtle::NoBarrier_CompareAndSwap(&valid_thread_id_, - 0, - current_thread_id) != 0) { - // gotcha! another thread is trying to use the same class. - asserter_->warn(); - } - - subtle::NoBarrier_AtomicIncrement(&counter_, 1); -} - -void ThreadCollisionWarner::Leave() { - if (subtle::Barrier_AtomicIncrement(&counter_, -1) == 0) { - subtle::NoBarrier_Store(&valid_thread_id_, 0); - } -} - -} // namespace base diff --git a/ipc/chromium/src/base/thread_collision_warner.h b/ipc/chromium/src/base/thread_collision_warner.h deleted file mode 100644 index b63bc742ef..0000000000 --- a/ipc/chromium/src/base/thread_collision_warner.h +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) 2008 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_THREAD_COLLISION_WARNER_H_ -#define BASE_THREAD_COLLISION_WARNER_H_ - -#include - -#include "base/atomicops.h" - -// A helper class alongside macros to be used to verify assumptions about thread -// safety of a class. -// -// Example: Queue implementation non thread-safe but still usable if clients -// are synchronized somehow. -// -// In this case the macro DFAKE_SCOPED_LOCK has to be -// used, it checks that if a thread is inside the push/pop then -// noone else is still inside the pop/push -// -// class NonThreadSafeQueue { -// public: -// ... -// void push(int) { DFAKE_SCOPED_LOCK(push_pop_); ... } -// int pop() { DFAKE_SCOPED_LOCK(push_pop_); ... } -// ... -// private: -// DFAKE_MUTEX(push_pop_); -// }; -// -// -// Example: Queue implementation non thread-safe but still usable if clients -// are synchronized somehow, it calls a method to "protect" from -// a "protected" method -// -// In this case the macro DFAKE_SCOPED_RECURSIVE_LOCK -// has to be used, it checks that if a thread is inside the push/pop -// then noone else is still inside the pop/push -// -// class NonThreadSafeQueue { -// public: -// void push(int) { -// DFAKE_SCOPED_LOCK(push_pop_); -// ... -// } -// int pop() { -// DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); -// bar(); -// ... -// } -// void bar() { DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); ... } -// ... -// private: -// DFAKE_MUTEX(push_pop_); -// }; -// -// -// Example: Queue implementation not usable even if clients are synchronized, -// so only one thread in the class life cycle can use the two members -// push/pop. -// -// In this case the macro DFAKE_SCOPED_LOCK_THREAD_LOCKED pins the -// specified -// critical section the first time a thread enters push or pop, from -// that time on only that thread is allowed to execute push or pop. -// -// class NonThreadSafeQueue { -// public: -// ... -// void push(int) { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... } -// int pop() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... } -// ... -// private: -// DFAKE_MUTEX(push_pop_); -// }; -// -// -// Example: Class that has to be contructed/destroyed on same thread, it has -// a "shareable" method (with external syncronization) and a not -// shareable method (even with external synchronization). -// -// In this case 3 Critical sections have to be defined -// -// class ExoticClass { -// public: -// ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } -// ~ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } -// -// void Shareable() { DFAKE_SCOPED_LOCK(shareable_section_); ... } -// void NotShareable() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } -// ... -// private: -// DFAKE_MUTEX(ctor_dtor_); -// DFAKE_MUTEX(shareable_section_); -// }; - - -#if !defined(NDEBUG) - -// Defines a class member that acts like a mutex. It is used only as a -// verification tool. -#define DFAKE_MUTEX(obj) \ - mutable base::ThreadCollisionWarner obj; -// Asserts the call is never called simultaneously in two threads. Used at -// member function scope. -#define DFAKE_SCOPED_LOCK(obj) \ - base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj) -// Asserts the call is never called simultaneously in two threads. Used at -// member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks. -#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \ - base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj) -// Asserts the code is always executed in the same thread. -#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \ - base::ThreadCollisionWarner::Check check_##obj(&obj) - -#else - -#define DFAKE_MUTEX(obj) -#define DFAKE_SCOPED_LOCK(obj) ((void)0) -#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) ((void)0) -#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) ((void)0) - -#endif - -namespace base { - -// The class ThreadCollisionWarner uses an Asserter to notify the collision -// AsserterBase is the interfaces and DCheckAsserter is the default asserter -// used. During the unit tests is used another class that doesn't "DCHECK" -// in case of collision (check thread_collision_warner_unittests.cc) -struct AsserterBase { - virtual ~AsserterBase() {} - virtual void warn() = 0; -}; - -struct DCheckAsserter : public AsserterBase { - virtual ~DCheckAsserter() {} - virtual void warn(); -}; - -class ThreadCollisionWarner { - public: - // The parameter asserter is there only for test purpose - explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter()) - : valid_thread_id_(0), - counter_(0), - asserter_(asserter) {} - - ~ThreadCollisionWarner() { - delete asserter_; - } - - // This class is meant to be used through the macro - // DFAKE_SCOPED_LOCK_THREAD_LOCKED - // it doesn't leave the critical section, as opposed to ScopedCheck, - // because the critical section being pinned is allowed to be used only - // from one thread - class Check { - public: - explicit Check(ThreadCollisionWarner* warner) - : warner_(warner) { - warner_->EnterSelf(); - } - - ~Check() {} - - private: - ThreadCollisionWarner* warner_; - - DISALLOW_COPY_AND_ASSIGN(Check); - }; - - // This class is meant to be used through the macro - // DFAKE_SCOPED_LOCK - class ScopedCheck { - public: - explicit ScopedCheck(ThreadCollisionWarner* warner) - : warner_(warner) { - warner_->Enter(); - } - - ~ScopedCheck() { - warner_->Leave(); - } - - private: - ThreadCollisionWarner* warner_; - - DISALLOW_COPY_AND_ASSIGN(ScopedCheck); - }; - - // This class is meant to be used through the macro - // DFAKE_SCOPED_RECURSIVE_LOCK - class ScopedRecursiveCheck { - public: - explicit ScopedRecursiveCheck(ThreadCollisionWarner* warner) - : warner_(warner) { - warner_->EnterSelf(); - } - - ~ScopedRecursiveCheck() { - warner_->Leave(); - } - - private: - ThreadCollisionWarner* warner_; - - DISALLOW_COPY_AND_ASSIGN(ScopedRecursiveCheck); - }; - - private: - // This method stores the current thread identifier and does a DCHECK - // if a another thread has already done it, it is safe if same thread - // calls this multiple time (recursion allowed). - void EnterSelf(); - - // Same as EnterSelf but recursion is not allowed. - void Enter(); - - // Removes the thread_id stored in order to allow other threads to - // call EnterSelf or Enter. - void Leave(); - - // This stores the thread id that is inside the critical section, if the - // value is 0 then no thread is inside. - volatile subtle::Atomic32 valid_thread_id_; - - // Counter to trace how many time a critical section was "pinned" - // (when allowed) in order to unpin it when counter_ reaches 0. - volatile subtle::Atomic32 counter_; - - // Here only for class unit tests purpose, during the test I need to not - // DCHECK but notify the collision with something else. - AsserterBase* asserter_; - - DISALLOW_COPY_AND_ASSIGN(ThreadCollisionWarner); -}; - -} // namespace base - -#endif // BASE_THREAD_COLLISION_WARNER_H_ diff --git a/ipc/chromium/src/base/time_format.h b/ipc/chromium/src/base/time_format.h deleted file mode 100644 index b51c76842d..0000000000 --- a/ipc/chromium/src/base/time_format.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2006-2008 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. - -// Basic time formatting methods. These methods use the current locale -// formatting for displaying the time. - -#ifndef BASE_TIME_FORMAT_H_ -#define BASE_TIME_FORMAT_H_ - -#include - -namespace base { - -class Time; - -// Returns the time of day, e.g., "3:07 PM". -std::wstring TimeFormatTimeOfDay(const Time& time); - -// Returns a shortened date, e.g. "Nov 7, 2007" -std::wstring TimeFormatShortDate(const Time& time); - -// Returns a numeric date such as 12/13/52. -std::wstring TimeFormatShortDateNumeric(const Time& time); - -// Formats a time in a friendly sentence format, e.g. -// "Monday, March 6, 2008 2:44:30 PM". -std::wstring TimeFormatShortDateAndTime(const Time& time); - -// Formats a time in a friendly sentence format, e.g. -// "Monday, March 6, 2008 2:44:30 PM". -std::wstring TimeFormatFriendlyDateAndTime(const Time& time); - -// Formats a time in a friendly sentence format, e.g. -// "Monday, March 6, 2008". -std::wstring TimeFormatFriendlyDate(const Time& time); - -} // namespace base - -#endif // BASE_TIME_FORMAT_H_ diff --git a/ipc/chromium/src/base/win_util.cc b/ipc/chromium/src/base/win_util.cc index d0985d85d0..2878b3c81a 100644 --- a/ipc/chromium/src/base/win_util.cc +++ b/ipc/chromium/src/base/win_util.cc @@ -8,25 +8,12 @@ #include #include "base/logging.h" -#include "base/registry.h" #include "base/singleton.h" #include "base/string_util.h" #include "base/tracked.h" namespace win_util { -bool IsShiftPressed() { - return (::GetKeyState(VK_SHIFT) & 0x80) == 0x80; -} - -bool IsCtrlPressed() { - return (::GetKeyState(VK_CONTROL) & 0x80) == 0x80; -} - -bool IsAltPressed() { - return (::GetKeyState(VK_MENU) & 0x80) == 0x80; -} - std::wstring FormatMessage(unsigned messageid) { wchar_t* string_buffer = NULL; unsigned string_length = ::FormatMessage( @@ -50,25 +37,3 @@ std::wstring FormatLastWin32Error() { } } // namespace win_util - -#ifdef _MSC_VER -// -// If the ASSERT below fails, please install Visual Studio 2005 Service Pack 1. -// -extern char VisualStudio2005ServicePack1Detection[10]; -COMPILE_ASSERT(sizeof(&VisualStudio2005ServicePack1Detection) == sizeof(void*), - VS2005SP1Detect); -// -// Chrome requires at least Service Pack 1 for Visual Studio 2005. -// -#endif // _MSC_VER - -#if 0 -#error You must install the Windows 2008 or Vista Software Development Kit and \ -set it as your default include path to build this library. You can grab it by \ -searching for "download windows sdk 2008" in your favorite web search engine. \ -Also make sure you register the SDK with Visual Studio, by selecting \ -"Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ -menu (see Start - All Programs - Microsoft Windows SDK - \ -Visual Studio Registration). -#endif diff --git a/ipc/chromium/src/base/win_util.h b/ipc/chromium/src/base/win_util.h index cc1799f169..6188182d02 100644 --- a/ipc/chromium/src/base/win_util.h +++ b/ipc/chromium/src/base/win_util.h @@ -14,19 +14,6 @@ namespace win_util { -// Returns true if the shift key is currently pressed. -bool IsShiftPressed(); - -// Returns true if the ctrl key is currently pressed. -bool IsCtrlPressed(); - -// Returns true if the alt key is currently pressed. -bool IsAltPressed(); - -// Use the Win32 API FormatMessage() function to generate a string, using -// Windows's default Message Compiled resources; ignoring the inserts. -std::wstring FormatMessage(unsigned messageid); - // Uses the last Win32 error to generate a human readable message string. std::wstring FormatLastWin32Error(); diff --git a/ipc/chromium/src/chrome/common/chrome_switches.cc b/ipc/chromium/src/chrome/common/chrome_switches.cc index d1f6e66e9e..3e1551b9c6 100644 --- a/ipc/chromium/src/chrome/common/chrome_switches.cc +++ b/ipc/chromium/src/chrome/common/chrome_switches.cc @@ -4,436 +4,13 @@ #include "chrome/common/chrome_switches.h" -#include "base/base_switches.h" - namespace switches { // Can't find the switch you are looking for? try looking in // base/base_switches.cc instead. -// Suppresses hang monitor dialogs in renderer processes. -const wchar_t kDisableHangMonitor[] = L"disable-hang-monitor"; - -// Completely disables UMA metrics system. -const wchar_t kDisableMetrics[] = L"disable-metrics"; - -// Enables the recording of metrics reports but disables reporting. -// In contrast to kDisableMetrics, this executes all the code that a normal -// client would use for reporting, except the report is dropped rather than sent -// to the server. This is useful for finding issues in the metrics code during -// UI and performance tests. -const wchar_t kMetricsRecordingOnly[] = L"metrics-recording-only"; - -// Causes the browser process to throw an assertion on startup. -const wchar_t kBrowserAssertTest[] = L"assert-test"; - -// Causes the renderer process to throw an assertion on launch. -const wchar_t kRendererAssertTest[] = L"renderer-assert-test"; - -// Causes the browser process to crash on startup. -const wchar_t kBrowserCrashTest[] = L"crash-test"; - -// Causes the renderer process to crash on launch. -const wchar_t kRendererCrashTest[] = L"renderer-crash-test"; - -// Causes the renderer process to display a dialog on launch. -const wchar_t kRendererStartupDialog[] = L"renderer-startup-dialog"; - -// Causes the plugin process to display a dialog on launch. -const wchar_t kPluginStartupDialog[] = L"plugin-startup-dialog"; - -// Specifies a command that should be used to launch the plugin process. Useful -// for running the plugin process through purify or quantify. Ex: -// --plugin-launcher="path\to\purify /Run=yes" -const wchar_t kPluginLauncher[] = L"plugin-launcher"; - // The value of this switch tells the child process which // IPC channel the browser expects to use to communicate with it. const wchar_t kProcessChannelID[] = L"channel"; -// The value of this switch tells the app to listen for and broadcast -// testing-related messages on IPC channel with the given ID. -const wchar_t kTestingChannelID[] = L"testing-channel"; - -// The value of this switch specifies which page will be displayed -// in newly-opened tabs. We need this for testing purposes so -// that the UI tests don't depend on what comes up for http://google.com. -const wchar_t kHomePage[] = L"homepage"; - -// Causes the process to run as renderer instead of as browser. -const wchar_t kRendererProcess[] = L"renderer"; - -// Path to the exe to run for the renderer and plugin subprocesses. -const wchar_t kBrowserSubprocessPath[] = L"browser-subprocess-path"; - -// Causes the process to run as a plugin subprocess. -const wchar_t kPluginProcess[] = L"plugin"; - -// Causes the process to run as a worker subprocess. -const wchar_t kWorkerProcess[] = L"worker"; - -// Runs the renderer and plugins in the same process as the browser -const wchar_t kSingleProcess[] = L"single-process"; - -// Runs each set of script-connected tabs (i.e., a BrowsingInstance) in its own -// renderer process. We default to using a renderer process for each -// site instance (i.e., group of pages from the same registered domain with -// script connections to each other). -const wchar_t kProcessPerTab[] = L"process-per-tab"; - -// Runs a single process for each site (i.e., group of pages from the same -// registered domain) the user visits. We default to using a renderer process -// for each site instance (i.e., group of pages from the same registered -// domain with script connections to each other). -const wchar_t kProcessPerSite[] = L"process-per-site"; - -// Runs plugins inside the renderer process -const wchar_t kInProcessPlugins[] = L"in-process-plugins"; - -// Runs the renderer outside the sandbox. -const wchar_t kNoSandbox[] = L"no-sandbox"; - -// Runs the plugin processes inside the sandbox. -const wchar_t kSafePlugins[] = L"safe-plugins"; - -// Excludes these plugins from the plugin sandbox. -// This is a comma-separated list of plugin library names and activex clsid. -const wchar_t kTrustedPlugins[] = L"trusted-plugins"; - -// Runs the security test for the sandbox. -const wchar_t kTestSandbox[] = L"test-sandbox"; - -// Specifies the user data directory, which is where the browser will look -// for all of its state. -const wchar_t kUserDataDir[] = L"user-data-dir"; - -// Specifies the plugin data directory, which is where plugins (Gears -// specifically) will store its state. -const wchar_t kPluginDataDir[] = L"plugin-data-dir"; - -// Use a specific disk cache location, rather than one derived from the -// UserDatadir. -const wchar_t kDiskCacheDir[] = L"disk-cache-dir"; - -// Whether the multiple profiles feature based on the user-data-dir flag is -// enabled or not. -const wchar_t kEnableUserDataDirProfiles[] = L"enable-udd-profiles"; - -// Specifies the path to the user data folder for the parent profile. -const wchar_t kParentProfile[] = L"parent-profile"; - -// Specifies that the associated value should be launched in "application" mode. -const wchar_t kApp[] = L"app"; - -// Specifies if the dom_automation_controller_ needs to be bound in the -// renderer. This binding happens on per-frame basis and hence can potentially -// be a performance bottleneck. One should only enable it when automating -// dom based tests. -const wchar_t kDomAutomationController[] = L"dom-automation"; - -// Tells the plugin process the path of the plugin to load -const wchar_t kPluginPath[] = L"plugin-path"; - -// A string used to override the default user agent with a custom one. -const wchar_t kUserAgent[] = L"user-agent"; - -// Specifies the flags passed to JS engine -const wchar_t kJavaScriptFlags[] = L"js-flags"; - -// The Country we should use. This is normally obtained from the operating -// system during first run and cached in the preferences afterwards. This is a -// string value, the 2 letter code from ISO 3166-1. -const wchar_t kCountry[] = L"country"; - -// The language file that we want to try to open. Of the form -// language[-country] where language is the 2 letter code from ISO-639. -const wchar_t kLang[] = L"lang"; - -// Will add kDebugOnStart to every child processes. If a value is passed, it -// will be used as a filter to determine if the child process should have the -// kDebugOnStart flag passed on or not. -const wchar_t kDebugChildren[] = L"debug-children"; - -// Will add kWaitForDebugger to every child processes. If a value is passed, it -// will be used as a filter to determine if the child process should have the -// kWaitForDebugger flag passed on or not. -const wchar_t kWaitForDebuggerChildren[] = L"wait-for-debugger-children"; - -// Will filter log messages to show only the messages that are prefixed -// with the specified value -const wchar_t kLogFilterPrefix[] = L"log-filter-prefix"; - -// Force logging to be enabled. Logging is disabled by default in release -// builds. -const wchar_t kEnableLogging[] = L"enable-logging"; - -// Force logging to be disabled. Logging is enabled by default in debug -// builds. -const wchar_t kDisableLogging[] = L"disable-logging"; - -// Sets the minimum log level. Valid values are from 0 to 3: -// INFO = 0, WARNING = 1, LOG_ERROR = 2, LOG_FATAL = 3. -const wchar_t kLoggingLevel[] = L"log-level"; - -// Make plugin processes log their sent and received messages to CHROMIUM_LOG(INFO). -const wchar_t kLogPluginMessages[] = L"log-plugin-messages"; - -// Dump any accumualted histograms to the log when browser terminates (requires -// logging to be enabled to really do anything). Used by developers and test -// scripts. -const wchar_t kDumpHistogramsOnExit[] = L"dump-histograms-on-exit"; - -// enable remote debug / automation shell on the specified port -const wchar_t kRemoteShellPort[] = L"remote-shell-port"; - -// Runs un-installation steps that were done by chrome first-run. -const wchar_t kUninstall[] = L"uninstall"; - -// Number of entries to show in the omnibox popup. -const wchar_t kOmniBoxPopupCount[] = L"omnibox-popup-count"; - -// The value of this switch tells the app to listen for and broadcast -// automation-related messages on IPC channel with the given ID. -const wchar_t kAutomationClientChannelID[] = L"automation-channel"; - -// Indicates the last session should be restored on startup. This overrides -// the preferences value and is primarily intended for testing. The value of -// this switch is the number of tabs to wait until loaded before -// 'load completed' is sent to the ui_test. -const wchar_t kRestoreLastSession[] = L"restore-last-session"; - -// Chrome supports a playback and record mode. Record mode saves *everything* -// to the cache. Playback mode reads data exclusively from the cache. This -// allows us to record a session into the cache and then replay it at will. -const wchar_t kRecordMode[] = L"record-mode"; -const wchar_t kPlaybackMode[] = L"playback-mode"; - -// Don't record/playback events when using record & playback. -const wchar_t kNoEvents[] = L"no-events"; - -// Support a separate switch that enables the v8 playback extension. -// The extension causes javascript calls to Date.now() and Math.random() -// to return consistent values, such that subsequent loads of the same -// page will result in consistent js-generated data and XHR requests. -// Pages may still be able to generate inconsistent data from plugins. -const wchar_t kNoJsRandomness[] = L"no-js-randomness"; - -// Make Windows happy by allowing it to show "Enable access to this program" -// checkbox in Add/Remove Programs->Set Program Access and Defaults. This -// only shows an error box because the only way to hide Chrome is by -// uninstalling it. -const wchar_t kHideIcons[] = L"hide-icons"; - -const wchar_t kShowIcons[] = L"show-icons"; - -// Make Chrome default browser -const wchar_t kMakeDefaultBrowser[] = L"make-default-browser"; - -// Use a specified proxy server, overrides system settings. This switch only -// affects HTTP and HTTPS requests. -const wchar_t kProxyServer[] = L"proxy-server"; - -// Use WinHTTP to fetch and evaluate PAC scripts. Otherwise the default is -// to use Chromium's network stack to fetch, and V8 to evaluate. -const wchar_t kWinHttpProxyResolver[] = L"winhttp-proxy-resolver"; - -// Chrome will support prefetching of DNS information. Until this becomes -// the default, we'll provide a command line switch. -extern const wchar_t kDnsLogDetails[] = L"dns-log-details"; -extern const wchar_t kDnsPrefetchDisable[] = L"dns-prefetch-disable"; - -// Enables support to debug printing subsystem. -const wchar_t kDebugPrint[] = L"debug-print"; - -// Allow initialization of all activex controls. This is only to help website -// developers test their controls to see if they are compatible in Chrome. -// Note there's a duplicate value in activex_shared.cc (to avoid -// dependency on chrome module). Please change both locations at the same time. -const wchar_t kAllowAllActiveX[] = L"allow-all-activex"; - -// Browser flag to disable the web inspector for all renderers. -const wchar_t kDisableDevTools[] = L"disable-dev-tools"; - -// Enable web inspector for all windows, even if they're part of the browser. -// Allows us to use our dev tools to debug browser windows itself. -const wchar_t kAlwaysEnableDevTools[] = L"always-enable-dev-tools"; - -// Used to set the value of SessionRestore::num_tabs_to_load_. See -// session_restore.h for details. -const wchar_t kTabCountToLoadOnSessionRestore[] = - L"tab-count-to-load-on-session-restore"; - -// Enable dynamic loading of the Memory Profiler DLL, which will trace -// all memory allocations during the run. -const wchar_t kMemoryProfiling[] = L"memory-profile"; - -// Configure Chrome's memory model. -// Does chrome really need multiple memory models? No. But we get a lot -// of concerns from individuals about how the changes work on *their* -// system, and we need to be able to experiment with a few choices. -const wchar_t kMemoryModel[] = L"memory-model"; - -// By default, cookies are not allowed on file://. They are needed in for -// testing, for example page cycler and layout tests. See bug 1157243. -const wchar_t kEnableFileCookies[] = L"enable-file-cookies"; - -// Start the browser maximized, regardless of any previous settings. -const wchar_t kStartMaximized[] = L"start-maximized"; - -// Spawn threads to watch for excessive delays in specified message loops. -// User should set breakpoints on Alarm() to examine problematic thread. -// Usage: -enable-watchdog=[ui][io] -// Order of the listed sub-arguments does not matter. -const wchar_t kEnableWatchdog[] = L"enable-watchdog"; - -// Display the First Run experience when the browser is started, regardless of -// whether or not it's actually the first run. -const wchar_t kFirstRun[] = L"first-run"; - -// Bypass the First Run experience when the browser is started, regardless of -// whether or not it's actually the first run. Overrides kFirstRun in case -// you're for some reason tempted to pass them both. -const wchar_t kNoFirstRun[] = L"no-first-run"; - -// Enable histograming of tasks served by MessageLoop. See about:histograms/Loop -// for results, which show frequency of messages on each thread, including APC -// count, object signalling count, etc. -const wchar_t kMessageLoopHistogrammer[] = L"message-loop-histogrammer"; - -// Perform importing from another browser. The value associated with this -// setting encodes the target browser and what items to import. -const wchar_t kImport[] = L"import"; - -// Change the DCHECKS to dump memory and continue instead of displaying error -// dialog. This is valid only in Release mode when --enable-dcheck is -// specified. -const wchar_t kSilentDumpOnDCHECK[] = L"silent-dump-on-dcheck"; - -// Normally when the user attempts to navigate to a page that was the result of -// a post we prompt to make sure they want to. This switch may be used to -// disable that check. This switch is used during automated testing. -const wchar_t kDisablePromptOnRepost[] = L"disable-prompt-on-repost"; - -// Disable pop-up blocking. -const wchar_t kDisablePopupBlocking[] = L"disable-popup-blocking"; - -// Don't execute JavaScript (browser JS like the new tab page still runs). -const wchar_t kDisableJavaScript[] = L"disable-javascript"; - -// Don't enforce the same-origin policy. (Used by people testing their sites.) -const wchar_t kDisableWebSecurity[] = L"disable-web-security"; - -// Prevent Java from running. -const wchar_t kDisableJava[] = L"disable-java"; - -// Prevent plugins from running. -const wchar_t kDisablePlugins[] = L"disable-plugins"; - -// Prevent images from loading. -const wchar_t kDisableImages[] = L"disable-images"; - -// Use the low fragmentation heap for the CRT. -const wchar_t kUseLowFragHeapCrt[] = L"use-lf-heap"; - -#ifndef NDEBUG -// Debug only switch to specify which gears plugin dll to load. -const wchar_t kGearsPluginPathOverride[] = L"gears-plugin-path"; -#endif - -// Enable the fastback page cache. -const wchar_t kEnableFastback[] = L"enable-fastback"; - -// Allow loading of the javascript debugger UI from the filesystem. -const wchar_t kJavaScriptDebuggerPath[] = L"javascript-debugger-path"; - -const wchar_t kDisableP13n[] = L"disable-p13n"; - -// Enable support for SDCH filtering (dictionary based expansion of content). -// Optional argument is *the* only domain name that will have SDCH suppport. -// Default is "-enable-sdch" to advertise SDCH on all domains. -// Sample usage with argument: "-enable-sdch=.google.com" -// SDCH is currently only supported server-side for searches on google.com. -const wchar_t kSdchFilter[] = L"enable-sdch"; - -// Enable user script support. -const wchar_t kEnableUserScripts[] = L"enable-user-scripts"; - -// Enable extensions. -const wchar_t kEnableExtensions[] = L"enable-extensions"; - -// Install the extension specified in the argument. This is for MIME type -// handling so that users can double-click on an extension. -const wchar_t kInstallExtension[] = L"install-extension"; - -// Load an extension from the specified directory. -const wchar_t kLoadExtension[] = L"load-extension"; - -// Load an NPAPI plugin from the specified path. -const wchar_t kLoadPlugin[] = L"load-plugin"; - -// directory to locate user scripts in as an over-ride of the default -const wchar_t kUserScriptsDir[] = L"user-scripts-dir"; - -// Causes the browser to launch directly in incognito mode. -const wchar_t kIncognito[] = L"incognito"; - -// Turns on the accessibility in the renderer. Off by default until -// http://b/issue?id=1432077 is fixed. -const wchar_t kEnableRendererAccessibility[] = L"enable-renderer-accessibility"; - -// Pass the name of the current running automated test to Chrome. -const wchar_t kTestName[] = L"test-name"; - -// On POSIX only: the contents of this flag are prepended to the renderer -// command line. (Useful values might be "valgrind" or "gdb --args") -const wchar_t kRendererCmdPrefix[] = L"renderer-cmd-prefix"; - -// Temparary option for new ftp implemetation. -const wchar_t kNewFtp[] = L"new-ftp"; - -// On POSIX only: use FIFO for IPC channels so that "unrelated" process -// can connect to a channel, provided it knows its name. For debugging purposes. -const wchar_t kIPCUseFIFO[] = L"ipc-use-fifo"; - -// If this flag is set open out of process developer tools window instead of -// Console Debugger when user clicks "Debug JavaScript". -const wchar_t kEnableOutOfProcessDevTools[] = L"enable-oop-devtools"; - -// Enable HTML5 Worker support -const wchar_t kEnableWebWorkers[] = L"enable-web-workers"; - -// Causes the worker process allocation to use as many processes as cores. -const wchar_t kWebWorkerProcessPerCore[] = L"web-worker-process-per-core"; - -// Causes workers to run together in one process, depending on their domains. -// Note this is duplicated in webworkerclient_impl.cc -const wchar_t kWebWorkerShareProcesses[] = L"web-worker-share-processes"; - -// Enables experimental views under gtk. -const wchar_t kViewsGtk[] = L"views-gtk"; - -// Enables the bookmark menu. -const wchar_t kBookmarkMenu[] = L"bookmark-menu"; - -// Enables StatsTable, logging statistics to a global named shared memory table. -const wchar_t kEnableStatsTable[] = L"enable-stats-table"; - -// Enables the Omnibox2 popup and functionality. -const wchar_t kEnableOmnibox2[] = L"enable-omnibox2"; - -// Replaces the audio IPC layer for