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

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

Issue 10748011: Fix to problem of chrome.runtime sometimes not being defined. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: single quotes Created 8 years, 5 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 | « no previous file | 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 requireNative('runtime');
6
5 function set(message) { 7 function set(message) {
6 var errorObject = { "message": message }; 8 var errorObject = { 'message': message };
7 if (chrome.extension) 9 if (chrome.extension)
8 chrome.extension.lastError = errorObject; 10 chrome.extension.lastError = errorObject;
9 chrome.runtime.lastError = errorObject; 11 chrome.runtime.lastError = errorObject;
10 }; 12 };
11 13
12 function clear() { 14 function clear() {
13 if (chrome.extension) 15 if (chrome.extension)
14 delete chrome.extension.lastError; 16 delete chrome.extension.lastError;
15 delete chrome.runtime.lastError; 17 delete chrome.runtime.lastError;
16 }; 18 };
17 19
18 exports.clear = clear; 20 exports.clear = clear;
19 exports.set = set; 21 exports.set = set;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698