Fix crash that happens when the PDF viewer is refreshed.

The root cause is the PdfViewerHandler instanceis destroyed but not removed from the list of observer in WebContentsZoomController
This commit is contained in:
Ahmed Mohamed Ali 2017-10-19 16:27:08 +02:00
parent 44f91e12e1
commit 9f3cfa2dbd
2 changed files with 19 additions and 8 deletions

View file

@ -45,7 +45,8 @@ class PdfViewerHandler : public content::WebUIMessageHandler,
void Reload(const base::ListValue* args);
void OnZoomLevelChanged(content::WebContents* web_contents, double level,
bool is_temporary);
void AddObserver();
void RemoveObserver();
std::unique_ptr<base::Value> initialize_callback_id_;
content::StreamInfo* stream_;
std::string original_url_;