Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Side by Side Diff: chrome/renderer/extensions/module_system.cc

Issue 22299009: Move channel-related (Chrome-specific) global state out of Feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/extensions/module_system.h" 5 #include "chrome/renderer/extensions/module_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/common/extensions/extension_messages.h" 14 #include "chrome/common/extensions/extension_messages.h"
15 #include "chrome/common/extensions/features/feature_channel.h"
15 #include "chrome/renderer/extensions/chrome_v8_context.h" 16 #include "chrome/renderer/extensions/chrome_v8_context.h"
16 #include "chrome/renderer/extensions/console.h" 17 #include "chrome/renderer/extensions/console.h"
17 #include "chrome/renderer/extensions/safe_builtins.h" 18 #include "chrome/renderer/extensions/safe_builtins.h"
18 #include "content/public/renderer/render_view.h" 19 #include "content/public/renderer/render_view.h"
19 #include "third_party/WebKit/public/web/WebFrame.h" 20 #include "third_party/WebKit/public/web/WebFrame.h"
20 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" 21 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
21 22
22 namespace extensions { 23 namespace extensions {
23 24
24 namespace { 25 namespace {
(...skipping 21 matching lines...) Expand all
46 full_message += context->GetContextTypeDescription(); 47 full_message += context->GetContextTypeDescription();
47 full_message += " context"; 48 full_message += " context";
48 if (context->extension()) { 49 if (context->extension()) {
49 full_message += " for "; 50 full_message += " for ";
50 full_message += context->extension()->id(); 51 full_message += context->extension()->id();
51 } 52 }
52 full_message += ") "; 53 full_message += ") ";
53 full_message += message; 54 full_message += message;
54 55
55 // <= dev means dev, canary, and trunk. 56 // <= dev means dev, canary, and trunk.
56 if (Feature::GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV) 57 if (GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV)
57 console::Fatal(v8::Context::GetCalling(), full_message); 58 console::Fatal(v8::Context::GetCalling(), full_message);
58 else 59 else
59 console::Error(v8::Context::GetCalling(), full_message); 60 console::Error(v8::Context::GetCalling(), full_message);
60 } 61 }
61 62
62 void Warn(const std::string& message) { 63 void Warn(const std::string& message) {
63 console::Warn(v8::Context::GetCalling(), message); 64 console::Warn(v8::Context::GetCalling(), message);
64 } 65 }
65 66
66 // Default exception handler which logs the exception. 67 // Default exception handler which logs the exception.
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 "(function(require, requireNative, exports, " 526 "(function(require, requireNative, exports, "
526 "console, " 527 "console, "
527 "$Array, $Function, $JSON, $Object, $RegExp, $String) {" 528 "$Array, $Function, $JSON, $Object, $RegExp, $String) {"
528 "'use strict';"); 529 "'use strict';");
529 v8::Handle<v8::String> right = v8::String::New("\n})"); 530 v8::Handle<v8::String> right = v8::String::New("\n})");
530 return handle_scope.Close( 531 return handle_scope.Close(
531 v8::String::Concat(left, v8::String::Concat(source, right))); 532 v8::String::Concat(left, v8::String::Concat(source, right)));
532 } 533 }
533 534
534 } // namespace extensions 535 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698