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

Side by Side Diff: extensions/browser/blob_holder.cc

Issue 1009583004: Add UMA histograms and logging for bad IPC message handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: actions.xml claims to be pretty printed Created 5 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
« no previous file with comments | « extensions/browser/bad_message.cc ('k') | extensions/browser/extension_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/blob_holder.h" 5 #include "extensions/browser/blob_holder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "content/public/browser/blob_handle.h" 11 #include "content/public/browser/blob_handle.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "content/public/browser/render_process_host.h" 13 #include "content/public/browser/render_process_host.h"
14 #include "extensions/browser/bad_message.h"
14 15
15 namespace extensions { 16 namespace extensions {
16 17
17 namespace { 18 namespace {
18 19
19 // Address to this variable used as the user data key. 20 // Address to this variable used as the user data key.
20 const int kBlobHolderUserDataKey = 0; 21 const int kBlobHolderUserDataKey = 0;
21 } 22 }
22 23
23 // static 24 // static
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 for (std::vector<std::string>::const_iterator uuid_it = blob_uuids.begin(); 71 for (std::vector<std::string>::const_iterator uuid_it = blob_uuids.begin();
71 uuid_it != blob_uuids.end(); 72 uuid_it != blob_uuids.end();
72 ++uuid_it) { 73 ++uuid_it) {
73 BlobHandleMultimap::iterator it = held_blobs_.find(*uuid_it); 74 BlobHandleMultimap::iterator it = held_blobs_.find(*uuid_it);
74 75
75 if (it != held_blobs_.end()) { 76 if (it != held_blobs_.end()) {
76 held_blobs_.erase(it); 77 held_blobs_.erase(it);
77 } else { 78 } else {
78 DLOG(ERROR) << "Tried to release a Blob we don't have ownership to." 79 DLOG(ERROR) << "Tried to release a Blob we don't have ownership to."
79 << "UUID: " << *uuid_it; 80 << "UUID: " << *uuid_it;
80 render_process_host_->ReceivedBadMessage(); 81 bad_message::ReceivedBadMessage(render_process_host_,
82 bad_message::BH_BLOB_NOT_OWNED);
81 } 83 }
82 } 84 }
83 } 85 }
84 86
85 } // namespace extensions 87 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/bad_message.cc ('k') | extensions/browser/extension_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698