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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc

Issue 100963005: [Pepper] Handle plugin crash on QuotaReservation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +comment Created 6 years, 11 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 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h " 5 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h "
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "content/browser/renderer_host/pepper/pepper_file_io_host.h" 9 #include "content/browser/renderer_host/pepper/pepper_file_io_host.h"
10 #include "content/browser/renderer_host/pepper/quota_reservation.h" 10 #include "content/browser/renderer_host/pepper/quota_reservation.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 type_(type), 57 type_(type),
58 called_open_(false), 58 called_open_(false),
59 opened_(false), 59 opened_(false),
60 file_system_context_(NULL), 60 file_system_context_(NULL),
61 reserved_quota_(0), 61 reserved_quota_(0),
62 reserving_quota_(false), 62 reserving_quota_(false),
63 weak_factory_(this) { 63 weak_factory_(this) {
64 } 64 }
65 65
66 PepperFileSystemBrowserHost::~PepperFileSystemBrowserHost() { 66 PepperFileSystemBrowserHost::~PepperFileSystemBrowserHost() {
67 // If |files_| is not empty, the plugin failed to close some files. It must
68 // have crashed.
69 if (!files_.empty()) {
70 file_system_context_->default_file_task_runner()->PostTask(
71 FROM_HERE,
72 base::Bind(&QuotaReservation::OnClientCrash, quota_reservation_));
73 }
74
67 // All FileRefs and FileIOs that reference us must have been destroyed. Cancel 75 // All FileRefs and FileIOs that reference us must have been destroyed. Cancel
68 // all pending file system operations. 76 // all pending file system operations.
69 if (file_system_operation_runner_) 77 if (file_system_operation_runner_)
70 file_system_operation_runner_->Shutdown(); 78 file_system_operation_runner_->Shutdown();
71 } 79 }
72 80
73 void PepperFileSystemBrowserHost::OpenExisting(const GURL& root_url, 81 void PepperFileSystemBrowserHost::OpenExisting(const GURL& root_url,
74 const base::Closure& callback) { 82 const base::Closure& callback) {
75 root_url_ = root_url; 83 root_url_ = root_url;
76 int render_process_id = 0; 84 int render_process_id = 0;
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 if (!IsAsciiAlpha(*it) && !IsAsciiDigit(*it) && 499 if (!IsAsciiAlpha(*it) && !IsAsciiDigit(*it) &&
492 *it != '.' && *it != '_' && *it != '-') { 500 *it != '.' && *it != '_' && *it != '-') {
493 LOG(WARNING) << "Failed to generate a plugin id."; 501 LOG(WARNING) << "Failed to generate a plugin id.";
494 return std::string(); 502 return std::string();
495 } 503 }
496 } 504 }
497 return output; 505 return output;
498 } 506 }
499 507
500 } // namespace content 508 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_file_io_host.cc ('k') | content/browser/renderer_host/pepper/quota_reservation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698