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

Side by Side Diff: chrome/renderer/resources/extensions/notifications_custom_bindings.js

Issue 12517011: Added activity logging for ext APIs with custom bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified setHandleRequest to avoid double logging Created 7 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Custom bindings for the notifications API. 5 // Custom bindings for the notifications API.
6 var binding = require('binding').Binding.create('notifications'); 6 var binding = require('binding').Binding.create('notifications');
7 7
8 var sendRequest = require('sendRequest').sendRequest; 8 var sendRequest = require('sendRequest').sendRequest;
9 var imageUtil = require('imageUtil'); 9 var imageUtil = require('imageUtil');
10 var lastError = require('lastError'); 10 var lastError = require('lastError');
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 failure_function, [callback, id]) 113 failure_function, [callback, id])
114 }); 114 });
115 }; 115 };
116 } 116 }
117 117
118 var handleCreate = genHandle(function(callback, id) { callback(id); }); 118 var handleCreate = genHandle(function(callback, id) { callback(id); });
119 var handleUpdate = genHandle(function(callback, id) { callback(false); }); 119 var handleUpdate = genHandle(function(callback, id) { callback(false); });
120 120
121 var notificationsCustomHook = function(bindingsAPI, extensionId) { 121 var notificationsCustomHook = function(bindingsAPI, extensionId) {
122 var apiFunctions = bindingsAPI.apiFunctions; 122 var apiFunctions = bindingsAPI.apiFunctions;
123 apiFunctions.setHandleRequest('create', handleCreate); 123 apiFunctions.setHandleRequest('create', handleCreate, false);
124 apiFunctions.setHandleRequest('update', handleCreate); 124 apiFunctions.setHandleRequest('update', handleCreate, false);
Matt Perry 2013/03/15 17:51:07 Both of these use sendRequest... sometimes. See ge
125 }; 125 };
126 126
127 binding.registerCustomHook(notificationsCustomHook); 127 binding.registerCustomHook(notificationsCustomHook);
128 128
129 exports.binding = binding.generate(); 129 exports.binding = binding.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698