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

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

Issue 10024055: Remove unneeded extension_messages_browsertest.cc + cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chrome_v8_context_set.h" 5 #include "chrome/renderer/extensions/chrome_v8_context_set.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/tracked_objects.h" 9 #include "base/tracked_objects.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // We copy the context list, because calling into javascript may modify it 110 // We copy the context list, because calling into javascript may modify it
111 // out from under us. 111 // out from under us.
112 ContextSet contexts = GetAll(); 112 ContextSet contexts = GetAll();
113 113
114 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); 114 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
115 for (ContextSet::iterator it = contexts.begin(); it != contexts.end(); 115 for (ContextSet::iterator it = contexts.begin(); it != contexts.end();
116 ++it) { 116 ++it) {
117 if ((*it)->v8_context().IsEmpty()) 117 if ((*it)->v8_context().IsEmpty())
118 continue; 118 continue;
119 119
120 if (!extension_id.empty() && extension_id != (*it)->extension_id()) 120 if (!extension_id.empty()) {
121 continue; 121 if (!(*it)->extension() || (extension_id != (*it)->extension()->id()))
122 continue;
123 }
122 124
123 content::RenderView* context_render_view = (*it)->GetRenderView(); 125 content::RenderView* context_render_view = (*it)->GetRenderView();
124 if (!context_render_view) 126 if (!context_render_view)
125 continue; 127 continue;
126 128
127 if (render_view && render_view != context_render_view) 129 if (render_view && render_view != context_render_view)
128 continue; 130 continue;
129 131
130 if (!HasSufficientPermissions(context_render_view, event_url)) 132 if (!HasSufficientPermissions(context_render_view, event_url))
131 continue; 133 continue;
(...skipping 14 matching lines...) Expand all
146 // TODO(rafaelw): Consider only doing this check if function_name == 148 // TODO(rafaelw): Consider only doing this check if function_name ==
147 // "Event.dispatchJSON". 149 // "Event.dispatchJSON".
148 #ifndef NDEBUG 150 #ifndef NDEBUG
149 if (!retval.IsEmpty() && !retval->IsUndefined()) { 151 if (!retval.IsEmpty() && !retval->IsUndefined()) {
150 std::string error = *v8::String::AsciiValue(retval); 152 std::string error = *v8::String::AsciiValue(retval);
151 DCHECK(false) << error; 153 DCHECK(false) << error;
152 } 154 }
153 #endif 155 #endif
154 } 156 }
155 } 157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698