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

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

Issue 10877004: Split a CHECK in 2 in MiscellaneousBindings::DispatchOnConnect to help (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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/miscellaneous_bindings.h" 5 #include "chrome/renderer/extensions/miscellaneous_bindings.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 arguments.size(), &arguments[0], 213 arguments.size(), &arguments[0],
214 &retval)) { 214 &retval)) {
215 continue; 215 continue;
216 } 216 }
217 217
218 if (try_catch.HasCaught()) { 218 if (try_catch.HasCaught()) {
219 LOG(ERROR) << "Exception caught when calling Port.dispatchOnConnect."; 219 LOG(ERROR) << "Exception caught when calling Port.dispatchOnConnect.";
220 continue; 220 continue;
221 } 221 }
222 222
223 CHECK(!retval.IsEmpty() && retval->IsBoolean()); 223 CHECK(!retval.IsEmpty());
224 CHECK(retval->IsBoolean());
224 if (retval->BooleanValue()) 225 if (retval->BooleanValue())
225 port_created = true; 226 port_created = true;
226 } 227 }
227 228
228 // If we didn't create a port, notify the other end of the channel (treat it 229 // If we didn't create a port, notify the other end of the channel (treat it
229 // as a disconnect). 230 // as a disconnect).
230 if (!port_created) { 231 if (!port_created) {
231 content::RenderThread::Get()->Send( 232 content::RenderThread::Get()->Send(
232 new ExtensionHostMsg_CloseChannel(target_port_id, true)); 233 new ExtensionHostMsg_CloseChannel(target_port_id, true));
233 } 234 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 std::vector<v8::Handle<v8::Value> > arguments; 296 std::vector<v8::Handle<v8::Value> > arguments;
296 arguments.push_back(v8::Integer::New(port_id)); 297 arguments.push_back(v8::Integer::New(port_id));
297 arguments.push_back(v8::Boolean::New(connection_error)); 298 arguments.push_back(v8::Boolean::New(connection_error));
298 (*it)->CallChromeHiddenMethod("Port.dispatchOnDisconnect", 299 (*it)->CallChromeHiddenMethod("Port.dispatchOnDisconnect",
299 arguments.size(), &arguments[0], 300 arguments.size(), &arguments[0],
300 NULL); 301 NULL);
301 } 302 }
302 } 303 }
303 304
304 } // namespace extensions 305 } // namespace extensions
OLDNEW
« chrome/renderer/extensions/dispatcher.h ('K') | « chrome/renderer/extensions/dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698